text
stringlengths 0
13M
|
---|
[Java] Class ConcurrentReaderHashMap.ValueIterator
org.codehaus.groovy.runtime.metaclass.ConcurrentReaderHashMap.ValueIterator
protected class ConcurrentReaderHashMap.ValueIterator
extends HashIterator Methods Summary
Methods
Type Params Return Type Name and description protected Object
returnValueOfNext()
Method Detail @Override protected Object returnValueOfNext()
|
numpy.ndarray.__float__
ndarray.__float__() <==> float(x)
|
module ActiveRecor8b7c:f320:99b9:690f:4595:cd17:293a:c069ConnectionAdapters8b7c:f320:99b9:690f:4595:cd17:293a:c069olumnDumper The goal of this module is to move Adapter specific column definitions to the Adapter instead of having it in the schema dumper itself. This code represents the normal case. We can then redefine how certain data types may be handled in the schema dumper on the Adapter level by over-writing this code inside the database specific adapters Public Instance Methods column_spec(column, types) Show source # File activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb, line 11
def column_spec(column, types)
spec = prepare_column_options(column, types)
(spec.keys - [:name, :type]).each{ |k| spec[k].insert(0, "#{k.to_s}: ")}
spec
end migration_keys() Show source Lists the valid migration options # File activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb, line 40
def migration_keys
[:name, :limit, :precision, :scale, :default, :null]
end prepare_column_options(column, types) Show source This can be overridden on a Adapter level basis to support other extended datatypes (Example: Adding an array option in the PostgreSQLAdapter) # File activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb, line 20
def prepare_column_options(column, types)
spec = {}
spec[:name] = column.name.inspect
# AR has an optimization which handles zero-scale decimals as integers. This
# code ensures that the dumper still dumps the column as a decimal.
spec[:type] = if column.type == :integer && /^(numeric|decimal)/ =~ column.sql_type
'decimal'
else
column.type.to_s
end
spec[:limit] = column.limit.inspect if column.limit != types[column.type][:limit] && spec[:type] != 'decimal'
spec[:precision] = column.precision.inspect if column.precision
spec[:scale] = column.scale.inspect if column.scale
spec[:null] = 'false' unless column.null
spec[:default] = default_string(column.default) if column.has_default?
spec
end
|
dart:ffi Allocator class Manages memory on the native heap. Available Extensions AllocatorAlloc Properties hashCode → int read-only, inherited
The hash code for this object. runtimeType → Type read-only, inherited
A representation of the runtime type of the object. Methods allocate<T extends NativeType>(int byteCount, {int? alignment}) → Pointer<T> Allocates byteCount bytes of memory on the native heap. free(Pointer<NativeType> pointer) → void Releases memory allocated on the native heap. noSuchMethod(Invocation invocation) → dynamic inherited
Invoked when a non-existent method or property is accessed. toString() → String inherited
A string representation of this object. Operators operator ==(Object other) → bool inherited
The equality operator.
|
fortinet.fortios.fortios_switch_controller_switch_group – Configure FortiSwitch switch groups in Fortinet’s FortiOS and FortiGate. Note This plugin is part of the fortinet.fortios collection (version 2.1.2). You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list. To install it, use: ansible-galaxy collection install fortinet.fortios. To use it in a playbook, specify: fortinet.fortios.fortios_switch_controller_switch_group. New in version 2.10: of fortinet.fortios Synopsis Requirements Parameters Notes Examples Return Values Synopsis This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify switch_controller feature and switch_group category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.0 Requirements The below requirements are needed on the host that executes this module. ansible>=2.9.0 Parameters Parameter Choices/Defaults Comments access_token string Token-based authentication. Generated from GUI of Fortigate. enable_log boolean
Choices:
no ← yes Enable/Disable logging for task. state string / required
Choices: present absent Indicates whether to create or remove the object. switch_controller_switch_group dictionary Configure FortiSwitch switch groups. description string Optional switch group description. fortilink string FortiLink interface to which switch group members belong. Source system.interface.name. members list / elements=string FortiSwitch members belonging to this switch group. name string / required Managed device ID. Source switch-controller.managed-switch.switch-id. switch_id string Managed device ID. Source switch-controller.managed-switch.switch-id. name string / required Switch group name. vdom string Default:"root" Virtual domain, among those defined previously. A vdom is a virtual instance of the FortiGate that can be configured and used as a different unit. Notes Note Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks Examples - hosts: fortigates
collections:
- fortinet.fortios
connection: httpapi
vars:
vdom: "root"
ansible_httpapi_use_ssl: yes
ansible_httpapi_validate_certs: no
ansible_httpapi_port: 443
tasks:
- name: Configure FortiSwitch switch groups.
fortios_switch_controller_switch_group:
vdom: "{{ vdom }}"
state: "present"
access_token: "<your_own_value>"
switch_controller_switch_group:
description: "<your_own_value>"
fortilink: "<your_own_value> (source system.interface.name)"
members:
-
name: "default_name_6 (source switch-controller.managed-switch.switch-id)"
switch_id: "<your_own_value> (source switch-controller.managed-switch.switch-id)"
name: "default_name_8"
Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description build string always Build number of the fortigate image Sample: 1547 http_method string always Last method used to provision the content into FortiGate Sample: PUT http_status string always Last result given by FortiGate on last operation applied Sample: 200 mkey string success Master key (id) used in the last call to FortiGate Sample: id name string always Name of the table used to fulfill the request Sample: urlfilter path string always Path of the table used to fulfill the request Sample: webfilter revision string always Internal revision number Sample: 30.455-91-61608 serial string always Serial number of the unit Sample: FGVMEVYYQT3AB5352 status string always Indication of the operation's result Sample: success vdom string always Virtual domain used Sample: root version string always Version of the FortiGate Sample: v5.6.3 Authors Link Zheng (@chillancezen) Jie Xue (@JieX19) Hongbin Lu (@fgtdev-hblu) Frank Shen (@frankshen01) Miguel Angel Munoz (@mamunozgonzalez) Nicolas Thomas (@thomnico)
© 2012–2018 Michael DeHaan
|
getTimeNanos
kotlin-stdlib / kotlin.system / getTimeNanos
Platform and version requirements: Native (1.3)
fun getTimeNanos(): Long
Gets current system time in nanoseconds since certain moment in the past, only delta between two subsequent calls makes sense.
|
sass Index
Compile
CompileResult
compile
compileAsync
compileString
compileStringAsync
Options
Options
StringOptionsWithImporter
StringOptionsWithoutImporter
OutputStyle
StringOptions
Syntax
Logger
Logger
Logger
SourceLocation
SourceSpan
Importer
FileImporter
Importer
ImporterResult
Custom Function
SassArgumentList
SassBoolean
SassColor
SassFunction
SassList
SassMap
SassNumber
SassString
Value
CustomFunction
ListSeparator
sassFalse
sassNull
sassTrue
Other
Exception
LegacyFileOptions
PromiseOr
info
Legacy
types
LegacyException
LegacyImporterThis
LegacyPluginThis
LegacyResult
LegacySharedOptions
LegacyStringOptions
LegacyAsyncFunction
LegacyAsyncFunctionDone
LegacyAsyncImporter
LegacyFunction
LegacyImporter
LegacyImporterResult
LegacyOptions
LegacySyncFunction
LegacySyncImporter
LegacyValue
FALSE
NULL
TRUE
render
renderSync
Compile
compile
compile(path: string, options?: Options<"sync">): CompileResult
Defined in js-api-doc/compile.d.ts:58
Compatibility:
Dart Sass since 1.45.0
Node Sass ✗ Synchronously compiles the Sass file at path to CSS. If it succeeds it returns a CompileResult, and if it fails it throws an Exception.
This only allows synchronous Importers and CustomFunctions.
example
constsass = require('sass');constresult = sass.compile("style.scss");console.log(result.css);
Parameters
path: string
Optional options: Options<"sync">
Returns CompileResult
compileAsync
compileAsync(path: string, options?: Options<"async">): Promise<CompileResult>
Defined in js-api-doc/compile.d.ts:84
Compatibility:
Dart Sass since 1.45.0
Node Sass ✗ Asynchronously compiles the Sass file at path to CSS. Returns a promise that resolves with a CompileResult if it succeeds and rejects with an Exception if it fails.
This only allows synchronous or asynchronous Importers and CustomFunctions.
⚠️ Heads up! When using Dart Sass, compile is almost twice as fast as compileAsync, due to the overhead of making the entire evaluation process asynchronous.
example
constsass = require('sass');constresult = awaitsass.compileAsync("style.scss");console.log(result.css);
Parameters
path: string
Optional options: Options<"async">
Returns Promise<CompileResult>
compileString
compileString(source: string, options?: StringOptions<"sync">): CompileResult
Defined in js-api-doc/compile.d.ts:114
Compatibility:
Dart Sass since 1.45.0
Node Sass ✗ Synchronously compiles a stylesheet whose contents is source to CSS. If it succeeds it returns a CompileResult, and if it fails it throws an Exception.
This only allows synchronous Importers and CustomFunctions.
example
constsass = require('sass');constresult = sass.compileString(`h1 { font-size: 40px; code { font-face: Roboto Mono; }}`);console.log(result.css);
Parameters
source: string
Optional options: StringOptions<"sync">
Returns CompileResult
compileStringAsync
compileStringAsync(source: string, options?: StringOptions<"async">): Promise<CompileResult>
Defined in js-api-doc/compile.d.ts:149
Compatibility:
Dart Sass since 1.45.0
Node Sass ✗ Asynchronously compiles a stylesheet whose contents is source to CSS. Returns a promise that resolves with a CompileResult if it succeeds and rejects with an Exception if it fails.
This only allows synchronous or asynchronous Importers and CustomFunctions.
⚠️ Heads up! When using Dart Sass, compile is almost twice as fast as compileAsync, due to the overhead of making the entire evaluation process asynchronous.
example
constsass = require('sass');constresult = awaitsass.compileStringAsync(`h1 { font-size: 40px; code { font-face: Roboto Mono; }}`);console.log(result.css);
Parameters
source: string
Optional options: StringOptions<"async">
Returns Promise<CompileResult>
Options
OutputStyle
OutputStyle: "expanded" | "compressed"
Defined in js-api-doc/options.d.ts:31
Possible output styles for the compiled CSS:
"expanded" (the default for Dart Sass) writes each selector and declaration on its own line.
"compressed" removes as many extra characters as possible, and writes the entire stylesheet on a single line.
StringOptions
StringOptions<sync>: StringOptionsWithImporter<sync> | StringOptionsWithoutImporter<sync>
Defined in js-api-doc/options.d.ts:433
Options that can be passed to compileString or compileStringAsync.
This is a StringOptionsWithImporter if it has a StringOptionsWithImporter.importer field, and a StringOptionsWithoutImporter otherwise.
Type parameters
sync: "sync" | "async"
This lets the TypeScript checker verify that asynchronous Importers, FileImporters, and CustomFunctions aren't passed to compile or compileString.
Syntax
Syntax: "scss" | "indented" | "css"
Defined in js-api-doc/options.d.ts:18
Syntaxes supported by Sass:
'scss' is the SCSS syntax.
'indented' is the indented syntax
'css' is plain CSS, which is parsed like SCSS but forbids the use of any special Sass features.
Custom Function
CustomFunction
CustomFunction<sync>: (args: Value[]) => PromiseOr<Value, sync>
Defined in js-api-doc/options.d.ts:76
Type parameters
sync: "sync" | "async"
A CustomFunction<'sync'> must return synchronously, but in return it can be passed to compile and compileString in addition to compileAsync and compileStringAsync. A CustomFunction<'async'> may either return synchronously or asynchronously, but it can only be used with compileAsync and compileStringAsync.
Type declaration
(args: Value[]): PromiseOr<Value, sync>
A callback that implements a custom Sass function. This can be passed to Options.functions.
constresult = sass.compile('style.scss', {functions: {"sum($arg1, $arg2)": (args) => {constarg1 = args[0].assertNumber('arg1');constvalue1 = arg1.value;constvalue2 = args[1].assertNumber('arg2') .convertValueToMatch(arg1, 'arg2', 'arg1');returnnewsass.SassNumber(value1 + value2).coerceToMatch(arg1); } }});
throws
any - This function may throw an error, which the Sass compiler will treat as the function call failing. If the exception object has a message property, it will be used as the wrapped exception's message; otherwise, the exception object's toString() will be used. This means it's safe for custom functions to throw plain strings.
Parameters
args: Value[]
An array of arguments passed by the function's caller. If the function takes arbitrary arguments, the last element will be a SassArgumentList.
Returns PromiseOr<Value, sync>
The function's result. This may be in the form of a Promise, but if it is the function may only be passed to compileAsync and compileStringAsync, not compile or compileString.
ListSeparator
ListSeparator: "," | "/" | " " | null
Defined in js-api-doc/value/list.d.ts:12
Possible separators used by Sass lists. The special separator null is only used for lists with fewer than two elements, and indicates that the separator has not yet been decided for this list. sassFalse
sassFalse: SassBoolean
Defined in js-api-doc/value/boolean.d.ts:15
Sass's false value. sassNull
sassNull: Value
Defined in js-api-doc/value/index.d.ts:25
Sass's null value. sassTrue
sassTrue: SassBoolean
Defined in js-api-doc/value/boolean.d.ts:8
Sass's true value. Other
PromiseOr
PromiseOr<T, sync>: sync extends "async" ? T | Promise<T> : T
Defined in js-api-doc/util/promise_or.d.ts:15
A utility type for choosing between synchronous and asynchronous return values.
This is used as the return value for plugins like CustomFunction, Importer, and FileImporter so that TypeScript enforces that asynchronous plugins are only passed to compileAsync and compileStringAsync, not compile or compileString.
Type parameters
T
sync: "sync" | "async"
If this is 'sync', this can only be a T. If it's 'async', this can be either a T or a Promise<T>.
info
info: string
Defined in js-api-doc/index.d.ts:80
Information about the Sass implementation. This always begins with a unique identifier for the Sass implementation, followed by U+0009 TAB, followed by its npm package version. Some implementations include additional information as well, but not in any standardized format.
For Dart Sass, the implementation name is dart-sass. For Node Sass, the implementation name is node-sass. For the embedded host, the implementation name is sass-embedded.
Legacy
LegacyAsyncFunction
LegacyAsyncFunction: ((this: LegacyPluginThis, done: (result: LegacyValue) => void) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, arg2: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, arg2: LegacyValue, arg3: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, arg2: LegacyValue, arg3: LegacyValue, arg4: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, arg2: LegacyValue, arg3: LegacyValue, arg4: LegacyValue, arg5: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, arg2: LegacyValue, arg3: LegacyValue, arg4: LegacyValue, arg5: LegacyValue, arg6: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, …args: […LegacyValue[], LegacyAsyncFunctionDone]) => void)
Defined in js-api-doc/legacy/function.d.ts:83
An asynchronous callback that implements a custom Sass function. This can be passed to LegacySharedOptions.functions, but only for render.
An asynchronous function must return undefined. Its final argument will always be a callback, which it should call with the result of the function once it's done running. If this throws an error, Sass will treat that as the function failing with that error message. sass.render({file:'style.scss',functions: {"sum($arg1, $arg2)": (arg1, arg2, done) => {if (!(arg1instanceofsass.types.Number)) {thrownewError("$arg1: Expected a number"); } elseif (!(arg2instanceofsass.types.Number)) {thrownewError("$arg2: Expected a number"); }done(newsass.types.Number(arg1.getValue() + arg2.getValue())); } }}, (result, error) => {// ...});
This is passed one argument for each argument that's declared in the signature that's passed to LegacySharedOptions.functions. If the signature takes arbitrary arguments, they're passed as a single argument list in the last argument before the callback.
deprecated
This only works with the legacy render and renderSync APIs. Use CustomFunction with compile, compileString, compileAsync, and compileStringAsync instead.
LegacyAsyncFunctionDone
LegacyAsyncFunctionDone: (result: LegacyValue | Error) => void
Defined in js-api-doc/legacy/function.d.ts:148
Type declaration
(result: LegacyValue | Error): void
The function called by a LegacyAsyncFunction to indicate that it's finished.
deprecated
This only works with the legacy render and renderSync APIs. Use CustomFunction with compile, compileString, compileAsync, and compileStringAsync instead.
Parameters
result: LegacyValue | Error
If this is a LegacyValue, that indicates that the function call completed successfully. If it's a types.Error, that indicates that the function call failed.
Returns void
LegacyAsyncImporter
LegacyAsyncImporter: (this: LegacyImporterThis, url: string, prev: string, done: (result: LegacyImporterResult) => void) => void
Defined in js-api-doc/legacy/importer.d.ts:144
Type declaration
(this: LegacyImporterThis, url: string, prev: string, done: (result: LegacyImporterResult) => void): void
An asynchronous callback that implements custom Sass loading logic for @import rules and @use rules. This can be passed to LegacySharedOptions.importer for either render or renderSync.
An asynchronous importer must return undefined, and then call done with the result of its LegacyImporterResult once it's done running. See LegacySharedOptions.importer for more detailed documentation. sass.render({file:"style.scss",importer: [function(url, prev, done) {if (url != "big-headers") done(null);done({contents:'h1 { font-size: 40px; }' }); } ]});
deprecated
This only works with the legacy render and renderSync APIs. Use Importer with compile, compileString, compileAsync, and compileStringAsync instead.
Parameters
this: LegacyImporterThis
url: string
The @use or @import rule’s URL as a string, exactly as it appears in the stylesheet.
prev: string
A string identifying the stylesheet that contained the @use or @import. This string’s format depends on how that stylesheet was loaded: If the stylesheet was loaded from the filesystem, it’s the absolute path of its file. If the stylesheet was loaded from an importer that returned its contents, it’s the URL of the @use or @import rule that loaded it. If the stylesheet came from the data option, it’s the string "stdin".
done: (result: LegacyImporterResult) => void
The callback to call once the importer has finished running.
(result: LegacyImporterResult): void
Parameters
result: LegacyImporterResult
Returns void
Returns void
LegacyFunction
LegacyFunction<sync>: sync extends "async" ? LegacySyncFunction | LegacyAsyncFunction : LegacySyncFunction
Defined in js-api-doc/legacy/function.d.ts:165
A callback that implements a custom Sass function. For renderSync, this must be a LegacySyncFunction which returns its result directly; for render, it may be either a LegacySyncFunction or a LegacyAsyncFunction which calls a callback with its result.
See LegacySharedOptions.functions for more details.
deprecated
This only works with the legacy render and renderSync APIs. Use CustomFunction with compile, compileString, compileAsync, and compileStringAsync instead.
Type parameters
sync: "sync" | "async"
LegacyImporter
LegacyImporter<sync>: sync extends "async" ? LegacySyncImporter | LegacyAsyncImporter : LegacySyncImporter
Defined in js-api-doc/legacy/importer.d.ts:166
A callback that implements custom Sass loading logic for @import rules and @use rules. For renderSync, this must be a LegacySyncImporter which returns its result directly; for render, it may be either a LegacySyncImporter or a LegacyAsyncImporter which calls a callback with its result.
See LegacySharedOptions.importer for more details.
deprecated
This only works with the legacy render and renderSync APIs. Use Importer with compile, compileString, compileAsync, and compileStringAsync instead.
Type parameters
sync = "sync" | "async"
LegacyImporterResult
LegacyImporterResult: { file: string } | { contents: string } | Error | null
Defined in js-api-doc/legacy/importer.d.ts:45
The result of running a LegacyImporter. It must be one of the following types:
An object with the key contents whose value is the contents of a stylesheet (in SCSS syntax). This causes Sass to load that stylesheet’s contents.
An object with the key file whose value is a path on disk. This causes Sass to load that file as though it had been imported directly.
null, which indicates that it doesn’t recognize the URL and another importer should be tried instead.
An Error object, indicating that importing failed.
deprecated
This only works with the legacy render and renderSync APIs. Use ImporterResult with compile, compileString, compileAsync, and compileStringAsync instead.
LegacyOptions
LegacyOptions<sync>: LegacyFileOptions<sync> | LegacyStringOptions<sync>
Defined in js-api-doc/legacy/options.d.ts:640
Options for render and renderSync. This can either be LegacyFileOptions to load a file from disk, or LegacyStringOptions to compile a string of Sass code.
See LegacySharedOptions for options that are shared across both file and string inputs.
deprecated
This only works with the legacy render and renderSync APIs. Use Options with compile, compileString, compileAsync, and compileStringAsync instead.
Type parameters
sync: "sync" | "async"
LegacySyncFunction
LegacySyncFunction: (this: LegacyPluginThis, …args: LegacyValue[]) => LegacyValue
Defined in js-api-doc/legacy/function.d.ts:37
Type declaration
(this: LegacyPluginThis, …args: LegacyValue[]): LegacyValue
A synchronous callback that implements a custom Sass function. This can be passed to LegacySharedOptions.functions for either render or renderSync.
If this throws an error, Sass will treat that as the function failing with that error message. constresult = sass.renderSync({file:'style.scss',functions: {"sum($arg1, $arg2)": (arg1, arg2) => {if (!(arg1instanceofsass.types.Number)) {thrownewError("$arg1: Expected a number"); } elseif (!(arg2instanceofsass.types.Number)) {thrownewError("$arg2: Expected a number"); }returnnewsass.types.Number(arg1.getValue() + arg2.getValue()); } }});
deprecated
This only works with the legacy render and renderSync APIs. Use CustomFunction with compile, compileString, compileAsync, and compileStringAsync instead.
Parameters
this: LegacyPluginThis
Rest …args: LegacyValue[]
One argument for each argument that's declared in the signature that's passed to LegacySharedOptions.functions. If the signature takes arbitrary arguments, they're passed as a single argument list in the last argument.
Returns LegacyValue
LegacySyncImporter
LegacySyncImporter: (this: LegacyImporterThis, url: string, prev: string) => LegacyImporterResult
Defined in js-api-doc/legacy/importer.d.ts:92
Type declaration
(this: LegacyImporterThis, url: string, prev: string): LegacyImporterResult
A synchronous callback that implements custom Sass loading logic for @import rules and @use rules. This can be passed to LegacySharedOptions.importer for either render or renderSync.
See LegacySharedOptions.importer for more detailed documentation. sass.renderSync({file:"style.scss",importer: [function(url, prev) {if (url != "big-headers") returnnull;return {contents:'h1 { font-size: 40px; }' }; } ]});
deprecated
This only works with the legacy render and renderSync APIs. Use Importer with compile, compileString, compileAsync, and compileStringAsync instead.
Parameters
this: LegacyImporterThis
url: string
The @use or @import rule’s URL as a string, exactly as it appears in the stylesheet.
prev: string
A string identifying the stylesheet that contained the @use or @import. This string’s format depends on how that stylesheet was loaded: If the stylesheet was loaded from the filesystem, it’s the absolute path of its file. If the stylesheet was loaded from an importer that returned its contents, it’s the URL of the @use or @import rule that loaded it. If the stylesheet came from the data option, it’s the string "stdin".
Returns LegacyImporterResult
LegacyValue
LegacyValue: Null | Number | String | Boolean | Color | List | Map
Defined in js-api-doc/legacy/function.d.ts:178
A type representing all the possible values that may be passed to or returned from a LegacyFunction.
deprecated
This only works with the legacy render and renderSync APIs. Use Value with compile, compileString, compileAsync, and compileStringAsync instead.
FALSE
FALSE: Boolean<false>
Defined in js-api-doc/legacy/function.d.ts:205
A shorthand for sass.types.Boolean.FALSE.
deprecated
This only works with the legacy render and renderSync APIs. Use sassFalse with compile, compileString, compileAsync, and compileStringAsync instead.
NULL
NULL: Null
Defined in js-api-doc/legacy/function.d.ts:215
A shorthand for sass.types.Null.NULL.
deprecated
This only works with the legacy render and renderSync APIs. Use sassNull with compile, compileString, compileAsync, and compileStringAsync instead.
TRUE
TRUE: Boolean<true>
Defined in js-api-doc/legacy/function.d.ts:195
A shorthand for sass.types.Boolean.TRUE.
deprecated
This only works with the legacy render and renderSync APIs. Use sassTrue with compile, compileString, compileAsync, and compileStringAsync instead.
render
render(options: LegacyOptions<"async">, callback: (exception?: LegacyException, result?: LegacyResult) => void): void
Defined in js-api-doc/legacy/render.d.ts:136
This function asynchronously compiles a Sass file to CSS, and calls callback with a LegacyResult if compilation succeeds or LegacyException if it fails.
⚠️ Heads up! When using Dart Sass, renderSync is almost twice as fast as render by default, due to the overhead of making the entire evaluation process asynchronous. constsass = require('sass'); // or require('node-sass');sass.render({file:"style.scss"}, function(err, result) {// ...});
deprecated
Use compileAsync or compileStringAsync instead.
Parameters
options: LegacyOptions<"async">
callback: (exception?: LegacyException, result?: LegacyResult) => void
(exception?: LegacyException, result?: LegacyResult): void
Parameters
Optional exception: LegacyException
Optional result: LegacyResult
Returns void
Returns void
renderSync
renderSync(options: LegacyOptions<"sync">): LegacyResult
Defined in js-api-doc/legacy/render.d.ts:111
This function synchronously compiles a Sass file to CSS. If it succeeds, it returns the result, and if it fails it throws an error.
example
constsass = require('sass'); // or require('node-sass');constresult = sass.renderSync({file:"style.scss"});// ...
deprecated
Use compile or compileString instead.
Parameters
options: LegacyOptions<"sync">
Returns LegacyResult
Exports
Logger
types
Compile
CompileResult
compile
compileAsync
compileString
compileStringAsync
Options
Options
StringOptionsWithImporter
StringOptionsWithoutImporter
OutputStyle
StringOptions
Syntax
Logger
Logger
Logger
SourceLocation
SourceSpan
Importer
FileImporter
Importer
ImporterResult
Custom Function
SassArgumentList
SassBoolean
SassColor
SassFunction
SassList
SassMap
SassNumber
SassString
Value
CustomFunction
ListSeparator
sassFalse
sassNull
sassTrue
Other
Exception
LegacyFileOptions
PromiseOr
info
Legacy
types
LegacyException
LegacyImporterThis
LegacyPluginThis
LegacyResult
LegacySharedOptions
LegacyStringOptions
LegacyAsyncFunction
LegacyAsyncFunctionDone
LegacyAsyncImporter
LegacyFunction
LegacyImporter
LegacyImporterResult
LegacyOptions
LegacySyncFunction
LegacySyncImporter
LegacyValue
FALSE
NULL
TRUE
render
renderSync
|
constant INSTALL_TASK_RUN_IF_NOT_COMPLETED Run the task on each installation request until the database is set up. This is the default method for running tasks and should be used for most tasks that occur after the database is set up; these tasks will then run once and be marked complete once they are successfully finished. For example, the Drupal installer uses this flag for the batch installation of modules on the new site, and also for the configuration form that collects basic site information and sets up the site maintenance account. File
core/includes/install.core.inc, line 65 API functions for installing Drupal. Code const INSTALL_TASK_RUN_IF_NOT_COMPLETED = 3;
|
8.205 RENAME — Rename a file
Description:
Renames a file from file PATH1 to PATH2. A null character (CHAR(0)) can be used to mark the end of the names in PATH1 and PATH2; otherwise, trailing blanks in the file names are ignored. If the STATUS argument is supplied, it contains 0 on success or a nonzero error code upon return; see rename(2). This intrinsic is provided in both subroutine and function forms; however, only one form can be used in any given program unit.
Standard:
GNU extension
Class:
Subroutine, function
Syntax:
CALL RENAME(PATH1, PATH2 [, STATUS])
STATUS = RENAME(PATH1, PATH2)
Arguments:
PATH1
Shall be of default CHARACTER type.
PATH2
Shall be of default CHARACTER type.
STATUS
(Optional) Shall be of default INTEGER type.
See also:
LINK
|
NavigationError class npm Package @angular/router Module import { NavigationError } from '@angular/router'; Source router/src/events.ts Represents an event triggered when a navigation fails due to an unexpected error. Overview class NavigationError extends RouterEvent {
constructor(id: number, url: string, error: any)
error: any
toString(): string
// inherited from router/RouterEvent
id: number
url: string
} Constructor constructor(id: number, url: string, error: any)
Members error: any toString(): string
|
clean_blog_cache( WP_Site|int $blog ) Clean the blog cache Parameters $blog WP_Site|int Required The site object or ID to be cleared from cache. Source File: wp-includes/ms-site.php. View all references function clean_blog_cache( $blog ) {
global $_wp_suspend_cache_invalidation;
if ( ! empty( $_wp_suspend_cache_invalidation ) ) {
return;
}
if ( empty( $blog ) ) {
return;
}
$blog_id = $blog;
$blog = get_site( $blog_id );
if ( ! $blog ) {
if ( ! is_numeric( $blog_id ) ) {
return;
}
// Make sure a WP_Site object exists even when the site has been deleted.
$blog = new WP_Site(
(object) array(
'blog_id' => $blog_id,
'domain' => null,
'path' => null,
)
);
}
$blog_id = $blog->blog_id;
$domain_path_key = md5( $blog->domain . $blog->path );
wp_cache_delete( $blog_id, 'sites' );
wp_cache_delete( $blog_id, 'site-details' );
wp_cache_delete( $blog_id, 'blog-details' );
wp_cache_delete( $blog_id . 'short', 'blog-details' );
wp_cache_delete( $domain_path_key, 'blog-lookup' );
wp_cache_delete( $domain_path_key, 'blog-id-cache' );
wp_cache_delete( $blog_id, 'blog_meta' );
/**
* Fires immediately after a site has been removed from the object cache.
*
* @since 4.6.0
*
* @param string $id Site ID as a numeric string.
* @param WP_Site $blog Site object.
* @param string $domain_path_key md5 hash of domain and path.
*/
do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key );
wp_cache_set( 'last_changed', microtime(), 'sites' );
/**
* Fires after the blog details cache is cleared.
*
* @since 3.4.0
* @deprecated 4.9.0 Use {@see 'clean_site_cache'} instead.
*
* @param int $blog_id Blog ID.
*/
do_action_deprecated( 'refresh_blog_details', array( $blog_id ), '4.9.0', 'clean_site_cache' );
}
Hooks do_action( 'clean_site_cache', string $id, WP_Site $blog, string $domain_path_key )
Fires immediately after a site has been removed from the object cache. do_action_deprecated( 'refresh_blog_details', int $blog_id )
Fires after the blog details cache is cleared. Related Uses Uses Description get_site() wp-includes/ms-site.php Retrieves site data given a site ID or site object. do_action_deprecated() wp-includes/plugin.php Fires functions attached to a deprecated action hook. WP_Sit8b7c:f320:99b9:690f:4595:cd17:293a:c069__construct() wp-includes/class-wp-site.php Creates a new WP_Site object. wp_cache_delete() wp-includes/cache.php Removes the cache contents matching key and group. wp_cache_set() wp-includes/cache.php Saves the data to the cache. do_action() wp-includes/plugin.php Calls the callback functions that have been added to an action hook.
Used By Used By Description wp_maybe_clean_new_site_cache_on_update() wp-includes/ms-site.php Cleans the necessary caches after specific site data has been updated. wp_initialize_site() wp-includes/ms-site.php Runs the initialization routine for a given site. wp_insert_site() wp-includes/ms-site.php Inserts a new site into the database. wp_update_site() wp-includes/ms-site.php Updates a site in the database. wp_delete_site() wp-includes/ms-site.php Deletes a site from the database. insert_blog() wp-includes/ms-deprecated.php Store basic site info in the blogs table. refresh_blog_details() wp-includes/ms-blogs.php Clear the blog details cache.
Changelog Version Description 3.5.0 Introduced.
|
ssh2_connect (PECL ssh2 >= 0.9.0)
ssh2_connect — Connect to an SSH server Description ssh2_connect(
string $host,
int $port = 22,
array $methods = ?,
array $callbacks = ?
): resource Establish a connection to a remote SSH server. Once connected, the client should verify the server's hostkey using ssh2_fingerprint(), then authenticate using either password or public key. Parameters
host
port
methods
methods may be an associative array with up to four parameters as described below.
methods may be an associative array with any or all of the following parameters. Index Meaning Supported Values* kex List of key exchange methods to advertise, comma separated in order of preference. diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, and diffie-hellman-group-exchange-sha1 hostkey List of hostkey methods to advertise, comma separated in order of preference. ssh-rsa and ssh-dss client_to_server Associative array containing crypt, compression, and message authentication code (MAC) method preferences for messages sent from client to server. server_to_client Associative array containing crypt, compression, and message authentication code (MAC) method preferences for messages sent from server to client. * - Supported Values are dependent on methods supported by underlying library. See » libssh2 documentation for additional information.
client_to_server and server_to_client may be an associative array with any or all of the following parameters. Index Meaning Supported Values* crypt List of crypto methods to advertise, comma separated in order of preference. [email protected], aes256-cbc, aes192-cbc, aes128-cbc, 3des-cbc, blowfish-cbc, cast128-cbc, arcfour, and none** comp List of compression methods to advertise, comma separated in order of preference. zlib and none mac List of MAC methods to advertise, comma separated in order of preference. hmac-sha1, hmac-sha1-96, hmac-ripemd160, [email protected], and none**
Note: Crypt and MAC method "none"
For security reasons, none is disabled by the underlying » libssh2 library unless explicitly enabled during build time by using the appropriate ./configure options. See documentation for the underlying library for more information. callbacks
callbacks may be an associative array with any or all of the following parameters.
Callbacks parameters Index Meaning Prototype ignore Name of function to call when an SSH2_MSG_IGNORE packet is received void ignore_cb($message) debug Name of function to call when an SSH2_MSG_DEBUG packet is received void debug_cb($message, $language, $always_display) macerror Name of function to call when a packet is received but the message authentication code failed. If the callback returns true, the mismatch will be ignored, otherwise the connection will be terminated. bool macerror_cb($packet) disconnect Name of function to call when an SSH2_MSG_DISCONNECT packet is received void disconnect_cb($reason, $message, $language) Return Values Returns a resource on success, or false on error. Examples
Example #1 ssh2_connect() example Open a connection forcing 3des-cbc when sending packets, any strength aes cipher when receiving packets, no compression in either direction, and Group1 key exchange. <?php
/* Notify the user if the server terminates the connection */
function my_ssh_disconnect($reason, $message, $language) {
printf("Server disconnected with reason code [%d] and message: %s\n",
$reason, $message);
}
$methods = array(
'kex' => 'diffie-hellman-group1-sha1',
'client_to_server' => array(
'crypt' => '3des-cbc',
'comp' => 'none'),
'server_to_client' => array(
'crypt' => 'aes256-cbc,aes192-cbc,aes128-cbc',
'comp' => 'none'));
$callbacks = array('disconnect' => 'my_ssh_disconnect');
$connection = ssh2_connect('shell.example.com', 22, $methods, $callbacks);
if (!$connection) die('Connection failed');
?> See Also
ssh2_fingerprint() - Retrieve fingerprint of remote server ssh2_auth_none() - Authenticate as "none" ssh2_auth_password() - Authenticate over SSH using a plain password ssh2_auth_pubkey_file() - Authenticate using a public key ssh2_disconnect() - Close a connection to a remote SSH server
|
public function FormBuilder8b7c:f320:99b9:690f:4595:cd17:293a:c069setCache public FormBuilder8b7c:f320:99b9:690f:4595:cd17:293a:c069setCache($form_build_id, $form, FormStateInterface $form_state) Stores a form in the cache. Parameters string $form_build_id: The unique form build ID. array $form: The form to cache. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Overrides FormCacheInter8b7c:f320:99b9:690f:4595:cd17:293a:c069setCache File
core/lib/Drupal/Core/Form/FormBuilder.php, line 438 Class
FormBuilder Provides form building and processing. Namespace Drupal\Core\Form Code public function setCache($form_build_id, $form, FormStateInterface $form_state) {
$this->formCache->setCache($form_build_id, $form, $form_state);
}
|
nextLong
kotlin-stdlib / kotlin.random / Random / nextLong
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
open fun nextLong(): Long
fun nextLong(): Long
Gets the next random Long from the random number generator. Generates a Long random value uniformly distributed between Long.MIN_VALUE and Long.MAX_VALUE (inclusive).
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
open fun nextLong(until: Long): Long
fun nextLong(until: Long): Long
Gets the next random non-negative Long from the random number generator less than the specified until bound. Generates a Long random value uniformly distributed between 0 (inclusive) and the specified until bound (exclusive). Parameters until - must be positive. Exceptions IllegalArgumentException - if until is negative or zero.
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
open fun nextLong(from: Long, until: Long): Long
fun nextLong(from: Long, until: Long): Long
Gets the next random Long from the random number generator in the specified range. Generates a Long random value uniformly distributed between the specified from (inclusive) and until (exclusive) bounds. Exceptions IllegalArgumentException - if from is greater than or equal to until.
|
Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt NAME SYNOPSIS DESCRIPTION Input Output METHODS ACCURACY and PRECISION Precision P Accuracy A Fallback F Rounding mode R Infinity and Not a Number INTERNALS MATH LIBRARY SIGN mantissa(), exponent() and parts() EXAMPLES Autocreating constants PERFORMANCEAlternative math libraries SUBCLASSINGSubclassing Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt UPGRADINGAuto-upgrade EXPORTS CAVEATS BUGS SUPPORT LICENSE SEE ALSO AUTHORS NAME Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt - Arbitrary size integer/float math package SYNOPSIS use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt; # or make it faster with huge numbers: install (optional) # Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069GMP and always use (it will fall back to # pure Perl if the GMP library is not installed): # (See also the L<MATH LIBRARY> section!) # will warn if Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069GMP cannot be found use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt lib => 'GMP'; # to suppress the warning use this: # use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt try => 'GMP'; # dies if GMP cannot be loaded: # use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt only => 'GMP'; my $str = '1234567890'; my @values = (64,74,18); my $n = 1; my $sign = '-'; # Number creation my $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new($str); # defaults to 0 my $y = $x->copy(); # make a true copy my $nan = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bnan(); # create a NotANumber my $zero = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bzero(); # create a +0 my $inf = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->binf(); # create a +inf my $inf = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->binf('-'); # create a -inf my $one = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bone(); # create a +1 my $mone = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bone('-'); # create a -1 my $pi = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bpi(); # returns '3' # see Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat8b7c:f320:99b9:690f:4595:cd17:293a:c069pi() $h = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new('0x123'); # from hexadecimal $b = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new('0b101'); # from binary $o = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->from_oct('0101'); # from octal # Testing (don't modify their arguments) # (return true if the condition is met, otherwise false) $x->is_zero(); # if $x is +0 $x->is_nan(); # if $x is NaN $x->is_one(); # if $x is +1 $x->is_one('-'); # if $x is -1 $x->is_odd(); # if $x is odd $x->is_even(); # if $x is even $x->is_pos(); # if $x > 0 $x->is_neg(); # if $x < 0 $x->is_inf($sign); # if $x is +inf, or -inf (sign is default '+') $x->is_int(); # if $x is an integer (not a float) # comparing and digit/sign extraction $x->bcmp($y); # compare numbers (undef,<0,=0,>0) $x->bacmp($y); # compare absolutely (undef,<0,=0,>0) $x->sign(); # return the sign, either +,- or NaN $x->digit($n); # return the nth digit, counting from right $x->digit(-$n); # return the nth digit, counting from left # The following all modify their first argument. If you want to pre- # serve $x, use $z = $x->copy()->bXXX($y); See under L<CAVEATS> for # why this is necessary when mixing $a = $b assignments with non-over- # loaded math. $x->bzero(); # set $x to 0 $x->bnan(); # set $x to NaN $x->bone(); # set $x to +1 $x->bone('-'); # set $x to -1 $x->binf(); # set $x to inf $x->binf('-'); # set $x to -inf $x->bneg(); # negation $x->babs(); # absolute value $x->bsgn(); # sign function (-1, 0, 1, or NaN) $x->bnorm(); # normalize (no-op in BigInt) $x->bnot(); # two's complement (bit wise not) $x->binc(); # increment $x by 1 $x->bdec(); # decrement $x by 1 $x->badd($y); # addition (add $y to $x) $x->bsub($y); # subtraction (subtract $y from $x) $x->bmul($y); # multiplication (multiply $x by $y) $x->bdiv($y); # divide, set $x to quotient # return (quo,rem) or quo if scalar $x->bmuladd($y,$z); # $x = $x * $y + $z $x->bmod($y); # modulus (x % y) $x->bmodpow($y,$mod); # modular exponentiation (($x ** $y) % $mod) $x->bmodinv($mod); # modular multiplicative inverse $x->bpow($y); # power of arguments (x ** y) $x->blsft($y); # left shift in base 2 $x->brsft($y); # right shift in base 2 # returns (quo,rem) or quo if in sca- # lar context $x->blsft($y,$n); # left shift by $y places in base $n $x->brsft($y,$n); # right shift by $y places in base $n # returns (quo,rem) or quo if in sca- # lar context $x->band($y); # bitwise and $x->bior($y); # bitwise inclusive or $x->bxor($y); # bitwise exclusive or $x->bnot(); # bitwise not (two's complement) $x->bsqrt(); # calculate square-root $x->broot($y); # $y'th root of $x (e.g. $y == 3 => cubic root) $x->bfac(); # factorial of $x (1*2*3*4*..$x) $x->bnok($y); # x over y (binomial coefficient n over k) $x->blog(); # logarithm of $x to base e (Euler's number) $x->blog($base); # logarithm of $x to base $base (f.i. 2) $x->bexp(); # calculate e ** $x where e is Euler's number $x->round($A,$P,$mode); # round to accuracy or precision using # mode $mode $x->bround($n); # accuracy: preserve $n digits $x->bfround($n); # $n > 0: round $nth digits, # $n < 0: round to the $nth digit after the # dot, no-op for BigInts # The following do not modify their arguments in BigInt (are no-ops), # but do so in BigFloat: $x->bfloor(); # round towards minus infinity $x->bceil(); # round towards plus infinity $x->bint(); # round towards zero # The following do not modify their arguments: # greatest common divisor (no OO style) my $gcd = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069gcd(@values); # lowest common multiple (no OO style) my $lcm = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069lcm(@values); $x->length(); # return number of digits in number ($xl,$f) = $x->length(); # length of number and length of fraction # part, latter is always 0 digits long # for BigInts $x->exponent(); # return exponent as BigInt $x->mantissa(); # return (signed) mantissa as BigInt $x->parts(); # return (mantissa,exponent) as BigInt $x->copy(); # make a true copy of $x (unlike $y = $x;) $x->as_int(); # return as BigInt (in BigInt: same as copy()) $x->numify(); # return as scalar (might overflow!) # conversion to string (do not modify their argument) $x->bstr(); # normalized string (e.g. '3') $x->bsstr(); # norm. string in scientific notation (e.g. '3E0') $x->as_hex(); # as signed hexadecimal string with prefixed 0x $x->as_bin(); # as signed binary string with prefixed 0b $x->as_oct(); # as signed octal string with prefixed 0 # precision and accuracy (see section about rounding for more) $x->precision(); # return P of $x (or global, if P of $x undef) $x->precision($n); # set P of $x to $n $x->accuracy(); # return A of $x (or global, if A of $x undef) $x->accuracy($n); # set A $x to $n # Global methods Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->precision(); # get/set global P for all BigInt objects Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->accuracy(); # get/set global A for all BigInt objects Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->round_mode(); # get/set global round mode, one of # 'even', 'odd', '+inf', '-inf', 'zero', # 'trunc' or 'common' Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->config(); # return hash containing configuration DESCRIPTION All operators (including basic math operations) are overloaded if you declare your big integers as $i = new Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt '123_456_789_123_456_789'; Operations with overloaded operators preserve the arguments which is exactly what you expect. Input Input values to these routines may be any string, that looks like a number and results in an integer, including hexadecimal and binary numbers. Scalars holding numbers may also be passed, but note that non-integer numbers may already have lost precision due to the conversion to float. Quote your input if you want BigInt to see all the digits: $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(12345678890123456789); # bad $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new('12345678901234567890'); # good You can include one underscore between any two digits. This means integer values like 1.01E2 or even 1000E-2 are also accepted. Non-integer values result in NaN. Hexadecimal (prefixed with "0x") and binary numbers (prefixed with "0b") are accepted, too. Please note that octal numbers are not recognized by new(), so the following will print "123": perl -MMath8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt -le 'print Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new("0123")' To convert an octal number, use from_oct(); perl -MMath8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt -le 'print Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->from_oct("0123")' Currently, Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069new() defaults to 0, while Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069new('') results in 'NaN'. This might change in the future, so use always the following explicit forms to get a zero or NaN: $zero = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bzero(); $nan = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bnan(); bnorm() on a BigInt object is now effectively a no-op, since the numbers are always stored in normalized form. If passed a string, creates a BigInt object from the input. Output Output values are BigInt objects (normalized), except for the methods which return a string (see SYNOPSIS). Some routines (is_odd() , is_even() , is_zero() , is_one() , is_nan() , etc.) return true or false, while others (bcmp() , bacmp() ) return either undef (if NaN is involved), <0, 0 or >0 and are suited for sort. METHODS Each of the methods below (except config(), accuracy() and precision()) accepts three additional parameters. These arguments $A , $P and $R are accuracy , precision and round_mode . Please see the section about ACCURACY and PRECISION for more information. config() use Dat8b7c:f320:99b9:690f:4595:cd17:293a:c069Dumper; print Dumper ( Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->config() ); print Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->config()->{lib},"\n"; Returns a hash containing the configuration, e.g. the version number, lib loaded etc. The following hash keys are currently filled in with the appropriate information. key Description Example ============================================================ lib Name of the low-level math library Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069lc lib_version Version of low-level math library (see 'lib') 0.30 class The class name of config() you just called Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt upgrade To which class math operations might be upgraded Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat downgrade To which class math operations might be downgraded undef precision Global precision undef accuracy Global accuracy undef round_mode Global round mode even version version number of the class you used 1.61 div_scale Fallback accuracy for div 40 trap_nan If true, traps creation of NaN via croak() 1 trap_inf If true, traps creation of +inf/-inf via croak() 1 The following values can be set by passing config() a reference to a hash: trap_inf trap_nan upgrade downgrade precision accuracy round_mode div_scale Example: $new_cfg = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->config( { trap_inf => 1, precision => 5 } ); accuracy() $x->accuracy(5); # local for $x CLASS->accuracy(5); # global for all members of CLASS # Note: This also applies to new()! $A = $x->accuracy(); # read out accuracy that affects $x $A = CLASS->accuracy(); # read out global accuracy Set or get the global or local accuracy, aka how many significant digits the results have. If you set a global accuracy, then this also applies to new()! Warning! The accuracy sticks, e.g. once you created a number under the influence of CLASS->accuracy($A) , all results from math operations with that number will also be rounded. In most cases, you should probably round the results explicitly using one of round(), bround() or bfround() or by passing the desired accuracy to the math operation as additional parameter: my $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(30000); my $y = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(7); print scalar $x->copy()->bdiv($y, 2); # print 4300 print scalar $x->copy()->bdiv($y)->bround(2); # print 4300 Please see the section about ACCURACY and PRECISION for further details. Value must be greater than zero. Pass an undef value to disable it: $x->accuracy(undef); Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->accuracy(undef); Returns the current accuracy. For $x->accuracy() it will return either the local accuracy, or if not defined, the global. This means the return value represents the accuracy that will be in effect for $x: $y = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(1234567); # unrounded print Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->accuracy(4),"\n"; # set 4, print 4 $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(123456); # $x will be automatic- # ally rounded! print "$x $y\n"; # '123500 1234567' print $x->accuracy(),"\n"; # will be 4 print $y->accuracy(),"\n"; # also 4, since # global is 4 print Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->accuracy(5),"\n"; # set to 5, print 5 print $x->accuracy(),"\n"; # still 4 print $y->accuracy(),"\n"; # 5, since global is 5 Note: Works also for subclasses like Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat. Each class has it's own globals separated from Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt, but it is possible to subclass Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt and make the globals of the subclass aliases to the ones from Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt. precision() $x->precision(-2); # local for $x, round at the second # digit right of the dot $x->precision(2); # ditto, round at the second digit # left of the dot CLASS->precision(5); # Global for all members of CLASS # This also applies to new()! CLASS->precision(-5); # ditto $P = CLASS->precision(); # read out global precision $P = $x->precision(); # read out precision that affects $x Note: You probably want to use accuracy() instead. With accuracy() you set the number of digits each result should have, with precision() you set the place where to round! precision() sets or gets the global or local precision, aka at which digit before or after the dot to round all results. A set global precision also applies to all newly created numbers! In Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt, passing a negative number precision has no effect since no numbers have digits after the dot. In Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat, it will round all results to P digits after the dot. Please see the section about ACCURACY and PRECISION for further details. Pass an undef value to disable it: $x->precision(undef); Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->precision(undef); Returns the current precision. For $x->precision() it will return either the local precision of $x, or if not defined, the global. This means the return value represents the prevision that will be in effect for $x: $y = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(1234567); # unrounded print Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->precision(4),"\n"; # set 4, print 4 $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(123456); # will be automatically rounded print $x; # print "120000"! Note: Works also for subclasses like Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat. Each class has its own globals separated from Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt, but it is possible to subclass Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt and make the globals of the subclass aliases to the ones from Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt. brsft() $x->brsft($y,$n); Shifts $x right by $y in base $n. Default is base 2, used are usually 10 and 2, but others work, too. Right shifting usually amounts to dividing $x by $n ** $y and truncating the result: $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(10); $x->brsft(1); # same as $x >> 1: 5 $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(1234); $x->brsft(2,10); # result 12 There is one exception, and that is base 2 with negative $x: $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(-5); print $x->brsft(1); This will print -3, not -2 (as it would if you divide -5 by 2 and truncate the result). new() $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new($str,$A,$P,$R); Creates a new BigInt object from a scalar or another BigInt object. The input is accepted as decimal, hex (with leading '0x') or binary (with leading '0b'). See Input for more info on accepted input formats. from_oct() $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->from_oct("0775"); # input is octal Interpret the input as an octal string and return the corresponding value. A "0" (zero) prefix is optional. A single underscore character may be placed right after the prefix, if present, or between any two digits. If the input is invalid, a NaN is returned. from_hex() $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->from_hex("0xcafe"); # input is hexadecimal Interpret input as a hexadecimal string. A "0x" or "x" prefix is optional. A single underscore character may be placed right after the prefix, if present, or between any two digits. If the input is invalid, a NaN is returned. from_bin() $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->from_bin("0b10011"); # input is binary Interpret the input as a binary string. A "0b" or "b" prefix is optional. A single underscore character may be placed right after the prefix, if present, or between any two digits. If the input is invalid, a NaN is returned. bnan() $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bnan(); Creates a new BigInt object representing NaN (Not A Number). If used on an object, it will set it to NaN: $x->bnan(); bzero() $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bzero(); Creates a new BigInt object representing zero. If used on an object, it will set it to zero: $x->bzero(); binf() $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->binf($sign); Creates a new BigInt object representing infinity. The optional argument is either '-' or '+', indicating whether you want infinity or minus infinity. If used on an object, it will set it to infinity: $x->binf(); $x->binf('-'); bone() $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->binf($sign); Creates a new BigInt object representing one. The optional argument is either '-' or '+', indicating whether you want one or minus one. If used on an object, it will set it to one: $x->bone(); # +1 $x->bone('-'); # -1 is_one()/is_zero()/is_nan()/is_inf() $x->is_zero(); # true if arg is +0 $x->is_nan(); # true if arg is NaN $x->is_one(); # true if arg is +1 $x->is_one('-'); # true if arg is -1 $x->is_inf(); # true if +inf $x->is_inf('-'); # true if -inf (sign is default '+') These methods all test the BigInt for being one specific value and return true or false depending on the input. These are faster than doing something like: if ($x == 0) is_pos()/is_neg()/is_positive()/is_negative() $x->is_pos(); # true if > 0 $x->is_neg(); # true if < 0 The methods return true if the argument is positive or negative, respectively. NaN is neither positive nor negative, while +inf counts as positive, and -inf is negative. A zero is neither positive nor negative. These methods are only testing the sign, and not the value. is_positive() and is_negative() are aliases to is_pos() and is_neg() , respectively. is_positive() and is_negative() were introduced in v1.36, while is_pos() and is_neg() were only introduced in v1.68. is_odd()/is_even()/is_int() $x->is_odd(); # true if odd, false for even $x->is_even(); # true if even, false for odd $x->is_int(); # true if $x is an integer The return true when the argument satisfies the condition. NaN , +inf , -inf are not integers and are neither odd nor even. In BigInt, all numbers except NaN , +inf and -inf are integers. bcmp() $x->bcmp($y); Compares $x with $y and takes the sign into account. Returns -1, 0, 1 or undef. bacmp() $x->bacmp($y); Compares $x with $y while ignoring their sign. Returns -1, 0, 1 or undef. sign() $x->sign(); Return the sign, of $x, meaning either + , - , -inf , +inf or NaN. If you want $x to have a certain sign, use one of the following methods: $x->babs(); # '+' $x->babs()->bneg(); # '-' $x->bnan(); # 'NaN' $x->binf(); # '+inf' $x->binf('-'); # '-inf' digit() $x->digit($n); # return the nth digit, counting from right If $n is negative, returns the digit counting from left. bneg() $x->bneg(); Negate the number, e.g. change the sign between '+' and '-', or between '+inf' and '-inf', respectively. Does nothing for NaN or zero. babs() $x->babs(); Set the number to its absolute value, e.g. change the sign from '-' to '+' and from '-inf' to '+inf', respectively. Does nothing for NaN or positive numbers. bsgn() $x->bsgn(); Signum function. Set the number to -1, 0, or 1, depending on whether the number is negative, zero, or positive, respectively. Does not modify NaNs. bnorm() $x->bnorm(); # normalize (no-op) bnot() $x->bnot(); Two's complement (bitwise not). This is equivalent to $x->binc()->bneg(); but faster. binc() $x->binc(); # increment x by 1 bdec() $x->bdec(); # decrement x by 1 badd() $x->badd($y); # addition (add $y to $x) bsub() $x->bsub($y); # subtraction (subtract $y from $x) bmul() $x->bmul($y); # multiplication (multiply $x by $y) bmuladd() $x->bmuladd($y,$z); Multiply $x by $y, and then add $z to the result, This method was added in v1.87 of Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt (June 2007). bdiv() $x->bdiv($y); # divide, set $x to quotient # return (quo,rem) or quo if scalar bmod() $x->bmod($y); # modulus (x % y) bmodinv() $x->bmodinv($mod); # modular multiplicative inverse Returns the multiplicative inverse of $x modulo $mod . If $y = $x -> copy() -> bmodinv($mod) then $y is the number closest to zero, and with the same sign as $mod , satisfying ($x * $y) % $mod = 1 % $mod If $x and $y are non-zero, they must be relative primes, i.e., bgcd($y, $mod)==1 . 'NaN ' is returned when no modular multiplicative inverse exists. bmodpow() $num->bmodpow($exp,$mod); # modular exponentiation # ($num**$exp % $mod) Returns the value of $num taken to the power $exp in the modulus $mod using binary exponentiation. bmodpow is far superior to writing $num ** $exp % $mod because it is much faster - it reduces internal variables into the modulus whenever possible, so it operates on smaller numbers. bmodpow also supports negative exponents. bmodpow($num, -1, $mod) is exactly equivalent to bmodinv($num, $mod) bpow() $x->bpow($y); # power of arguments (x ** y) blog() $x->blog($base, $accuracy); # logarithm of x to the base $base If $base is not defined, Euler's number (e) is used: print $x->blog(undef, 100); # log(x) to 100 digits bexp() $x->bexp($accuracy); # calculate e ** X Calculates the expression e ** $x where e is Euler's number. This method was added in v1.82 of Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt (April 2007). See also blog(). bnok() $x->bnok($y); # x over y (binomial coefficient n over k) Calculates the binomial coefficient n over k, also called the "choose" function. The result is equivalent to: ( n ) n! | - | = ------- ( k ) k!(n-k)! This method was added in v1.84 of Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt (April 2007). bpi() print Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bpi(100), "\n"; # 3 Returns PI truncated to an integer, with the argument being ignored. This means under BigInt this always returns 3 . If upgrading is in effect, returns PI, rounded to N digits with the current rounding mode: use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat; use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt upgrade => Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat; print Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bpi(3), "\n"; # 3.14 print Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bpi(100), "\n"; # 3.1415.... This method was added in v1.87 of Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt (June 2007). bcos() my $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(1); print $x->bcos(100), "\n"; Calculate the cosinus of $x, modifying $x in place. In BigInt, unless upgrading is in effect, the result is truncated to an integer. This method was added in v1.87 of Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt (June 2007). bsin() my $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(1); print $x->bsin(100), "\n"; Calculate the sinus of $x, modifying $x in place. In BigInt, unless upgrading is in effect, the result is truncated to an integer. This method was added in v1.87 of Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt (June 2007). batan2() my $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(1); my $y = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(1); print $y->batan2($x), "\n"; Calculate the arcus tangens of $y divided by $x , modifying $y in place. In BigInt, unless upgrading is in effect, the result is truncated to an integer. This method was added in v1.87 of Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt (June 2007). batan() my $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->new(0.5); print $x->batan(100), "\n"; Calculate the arcus tangens of $x, modifying $x in place. In BigInt, unless upgrading is in effect, the result is truncated to an integer. This method was added in v1.87 of Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt (June 2007). blsft() $x->blsft($y); # left shift in base 2 $x->blsft($y,$n); # left shift, in base $n (like 10) brsft() $x->brsft($y); # right shift in base 2 $x->brsft($y,$n); # right shift, in base $n (like 10) band() $x->band($y); # bitwise and bior() $x->bior($y); # bitwise inclusive or bxor() $x->bxor($y); # bitwise exclusive or bnot() $x->bnot(); # bitwise not (two's complement) bsqrt() $x->bsqrt(); # calculate square-root broot() $x->broot($N); Calculates the N'th root of $x . bfac() $x->bfac(); # factorial of $x (1*2*3*4*..$x) round() $x->round($A,$P,$round_mode); Round $x to accuracy $A or precision $P using the round mode $round_mode . bround() $x->bround($N); # accuracy: preserve $N digits bfround() $x->bfround($N); If N is > 0, rounds to the Nth digit from the left. If N < 0, rounds to the Nth digit after the dot. Since BigInts are integers, the case N < 0 is a no-op for them. Examples: Input N Result =================================================== 123456.123456 3 123500 123456.123456 2 123450 123456.123456 -2 123375-85-157156.123456 -+1-416-536-2255 bfloor() $x->bfloor(); Round $x towards minus infinity (i.e., set $x to the largest integer less than or equal to $x). This is a no-op in BigInt, but changes $x in BigFloat, if $x is not an integer. bceil() $x->bceil(); Round $x towards plus infinity (i.e., set $x to the smallest integer greater than or equal to $x). This is a no-op in BigInt, but changes $x in BigFloat, if $x is not an integer. bint() $x->bint(); Round $x towards zero. This is a no-op in BigInt, but changes $x in BigFloat, if $x is not an integer. bgcd() bgcd(@values); # greatest common divisor (no OO style) blcm() blcm(@values); # lowest common multiple (no OO style) length() $x->length(); ($xl,$fl) = $x->length(); Returns the number of digits in the decimal representation of the number. In list context, returns the length of the integer and fraction part. For BigInt's, the length of the fraction part will always be 0. exponent() $x->exponent(); Return the exponent of $x as BigInt. mantissa() $x->mantissa(); Return the signed mantissa of $x as BigInt. parts() $x->parts(); # return (mantissa,exponent) as BigInt copy() $x->copy(); # make a true copy of $x (unlike $y = $x;) as_int()/as_number() $x->as_int(); Returns $x as a BigInt (truncated towards zero). In BigInt this is the same as copy() . as_number() is an alias to this method. as_number was introduced in v1.22, while as_int() was only introduced in v1.68. bstr() $x->bstr(); Returns a normalized string representation of $x . bsstr() $x->bsstr(); # normalized string in scientific notation as_hex() $x->as_hex(); # as signed hexadecimal string with prefixed 0x as_bin() $x->as_bin(); # as signed binary string with prefixed 0b as_oct() $x->as_oct(); # as signed octal string with prefixed 0 numify() print $x->numify(); This returns a normal Perl scalar from $x. It is used automatically whenever a scalar is needed, for instance in array index operations. This loses precision, to avoid this use as_int() instead. modify() $x->modify('bpowd'); This method returns 0 if the object can be modified with the given operation, or 1 if not. This is used for instance by Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069onstant. upgrade()/downgrade() Set/get the class for downgrade/upgrade operations. Thuis is used for instance by bignum. The defaults are '', thus the following operation will create a BigInt, not a BigFloat: my $i = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(123); my $f = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->new('123.1'); print $i + $f,"\n"; # print 246 div_scale() Set/get the number of digits for the default precision in divide operations. round_mode() Set/get the current round mode. ACCURACY and PRECISION Since version v1.33, Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt and Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat have full support for accuracy and precision based rounding, both automatically after every operation, as well as manually. This section describes the accuracy/precision handling in Math8b7c:f320:99b9:690f:4595:cd17:293a:c069ig* as it used to be and as it is now, complete with an explanation of all terms and abbreviations. Not yet implemented things (but with correct description) are marked with '!', things that need to be answered are marked with '?'. In the next paragraph follows a short description of terms used here (because these may differ from terms used by others people or documentation). During the rest of this document, the shortcuts A (for accuracy), P (for precision), F (fallback) and R (rounding mode) will be used. Precision P A fixed number of digits before (positive) or after (negative) the decimal point. For example, 123.45 has a precision of -2. 0 means an integer like 123 (or 120). A precision of 2 means two digits to the left of the decimal point are zero, so 123 with P = 1 becomes 120. Note that numbers with zeros before the decimal point may have different precisions, because 1200 can have p = 0, 1 or 2 (depending on what the initial value was). It could also have p < 0, when the digits after the decimal point are zero. The string output (of floating point numbers) will be padded with zeros: Initial value P A Result String ------------------------------------------------------------ 1234.01 -3 1000 1000 1234 -2 1200 1200 1234.5 -1 1230 1230 1234.001 1 1234 1234.0 1234.01 0 1234 1234 1234.01 2 1375-85-1571.01 1234.01 5 1375-85-1571.01000 For BigInts, no padding occurs. Accuracy A Number of significant digits. Leading zeros are not counted. A number may have an accuracy greater than the non-zero digits when there are zeros in it or trailing zeros. For example, 123.456 has A of 6, 10203 has 5, 123.0506 has 7, 123.450000 has 8 and 0.000123 has 3. The string output (of floating point numbers) will be padded with zeros: Initial value P A Result String ------------------------------------------------------------ 1234.01 3 1230 1230 1234.01 6 1375-85-1571.01 1234.1 8 1234.1 1234.1000 For BigInts, no padding occurs. Fallback F When both A and P are undefined, this is used as a fallback accuracy when dividing numbers. Rounding mode R When rounding a number, different 'styles' or 'kinds' of rounding are possible. (Note that random rounding, as in Math8b7c:f320:99b9:690f:4595:cd17:293a:c069Round, is not implemented.) 'trunc' truncation invariably removes all digits following the rounding place, replacing them with zeros. Thus, 987.65 rounded to tens (P=1) becomes 980, and rounded to the fourth sigdig becomes 987.6 (A=4). 123.456 rounded to the second place after the decimal point (P=-2) becomes 123.46. All other implemented styles of rounding attempt to round to the "nearest digit." If the digit D immediately to the right of the rounding place (skipping the decimal point) is greater than 5, the number is incremented at the rounding place (possibly causing a cascade of incrementation): e.g. when rounding to units, 0.9 rounds to 1, and -19.9 rounds to -20. If D < 5, the number is similarly truncated at the rounding place: e.g. when rounding to units, 0.4 rounds to 0, and -19.4 rounds to -19. However the results of other styles of rounding differ if the digit immediately to the right of the rounding place (skipping the decimal point) is 5 and if there are no digits, or no digits other than 0, after that 5. In such cases: 'even' rounds the digit at the rounding place to 0, 2, 4, 6, or 8 if it is not already. E.g., when rounding to the first sigdig, 0.45 becomes 0.4, -0.55 becomes -0.6, but 0.4501 becomes 0.5. 'odd' rounds the digit at the rounding place to 1, 3, 5, 7, or 9 if it is not already. E.g., when rounding to the first sigdig, 0.45 becomes 0.5, -0.55 becomes -0.5, but 0.5501 becomes 0.6. '+inf' round to plus infinity, i.e. always round up. E.g., when rounding to the first sigdig, 0.45 becomes 0.5, -0.55 becomes -0.5, and 0.4501 also becomes 0.5. '-inf' round to minus infinity, i.e. always round down. E.g., when rounding to the first sigdig, 0.45 becomes 0.4, -0.55 becomes -0.6, but 0.4501 becomes 0.5. 'zero' round to zero, i.e. positive numbers down, negative ones up. E.g., when rounding to the first sigdig, 0.45 becomes 0.4, -0.55 becomes -0.5, but 0.4501 becomes 0.5. 'common' round up if the digit immediately to the right of the rounding place is 5 or greater, otherwise round down. E.g., 0.15 becomes 0.2 and 0.149 becomes 0.1. The handling of A & P in MBI/MBF (the old core code shipped with Perl versions <= 5.7.2) is like this: Precision * ffround($p) is able to round to $p number of digits after the decimal point * otherwise P is unused Accuracy (significant digits) * fround($a) rounds to $a significant digits * only fdiv() and fsqrt() take A as (optional) parameter + other operations simply create the same number (fneg etc), or more (fmul) of digits + rounding/truncating is only done when explicitly calling one of fround or ffround, and never for BigInt (not implemented) * fsqrt() simply hands its accuracy argument over to fdiv. * the documentation and the comment in the code indicate two different ways on how fdiv() determines the maximum number of digits it should calculate, and the actual code does yet another thing POD: max($Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat8b7c:f320:99b9:690f:4595:cd17:293a:c069iv_scale,length(dividend)+length(divisor)) Comment: result has at most max(scale, length(dividend), length(divisor)) digits Actual code: scale = max(scale, length(dividend)-1,length(divisor)-1); scale += length(divisor) - length(dividend); So for lx = 3, ly = 9, scale = 10, scale will actually be 16 (10 So for lx = 3, ly = 9, scale = 10, scale will actually be 16 (10+9-3). Actually, the 'difference' added to the scale is cal- culated from the number of "significant digits" in dividend and divisor, which is derived by looking at the length of the man- tissa. Which is wrong, since it includes the + sign (oops) and actually gets 2 for '+100' and 4 for '+101'. Oops again. Thus 124/3 with div_scale=1 will get you '41.3' based on the strange assumption that 124 has 3 significant digits, while 120/7 will get you '17', not '17.1' since 120 is thought to have 2 signif- icant digits. The rounding after the division then uses the remainder and $y to determine whether it must round up or down. ? I have no idea which is the right way. That's why I used a slightly more ? simple scheme and tweaked the few failing testcases to match it. This is how it works now: Setting/Accessing * You can set the A global via Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->accuracy() or Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->accuracy() or whatever class you are using. * You can also set P globally by using Math8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeClass->precision() likewise. * Globals are classwide, and not inherited by subclasses. * to undefine A, use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeCLass->accuracy(undef); * to undefine P, use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeClass->precision(undef); * Setting Math8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeClass->accuracy() clears automatically Math8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeClass->precision(), and vice versa. * To be valid, A must be > 0, P can have any value. * If P is negative, this means round to the P'th place to the right of the decimal point; positive values mean to the left of the decimal point. P of 0 means round to integer. * to find out the current global A, use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeClass->accuracy() * to find out the current global P, use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeClass->precision() * use $x->accuracy() respective $x->precision() for the local setting of $x. * Please note that $x->accuracy() respective $x->precision() return eventually defined global A or P, when $x's A or P is not set. Creating numbers * When you create a number, you can give the desired A or P via: $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new($number,$A,$P); * Only one of A or P can be defined, otherwise the result is NaN * If no A or P is give ($x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new($number) form), then the globals (if set) will be used. Thus changing the global defaults later on will not change the A or P of previously created numbers (i.e., A and P of $x will be what was in effect when $x was created) * If given undef for A and P, NO rounding will occur, and the globals will NOT be used. This is used by subclasses to create numbers without suffering rounding in the parent. Thus a subclass is able to have its own globals enforced upon creation of a number by using $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new($number,undef,undef): use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeSubclass; use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt; Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->accuracy(2); Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeSubClass->accuracy(3); $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeSubClass->new(1234); $x is now 1230, and not 1200. A subclass might choose to implement this otherwise, e.g. falling back to the parent's A and P. Usage * If A or P are enabled/defined, they are used to round the result of each operation according to the rules below * Negative P is ignored in Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt, since BigInts never have digits after the decimal point * Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat uses Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt internally, but setting A or P inside Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt as globals does not tamper with the parts of a BigFloat. A flag is used to mark all Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat numbers as 'never round'. Precedence * It only makes sense that a number has only one of A or P at a time. If you set either A or P on one object, or globally, the other one will be automatically cleared. * If two objects are involved in an operation, and one of them has A in effect, and the other P, this results in an error (NaN). * A takes precedence over P (Hint: A comes before P). If neither of them is defined, nothing is used, i.e. the result will have as many digits as it can (with an exception for fdiv/fsqrt) and will not be rounded. * There is another setting for fdiv() (and thus for fsqrt()). If neither of A or P is defined, fdiv() will use a fallback (F) of $div_scale digits. If either the dividend's or the divisor's mantissa has more digits than the value of F, the higher value will be used instead of F. This is to limit the digits (A) of the result (just consider what would happen with unlimited A and P in the case of 1/3 :-) * fdiv will calculate (at least) 4 more digits than required (determined by A, P or F), and, if F is not used, round the result (this will still fail in the case of a result like 0.12345000000001 with A or P of 5, but this can not be helped - or can it?) * Thus you can have the math done by on Math8b7c:f320:99b9:690f:4595:cd17:293a:c069ig* class in two modi: + never round (this is the default): This is done by setting A and P to undef. No math operation will round the result, with fdiv() and fsqrt() as exceptions to guard against overflows. You must explicitly call bround(), bfround() or round() (the latter with parameters). Note: Once you have rounded a number, the settings will 'stick' on it and 'infect' all other numbers engaged in math operations with it, since local settings have the highest precedence. So, to get SaferRound[tm], use a copy() before rounding like this: $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->new(12.34); $y = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->new(98.76); $z = $x * $y; # 1218.6984 print $x->copy()->fround(3); # 12.3 (but A is now 3!) $z = $x * $y; # still 1218.6984, without # copy would have been 1210! + round after each op: After each single operation (except for testing like is_zero()), the method round() is called and the result is rounded appropriately. By setting proper values for A and P, you can have all-the-same-A or all-the-same-P modes. For example, Math8b7c:f320:99b9:690f:4595:cd17:293a:c069urrency might set A to undef, and P to -2, globally. ?Maybe an extra option that forbids local A & P settings would be in order, ?so that intermediate rounding does not 'poison' further math? Overriding globals * you will be able to give A, P and R as an argument to all the calculation routines; the second parameter is A, the third one is P, and the fourth is R (shift right by one for binary operations like badd). P is used only if the first parameter (A) is undefined. These three parameters override the globals in the order detailed as follows, i.e. the first defined value wins: (local: per object, global: global default, parameter: argument to sub) + parameter A + parameter P + local A (if defined on both of the operands: smaller one is taken) + local P (if defined on both of the operands: bigger one is taken) + global A + global P + global F * fsqrt() will hand its arguments to fdiv(), as it used to, only now for two arguments (A and P) instead of one Local settings * You can set A or P locally by using $x->accuracy() or $x->precision() and thus force different A and P for different objects/numbers. * Setting A or P this way immediately rounds $x to the new value. * $x->accuracy() clears $x->precision(), and vice versa. Rounding * the rounding routines will use the respective global or local settings. fround()/bround() is for accuracy rounding, while ffround()/bfround() is for precision * the two rounding functions take as the second parameter one of the following rounding modes (R): 'even', 'odd', '+inf', '-inf', 'zero', 'trunc', 'common' * you can set/get the global R by using Math8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeClass->round_mode() or by setting $Math8b7c:f320:99b9:690f:4595:cd17:293a:c069SomeClass8b7c:f320:99b9:690f:4595:cd17:293a:c069round_mode * after each operation, $result->round() is called, and the result may eventually be rounded (that is, if A or P were set either locally, globally or as parameter to the operation) * to manually round a number, call $x->round($A,$P,$round_mode); this will round the number by using the appropriate rounding function and then normalize it. * rounding modifies the local settings of the number: $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->new(123.456); $x->accuracy(5); $x->bround(4); Here 4 takes precedence over 5, so 123.5 is the result and $x->accuracy() will be 4 from now on. Default values * R: 'even' * F: 40 * A: undef * P: undef Remarks * The defaults are set up so that the new code gives the same results as the old code (except in a few cases on fdiv): + Both A and P are undefined and thus will not be used for rounding after each operation. + round() is thus a no-op, unless given extra parameters A and P Infinity and Not a Number While BigInt has extensive handling of inf and NaN, certain quirks remain. oct()/hex() These perl routines currently (as of Perl v.5.8.6) cannot handle passed inf. te@linux:~> perl -wle 'print 2 ** 3333' inf te@linux:~> perl -wle 'print 2 ** 3333 == 2 ** 3333' 1 te@linux:~> perl -wle 'print oct(2 ** 3333)' 0 te@linux:~> perl -wle 'print hex(2 ** 3333)' Illegal hexadecimal digit 'i' ignored at -e line 1. 0 The same problems occur if you pass them Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->binf() objects. Since overloading these routines is not possible, this cannot be fixed from BigInt. ==, !=, <, >, <=, >= with NaNs BigInt's bcmp() routine currently returns undef to signal that a NaN was involved in a comparison. However, the overload code turns that into either 1 or '' and thus operations like NaN != NaN might return wrong values. log(-inf) log(-inf) is highly weird. Since log(-x)=pi*i+log(x), then log(-inf)=pi*i+inf. However, since the imaginary part is finite, the real infinity "overshadows" it, so the number might as well just be infinity. However, the result is a complex number, and since BigInt/BigFloat can only have real numbers as results, the result is NaN. exp(), cos(), sin(), atan2() These all might have problems handling infinity right. INTERNALS The actual numbers are stored as unsigned big integers (with separate sign). You should neither care about nor depend on the internal representation; it might change without notice. Use ONLY method calls like $x->sign(); instead relying on the internal representation. MATH LIBRARY Math with the numbers is done (by default) by a module called Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069lc . This is equivalent to saying: use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt try => 'Calc'; You can change this backend library by using: use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt try => 'GMP'; Note: General purpose packages should not be explicit about the library to use; let the script author decide which is best. If your script works with huge numbers and Calc is too slow for them, you can also for the loading of one of these libraries and if none of them can be used, the code will die: use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt only => 'GMP,Pari'; The following would first try to find Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069oo, then Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069r, and when this also fails, revert to Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069lc: use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt try => 'Foo,Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069r'; The library that is loaded last will be used. Note that this can be overwritten at any time by loading a different library, and numbers constructed with different libraries cannot be used in math operations together. What library to use? Note: General purpose packages should not be explicit about the library to use; let the script author decide which is best. Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069GMP and Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt8b7c:f320:99b9:690f:4595:cd17:293a:c069Pari are in cases involving big numbers much faster than Calc, however it is slower when dealing with very small numbers (less than about 20 digits) and when converting very large numbers to decimal (for instance for printing, rounding, calculating their length in decimal etc). So please select carefully what library you want to use. Different low-level libraries use different formats to store the numbers. However, you should NOT depend on the number having a specific format internally. See the respective math library module documentation for further details. SIGN The sign is either '+', '-', 'NaN', '+inf' or '-inf'. A sign of 'NaN' is used to represent the result when input arguments are not numbers or as a result of 0/0. '+inf' and '-inf' represent plus respectively minus infinity. You will get '+inf' when dividing a positive number by 0, and '-inf' when dividing any negative number by 0. mantissa(), exponent() and parts() mantissa() and exponent() return the said parts of the BigInt such that: $m = $x->mantissa(); $e = $x->exponent(); $y = $m * ( 10 ** $e ); print "ok\n" if $x == $y; ($m,$e) = $x->parts() is just a shortcut that gives you both of them in one go. Both the returned mantissa and exponent have a sign. Currently, for BigInts $e is always 0, except +inf and -inf, where it is +inf ; and for NaN, where it is NaN ; and for $x == 0 , where it is 1 (to be compatible with Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat's internal representation of a zero as 0E1 ). $m is currently just a copy of the original number. The relation between $e and $m will stay always the same, though their real values might change. EXAMPLES use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt; sub bigint { Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(shift); } $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bstr("1234") # string "1234" $x = "$x"; # same as bstr() $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bneg("1234"); # BigInt "-1234" $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->babs("-12345"); # BigInt "12345" $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->bnorm("-0.00"); # BigInt "0" $x = bigint(1) + bigint(2); # BigInt "3" $x = bigint(1) + "2"; # ditto (auto-BigIntify of "2") $x = bigint(1); # BigInt "1" $x = $x + 5 / 2; # BigInt "3" $x = $x ** 3; # BigInt "27" $x *= 2; # BigInt "54" $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new(0); # BigInt "0" $x--; # BigInt "-1" $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->badd(4,5) # BigInt "9" print $x->bsstr(); # 9e+0 Examples for rounding: use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat; use Test8b7c:f320:99b9:690f:4595:cd17:293a:c069More; $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->new(123.4567); $y = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->new(123.456789); Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->accuracy(4); # no more A than 4 is ($x->copy()->fround(),123.4); # even rounding print $x->copy()->fround(),"\n"; # 123.4 Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->round_mode('odd'); # round to odd print $x->copy()->fround(),"\n"; # 123.5 Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->accuracy(5); # no more A than 5 Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->round_mode('odd'); # round to odd print $x->copy()->fround(),"\n"; # 123.46 $y = $x->copy()->fround(4),"\n"; # A = 4: 123.4 print "$y, ",$y->accuracy(),"\n"; # 123.4, 4 Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->accuracy(undef); # A not important now Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat->precision(2); # P important print $x->copy()->bnorm(),"\n"; # 123.46 print $x->copy()->fround(),"\n"; # 123.46 Examples for converting: my $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new('0b1'.'01' x 123); print "bin: ",$x->as_bin()," hex:",$x->as_hex()," dec: ",$x,"\n"; Autocreating constants After use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt ':constant' all the integer decimal, hexadecimal and binary constants in the given scope are converted to Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt . This conversion happens at compile time. In particular, perl -MMath8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt=:constant -e 'print 2**100,"\n"' prints the integer value of 2**100 . Note that without conversion of constants the expression 2**100 will be calculated as perl scalar. Please note that strings and floating point constants are not affected, so that use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt qw/:constant/; $x = 1234567890123456789012345678901234567890 + 123456789123456789; $y = '1234567890123456789012345678901234567890' + '123456789123456789'; do not work. You need an explicit Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new() around one of the operands. You should also quote large constants to protect loss of precision: use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt; $x = Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt->new('1234567889123456789123456789123456789'); Without the quotes Perl would convert the large number to a floating point constant at compile time and then hand the result to BigInt, which results in an truncated result or a NaN. This also applies to integers that look like floating point constants: use Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt ':constant'; print ref(123e2),"\n"; print ref(123.2e2),"\n"; will print nothing but newlines. Use either bignum or Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igFloat to get this to work. PERFORMANCE Using the form $x += $y; etc over $x = $x + $y is faster, since a copy of $x must be made in the second case. For long numbers, the copy can eat up to 20% of the work (in the case of addition/subtraction, less for multiplication/division). If $y is very small compared to $x, the form $x += $y is MUCH faster than $x = $x + $y since making the copy of $x takes more time then the actual addition. With a technique called copy-on-write, the cost of copying with overload could be minimized or even completely avoided. A test implementation of COW did show performance gains for overloaded math, but introduced a performance loss due to a constant overhead for all other operations. So Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt does currently not COW. The rewritten version of this module (vs. v0.01) is slower on certain operations, like new() , bstr() and numify() . The reason are that it does now more work and handles much more cases. The time spent in these operations is usually gained in the other math operations so that code on the average should get (much) faster. If they don't, please contact the author. Some operations may be slower for small numbers, but are significantly faster for big numbers. Other operations are now constant (O(1), like bneg() , babs() etc), instead of O(N) and thus nearly always take much less time. These optimizations were done on purpose. If you find the Calc module to slow, try to install any of the replacement modules and see if they help you. Alternative math libraries You can use an alternative library to drive Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt. See the section MATH LIBRARY for more information. For more benchmark results see http://bloodgate.com/perl/benchmarks.html. SUBCLASSING Subclassing Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt The basic design of Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt allows simple subclasses with very little work, as long as a few simple rules are followed: The public API must remain consistent, i.e. if a sub-class is overloading addition, the sub-class must use the same name, in this case badd(). The reason for this is that Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt is optimized to call the object methods directly. The private object hash keys like $x->{sign} may not be changed, but additional keys can be added, like $x->{_custom} . Accessor functions are available for all existing object hash keys and should be used instead of directly accessing the internal hash keys. The reason for this is that Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt itself has a pluggable interface which permits it to support different storage methods. More complex sub-classes may have to replicate more of the logic internal of Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt if they need to change more basic behaviors. A subclass that needs to merely change the output only needs to overload bstr() . All other object methods and overloaded functions can be directly inherited from the parent class. At the very minimum, any subclass will need to provide its own new() and can store additional hash keys in the object. There are also some package globals that must be defined, e.g.: # Globals $accuracy = undef; $precision = -2; # round to 2 decimal places $round_mode = 'even'; $div_scale = 40; Additionally, you might want to provide the following two globals to allow auto-upgrading and auto-downgrading to work correctly: $upgrade = undef; $downgrade = undef; This allows Math8b7c:f320:99b9:690f:4595:cd17:293a:c069igInt to correctly retrieve package globals from the subclass, like $SubClass8b7c:f320:99b9:690f:4595:cd17:293a:c069precision . See t/Math/BigInt/Subclass.pm or t/Math/BigFloat/SubClass.pm completely functional subclass examples. Don't forget to use overload; in your
|
SetPropertyCommand Class (qdesigner_internal8b7c:f320:99b9:690f:4595:cd17:293a:c069SetPropertyCommand)
Inherits:
qdesigner_internal8b7c:f320:99b9:690f:4595:cd17:293a:c069PropertyListCommand
List of all members, including inherited members
|
lchgrp (PHP 5 >= 5.1.3, PHP 7, PHP 8)
lchgrp — Changes group ownership of symlink Description lchgrp(string $filename, string|int $group): bool Attempts to change the group of the symlink filename to group. Only the superuser may change the group of a symlink arbitrarily; other users may change the group of a symlink to any group of which that user is a member. Parameters
filename
Path to the symlink. group
The group specified by name or number. Return Values Returns true on success or false on failure. Examples
Example #1 Changing the group of a symbolic link <?php
$target = 'output.php';
$link = 'output.html';
symlink($target, $link);
lchgrp($link, 8);
?> Notes Note: This function will not work on remote files as the file to be examined must be accessible via the server's filesystem. Note: This function is not implemented on Windows platforms. See Also
chgrp() - Changes file group lchown() - Changes user ownership of symlink chown() - Changes file owner chmod() - Changes file mode
|
Namespace Cake\Form Class summary Form
Form abstraction used to create forms not tied to ORM backed models, or to other permanent datastores. Ideal for implementing forms on top of API services, or contact forms. Schema Contains the schema information for Form instances.
|
I18nSelectPipe pipe npm Package @angular/common Module import { I18nSelectPipe } from '@angular/common'; Source common/src/pipes/i18n_select_pipe.ts NgModule CommonModule Generic selector that displays the string that matches the current value. How To Use expression | i18nSelect:mapping Description Where mapping is an object that indicates the text that should be displayed for different values of the provided expression. If none of the keys of the mapping match the value of the expression, then the content of the other key is returned when present, otherwise an empty string is returned. Example @Component(
{selector: 'i18n-select-pipe', template: `<div>{{gender | i18nSelect: inviteMap}} </div>`})
export class I18nSelectPipeComponent {
gender: string = 'male';
inviteMap: any = {'male': 'Invite him.', 'female': 'Invite her.', 'other': 'Invite them.'};
}
|
pandas.core.window.Rolling.max
Rolling.max(*args, **kwargs) [source]
rolling maximum
Parameters:
how : string, default ‘max’ (DEPRECATED) Method for down- or re-sampling
Returns:
same type as input See also pandas.Series.rolling, pandas.DataFrame.rolling
|
matplotlib.animation.AVConvBase
class matplotlib.animation.AVConvBase
Mixin class for avconv output. To be useful this must be multiply-inherited from with a MovieWriterBase sub-class.
__init__($self, /, *args, **kwargs)
Initialize self. See help(type(self)) for accurate signature.
args_key = 'animation.avconv_args'
exec_key = 'animation.avconv_path'
|
class BatchQueue Defines a batch queue. Stale items from failed batches are cleaned from the {queue} table on cron using the 'created' date. Hierarchy
class \SystemQueue implements DrupalReliableQueueInterface
class \BatchQueue
Expanded class hierarchy of BatchQueue File
includes/batch.queue.inc, line 19 Queue handlers used by the Batch API. Members
Name Modifiers Type Description BatchQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069claimItem public function Overrides SystemQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069claimItem(). Overrides SystemQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069claimItem BatchQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069getAllItems public function Retrieves all remaining items in the queue. SystemQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069$name protected property The name of the queue this instance is working with. SystemQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069createItem public function Add a queue item and store it directly to the queue. Overrides DrupalQueueInter8b7c:f320:99b9:690f:4595:cd17:293a:c069createItem SystemQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069createQueue public function Create a queue. Overrides DrupalQueueInter8b7c:f320:99b9:690f:4595:cd17:293a:c069createQueue SystemQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069deleteItem public function Delete a finished item from the queue. Overrides DrupalQueueInter8b7c:f320:99b9:690f:4595:cd17:293a:c069deleteItem SystemQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069deleteQueue public function Delete a queue and every item in the queue. Overrides DrupalQueueInter8b7c:f320:99b9:690f:4595:cd17:293a:c069deleteQueue SystemQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069numberOfItems public function Retrieve the number of items in the queue. Overrides DrupalQueueInter8b7c:f320:99b9:690f:4595:cd17:293a:c069numberOfItems SystemQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069releaseItem public function Release an item that the worker could not process, so another worker can come in and process it before the timeout expires. Overrides DrupalQueueInter8b7c:f320:99b9:690f:4595:cd17:293a:c069releaseItem SystemQueu8b7c:f320:99b9:690f:4595:cd17:293a:c069__construct public function
|
Alerts In addition to defining alert handler in TICKscript Kapacitor supports an alert system that follows a publish subscribe design pattern. Alerts are published to a topic and handlers subscribe to a topic. Topics An alert topic is simply a namespace where alerts are grouped. When an alert event fires it is assigned to a topic. Multiple handlers can be defined on a topic and all handlers process each alert event for the topic. Handlers A handler takes action on incoming alert events for a specific topic. Each handler operates on exactly one topic. A handler definition has a few properties: ID - The unique ID of the handler. Kind - The kind of handler, see handlers for a list of available kinds. Match - A lambda expression to filter matching alerts. By default all alerts match, see matching for details on the match expression. Options - A map of values, differs by kind. Example See the Using Alert Topics example for a walk through defining and using alert topics.
|
Class FunctionWrappers.AsJavaBiFunction
Source code
case class AsJavaBiFunction[T, U, R](sf: (T, U) => R) extends BiFunction[T, U, R]
Supertypes
trait Serializable
trait Product
trait Equals
trait BiFunction[T, U, R]
class Object
trait Matchable
class Any
Concrete methods
Source
def apply(x1: T, x2: U): R
Inherited methods
def andThen[V <: <FromJavaObject>](x$0: Function[_ >: R <: <FromJavaObject>, _ <: V]): BiFunction[T, U, V]
Inherited from
BiFunction
Source
def productElementNames: Iterator[String]
An iterator over the names of all the elements of this product.
Inherited from
Product
Source
def productIterator: Iterator[Any]
An iterator over all the elements of this product.
Returns
in the default implementation, an Iterator[Any]
Inherited from
Product
|
plot.dataframe Plot Method for Data Frames Description plot.data.frame, a method for the plot generic. It is designed for a quick look at numeric data frames. Usage
## S3 method for class 'data.frame'
plot(x, ...)
Arguments
x object of class data.frame.
... further arguments to stripchart, plot.default or pairs.
Details This is intended for data frames with numeric columns. For more than two columns it first calls data.matrix to convert the data frame to a numeric matrix and then calls pairs to produce a scatterplot matrix. This can fail and may well be inappropriate: for example numerical conversion of dates will lose their special meaning and a warning will be given. For a two-column data frame it plots the second column against the first by the most appropriate method for the first column. For a single numeric column it uses stripchart, and for other single-column data frames tries to find a plot method for the single column. See Also data.frame Examples
plot(OrchardSprays[1], method = "jitter")
plot(OrchardSprays[c(4,1)])
plot(OrchardSprays)
plot(iris)
plot(iris[5:4])
plot(women)
Copyright (
|
protected property Token8b7c:f320:99b9:690f:4595:cd17:293a:c069$languageManager The language manager. Type: \Drupal\Core\Language\LanguageManagerInterface File
core/lib/Drupal/Core/Utility/Token.php, line 79 Class
Token Drupal placeholder/token replacement system. Namespace Drupal\Core\Utility Code protected $languageManager;
|
private property PoStreamReader8b7c:f320:99b9:690f:4595:cd17:293a:c069$_last_item Object wrapper for the last read source/translation pair. Type: \Drupal\Component\Gettext\PoItem File
core/lib/Drupal/Component/Gettext/PoStreamReader.php, line 84 Class
PoStreamReader Implements Gettext PO stream reader. Namespace Drupal\Component\Gettext Code private $_last_item;
|
class OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069PKey8b7c:f320:99b9:690f:4595:cd17:293a:c069PKey
Parent:
Object
An abstract class that bundles signature creation (PKey#sign) and validation (PKey#verify) that is common to all implementations except OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069PKey8b7c:f320:99b9:690f:4595:cd17:293a:c069H
OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069PKey8b7c:f320:99b9:690f:4595:cd17:293a:c069RSA
OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069PKey8b7c:f320:99b9:690f:4595:cd17:293a:c069SA
OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069PKey8b7c:f320:99b9:690f:4595:cd17:293a:c069
Public Class Methods new → self Show source
static VALUE
ossl_pkey_initialize(VALUE self)
{
if (rb_obj_is_instance_of(self, cPKey)) {
ossl_raise(rb_eTypeError, "OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069PKey8b7c:f320:99b9:690f:4595:cd17:293a:c069PKey can't be instantiated directly");
}
return self;
} Because PKey is an abstract class, actually calling this method explicitly will raise a NotImplementedError. Public Instance Methods inspect → string Show source
static VALUE
ossl_pkey_inspect(VALUE self)
{
EVP_PKEY *pkey;
int nid;
GetPKey(self, pkey);
nid = EVP_PKEY_id(pkey);
return rb_sprintf("#<%"PRIsVALUE":%p oid=%s>",
rb_class_name(CLASS_OF(self)), (void *)self,
OBJ_nid2sn(nid));
} Returns a string describing the PKey object. oid → string Show source
static VALUE
ossl_pkey_oid(VALUE self)
{
EVP_PKEY *pkey;
int nid;
GetPKey(self, pkey);
nid = EVP_PKEY_id(pkey);
return rb_str_new_cstr(OBJ_nid2sn(nid));
} Returns the short name of the OID associated with pkey. private_to_der → string Show source private_to_der(cipher, password) → string
static VALUE
ossl_pkey_private_to_der(int argc, VALUE *argv, VALUE self)
{
return do_pkcs8_export(argc, argv, self, 1);
} Serializes the private key to DER-encoded PKCS #8 format. If called without arguments, unencrypted PKCS #8 PrivateKeyInfo format is used. If called with a cipher name and a password, PKCS #8 EncryptedPrivateKeyInfo format with PBES2 encryption scheme is used. private_to_pem → string Show source private_to_pem(cipher, password) → string
static VALUE
ossl_pkey_private_to_pem(int argc, VALUE *argv, VALUE self)
{
return do_pkcs8_export(argc, argv, self, 0);
} Serializes the private key to PEM-encoded PKCS #8 format. See private_to_der for more details. public_to_der → string Show source
static VALUE
ossl_pkey_public_to_der(VALUE self)
{
return do_spki_export(self, 1);
} Serializes the public key to DER-encoded X.509 SubjectPublicKeyInfo format. public_to_pem → string Show source
static VALUE
ossl_pkey_public_to_pem(VALUE self)
{
return do_spki_export(self, 0);
} Serializes the public key to PEM-encoded X.509 SubjectPublicKeyInfo format. sign(digest, data) → String Show source
static VALUE
ossl_pkey_sign(VALUE self, VALUE digest, VALUE data)
{
EVP_PKEY *pkey;
const EVP_MD *md;
EVP_MD_CTX *ctx;
unsigned int buf_len;
VALUE str;
int result;
pkey = GetPrivPKeyPtr(self);
md = ossl_evp_get_digestbyname(digest);
StringValue(data);
str = rb_str_new(0, EVP_PKEY_size(pkey));
ctx = EVP_MD_CTX_new();
if (!ctx)
ossl_raise(ePKeyError, "EVP_MD_CTX_new");
if (!EVP_SignInit_ex(ctx, md, NULL)) {
EVP_MD_CTX_free(ctx);
ossl_raise(ePKeyError, "EVP_SignInit_ex");
}
if (!EVP_SignUpdate(ctx, RSTRING_PTR(data), RSTRING_LEN(data))) {
EVP_MD_CTX_free(ctx);
ossl_raise(ePKeyError, "EVP_SignUpdate");
}
result = EVP_SignFinal(ctx, (unsigned char *)RSTRING_PTR(str), &buf_len, pkey);
EVP_MD_CTX_free(ctx);
if (!result)
ossl_raise(ePKeyError, "EVP_SignFinal");
rb_str_set_len(str, buf_len);
return str;
} To sign the String data, digest, an instance of OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069igest, must be provided. The return value is again a String containing the signature. A PKeyError is raised should errors occur. Any previous state of the Digest instance is irrelevant to the signature outcome, the digest instance is reset to its initial state during the operation. Example data = 'Sign me!'
digest = OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069igest.new('SHA256')
pkey = OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069PKey8b7c:f320:99b9:690f:4595:cd17:293a:c069RSA.new(2048)
signature = pkey.sign(digest, data)
verify(digest, signature, data) → String Show source
static VALUE
ossl_pkey_verify(VALUE self, VALUE digest, VALUE sig, VALUE data)
{
EVP_PKEY *pkey;
const EVP_MD *md;
EVP_MD_CTX *ctx;
int siglen, result;
GetPKey(self, pkey);
ossl_pkey_check_public_key(pkey);
md = ossl_evp_get_digestbyname(digest);
StringValue(sig);
siglen = RSTRING_LENINT(sig);
StringValue(data);
ctx = EVP_MD_CTX_new();
if (!ctx)
ossl_raise(ePKeyError, "EVP_MD_CTX_new");
if (!EVP_VerifyInit_ex(ctx, md, NULL)) {
EVP_MD_CTX_free(ctx);
ossl_raise(ePKeyError, "EVP_VerifyInit_ex");
}
if (!EVP_VerifyUpdate(ctx, RSTRING_PTR(data), RSTRING_LEN(data))) {
EVP_MD_CTX_free(ctx);
ossl_raise(ePKeyError, "EVP_VerifyUpdate");
}
result = EVP_VerifyFinal(ctx, (unsigned char *)RSTRING_PTR(sig), siglen, pkey);
EVP_MD_CTX_free(ctx);
switch (result) {
case 0:
ossl_clear_error();
return Qfalse;
case 1:
return Qtrue;
default:
ossl_raise(ePKeyError, "EVP_VerifyFinal");
}
} To verify the String signature, digest, an instance of OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069igest, must be provided to re-compute the message digest of the original data, also a String. The return value is true if the signature is valid, false otherwise. A PKeyError is raised should errors occur. Any previous state of the Digest instance is irrelevant to the validation outcome, the digest instance is reset to its initial state during the operation. Example data = 'Sign me!'
digest = OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069igest.new('SHA256')
pkey = OpenSSL8b7c:f320:99b9:690f:4595:cd17:293a:c069PKey8b7c:f320:99b9:690f:4595:cd17:293a:c069RSA.new(2048)
signature = pkey.sign(digest, data)
pub_key = pkey.public_key
puts pub_key.verify(digest, signature, data) # => true
Ruby Core © 1993–2020 Yukihiro MatsumotoLicensed under the Ruby License.Ruby Standard Library
|
tf.raw_ops.TensorListSplit Splits a tensor into a list. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListSplit
tf.raw_ops.TensorListSplit(
tensor, element_shape, lengths, name=None
)
list[i] corresponds to lengths[i] tensors from the input tensor. The tensor must have rank at least 1 and contain exactly sum(lengths) elements. tensor: The input tensor. element_shape: A shape compatible with that of elements in the tensor. lengths: Vector of sizes of the 0th dimension of tensors in the list. output_handle: The list.
Args
tensor A Tensor.
element_shape A Tensor. Must be one of the following types: int32, int64.
lengths A Tensor of type int64.
name A name for the operation (optional).
Returns A Tensor of type variant.
|
FileStorage class FileStorage extends Storage FileStorage represents a template stored on the filesystem. Methods __construct(string $template) Constructor. from Storage string __toString() Returns the object string representation. from Storage string getContent() Returns the content of the template.
Details
__construct(string $template)
Constructor. Parameters string $template The template name string
__toString()
Returns the object string representation. Return Value string The template name string
getContent()
Returns the content of the template. Return Value string The template content
|
cp_mgmt_group_with_exclusion – Manages group-with-exclusion objects on Check Point over Web Services API New in version 2.9. Synopsis Parameters Examples Return Values Status Synopsis Manages group-with-exclusion objects on Check Point devices including creating, updating and removing objects. All operations are performed over Web Services API. Parameters Parameter Choices/Defaults Comments auto_publish_session boolean
Choices: no yes Publish the current session if changes have been performed after task completes. color string
Choices: aquamarine black blue crete blue burlywood cyan dark green khaki orchid dark orange dark sea green pink turquoise dark blue firebrick brown forest green gold dark gold gray dark gray light green lemon chiffon coral sea green sky blue magenta purple slate blue violet red navy blue olive orange red sienna yellow Color of the object. Should be one of existing colors. comments string Comments string. details_level string
Choices: uid standard full The level of detail for some of the fields in the response can vary from showing only the UID value of the object to a fully detailed representation of the object. except string Name or UID of an object which the group excludes. groups list Collection of group identifiers. ignore_errors boolean
Choices: no yes Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. ignore_warnings boolean
Choices: no yes Apply changes ignoring warnings. include string Name or UID of an object which the group includes. name string / required Object name. state string
Choices:
present ← absent State of the access rule (present or absent). Defaults to present. tags list Collection of tag identifiers. version string Version of checkpoint. If not given one, the latest version taken. wait_for_task boolean
Choices: no
yes ← Wait for the task to end. Such as publish task. Examples - name: add-group-with-exclusion
cp_mgmt_group_with_exclusion:
except: New Group 2
include: New Group 1
name: Group with exclusion
state: present
- name: set-group-with-exclusion
cp_mgmt_group_with_exclusion:
except: New Group 1
include: New Group 2
name: Group with exclusion
state: present
- name: delete-group-with-exclusion
cp_mgmt_group_with_exclusion:
name: Group with exclusion
state: absent
Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description cp_mgmt_group_with_exclusion dictionary always, except when deleting the object. The checkpoint object created or updated. Status This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors Or Soffer (@chkp-orso) Hint If you notice any issues in this documentation, you can edit this document to improve it.
© 2012–2018 Michael DeHaan
|
protected property FileCach8b7c:f320:99b9:690f:4595:cd17:293a:c069$cache The cache backend backing this FileCache object. Type: \Drupal\Component\FileCache\FileCacheBackendInterface File
core/lib/Drupal/Component/FileCache/FileCache.php, line 36 Class
FileCache Allows to cache data based on file modification dates. Namespace Drupal\Component\FileCache Code protected $cache;
|
AnimationNodeStateMachineTransition Inherits: Resource < Reference < Object Tutorials Using AnimationTree Properties
String advance_condition ""
bool auto_advance false
bool disabled false
int priority 1
SwitchMode switch_mode 0
float xfade_time 0.0 Signals advance_condition_changed ( ) Emitted when advance_condition is changed. Enumerations enum SwitchMode:
SWITCH_MODE_IMMEDIATE = 0 --- Switch to the next state immediately. The current state will end and blend into the beginning of the new one.
SWITCH_MODE_SYNC = 1 --- Switch to the next state immediately, but will seek the new state to the playback position of the old state.
SWITCH_MODE_AT_END = 2 --- Wait for the current state playback to end, then switch to the beginning of the next state animation. Property Descriptions String advance_condition
Default ""
Setter set_advance_condition(value)
Getter get_advance_condition() Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the AnimationTree that can be controlled from code (see Using AnimationTree). For example, if AnimationTree.tree_root is an AnimationNodeStateMachine and advance_condition is set to "idle": $animation_tree["parameters/conditions/idle"] = is_on_floor and (linear_velocity.x == 0)
bool auto_advance
Default false
Setter set_auto_advance(value)
Getter has_auto_advance() Turn on the transition automatically when this state is reached. This works best with SWITCH_MODE_AT_END. bool disabled
Default false
Setter set_disabled(value)
Getter is_disabled() Don't use this transition during AnimationNodeStateMachinePlayback.travel or auto_advance. int priority
Default 1
Setter set_priority(value)
Getter get_priority() Lower priority transitions are preferred when travelling through the tree via AnimationNodeStateMachinePlayback.travel or auto_advance. SwitchMode switch_mode
Default 0
Setter set_switch_mode(value)
Getter get_switch_mode() The transition type. float xfade_time
Default 0.0
Setter set_xfade_time(value)
Getter get_xfade_time() The time to cross-fade between this state and the next.
|
rax_mon_alarm - Create or delete a Rackspace Cloud Monitoring alarm. New in version 2.0.
Synopsis Requirements Parameters Notes Examples
Status Author Synopsis Create or delete a Rackspace Cloud Monitoring alarm that associates an existing rax_mon_entity, rax_mon_check, and rax_mon_notification_plan with criteria that specify what conditions will trigger which levels of notifications. Rackspace monitoring module flow | rax_mon_entity -> rax_mon_check -> rax_mon_notification -> rax_mon_notification_plan -> rax_mon_alarm
Requirements The below requirements are needed on the host that executes this module. python >= 2.6 pyrax Parameters Parameter Choices/Defaults Comments api_key Rackspace API key, overrides credentials.
aliases: password auth_endpoint (added in 1.5) Default:https://identity.api.rackspacecloud.com/v2.0/ The URI of the authentication service. check_id required ID of the check that should be alerted on. May be acquired by registering the value of a rax_mon_check task. credentials Default:None File to find the Rackspace credentials in. Ignored if api_key and username are provided.
aliases: creds_file criteria Alarm DSL that describes alerting conditions and their output states. Must be between 1 and 16384 characters long. See http://docs.rackspace.com/cm/api/v1.0/cm-devguide/content/alerts-language.html for a reference on the alerting language. disabled
Choices: yes no If yes, create this alarm, but leave it in an inactive state. Defaults to no. entity_id required ID of the entity this alarm is attached to. May be acquired by registering the value of a rax_mon_entity task. env (added in 1.5) Environment as configured in ~/.pyrax.cfg, see https://github.com/rackspace/pyrax/blob/master/docs/getting_started.md#pyrax-configuration. identity_type (added in 1.5) Default:rackspace Authentication mechanism to use, such as rackspace or keystone. label required Friendly name for this alarm, used to achieve idempotence. Must be a String between 1 and 255 characters long. metadata Arbitrary key/value pairs to accompany the alarm. Must be a hash of String keys and values between 1 and 255 characters long. notification_plan_id required ID of the notification plan to trigger if this alarm fires. May be acquired by registering the value of a rax_mon_notification_plan task. region Default:DFW Region to create an instance in. state
Choices:
present ← absent Ensure that the alarm with this label exists or does not exist. tenant_id (added in 1.5) The tenant ID used for authentication. tenant_name (added in 1.5) The tenant name used for authentication. username Rackspace username, overrides credentials. verify_ssl (added in 1.5) Whether or not to require SSL validation of API endpoints. Notes Note The following environment variables can be used, RAX_USERNAME, RAX_API_KEY, RAX_CREDS_FILE, RAX_CREDENTIALS, RAX_REGION.
RAX_CREDENTIALS and RAX_CREDS_FILE points to a credentials file appropriate for pyrax. See https://github.com/rackspace/pyrax/blob/master/docs/getting_started.md#authenticating
RAX_USERNAME and RAX_API_KEY obviate the use of a credentials file
RAX_REGION defines a Rackspace Public Cloud region (DFW, ORD, LON, ...) Examples - name: Alarm example
gather_facts: False
hosts: local
connection: local
tasks:
- name: Ensure that a specific alarm exists.
rax_mon_alarm:
credentials: ~/.rax_pub
state: present
label: uhoh
entity_id: "{{ the_entity['entity']['id'] }}"
check_id: "{{ the_check['check']['id'] }}"
notification_plan_id: "{{ defcon1['notification_plan']['id'] }}"
criteria: >
if (rate(metric['average']) > 10) {
return new AlarmStatus(WARNING);
}
return new AlarmStatus(OK);
register: the_alarm
Status This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface. Author Ash Wilson Hint If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
|
RTCPeerConnection.removeStream()
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. The RTCPeerConnection.removeStream() method removes a MediaStream as a local source of audio or video. If the negotiation already happened, a new one will be needed for the remote peer to be able to use it. Because this method has been deprecated, you should instead use removeTrack() if your target browser versions have implemented it. If the signalingState is set to "closed", an InvalidStateError is raised. If the signalingState is set to "stable", the event negotiationneeded is sent on the RTCPeerConnection.
Syntax
RTCPeerConnection.removeStream(mediaStream);
Parameters
mediaStream A MediaStream specifying the stream to remove from the connection.
Return value
undefined.
Example
var pc, videoStream;
navigator.getUserMedia({video: true}, function(stream) {
pc = new RTCPeerConnection();
videoStream = stream;
pc.addStream(stream);
}
document.getElementById("closeButton").addEventListener("click", function(event) {
pc.removeStream(videoStream);
pc.close();
}, false);
Browser compatibility
Desktop
Mobile
Chrome
Edge
Firefox
Internet Explorer
Opera
Safari
WebView Android
Chrome Android
Firefox for Android
Opera Android
Safari on IOS
Samsung Internet
removeStream
24
See bug 697059.
15
22-51
No
15
11-12
≤37
25
See bug 697059.
44
14
11-12
1.5
See also
WebRTC RTCPeerConnection.removeTrack() RTCPeerConnection.addTrack() RTCPeerConnection.addStream()
Found a problem with this page?
Edit on GitHub
Source on GitHub
Report a problem with this content on GitHub
Want to fix the problem yourself? See our Contribution guide.
Last modified: Sep 14, 2021, by MDN contributors
|
QChannelMapping Class (Qt3DAnimation8b7c:f320:99b9:690f:4595:cd17:293a:c069QChannelMapping) Allows to map the channels within the clip onto properties of objects in the application. More...
Header:
#include <QChannelMapping>
qmake:
QT += 3danimation
Inherits:
Qt3DAnimation8b7c:f320:99b9:690f:4595:cd17:293a:c069QAbstractChannelMapping
List of all members, including inherited members Public Functions
QString
channelName() const
QString
property() const
Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode *
target() const
Public Slots
void
setChannelName(const QString &channelName)
void
setProperty(const QString &property)
void
setTarget(Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode *target)
Signals
void
channelNameChanged(QString channelName)
void
propertyChanged(QString property)
void
targetChanged(Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode *target)
Detailed Description
|
public function FormBuilder8b7c:f320:99b9:690f:4595:cd17:293a:c069rebuildForm public FormBuilder8b7c:f320:99b9:690f:4595:cd17:293a:c069rebuildForm($form_id, FormStateInterface &$form_state, $old_form = NULL) Constructs a new $form from the information in $form_state. This is the key function for making multi-step forms advance from step to step. It is called by sel8b7c:f320:99b9:690f:4595:cd17:293a:c069processForm() when all user input processing, including calling validation and submission handlers, for the request is finished. If a validate or submit handler set $form_state->isRebuilding() to TRUE, and if other conditions don't preempt a rebuild from happening, then this function is called to generate a new $form, the next step in the form workflow, to be returned for rendering. Ajax form submissions are almost always multi-step workflows, so that is one common use-case during which form rebuilding occurs. Parameters string $form_id: The unique string identifying the desired form. If a function with that name exists, it is called to build the form array. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. array|null $old_form: (optional) A previously built $form. Used to retain the #build_id and #action properties in Ajax callbacks and similar partial form rebuilds. The only properties copied from $old_form are the ones which both exist in $old_form and for which $form_state->getRebuildInfo()['copy'][PROPERTY] is TRUE. If $old_form is not passed, the entire $form is rebuilt freshly. 'rebuild_info' needs to be a separate top-level property next to 'build_info', since the contained data must not be cached. Return value array The newly built form. Overrides FormBuilderInter8b7c:f320:99b9:690f:4595:cd17:293a:c069rebuildForm See also sel8b7c:f320:99b9:690f:4595:cd17:293a:c069processForm() File
core/lib/Drupal/Core/Form/FormBuilder.php, line 361 Class
FormBuilder Provides form building and processing. Namespace Drupal\Core\Form Code public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form = NULL) {
$form = $this->retrieveForm($form_id, $form_state);
// Only GET and POST are valid form methods. If the form receives its input
// via POST, then $form_state must be persisted when it is rebuilt between
// submissions. If the form receives its input via GET, then persisting
// state is forbidden by $form_state->setCached(), and the form must use
// the URL itself to transfer its state across steps. Although $form_state
// throws an exception based on the request method rather than the form's
// method, we base the decision to cache on the form method, because:
// - It's the form method that defines what the form needs to do to manage
// its state.
// - rebuildForm() should only be called after successful input processing,
// which means the request method matches the form method, and if not,
// there's some other error, so it's ok if an exception is thrown.
if ($form_state->isMethodType('POST')) {
$form_state->setCached();
}
// If only parts of the form will be returned to the browser (e.g., Ajax or
// RIA clients), or if the form already had a new build ID regenerated when
// it was retrieved from the form cache, reuse the existing #build_id.
// Otherwise, a new #build_id is generated, to not clobber the previous
// build's data in the form cache; also allowing the user to go back to an
// earlier build, make changes, and re-submit.
// @see sel8b7c:f320:99b9:690f:4595:cd17:293a:c069prepareForm()
$rebuild_info = $form_state->getRebuildInfo();
$enforce_old_build_id = isset($old_form['#build_id']) && !empty($rebuild_info['copy']['#build_id']);
$old_form_is_mutable_copy = isset($old_form['#build_id_old']);
if ($enforce_old_build_id || $old_form_is_mutable_copy) {
$form['#build_id'] = $old_form['#build_id'];
if ($old_form_is_mutable_copy) {
$form['#build_id_old'] = $old_form['#build_id_old'];
}
}
else {
if (isset($old_form['#build_id'])) {
$form['#build_id_old'] = $old_form['#build_id'];
}
$form['#build_id'] = 'form-' . Crypt8b7c:f320:99b9:690f:4595:cd17:293a:c069randomBytesBase64();
}
// #action defaults to $request->getRequestUri(), but in case of Ajax and
// other partial rebuilds, the form is submitted to an alternate URL, and
// the original #action needs to be retained.
if (isset($old_form['#action']) && !empty($rebuild_info['copy']['#action'])) {
$form['#action'] = $old_form['#action'];
}
$this->prepareForm($form_id, $form, $form_state);
// Caching is normally done in sel8b7c:f320:99b9:690f:4595:cd17:293a:c069processForm(), but what needs to be
// cached is the $form structure before it passes through
// sel8b7c:f320:99b9:690f:4595:cd17:293a:c069doBuildForm(), so we need to do it here.
// @todo For Drupal 8, find a way to avoid this code duplication.
if ($form_state->isCached()) {
$this->setCache($form['#build_id'], $form, $form_state);
}
// Clear out all group associations as these might be different when
// re-rendering the form.
$form_state->setGroups([]);
// Return a fully built form that is ready for rendering.
return $this->doBuildForm($form_id, $form, $form_state);
}
|
SpinBox Inherits: Range < Control < CanvasItem < Node < Object Numerical input text field. Description SpinBox is a numerical input text field. It allows entering integers and floats. Example: var spin_box = SpinBox.new()
add_child(spin_box)
var line_edit = spin_box.get_line_edit()
line_edit.context_menu_enabled = false
spin_box.align = LineEdit.ALIGN_RIGHT
The above code will create a SpinBox, disable context menu on it and set the text alignment to right. See Range class for more options over the SpinBox. Note: SpinBox relies on an underlying LineEdit node. To theme a SpinBox's background, add theme items for LineEdit and customize them. Properties
Align align 0
bool editable true
String prefix ""
String suffix "" Methods
void apply ( )
LineEdit get_line_edit ( ) Theme Properties
Texture updown Property Descriptions Align align
Default 0
Setter set_align(value)
Getter get_align() Sets the text alignment of the SpinBox. bool editable
Default true
Setter set_editable(value)
Getter is_editable() If true, the SpinBox will be editable. Otherwise, it will be read only. String prefix
Default ""
Setter set_prefix(value)
Getter get_prefix() Adds the specified prefix string before the numerical value of the SpinBox. String suffix
Default ""
Setter set_suffix(value)
Getter get_suffix() Adds the specified suffix string after the numerical value of the SpinBox. Method Descriptions void apply ( ) Applies the current value of this SpinBox. LineEdit get_line_edit ( ) Returns the LineEdit instance from this SpinBox. You can use it to access properties and methods of LineEdit.
|
Class WeakPasswordHasher Password hashing class that use weak hashing algorithms. This class is intended only to be used with legacy databases where passwords have not been migrated to a stronger algorithm yet. Cake\Auth\AbstractPasswordHasher uses Cake\Core\InstanceConfigTrait Cake\Auth\WeakPasswordHasher Namespace: Cake\Auth Location: Auth/WeakPasswordHasher.php Properties summary $_defaultConfig protected array Default config for this object. Inherited Properties _config, _configInitialized Method Summary __construct() public Constructor check() public Check hash. Generate hash for user provided password and check against existing hash. hash() public Generates password hash. Method Detail __construct()source public __construct( array $config [] ) Constructor Parameters array $config optional [] Array of config. Overrides Cake\Auth\AbstractPasswordHasher8b7c:f320:99b9:690f:4595:cd17:293a:c069__construct() check()source public check( string $password , string $hashedPassword ) Check hash. Generate hash for user provided password and check against existing hash. Parameters string $password Plain text password to hash. string $hashedPassword Existing hashed password. Returns booleanTrue if hashes match else false. hash()source public hash( string $password ) Generates password hash. Parameters string $password Plain text password to hash. Returns stringPassword hash Methods inherited from Cake\Auth\AbstractPasswordHasher
needsRehash()source public needsRehash( string $password ) Returns true if the password need to be rehashed, due to the password being created with anything else than the passwords generated by this class. Returns true by default since the only implementation users should rely on is the one provided by default in php 5.5+ or any compatible library Parameters string $password The password to verify Returns boolean Methods used from Cake\Core\InstanceConfigTrait
_configDelete()source protected _configDelete( string $key ) Delete a single config key Parameters string $key Key to delete. Throws Cake\Core\Exception\Exceptionif attempting to clobber existing config _configRead()source protected _configRead( string|null $key ) Read a config variable Parameters string|null $key Key to read. Returns mixed _configWrite()source protected _configWrite( string|array $key , mixed $value , boolean|string $merge false ) Write a config variable Parameters string|array $key Key to write to. mixed $value Value to write. boolean|string $merge optional false True to merge recursively, 'shallow' for simple merge, false to overwrite, defaults to false. Throws Cake\Core\Exception\Exceptionif attempting to clobber existing config config()source public config( string|array|null $key null , mixed|null $value null , boolean $merge true ) Usage Reading the whole config: $this->config(); Reading a specific value: $this->config('key'); Reading a nested value: $this->config('some.nested.key'); Setting a specific value: $this->config('key', $value); Setting a nested value: $this->config('some.nested.key', $value); Updating multiple config settings at the same time: $this->config(['one' => 'value', 'another' => 'value']); Parameters string|array|null $key optional null The key to get/set, or a complete array of configs. mixed|null $value optional null The value to set. boolean $merge optional true Whether to recursively merge or overwrite existing config, defaults to true. Returns mixedConfig value being read, or the object itself on write operations. Throws Cake\Core\Exception\ExceptionWhen trying to set a key that is invalid. configShallow()source public configShallow( string|array $key , mixed|null $value null ) Merge provided config with existing config. Unlike config() which does a recursive merge for nested keys, this method does a simple merge. Setting a specific value: $this->config('key', $value); Setting a nested value: $this->config('some.nested.key', $value); Updating multiple config settings at the same time: $this->config(['one' => 'value', 'another' => 'value']); Parameters string|array $key The key to set, or a complete array of configs. mixed|null $value optional null The value to set. Returns $this The object itself. Properties detail $_defaultConfigsource protected array Default config for this object. [
'hashType' => null
]
|
Class HttpsEnforcerMiddleware Enforces use of HTTPS (SSL) for requests. Namespace: Cake\Http\Middleware Property Summary $config protected array Configuration. Method Summary __construct() public Constructor process() public Check whether request has been made using HTTPS. Method Detail __construct() public __construct(array $config = []) Constructor Parameters array $config optional The options to use. See Also sel8b7c:f320:99b9:690f:4595:cd17:293a:c069$config process() public process(ServerRequestInterface $request, RequestHandlerInterface $handler): Psr\Http\Message\ResponseInterface Check whether request has been made using HTTPS. Depending on the configuration and request method, either redirects to same URL with https or throws an exception. Parameters ServerRequestInterface $request The request. RequestHandlerInterface $handler The request handler. Returns Psr\Http\Message\ResponseInterface Throws Cake\Http\Exception\BadRequestException Property Detail $config protected Configuration. Options
redirect - If set to true (default) redirects GET requests to same URL with https.
statusCode - Status code to use in case of redirect, defaults to 301 - Permanent redirect.
headers - Array of response headers in case of redirect.
disableOnDebug - Whether HTTPS check should be disabled when debug is on. Default true. Type array
|
dart:html fromFloat32Array method DomMatrix fromFloat32Array(
Float32List array32 ) override Implementation static DomMatrix fromFloat32Array(Float32List array32) native;
|
dart:web_gl getProgramParameter method @Creates('int|bool|Null') @Returns('int|bool|Null') Object? getProgramParameter(
Program program,
int pname ) @Creates('int|bool|Null'), @Returns('int|bool|Null') Implementation @Creates('int|bool|Null')
@Returns('int|bool|Null')
Object? getProgramParameter(Program program, int pname) native;
|
embedFonts Embed Fonts in PostScript and PDF Description Runs Ghostscript to process a PDF or PostScript file and embed all fonts in the file. Usage
embedFonts(file, format, outfile = file,
fontpaths = character(), options = character())
Arguments
file a character string giving the name of the original file.
format the format for the new file (with fonts embedded) given as the name of a ghostscript output device. If not specified, it is guessed from the suffix of file.
outfile the name of the new file (with fonts embedded).
fontpaths a character vector giving directories that Ghostscript will search for fonts.
options a character vector containing further options to Ghostscript.
Details This function is not necessary if you just use the standard default fonts for PostScript and PDF output. If you use a special font, this function is useful for embedding that font in your PostScript or PDF document so that it can be shared with others without them having to install your special font (provided the font licence allows this). If the special font is not installed for Ghostscript, you will need to tell Ghostscript where the font is, using something like options="-sFONTPATH=path/to/font". You will need ghostscript: the full path to the executable can be set by the environment variable R_GSCMD. If this is unset, a GhostScript executable will be looked for by name on your path: on a Unix alike "gs" is used, and on Windows the setting of the environment variable GSC is used, otherwise commands "gswi64c.exe" then "gswin32c.exe" are tried. The format is by default "ps2write", when the original file has a .ps or .eps suffix, or "pdfwrite" when the original file has a .pdf suffix. For versions of Ghostscript before 9.10, format = "pswrite" or format =
"epswrite" can be used: as from 9.14 format = "eps2write" is also available. If an invalid device is given, the error message will list the available devices. Note that Ghostscript may do font substitution, so the font embedded may differ from that specified in the original file. Some other options which can be useful (see your Ghostscript documentation) are -dMaxSubsetPct=100, -dSubsetFonts=true and -dEmbedAllFonts=true. Value The shell command used to invoke Ghostscript is returned invisibly. This may be useful for debugging purposes as you can run the command by hand in a shell to look for problems. See Also postscriptFonts, Devices. Paul Murrell and Brian Ripley (2006). “Non-standard fonts in PostScript and PDF graphics.” R News, 6(2), 41–47. https://www.r-project.org/doc/Rnews/Rnews_2006-2.pdf.
Copyright (
|
4.1.1 Empty Matrices A matrix may have one or both dimensions zero, and operations on empty matrices are handled as described by Carl de Boor in An Empty Exercise, SIGNUM, Volume 25, pages 2–6, 1990 and C. N. Nett and W. M. Haddad, in A System-Theoretic Appropriate Realization of the Empty Matrix Concept, IEEE Transactions on Automatic Control, Volume 38, Number 5, May 1993. Briefly, given a scalar s, an m by n matrix M(mxn), and an m by n empty matrix [](mxn) (with either one or both dimensions equal to zero), the following are true: s * [](mxn) = [](mxn) * s = [](mxn)
[](mxn) + [](mxn) = [](mxn)
[](0xm) * M(mxn) = [](0xn)
M(mxn) * [](nx0) = [](mx0)
[](mx0) * [](0xn) = 0(mxn) By default, dimensions of the empty matrix are printed along with the empty matrix symbol, ‘[]’. The built-in variable print_empty_dimensions controls this behavior.
: val = print_empty_dimensions () ¶
: old_val = print_empty_dimensions (new_val) ¶
: print_empty_dimensions (new_val, "local") ¶
Query or set the internal variable that controls whether the dimensions of empty matrices are printed along with the empty matrix symbol, ‘[]’. For example, the expression zeros (3, 0) will print ans = [](3x0) When called from inside a function with the "local" option, the variable is changed locally for the function and any subroutines it calls. The original variable value is restored when exiting the function. See also: format.
Empty matrices may also be used in assignment statements as a convenient way to delete rows or columns of matrices. See Assignment Expressions. When Octave parses a matrix expression, it examines the elements of the list to determine whether they are all constants. If they are, it replaces the list with a single matrix constant.
|
Hierarchical Dependency Injectors The Angular dependency injection system is hierarchical. There is a tree of injectors that parallel an app's component tree. You can reconfigure the injectors at any level of that component tree. This guide explores this system and how to use it to your advantage. It uses examples based on this live example. Where to configure providers You can configure providers for different injectors in the injector hierarchy. An internal platform-level injector is shared by all running apps. The AppModule injector is the root of an app-wide injector hierarchy, and within an NgModule, directive-level injectors follow the structure of the component hierarchy. The choices you make about where to configure providers lead to differences in the final bundle size, service scope, and service lifetime. When you specify providers in the @Injectable() decorator of the service itself (typically at the app root level), optimization tools such as those used by the CLI's production builds can perform tree shaking, which removes services that aren't used by your app. Tree shaking results in smaller bundle sizes. Learn more about tree-shakable providers. You're likely to inject UserService in many places throughout the app and will want to inject the same service instance every time. Providing UserService through the root injector is a good choice, and is the default that the CLI uses when you generate a service for your app. Platform injector When you use providedIn:'root', you are configuring the root injector for the app, which is the injector for AppModule. The actual root of the entire injector hierarchy is a platform injector that is the parent of app-root injectors. This allows multiple apps to share a platform configuration. For example, a browser has only one URL bar, no matter how many apps you have running. The platform injector is used internally during bootstrap, to configure platform-specific dependencies. You can configure additional platform-specific providers at the platform level by supplying extraProviders using the platformBrowser() function. Learn more about dependency resolution through the injector hierarchy: What you always wanted to know about Angular Dependency Injection tree NgModule-level providers can be specified with @NgModule() providers metadata option, or in the @Injectable() providedIn option (with some module other than the root AppModule). Use the @NgModule() provides option if a module is lazy loaded. The module's own injector is configured with the provider when that module is loaded, and Angular can inject the corresponding services in any class it creates in that module. If you use the @Injectable() option providedIn: MyLazyloadModule, the provider could be shaken out at compile time, if it is not used anywhere else in the app. Learn more about tree-shakable providers. For both root-level and module-level injectors, a service instance lives for the life of the app or module, and Angular injects this one service instance in every class that needs it. Component-level providers configure each component instance's own injector. Angular can only inject the corresponding services in that component instance or one of its descendant component instances. Angular can't inject the same service instance anywhere else. A component-provided service may have a limited lifetime. Each new instance of the component gets its own instance of the service. When the component instance is destroyed, so is that service instance. In our sample app, HeroComponent is created when the application starts and is never destroyed, so the HeroService instance created for HeroComponent lives for the life of the app. If you want to restrict HeroService access to HeroComponent and its nested HeroListComponent, provide HeroService at the component level, in HeroComponent metadata. See more examples of component-level injection below. @Injectable-level configuration The @Injectable() decorator identifies every service class. The providedIn metadata option for a service class configures a specific injector (typically root) to use the decorated class as a provider of the service. When an injectable class provides its own service to the root injector, the service is available anywhere the class is imported. The following example configures a provider for HeroService using the @Injectable() decorator on the class. src/app/heroes/heroes.service.tsimport { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class HeroService {
constructor() { }
} This configuration tells Angular that the app's root injector is responsible for creating an instance of HeroService by invoking its constructor, and for making that instance available across the application. Providing a service with the app's root injector is a typical case, and the CLI sets up this kind of a provider automatically for you when generating a new service. However, you might not always want to provide your service at the root level. You might, for instance, want users to explicitly opt-in to using the service. Instead of specifying the root injector, you can set providedIn to a specific NgModule. For example, in the following excerpt, the @Injectable() decorator configures a provider that is available in any injector that includes the HeroModule. src/app/heroes/hero.service.tsimport { Injectable } from '@angular/core';
import { HeroModule } from './hero.module';
import { HEROES } from './mock-heroes';
@Injectable({
// we declare that this service should be created
// by any injector that includes HeroModule.
providedIn: HeroModule,
})
export class HeroService {
getHeroes() { return HEROES; }
} This is generally no different from configuring the injector of the NgModule itself, except that the service is tree-shakable if the NgModule doesn't use it. It can be useful for a library that offers a particular service that some components might want to inject optionally, and leave it up to the app whether to provide the service. Learn more about tree-shakable providers. @NgModule-level injectors You can configure a provider at the module level using the providedIn metadata option for a non-root NgModule, in order to limit the scope of the provider to that module. This is the equivalent of specifying the non-root module in the @Injectable() metadata, except that the service provided this way is not tree-shakable. You generally don't need to specify AppModule with providedIn, because the app's root injector is the AppModule injector. However, if you configure a app-wide provider in the@NgModule() metadata for AppModule, it overrides one configured for root in the @Injectable() metadata. You can do this to configure a non-default provider of a service that is shared with multiple apps. Here is an example of the case where the component router configuration includes a non-default location strategy by listing its provider in the providers list of the AppModule. src/app/app.module.ts (providers)providers: [
{ provide: LocationStrategy, useClass: HashLocationStrategy }
] @Component-level injectors Individual components within an NgModule have their own injectors. You can limit the scope of a provider to a component and its children by configuring the provider at the component level using the @Component metadata. The following example is a revised HeroesComponent that specifies HeroService in its providers array. HeroService can provide heroes to instances of this component, or to any child component instances. src/app/heroes/heroes.component.tsimport { Component } from '@angular/core';
import { HeroService } from './hero.service';
@Component({
selector: 'app-heroes',
providers: [ HeroService ],
template: `
<h2>Heroes</h2>
<app-hero-list></app-hero-list>
`
})
export class HeroesComponent { } Element injectors An injector does not actually belong to a component, but rather to the component instance's anchor element in the DOM. A different component instance on a different DOM element uses a different injector. Components are a special type of directive, and the providers property of @Component() is inherited from @Directive(). Directives can also have dependencies, and you can configure providers in their @Directive() metadata. When you configure a provider for a component or directive using the providers property, that provider belongs to the injector for the anchor DOM element. Components and directives on the same element share an injector. Learn more about Element Injectors in Angular. Injector bubbling Consider this guide's variation on the Tour of Heroes application. At the top is the AppComponent which has some subcomponents, such as the HeroesListComponent. The HeroesListComponent holds and manages multiple instances of the HeroTaxReturnComponent. The following diagram represents the state of this three-level component tree when there are three instances of HeroTaxReturnComponent open simultaneously. When a component requests a dependency, Angular tries to satisfy that dependency with a provider registered in that component's own injector. If the component's injector lacks the provider, it passes the request up to its parent component's injector. If that injector can't satisfy the request, it passes the request along to the next parent injector up the tree. The requests keep bubbling up until Angular finds an injector that can handle the request or runs out of ancestor injectors. If it runs out of ancestors, Angular throws an error. If you have registered a provider for the same DI token at different levels, the first one Angular encounters is the one it uses to provide the dependency. If, for example, a provider is registered locally in the component that needs a service, Angular doesn't look for another provider of the same service. You can cap the bubbling by adding the @Host() parameter decorator on the dependant-service parameter in a component's constructor. The hunt for providers stops at the injector for the host element of the component. See an example of using @Host together with @Optional, another parameter decorator that lets you handle the null case if no provider is found. Learn more about the @Host decorator and Element Injectors. If you only register providers with the root injector at the top level (typically the root AppModule), the tree of injectors appears to be flat. All requests bubble up to the root injector, whether you configured it with the bootstrapModule method, or registered all providers with root in their own services. Component injectors The ability to configure one or more providers at different levels opens up interesting and useful possibilities. The guide sample offers some scenarios where you might want to do so. Scenario: service isolation Architectural reasons may lead you to restrict access to a service to the application domain where it belongs. For example, the guide sample includes a VillainsListComponent that displays a list of villains. It gets those villains from a VillainsService. If you provide VillainsService in the root AppModule (where you registered the HeroesService), that would make the VillainsService available everywhere in the application, including the Hero workflows. If you later modified the VillainsService, you could break something in a hero component somewhere. Providing the service in the root AppModule creates that risk. Instead, you can provide the VillainsService in the providers metadata of the VillainsListComponent like this: src/app/villains-list.component.ts (metadata)@Component({
selector: 'app-villains-list',
templateUrl: './villains-list.component.html',
providers: [ VillainsService ]
}) By providing VillainsService in the VillainsListComponent metadata and nowhere else, the service becomes available only in the VillainsListComponent and its sub-component tree. It's still a singleton, but it's a singleton that exist solely in the villain domain. Now you know that a hero component can't access it. You've reduced your exposure to error. Scenario: multiple edit sessions Many applications allow users to work on several open tasks at the same time. For example, in a tax preparation application, the preparer could be working on several tax returns, switching from one to the other throughout the day. This guide demonstrates that scenario with an example in the Tour of Heroes theme. Imagine an outer HeroListComponent that displays a list of super heroes. To open a hero's tax return, the preparer clicks on a hero name, which opens a component for editing that return. Each selected hero tax return opens in its own component and multiple returns can be open at the same time. Each tax return component has the following characteristics: Is its own tax return editing session. Can change a tax return without affecting a return in another component. Has the ability to save the changes to its tax return or cancel them. Suppose that the HeroTaxReturnComponent has logic to manage and restore changes. That would be a pretty easy task for a simple hero tax return. In the real world, with a rich tax return data model, the change management would be tricky. You could delegate that management to a helper service, as this example does. Here is the HeroTaxReturnService. It caches a single HeroTaxReturn, tracks changes to that return, and can save or restore it. It also delegates to the application-wide singleton HeroService, which it gets by injection. src/app/hero-tax-return.service.tsimport { Injectable } from '@angular/core';
import { HeroTaxReturn } from './hero';
import { HeroesService } from './heroes.service';
@Injectable()
export class HeroTaxReturnService {
private currentTaxReturn: HeroTaxReturn;
private originalTaxReturn: HeroTaxReturn;
constructor(private heroService: HeroesService) { }
set taxReturn (htr: HeroTaxReturn) {
this.originalTaxReturn = htr;
this.currentTaxReturn = htr.clone();
}
get taxReturn (): HeroTaxReturn {
return this.currentTaxReturn;
}
restoreTaxReturn() {
this.taxReturn = this.originalTaxReturn;
}
saveTaxReturn() {
this.taxReturn = this.currentTaxReturn;
this.heroService.saveTaxReturn(this.currentTaxReturn).subscribe();
}
} Here is the HeroTaxReturnComponent that makes use of it. src/app/hero-tax-return.component.tsimport { Component, EventEmitter, Input, Output } from '@angular/core';
import { HeroTaxReturn } from './hero';
import { HeroTaxReturnService } from './hero-tax-return.service';
@Component({
selector: 'app-hero-tax-return',
templateUrl: './hero-tax-return.component.html',
styleUrls: [ './hero-tax-return.component.css' ],
providers: [ HeroTaxReturnService ]
})
export class HeroTaxReturnComponent {
message = '';
@Output() close = new EventEmitter<void>();
get taxReturn(): HeroTaxReturn {
return this.heroTaxReturnService.taxReturn;
}
@Input()
set taxReturn (htr: HeroTaxReturn) {
this.heroTaxReturnService.taxReturn = htr;
}
constructor(private heroTaxReturnService: HeroTaxReturnService) { }
onCanceled() {
this.flashMessage('Canceled');
this.heroTaxReturnService.restoreTaxReturn();
};
onClose() { this.close.emit(); };
onSaved() {
this.flashMessage('Saved');
this.heroTaxReturnService.saveTaxReturn();
}
flashMessage(msg: string) {
this.message = msg;
setTimeout(() => this.message = '', 500);
}
} The tax-return-to-edit arrives via the input property which is implemented with getters and setters. The setter initializes the component's own instance of the HeroTaxReturnService with the incoming return. The getter always returns what that service says is the current state of the hero. The component also asks the service to save and restore this tax return. This won't work if the service is an application-wide singleton. Every component would share the same service instance, and each component would overwrite the tax return that belonged to another hero. To prevent this, we configure the component-level injector of HeroTaxReturnComponent to provide the service, using the providers property in the component metadata. src/app/hero-tax-return.component.ts (providers)providers: [ HeroTaxReturnService ] The HeroTaxReturnComponent has its own provider of the HeroTaxReturnService. Recall that every component instance has its own injector. Providing the service at the component level ensures that every instance of the component gets its own, private instance of the service, and no tax return gets overwritten. The rest of the scenario code relies on other Angular features and techniques that you can learn about elsewhere in the documentation. You can review it and download it from the live example. Scenario: specialized providers Another reason to re-provide a service at another level is to substitute a more specialized implementation of that service, deeper in the component tree. Consider a Car component that depends on several services. Suppose you configured the root injector (marked as A) with generic providers for CarService, EngineService and TiresService. You create a car component (A) that displays a car constructed from these three generic services. Then you create a child component (B) that defines its own, specialized providers for CarService and EngineService that have special capabilities suitable for whatever is going on in component (B). Component (B) is the parent of another component (C) that defines its own, even more specialized provider for CarService. Behind the scenes, each component sets up its own injector with zero, one, or more providers defined for that component itself. When you resolve an instance of Car at the deepest component (C), its injector produces an instance of Car resolved by injector (C) with an Engine resolved by injector (B) and Tires resolved by the root injector (A). The code for this cars scenario is in the car.components.ts and car.services.ts files of the sample which you can review and download from the live example.
|
love.event.push
Available since LÖVE 0.6.0 This function is not supported in earlier versions. Adds an event to the event queue.
See Variant for the list of supported types for the arguments.
From 0.10.0 onwards, you may pass an arbitrary amount of arguments with this function, though the default callbacks don't ever use more than six. Function Synopsis love.event.push( n, a, b, c, d, e, f, ... ) Arguments
Event n The name of the event. Variant a (nil) First event argument. Variant b (nil) Second event argument. Variant c (nil) Third event argument.
Variant d (nil) Available since 0.8.0
Fourth event argument.
Variant e (nil) Available since 0.10.0
Fifth event argument.
Variant f (nil) Available since 0.10.0
Sixth event argument.
Variant ... (nil) Available since 0.10.0
Further event arguments may follow.
Returns Nothing. Examples function love.keypressed(k)
if k == 'escape' then
love.event.push('quit') -- Quit the game.
end
end function love.keypressed(k)
if k == 'escape' then
love.event.push('q') -- Quit the game.
end
end See Also love.event
|
[Java] Class Types
org.codehaus.groovy.syntax.Types
public class Types
extends Object Typing information for the CST system. The types here are those used by CSTNode, Token, and Reduction. Field Summary
Fields
Modifiers Name Description
static int ANY
static int ANY_END_OF_STATEMENT
static int ARRAY_EXPRESSION
static int ARRAY_ITEM_TERMINATORS
static int ASSIGN
static int ASSIGNMENT_OPERATOR
static int BITWISE_AND
static int BITWISE_AND_EQUAL
static int BITWISE_NEGATION
static int BITWISE_OPERATOR
static int BITWISE_OR
static int BITWISE_OR_EQUAL
static int BITWISE_XOR
static int BITWISE_XOR_EQUAL
static int COLON
static int COMMA
static int COMPARE_EQUAL
static int COMPARE_GREATER_THAN
static int COMPARE_GREATER_THAN_EQUAL
static int COMPARE_IDENTICAL
static int COMPARE_LESS_THAN
static int COMPARE_LESS_THAN_EQUAL
static int COMPARE_NOT_EQUAL
static int COMPARE_NOT_IDENTICAL
static int COMPARE_NOT_IN
static int COMPARE_NOT_INSTANCEOF
static int COMPARE_TO
static int COMPARISON_OPERATOR
static int COMPLEX_EXPRESSION
static int CREATABLE_PRIMITIVE_TYPE
static int CREATABLE_TYPE_NAME
static int DECIMAL_NUMBER
static int DECLARATION_MODIFIER
static int DEREFERENCE_OPERATOR
static int DIVIDE
static int DIVIDE_EQUAL
static int DOT
static int DOT_DOT
static int DOT_DOT_DOT
static int DOUBLE_PIPE
static int ELVIS_EQUAL
static int EOF
static int EQUAL
static int EQUALS
static int EXPRESSION
static int FIND_REGEX
static int GENERAL_END_OF_STATEMENT
static int GSTRING_END
static int GSTRING_EXPRESSION_END
static int GSTRING_EXPRESSION_START
static int GSTRING_START
static int IDENTIFIER
static int INFIX_OPERATOR
static int INSTANCEOF_OPERATOR
static int INTDIV
static int INTDIV_EQUAL
static int INTEGER_NUMBER
static int KEYWORD
static int KEYWORD_ABSTRACT
static int KEYWORD_AS
static int KEYWORD_ASSERT
static int KEYWORD_BOOLEAN
static int KEYWORD_BREAK
static int KEYWORD_BYTE
static int KEYWORD_CASE
static int KEYWORD_CATCH
static int KEYWORD_CHAR
static int KEYWORD_CLASS
static int KEYWORD_CONST
static int KEYWORD_CONTINUE
static int KEYWORD_DEF
static int KEYWORD_DEFAULT
static int KEYWORD_DEFMACRO
static int KEYWORD_DO
static int KEYWORD_DOUBLE
static int KEYWORD_ELSE
static int KEYWORD_EXPRESSION
static int KEYWORD_EXTENDS
static int KEYWORD_FALSE
static int KEYWORD_FINAL
static int KEYWORD_FINALLY
static int KEYWORD_FLOAT
static int KEYWORD_FOR
static int KEYWORD_GOTO
static int KEYWORD_IDENTIFIER
static int KEYWORD_IF
static int KEYWORD_IMPLEMENTS
static int KEYWORD_IMPORT
static int KEYWORD_IN
static int KEYWORD_INSTANCEOF
static int KEYWORD_INT
static int KEYWORD_INTERFACE
static int KEYWORD_LONG
static int KEYWORD_MIXIN
static int KEYWORD_NATIVE
static int KEYWORD_NEW
static int KEYWORD_NULL
static int KEYWORD_PACKAGE
static int KEYWORD_PRIVATE
static int KEYWORD_PROPERTY
static int KEYWORD_PROTECTED
static int KEYWORD_PUBLIC
static int KEYWORD_RETURN
static int KEYWORD_SHORT
static int KEYWORD_STATIC
static int KEYWORD_SUPER
static int KEYWORD_SWITCH
static int KEYWORD_SYNCHRONIZED
static int KEYWORD_THIS
static int KEYWORD_THROW
static int KEYWORD_THROWS
static int KEYWORD_TRANSIENT
static int KEYWORD_TRUE
static int KEYWORD_TRY
static int KEYWORD_VOID
static int KEYWORD_VOLATILE
static int KEYWORD_WHILE
static int LEFT_CURLY_BRACE
static int LEFT_OF_MATCHED_CONTAINER
static int LEFT_PARENTHESIS
static int LEFT_SHIFT
static int LEFT_SHIFT_EQUAL
static int LEFT_SQUARE_BRACKET
static int LITERAL
static int LITERAL_EXPRESSION
static int LOGICAL_AND
static int LOGICAL_AND_EQUAL
static int LOGICAL_OPERATOR
static int LOGICAL_OR
static int LOGICAL_OR_EQUAL
static int LOOP
static int MATCHED_CONTAINER
static int MATCH_REGEX
static int MATH_OPERATOR
static int METHOD_CALL_STARTERS
static int MINUS
static int MINUS_EQUAL
static int MINUS_MINUS
static int MOD
static int MOD_EQUAL
static int MULTIPLY
static int MULTIPLY_EQUAL
static int NAMED_VALUE
static int NAVIGATE
static int NEWLINE
static int NOT
static int NOT_EOF
static int NUMBER
static int OPERATOR_EXPRESSION
static int OPTIONAL_DATATYPE_FOLLOWERS
static int PARAMETER_TERMINATORS
static int PIPE
static int PLUS
static int PLUS_EQUAL
static int PLUS_PLUS
static int POSTFIX_MINUS_MINUS
static int POSTFIX_OPERATOR
static int POSTFIX_PLUS_PLUS
static int POWER
static int POWER_EQUAL
static int PRECLUDES_CAST_OPERATOR
static int PREFIX_MINUS
static int PREFIX_MINUS_MINUS
static int PREFIX_OPERATOR
static int PREFIX_OR_INFIX_OPERATOR
static int PREFIX_PLUS
static int PREFIX_PLUS_PLUS
static int PRIMITIVE_TYPE
static int PURE_PREFIX_OPERATOR
static int QUESTION
static int RANGE_OPERATOR
static int REGEX_COMPARISON_OPERATOR
static int REGEX_PATTERN
static int RESERVED_KEYWORD
static int RIGHT_CURLY_BRACE
static int RIGHT_OF_MATCHED_CONTAINER
static int RIGHT_PARENTHESIS
static int RIGHT_SHIFT
static int RIGHT_SHIFT_EQUAL
static int RIGHT_SHIFT_UNSIGNED
static int RIGHT_SHIFT_UNSIGNED_EQUAL
static int RIGHT_SQUARE_BRACKET
static int SEMICOLON
static int SIGN
static int SIMPLE_EXPRESSION
static int STAR
static int STAR_STAR
static int STRING
static int SWITCH_BLOCK_TERMINATORS
static int SWITCH_ENTRIES
static int SYMBOL
static int SYNTHETIC
static int SYNTH_BLOCK
static int SYNTH_CAST
static int SYNTH_CLASS
static int SYNTH_CLOSURE
static int SYNTH_COMPILATION_UNIT
static int SYNTH_EXPRESSION
static int SYNTH_GSTRING
static int SYNTH_INTERFACE
static int SYNTH_LABEL
static int SYNTH_LIST
static int SYNTH_MAP
static int SYNTH_METHOD
static int SYNTH_METHOD_CALL
static int SYNTH_MIXIN
static int SYNTH_PARAMETER_DECLARATION
static int SYNTH_PROPERTY
static int SYNTH_TERNARY
static int SYNTH_TUPLE
static int SYNTH_VARIABLE_DECLARATION
static int TRUTH_VALUE
static int TYPE_DECLARATION
static int TYPE_LIST_TERMINATORS
static int TYPE_NAME
static int UNKNOWN
static int UNSAFE_OVER_NEWLINES Methods Summary
Methods
Type Params Return Type Name and description public static boolean
canMean(int actual, int preferred)Given two types, returns true if the first can be viewed as the second. public static String
getDescription(int type)Gets the description for the specified type. public static Collection<String>
getKeywords()
public static int
getPrecedence(int type, boolean throwIfInvalid)Returns the precedence of the specified operator. public static String
getText(int type)Returns the text for the specified type. public static boolean
isAssignment(int type)
Since:
3.0.0
public static boolean
isKeyword(String text)
public static int
lookup(String text, int filter)Returns the type for the specified symbol/keyword text. public static int
lookupKeyword(String text)Returns the type for the specified keyword text. public static int
lookupSymbol(String text)Returns the type for the specified symbol text. public static void
makePostfix(CSTNode node, boolean throwIfInvalid)Converts a node from a generic type to a specific postfix type. public static void
makePrefix(CSTNode node, boolean throwIfInvalid)Converts a node from a generic type to a specific prefix type. public static boolean
ofType(int specific, int general)Given two types, returns true if the second describes the first. Inherited Methods Summary
Inherited Methods
Methods inherited from class Name class Object wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll Field Detail public static final int ANY
public static final int ANY_END_OF_STATEMENT
public static final int ARRAY_EXPRESSION
public static final int ARRAY_ITEM_TERMINATORS
public static final int ASSIGN
public static final int ASSIGNMENT_OPERATOR
public static final int BITWISE_AND
public static final int BITWISE_AND_EQUAL
public static final int BITWISE_NEGATION
public static final int BITWISE_OPERATOR
public static final int BITWISE_OR
public static final int BITWISE_OR_EQUAL
public static final int BITWISE_XOR
public static final int BITWISE_XOR_EQUAL
public static final int COLON
public static final int COMMA
public static final int COMPARE_EQUAL
public static final int COMPARE_GREATER_THAN
public static final int COMPARE_GREATER_THAN_EQUAL
public static final int COMPARE_IDENTICAL
public static final int COMPARE_LESS_THAN
public static final int COMPARE_LESS_THAN_EQUAL
public static final int COMPARE_NOT_EQUAL
public static final int COMPARE_NOT_IDENTICAL
public static final int COMPARE_NOT_IN
public static final int COMPARE_NOT_INSTANCEOF
public static final int COMPARE_TO
public static final int COMPARISON_OPERATOR
public static final int COMPLEX_EXPRESSION
public static final int CREATABLE_PRIMITIVE_TYPE
public static final int CREATABLE_TYPE_NAME
public static final int DECIMAL_NUMBER
public static final int DECLARATION_MODIFIER
public static final int DEREFERENCE_OPERATOR
public static final int DIVIDE
public static final int DIVIDE_EQUAL
public static final int DOT
public static final int DOT_DOT
public static final int DOT_DOT_DOT
public static final int DOUBLE_PIPE
public static final int ELVIS_EQUAL
public static final int EOF
public static final int EQUAL
public static final int EQUALS
public static final int EXPRESSION
public static final int FIND_REGEX
public static final int GENERAL_END_OF_STATEMENT
public static final int GSTRING_END
public static final int GSTRING_EXPRESSION_END
public static final int GSTRING_EXPRESSION_START
public static final int GSTRING_START
public static final int IDENTIFIER
public static final int INFIX_OPERATOR
public static final int INSTANCEOF_OPERATOR
public static final int INTDIV
public static final int INTDIV_EQUAL
public static final int INTEGER_NUMBER
public static final int KEYWORD
public static final int KEYWORD_ABSTRACT
public static final int KEYWORD_AS
public static final int KEYWORD_ASSERT
public static final int KEYWORD_BOOLEAN
public static final int KEYWORD_BREAK
public static final int KEYWORD_BYTE
public static final int KEYWORD_CASE
public static final int KEYWORD_CATCH
public static final int KEYWORD_CHAR
public static final int KEYWORD_CLASS
public static final int KEYWORD_CONST
public static final int KEYWORD_CONTINUE
public static final int KEYWORD_DEF
public static final int KEYWORD_DEFAULT
public static final int KEYWORD_DEFMACRO
public static final int KEYWORD_DO
public static final int KEYWORD_DOUBLE
public static final int KEYWORD_ELSE
public static final int KEYWORD_EXPRESSION
public static final int KEYWORD_EXTENDS
public static final int KEYWORD_FALSE
public static final int KEYWORD_FINAL
public static final int KEYWORD_FINALLY
public static final int KEYWORD_FLOAT
public static final int KEYWORD_FOR
public static final int KEYWORD_GOTO
public static final int KEYWORD_IDENTIFIER
public static final int KEYWORD_IF
public static final int KEYWORD_IMPLEMENTS
public static final int KEYWORD_IMPORT
public static final int KEYWORD_IN
public static final int KEYWORD_INSTANCEOF
public static final int KEYWORD_INT
public static final int KEYWORD_INTERFACE
public static final int KEYWORD_LONG
public static final int KEYWORD_MIXIN
public static final int KEYWORD_NATIVE
public static final int KEYWORD_NEW
public static final int KEYWORD_NULL
public static final int KEYWORD_PACKAGE
public static final int KEYWORD_PRIVATE
public static final int KEYWORD_PROPERTY
public static final int KEYWORD_PROTECTED
public static final int KEYWORD_PUBLIC
public static final int KEYWORD_RETURN
public static final int KEYWORD_SHORT
public static final int KEYWORD_STATIC
public static final int KEYWORD_SUPER
public static final int KEYWORD_SWITCH
public static final int KEYWORD_SYNCHRONIZED
public static final int KEYWORD_THIS
public static final int KEYWORD_THROW
public static final int KEYWORD_THROWS
public static final int KEYWORD_TRANSIENT
public static final int KEYWORD_TRUE
public static final int KEYWORD_TRY
public static final int KEYWORD_VOID
public static final int KEYWORD_VOLATILE
public static final int KEYWORD_WHILE
public static final int LEFT_CURLY_BRACE
public static final int LEFT_OF_MATCHED_CONTAINER
public static final int LEFT_PARENTHESIS
public static final int LEFT_SHIFT
public static final int LEFT_SHIFT_EQUAL
public static final int LEFT_SQUARE_BRACKET
public static final int LITERAL
public static final int LITERAL_EXPRESSION
public static final int LOGICAL_AND
public static final int LOGICAL_AND_EQUAL
public static final int LOGICAL_OPERATOR
public static final int LOGICAL_OR
public static final int LOGICAL_OR_EQUAL
public static final int LOOP
public static final int MATCHED_CONTAINER
public static final int MATCH_REGEX
public static final int MATH_OPERATOR
public static final int METHOD_CALL_STARTERS
public static final int MINUS
public static final int MINUS_EQUAL
public static final int MINUS_MINUS
public static final int MOD
public static final int MOD_EQUAL
public static final int MULTIPLY
public static final int MULTIPLY_EQUAL
public static final int NAMED_VALUE
public static final int NAVIGATE
public static final int NEWLINE
public static final int NOT
public static final int NOT_EOF
public static final int NUMBER
public static final int OPERATOR_EXPRESSION
public static final int OPTIONAL_DATATYPE_FOLLOWERS
public static final int PARAMETER_TERMINATORS
public static final int PIPE
public static final int PLUS
public static final int PLUS_EQUAL
public static final int PLUS_PLUS
public static final int POSTFIX_MINUS_MINUS
public static final int POSTFIX_OPERATOR
public static final int POSTFIX_PLUS_PLUS
public static final int POWER
public static final int POWER_EQUAL
public static final int PRECLUDES_CAST_OPERATOR
public static final int PREFIX_MINUS
public static final int PREFIX_MINUS_MINUS
public static final int PREFIX_OPERATOR
public static final int PREFIX_OR_INFIX_OPERATOR
public static final int PREFIX_PLUS
public static final int PREFIX_PLUS_PLUS
public static final int PRIMITIVE_TYPE
public static final int PURE_PREFIX_OPERATOR
public static final int QUESTION
public static final int RANGE_OPERATOR
public static final int REGEX_COMPARISON_OPERATOR
public static final int REGEX_PATTERN
public static final int RESERVED_KEYWORD
public static final int RIGHT_CURLY_BRACE
public static final int RIGHT_OF_MATCHED_CONTAINER
public static final int RIGHT_PARENTHESIS
public static final int RIGHT_SHIFT
public static final int RIGHT_SHIFT_EQUAL
public static final int RIGHT_SHIFT_UNSIGNED
public static final int RIGHT_SHIFT_UNSIGNED_EQUAL
public static final int RIGHT_SQUARE_BRACKET
public static final int SEMICOLON
public static final int SIGN
public static final int SIMPLE_EXPRESSION
public static final int STAR
public static final int STAR_STAR
public static final int STRING
public static final int SWITCH_BLOCK_TERMINATORS
public static final int SWITCH_ENTRIES
public static final int SYMBOL
public static final int SYNTHETIC
public static final int SYNTH_BLOCK
public static final int SYNTH_CAST
public static final int SYNTH_CLASS
public static final int SYNTH_CLOSURE
public static final int SYNTH_COMPILATION_UNIT
public static final int SYNTH_EXPRESSION
public static final int SYNTH_GSTRING
public static final int SYNTH_INTERFACE
public static final int SYNTH_LABEL
public static final int SYNTH_LIST
public static final int SYNTH_MAP
public static final int SYNTH_METHOD
public static final int SYNTH_METHOD_CALL
public static final int SYNTH_MIXIN
public static final int SYNTH_PARAMETER_DECLARATION
public static final int SYNTH_PROPERTY
public static final int SYNTH_TERNARY
public static final int SYNTH_TUPLE
public static final int SYNTH_VARIABLE_DECLARATION
public static final int TRUTH_VALUE
public static final int TYPE_DECLARATION
public static final int TYPE_LIST_TERMINATORS
public static final int TYPE_NAME
public static final int UNKNOWN
public static final int UNSAFE_OVER_NEWLINES
Method Detail public static boolean canMean(int actual, int preferred) Given two types, returns true if the first can be viewed as the second. NOTE that canMean() is orthogonal to ofType(). public static String getDescription(int type) Gets the description for the specified type. public static Collection<String> getKeywords() public static int getPrecedence(int type, boolean throwIfInvalid) Returns the precedence of the specified operator. Non-operator's will receive -1 or a GroovyBugError, depending on your preference. public static String getText(int type) Returns the text for the specified type. Returns "" if the text isn't found. public static boolean isAssignment(int type)
Since:
3.0.0
public static boolean isKeyword(String text) public static int lookup(String text, int filter) Returns the type for the specified symbol/keyword text. Returns UNKNOWN if the text isn't found. You can filter finds on a type. public static int lookupKeyword(String text) Returns the type for the specified keyword text. Returns UNKNOWN if the text isn't found. public static int lookupSymbol(String text) Returns the type for the specified symbol text. Returns UNKNOWN if the text isn't found. public static void makePostfix(CSTNode node, boolean throwIfInvalid) Converts a node from a generic type to a specific postfix type. Throws a GroovyBugError if the type can't be converted. public static void makePrefix(CSTNode node, boolean throwIfInvalid) Converts a node from a generic type to a specific prefix type. Throws a GroovyBugError if the type can't be converted and requested. public static boolean ofType(int specific, int general) Given two types, returns true if the second describes the first.
|
Class StreamExtensions.StringHasSeqParStream
Source code
implicit class StringHasSeqParStream(s: String)
Supertypes
class Object
trait Matchable
class Any
Concrete methods
Source
def asJavaParCharStream: IntStream
A parallel stream on the characters of a string. See also asJavaParCodePointStream.
Source
def asJavaParCodePointStream: IntStream
A parallel stream on the code points of a string. See also asJavaParCharStream.
Source
def asJavaParStream: IntStream
A parallel stream on the characters of a string, same as asJavaParCharStream. See also asJavaParCodePointStream.
Source
def asJavaSeqCharStream: IntStream
A sequential stream on the characters of a string. See also asJavaSeqCodePointStream.
Source
def asJavaSeqCodePointStream: IntStream
A sequential stream on the code points of a string. See also asJavaSeqCharStream.
Source
def asJavaSeqStream: IntStream
A sequential stream on the characters of a string, same as asJavaSeqCharStream. See also asJavaSeqCodePointStream.
|
constant Unico8b7c:f320:99b9:690f:4595:cd17:293a:c069STATUS_ERROR Indicates an error during check for PHP unicode support. File
core/lib/Drupal/Component/Utility/Unicode.php, line 88 Class
Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Code const STATUS_ERROR = -1;
|
community.zabbix.zabbix_screen – Create/update/delete Zabbix screens Note This plugin is part of the community.zabbix collection (version 1.1.0). To install it use: ansible-galaxy collection install community.zabbix. To use it in a playbook, specify: community.zabbix.zabbix_screen. Synopsis Requirements Parameters Notes Examples Synopsis This module allows you to create, modify and delete Zabbix screens and associated graph data. Requirements The below requirements are needed on the host that executes this module. python >= 2.6 zabbix-api >= 0.5.4 Parameters Parameter Choices/Defaults Comments http_login_password string Basic Auth password http_login_user string Basic Auth login login_password string / required Zabbix user password. login_user string / required Zabbix user name. screens list / elements=dictionary / required List of screens to be created/updated/deleted (see example). graph_height integer Graph height will be set in graph settings. graph_names list / elements=string Graph names will be added to a screen. Case insensitive. Required if state=present. graph_width integer Graph width will be set in graph settings. graphs_in_row integer Default:3 Limit columns of a screen and make multiple rows. host_group list / elements=string Host group(s) will be used for searching hosts. Required if state=present.
aliases: host_groups screen_name string / required Screen name will be used. If a screen has already been added, the screen name won't be updated. sort boolean
Choices:
no ← yes Sort hosts alphabetically. If there are numbers in hostnames, leading zero should be used. state string
Choices: absent
present ←
present - Create a screen if it doesn't exist. If the screen already exists, the screen will be updated as needed.
absent - If a screen exists, the screen will be deleted. server_url string / required URL of Zabbix server, with protocol (http or https). url is an alias for server_url.
aliases: url timeout integer Default:10 The timeout of API request (seconds). validate_certs boolean
Choices: no
yes ← If set to False, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. Notes Note Too many concurrent updates to the same screen may cause Zabbix to return errors, see examples for a workaround if needed. If you use login_password=zabbix, the word “zabbix” is replaced by “****” in all module output, because login_password uses no_log. See this FAQ for more information. Examples # Create/update a screen.
- name: Create a new screen or update an existing screen's items 5 in a row
local_action:
module: community.zabbix.zabbix_screen
server_url: http://monitor.example.com
login_user: username
login_password: password
screens:
- screen_name: ExampleScreen1
host_group: Example group1
state: present
graph_names:
- Example graph1
- Example graph2
graph_width: 200
graph_height: 100
graphs_in_row: 5
# Create/update multi-screen
- name: Create two of new screens or update the existing screens' items
local_action:
module: community.zabbix.zabbix_screen
server_url: http://monitor.example.com
login_user: username
login_password: password
screens:
- screen_name: ExampleScreen1
host_group: Example group1
state: present
graph_names:
- Example graph1
- Example graph2
graph_width: 200
graph_height: 100
- screen_name: ExampleScreen2
host_group: Example group2
state: present
graph_names:
- Example graph1
- Example graph2
graph_width: 200
graph_height: 100
# Limit the Zabbix screen creations to one host since Zabbix can return an error when doing concurrent updates
- name: Create a new screen or update an existing screen's items
local_action:
module: community.zabbix.zabbix_screen
server_url: http://monitor.example.com
login_user: username
login_password: password
state: present
screens:
- screen_name: ExampleScreen
host_group: Example group
state: present
graph_names:
- Example graph1
- Example graph2
graph_width: 200
graph_height: 100
when: inventory_hostname==groups['group_name'][0]
# Create/update using multiple hosts_groups. Hosts NOT present in all listed host_groups will be skipped.
- name: Create new screen or update the existing screen's items for hosts in both given groups
local_action:
module: community.zabbix.zabbix_screen
server_url: http://monitor.example.com
login_user: username
login_password: password
screens:
- screen_name: ExampleScreen1
host_group:
- Example group1
- Example group2
state: present
graph_names:
- Example graph1
- Example graph2
graph_width: 200
graph_height: 100
Authors Cove (@cove) Tony Minfei Ding (!UNKNOWN) Harrison Gu (@harrisongu)
© 2012–2018 Michael DeHaan
|
PublicKeyCredential.getClientExtensionResults()
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers. getClientExtensionResults() is a method of the PublicKeyCredential interface that returns an ArrayBuffer which contains a map between the extensions identifiers and their results after having being processed by the client. During the creation or fetching of a PublicKeyCredential (respectively via navigator.credentials.create() and navigator.credentials.get()), it is possible to have "custom" processing by the client for different extensions which are respectively given by PublicKeyCredentialCreationOptions.extensions and PublicKeyCredentialRequestOptions.extensions. Note: Extensions are optional and different browsers may recognize different extensions. All extensions are optional for the client to process them: if a browser does not know of a given extension, that will not cause any failure. Note: This method may only be used in top-level contexts and will not be available in an <iframe> for example.
Syntax
getClientExtensionResults()
Parameters
None.
Return value
An ArrayBuffer containing the result of the processing of the different extensions by the client. This object contains a map between the extensions' identifiers and their results from the processing. Warning: As of March 2019, only appId (used during creation with PublicKeyCredentialRequestOptions.extensions) is supported by Chrome and Edge. Firefox does not seem to support any extension.
Examples
var publicKey = {
// Here are the extensions (as "inputs")
extensions: {
"loc": true, // This extension has been defined to include location information in attestation
"uvi": true // user verification index: how the user was verified
},
challenge: new Uint8Array(16) /* from the server */,
rp: {
name: "Example CORP",
id : "login.example.com"
},
user: {
id: new Uint8Array(16) /* from the server */,
name: "[email protected]",
displayName: "John Doe"
},
pubKeyCredParams: [
{
type: "public-key",
alg: -7
}
]
};
navigator.credentials.create({ publicKey })
.then(function (newCredentialInfo) {
var myBuffer = newCredentialInfo.getClientExtensionResults();
// myBuffer will contain the result of any of the processing of the "loc" and "uvi" extensions
}).catch(function (err) {
console.error(err);
});
Specifications
Specification
Web Authentication: An API for accessing Public Key Credentials - Level 3 # ref-for-dom-publickeycredential-getclientextensionresults
Browser compatibility
Desktop
Mobile
Chrome
Edge
Firefox
Internet Explorer
Opera
Safari
WebView Android
Chrome Android
Firefox for Android
Opera Android
Safari on IOS
Samsung Internet
getClientExtensionResults
67
18
60
Only supports USB U2F tokens.
No
54
13
No
70
92
60-92
Only supports USB U2F tokens.
49
13
No
See also
The list of the currently defined extensions AuthenticatorAssertionResponse.authenticatorData which contains the result of the authenticator's extensions processing PublicKeyCredentialCreationOptions.extensions which contains the client extensions' input values for the creation of the credential PublicKeyCredentialRequestOptions.extensions which contains the client extensions' input values for the retrieval of the credential
Found a problem with this page?
Edit on GitHub
Source on GitHub
Report a problem with this content on GitHub
Want to fix the problem yourself? See our Contribution guide.
Last modified: Apr 20, 2022, by MDN contributors
|
SolrQuery8b7c:f320:99b9:690f:4595:cd17:293a:c069getMltMaxNumQueryTerms (PECL solr >= 0.9.2)
SolrQuery8b7c:f320:99b9:690f:4595:cd17:293a:c069getMltMaxNumQueryTerms — Returns the maximum number of query terms that will be included in any generated query Description public SolrQuery8b7c:f320:99b9:690f:4595:cd17:293a:c069getMltMaxNumQueryTerms(): int Returns the maximum number of query terms that will be included in any generated query Parameters This function has no parameters. Return Values Returns an integer on success and null if not set.
|
Improve this Doc View Source ngRepeat directive in module ng The ngRepeat directive instantiates a template once per item from a collection. Each template instance gets its own scope, where the given loop variable is set to the current collection item, and $index is set to the item index or key. Special properties are exposed on the local scope of each template instance, including: Variable Type Details $index number iterator offset of the repeated element (0..length-1) $first boolean true if the repeated element is first in the iterator. $middle boolean true if the repeated element is between the first and last in the iterator. $last boolean true if the repeated element is last in the iterator. $even boolean true if the iterator position $index is even (otherwise false). $odd boolean true if the iterator position $index is odd (otherwise false). Creating aliases for these properties is possible with ngInit. This may be useful when, for instance, nesting ngRepeats. Iterating over object properties It is possible to get ngRepeat to iterate over the properties of an object using the following syntax: <div ng-repeat="(key, value) in myObj"> ... </div>
However, there are a few limitations compared to array iteration:
The JavaScript specification does not define the order of keys returned for an object, so Angular relies on the order returned by the browser when running for key in myObj. Browsers generally follow the strategy of providing keys in the order in which they were defined, although there are exceptions when keys are deleted and reinstated. See the MDN page on delete for more info.
ngRepeat will silently ignore object keys starting with $, because it's a prefix used by Angular for public ($) and private ($$) properties.
The built-in filters orderBy and filter do not work with objects, and will throw an error if used with one. If you are hitting any of these limitations, the recommended workaround is to convert your object into an array that is sorted into the order that you prefer before providing it to ngRepeat. You could do this with a filter such as toArrayFilter or implement a $watch on the object yourself. Tracking and Duplicates ngRepeat uses $watchCollection to detect changes in the collection. When a change happens, ngRepeat then makes the corresponding changes to the DOM: When an item is added, a new instance of the template is added to the DOM. When an item is removed, its template instance is removed from the DOM. When items are reordered, their respective templates are reordered in the DOM. To minimize creation of DOM elements, ngRepeat uses a function to "keep track" of all items in the collection and their corresponding DOM elements. For example, if an item is added to the collection, ngRepeat will know that all other items already have DOM elements, and will not re-render them. The default tracking function (which tracks items by their identity) does not allow duplicate items in arrays. This is because when there are duplicates, it is not possible to maintain a one-to-one mapping between collection items and DOM elements. If you do need to repeat duplicate items, you can substitute the default tracking behavior with your own using the track by expression. For example, you may track items by the index of each item in the collection, using the special scope property $index: <div ng-repeat="n in [42, 42, 43, 43] track by $index">
{{n}}
</div>
You may also use arbitrary expressions in track by, including references to custom functions on the scope: <div ng-repeat="n in [42, 42, 43, 43] track by myTrackingFunction(n)">
{{n}}
</div>
If you are working with objects that have a unique identifier property, you should track by this identifier instead of the object instance. Should you reload your data later, ngRepeat will not have to rebuild the DOM elements for items it has already rendered, even if the JavaScript objects in the collection have been substituted for new ones. For large collections, this significantly improves rendering performance. If you don't have a unique identifier, track by $index can also provide a performance boost. <div ng-repeat="model in collection track by model.id">
{{model.name}}
</div>
Avoid using track by $index when the repeated template contains one-time bindings. In such cases, the nth DOM element will always be matched with the nth item of the array, so the bindings on that element will not be updated even when the corresponding item changes, essentially causing the view to get out-of-sync with the underlying data. When no track by expression is provided, it is equivalent to tracking by the built-in $id function, which tracks items by their identity: <div ng-repeat="obj in collection track by $id(obj)">
{{obj.prop}}
</div>
Note: track by must always be the last expression: <div ng-repeat="model in collection | orderBy: 'id' as filtered_result track by model.id">
{{model.name}}
</div>
Special repeat start and end points To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending the range of the repeater by defining explicit start and end points by using ng-repeat-start and ng-repeat-end respectively. The ng-repeat-start directive works the same as ng-repeat, but will repeat all the HTML code (including the tag it's defined on) up to and including the ending HTML tag where ng-repeat-end is placed. The example below makes use of this feature: <header ng-repeat-start="item in items">
Header {{ item }}
</header>
<div class="body">
Body {{ item }}
</div>
<footer ng-repeat-end>
Footer {{ item }}
</footer>
And with an input of ['A','B'] for the items variable in the example above, the output will evaluate to: <header>
Header A
</header>
<div class="body">
Body A
</div>
<footer>
Footer A
</footer>
<header>
Header B
</header>
<div class="body">
Body B
</div>
<footer>
Footer B
</footer>
The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such as data-ng-repeat-start, x-ng-repeat-start and ng:repeat-start). Directive Info This directive creates new scope. This directive executes at priority level 1000. This directive can be used as multiElement
Usage as element: (This directive can be used as custom element, but be aware of IE restrictions). <ng-repeat
ng-repeat="repeat_expression">
...
</ng-repeat> as attribute: <ANY
ng-repeat="repeat_expression">
...
</ANY>
Animations Animation Occurs enter when a new item is added to the list or when an item is revealed after a filter leave when an item is removed from the list or when an item is filtered out move when an adjacent item is filtered out causing a reorder or when the item contents are reordered See the example below for defining CSS animations with ngRepeat. Click here to learn more about the steps involved in the animation. Arguments Param Type Details ngRepeat repeat_expression The expression indicating how to enumerate a collection. These formats are currently supported:
variable in expression – where variable is the user defined loop variable and expression is a scope expression giving the collection to enumerate. For example: album in artist.albums.
(key, value) in expression – where key and value can be any user defined identifiers, and expression is the scope expression giving the collection to enumerate. For example: (name, age) in {'adam':10, 'amalie':12}.
variable in expression track by tracking_expression – You can also provide an optional tracking expression which can be used to associate the objects in the collection with the DOM elements. If no tracking expression is specified, ng-repeat associates elements by identity. It is an error to have more than one tracking expression value resolve to the same key. (This would mean that two distinct objects are mapped to the same DOM element, which is not possible.) Note that the tracking expression must come last, after any filters, and the alias expression. For example: item in items is equivalent to item in items track by $id(item). This implies that the DOM elements will be associated by item identity in the array. For example: item in items track by $id(item). A built in $id() function can be used to assign a unique $$hashKey property to each item in the array. This property is then used as a key to associated DOM elements with the corresponding item in the array by identity. Moving the same object in array would move the DOM element in the same way in the DOM. For example: item in items track by item.id is a typical pattern when the items come from the database. In this case the object identity does not matter. Two objects are considered equivalent as long as their id property is same. For example: item in items | filter:searchText track by item.id is a pattern that might be used to apply a filter to items in conjunction with a tracking expression.
variable in expression as alias_expression – You can also provide an optional alias expression which will then store the intermediate results of the repeater after the filters have been applied. Typically this is used to render a special message when a filter is active on the repeater, but the filtered result set is empty. For example: item in items | filter:x as results will store the fragment of the repeated items as results, but only after the items have been processed through the filter. Please note that `as [variable name] is not an operator but rather a part of ngRepeat micro-syntax so it can be used only at the end (and not as operator, inside an expression). For example: item in items | filter : x | orderBy : order | limitTo : limit as results . This example uses ngRepeat to display a list of people. A filter is used to restrict the displayed results by name or by age. New (entering) and removed (leaving) items are animated.
|
Eigen8b7c:f320:99b9:690f:4595:cd17:293a:c069SimplicialCholesky
template<typename _MatrixType, int _UpLo, typename _Ordering> class Eigen8b7c:f320:99b9:690f:4595:cd17:293a:c069SimplicialCholesky< _MatrixType, _UpLo, _Ordering >
Deprecated:
use SimplicialLDLT or class SimplicialLLT
See also
class SimplicialLDLT, class SimplicialLLT
void
analyzePattern (const MatrixType &a)
SimplicialCholesky &
compute (const MatrixType &matrix)
void
factorize (const MatrixType &a)
Public Member Functions inherited from Eigen8b7c:f320:99b9:690f:4595:cd17:293a:c069SimplicialCholeskyBase< SimplicialCholesky< _MatrixType, _UpLo, _Ordering > >
ComputationInfo
info () const
Reports whether previous computation was successful. More...
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &
permutationP () const
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &
permutationPinv () const
SimplicialCholesky< _MatrixType, _UpLo, _Ordering > &
setShift (const RealScalar &offset, const RealScalar &scale=1)
SimplicialCholeskyBase ()
Public Member Functions inherited from Eigen8b7c:f320:99b9:690f:4595:cd17:293a:c069SparseSolverBase< SimplicialCholesky< _MatrixType, _UpLo, _Ordering > >
const Solve< SimplicialCholesky< _MatrixType, _UpLo, _Ordering >, Rhs >
solve (const MatrixBase< Rhs > &b) const
const Solve< SimplicialCholesky< _MatrixType, _UpLo, _Ordering >, Rhs >
solve (const SparseMatrixBase< Rhs > &b) const
SparseSolverBase ()
Protected Member Functions inherited from Eigen8b7c:f320:99b9:690f:4595:cd17:293a:c069SimplicialCholeskyBase< SimplicialCholesky< _MatrixType, _UpLo, _Ordering > >
void
compute (const MatrixType &matrix)
analyzePattern() template<typename _MatrixType , int _UpLo, typename _Ordering > void Eigen8b7c:f320:99b9:690f:4595:cd17:293a:c069SimplicialCholesky< _MatrixType, _UpLo, _Ordering >8b7c:f320:99b9:690f:4595:cd17:293a:c069nalyzePattern ( const MatrixType & a
) inline
Performs a symbolic decomposition on the sparcity of matrix. This function is particularly useful when solving for several problems having the same structure.
See also
factorize()
compute() template<typename _MatrixType , int _UpLo, typename _Ordering >
SimplicialCholesky& Eigen8b7c:f320:99b9:690f:4595:cd17:293a:c069SimplicialCholesky< _MatrixType, _UpLo, _Ordering >8b7c:f320:99b9:690f:4595:cd17:293a:c069ompute ( const MatrixType & matrix
) inline
Computes the sparse Cholesky decomposition of matrix factorize() template<typename _MatrixType , int _UpLo, typename _Ordering > void Eigen8b7c:f320:99b9:690f:4595:cd17:293a:c069SimplicialCholesky< _MatrixType, _UpLo, _Ordering >8b7c:f320:99b9:690f:4595:cd17:293a:c069torize ( const MatrixType & a
) inline
Performs a numeric decomposition of matrix The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.
See also
analyzePattern()
The documentation for this class was generated from the following file: SimplicialCholesky.h
|
struct BigRational
BigRational
Number
Value
Object
Overview Rational numbers are represented as the quotient of arbitrarily large numerators and denominators. Rationals are canonicalized such that the denominator and the numerator have no common factors, and that the denominator is positive. Zero has the unique representation 0/1. require "big"
r = BigRational.new(7.to_big_i, 3.to_big_i)
r.to_s # => "7/3"
r = BigRational.new(3, -9)
r.to_s # => "-1/3" It is implemented under the hood with GMP. Included Modules
Comparable(BigDecimal)
Comparable(Float)
Comparable(Int)
Comparable(BigRational) Defined in: big.cr big/big_decimal.cr big/big_rational.cr big/number.cr Constructors .new(numerator : Int, denominator : Int) Creates a new BigRational. .new(num : Int) Creates a new BigRational with num as the numerator and 1 for denominator. .new(num : Float) Creates a exact representation of float as rational. .new(num : BigRational) Creates a BigRational from the given num. .new(num : BigDecimal) Creates a BigRational from the given num. Instance Method Summary #*(other : BigRational) : BigRational #*(other : Int) : BigRational #**(other : Int) : BigRational Raises the rational to the otherth power #+(other : BigRational) : BigRational #+(other : Int) : BigRational #-(other : BigRational) : BigRational #-(other : Int) : BigRational #- : BigRational #/(other : BigRational) : BigRational #/(other : BigInt) : BigRational #/(other : BigFloat) : BigRational #/(other : BigDecimal) : BigRational #/(other : Int8) : BigRational #/(other : UInt8) : BigRational #/(other : Int16) : BigRational #/(other : UInt16) : BigRational #/(other : Int32) : BigRational #/(other : UInt32) : BigRational #/(other : Int64) : BigRational #/(other : UInt64) : BigRational #/(other : Int128) : BigRational #/(other : UInt128) : BigRational #/(other : Float32) : BigRational #/(other : Float64) : BigRational #<<(other : Int) : BigRational Multiplies the rational by (2 ** other) #<=>(other : BigRational) #<=>(other : Float32 | Float64) #<=>(other : Float) #<=>(other : Int) #<=>(other : BigDecimal) The comparison operator. #>>(other : Int) : BigRational Divides the rational by (2 ** other) #abs : BigRational Returns the absolute value of this number. #ceil : BigRational #clone #denominator : BigInt #floor : BigRational #hash(hasher) TODO improve this #inspect(io : IO) : Nil Appends a string representation of this object to the given IO object. #inspect : String Returns a String representation of this object suitable to be embedded inside other expressions, sometimes providing more information about this object. #inv : BigRational Returns a new BigRational as 1/r. #numerator : BigInt #to_big_d : BigDecimal Converts self to BigDecimal. #to_big_f : BigFloat #to_big_i : BigInt #to_big_r : BigRational Returns self. #to_f : Float64 Returns the Float64 representing this rational. #to_f! : Float64 #to_f32 : Float32 #to_f32! : Float32 #to_f64 : Float64 #to_f64! : Float64 #to_i16(*args, **options) #to_i16(*args, **options, &) #to_i32(*args, **options) #to_i32(*args, **options, &) #to_i64(*args, **options) #to_i64(*args, **options, &) #to_i8(*args, **options) #to_i8(*args, **options, &) #to_s(base : Int = 10) : String Returns the string representing this rational. #to_s(io : IO, base : Int = 10) : Nil Appends a String representation of this object to the given IO object. #to_u16(*args, **options) #to_u16(*args, **options, &) #to_u32(*args, **options) #to_u32(*args, **options, &) #to_u64(*args, **options) #to_u64(*args, **options, &) #to_u8(*args, **options) #to_u8(*args, **options, &) #to_unsafe #trunc : BigRational Instance methods inherited from module Comparable(BigDecimal)
<(other : T) : Bool <, <=(other : T) <=, <=>(other : T) <=>, ==(other : T) ==, >(other : T) : Bool >, >=(other : T) >=, clamp(min, max)clamp(range : Range) clamp Instance methods inherited from module Comparable(Float)
<(other : T) : Bool <, <=(other : T) <=, <=>(other : T) <=>, ==(other : T) ==, >(other : T) : Bool >, >=(other : T) >=, clamp(min, max)clamp(range : Range) clamp Instance methods inherited from module Comparable(Int)
<(other : T) : Bool <, <=(other : T) <=, <=>(other : T) <=>, ==(other : T) ==, >(other : T) : Bool >, >=(other : T) >=, clamp(min, max)clamp(range : Range) clamp Instance methods inherited from module Comparable(BigRational)
<(other : T) : Bool <, <=(other : T) <=, <=>(other : T) <=>, ==(other : T) ==, >(other : T) : Bool >, >=(other : T) >=, clamp(min, max)clamp(range : Range) clamp Instance methods inherited from struct Number
*(other : BigFloat) : BigFloat*(other : Complex) : Complex *, +(other : BigFloat)+(other : Complex) : Complex+ +, -(other : BigFloat)-(other : Complex) : Complex -, /(other : BigFloat) : BigFloat/(other : Complex) : Complex /, //(other) //, <=>(other : BigFloat)<=>(other) : Int32? <=>, ==(other : Complex) ==, abs : self abs, abs2 abs2, cis : Complex cis, divmod(number) divmod, format(io : IO, separator = '.', delimiter = ',', decimal_places : Int? = nil, *, group : Int = 3, only_significant : Bool = false) : Nilformat(separator = '.', delimiter = ',', decimal_places : Int? = nil, *, group : Int = 3, only_significant : Bool = false) : String format, humanize(io : IO, precision = 3, separator = '.', delimiter = ',', *, base = 10 ** 3, significant = true, prefixes : Indexable = SI_PREFIXES) : Nilhumanize(io : IO, precision = 3, separator = '.', delimiter = ',', *, base = 10 ** 3, significant = true, prefixes : Proc) : Nilhumanize(precision = 3, separator = '.', delimiter = ',', *, base = 10 ** 3, significant = true, prefixes = SI_PREFIXES) : Stringhumanize(io : IO, precision = 3, separator = '.', delimiter = ',', *, base = 10 ** 3, significant = true, &prefixes : Int32, Float64 -> Tuple(Int32, _) | Tuple(Int32, _, Bool)) : Nilhumanize(precision = 3, separator = '.', delimiter = ',', *, base = 10 ** 3, significant = true, &) : Stringhumanize(precision = 3, separator = '.', delimiter = ',', *, base = 10 ** 3, significant = true, prefixes : Proc) : String humanize, i : Complex i, negative? : Bool negative?, positive? : Bool positive?, round(mode : RoundingMode = :ties_even) : selfround(digits : Number, base = 10, *, mode : RoundingMode = :ties_even) round, sign : Int32 sign, significant(digits, base = 10) significant, step(*, to limit = nil, exclusive : Bool = false, &) : Nilstep(*, to limit = nil, exclusive : Bool = false) step, to_big_f : BigFloat to_big_f, to_c : Complex to_c, to_yaml(yaml : YAML8b7c:f320:99b9:690f:4595:cd17:293a:c069Nodes8b7c:f320:99b9:690f:4595:cd17:293a:c069uilder) : Nil to_yaml, zero? : Bool zero? Constructor methods inherited from struct Number
additive_identity : self additive_identity, multiplicative_identity : self multiplicative_identity, zero : self zero Class methods inherited from struct Number
si_prefix(magnitude : Int, prefixes = SI_PREFIXES) : Char? si_prefix Instance methods inherited from module Comparable(BigFloat)
<(other : T) : Bool <, <=(other : T) <=, <=>(other : T) <=>, ==(other : T) ==, >(other : T) : Bool >, >=(other : T) >=, clamp(min, max)clamp(range : Range) clamp Instance methods inherited from module Steppable
step(*, to limit = nil, by step, exclusive : Bool = false, &) : Nilstep(*, to limit = nil, by step, exclusive : Bool = false) step Instance methods inherited from module Comparable(Number)
<(other : T) : Bool <, <=(other : T) <=, <=>(other : T) <=>, ==(other : T) ==, >(other : T) : Bool >, >=(other : T) >=, clamp(min, max)clamp(range : Range) clamp Instance methods inherited from struct Value
==(other : JSON8b7c:f320:99b9:690f:4595:cd17:293a:c069ny)==(other : YAML8b7c:f320:99b9:690f:4595:cd17:293a:c069ny)==(other) ==, dup dup Instance methods inherited from class Object
! : Bool !, !=(other) !=, !~(other) !~, ==(other) ==, ===(other : JSON8b7c:f320:99b9:690f:4595:cd17:293a:c069ny)===(other : YAML8b7c:f320:99b9:690f:4595:cd17:293a:c069ny)===(other) ===, =~(other) =~, as(type : Class) as, as?(type : Class) as?, class class, dup dup, hash(hasher)hash hash, in?(collection : Object) : Boolin?(*values : Object) : Bool in?, inspect(io : IO) : Nilinspect : String inspect, is_a?(type : Class) : Bool is_a?, itself itself, nil? : Bool nil?, not_nil! not_nil!, pretty_inspect(width = 79, newline = "\n", indent = 0) : String pretty_inspect, pretty_print(pp : PrettyPrint) : Nil pretty_print, responds_to?(name : Symbol) : Bool responds_to?, tap(&) tap, to_json(io : IO) : Nilto_json : String to_json, to_pretty_json(indent : String = " ") : Stringto_pretty_json(io : IO, indent : String = " ") : Nil to_pretty_json, to_s(io : IO) : Nilto_s : String to_s, to_yaml(io : IO) : Nilto_yaml : String to_yaml, try(&) try, unsafe_as(type : T.class) forall T unsafe_as Class methods inherited from class Object
from_json(string_or_io, root : String)from_json(string_or_io) from_json, from_yaml(string_or_io : String | IO) from_yaml Constructor Detail def self.new(numerator : Int, denominator : Int)Source
Creates a new BigRational. If denominator is 0, this will raise an exception. def self.new(num : Int)Source
Creates a new BigRational with num as the numerator and 1 for denominator. def self.new(num : Float)Source
Creates a exact representation of float as rational. def self.new(num : BigRational)Source
Creates a BigRational from the given num. def self.new(num : BigDecimal)Source
Creates a BigRational from the given num. Instance Method Detail def *(other : BigRational) : BigRationalSource
def *(other : Int) : BigRationalSource
def **(other : Int) : BigRationalSource
Raises the rational to the otherth power This will raise DivisionByZeroError if rational is 0 and other is negative. require "big"
BigRational.new(2, 3) ** 2 # => 4/9
BigRational.new(2, 3) ** -1 # => 3/2 def +(other : BigRational) : BigRationalSource
def +(other : Int) : BigRationalSource
def -(other : BigRational) : BigRationalSource
def -(other : Int) : BigRationalSource
def - : BigRationalSource
def /(other : BigRational) : BigRationalSource
def /(other : BigInt) : BigRationalSource
def /(other : BigFloat) : BigRationalSource
def /(other : BigDecimal) : BigRationalSource
def /(other : Int8) : BigRationalSource
def /(other : UInt8) : BigRationalSource
def /(other : Int16) : BigRationalSource
def /(other : UInt16) : BigRationalSource
def /(other : Int32) : BigRationalSource
def /(other : UInt32) : BigRationalSource
def /(other : Int64) : BigRationalSource
def /(other : UInt64) : BigRationalSource
def /(other : Int128) : BigRationalSource
def /(other : UInt128) : BigRationalSource
def /(other : Float32) : BigRationalSource
def /(other : Float64) : BigRationalSource
def <<(other : Int) : BigRationalSource
Multiplies the rational by (2 ** other) require "big"
BigRational.new(2, 3) << 2 # => 8/3 def <=>(other : BigRational)Source
def <=>(other : Float32 | Float64)Source
def <=>(other : Float)Source
def <=>(other : Int)Source
def <=>(other : BigDecimal)Source
Description copied from module Comparable(BigDecimal) The comparison operator. Returns 0 if the two objects are equal, a negative number if this object is considered less than other, a positive number if this object is considered greater than other, or nil if the two objects are not comparable. Subclasses define this method to provide class-specific ordering. The comparison operator is usually used to sort values: # Sort in a descending way:
[3, 1, 2].sort { |x, y| y <=> x } # => [3, 2, 1]
# Sort in an ascending way:
[3, 1, 2].sort { |x, y| x <=> y } # => [1, 2, 3] def >>(other : Int) : BigRationalSource
Divides the rational by (2 ** other) require "big"
BigRational.new(2, 3) >> 2 # => 1/6 def abs : BigRationalSource
Description copied from struct Number Returns the absolute value of this number. 123.abs # => 123
-123.abs # => 123 def ceil : BigRationalSource
def cloneSource
def denominator : BigIntSource
def floor : BigRationalSource
def hash(hasher)Source
TODO improve this def inspect(io : IO) : NilSource
Description copied from class Object Appends a string representation of this object to the given IO object. Similar to #to_s(io), but usually appends more information about this object. See #inspect. def inspect : StringSource
Description copied from class Object Returns a String representation of this object suitable to be embedded inside other expressions, sometimes providing more information about this object. #inspect (and #inspect(io)) are the methods used when you invoke #to_s or #inspect on an object that holds other objects and wants to show them. For example when you invoke Array#to_s, #inspect will be invoked on each element: ary = ["one", "two", "three, etc."]
ary.inspect # => ["one", "two", "three, etc."] Note that if Array invoked #to_s on each of the elements above, the output would have been this: ary = ["one", "two", "three, etc."]
# If inspect invoked to_s on each element...
ary.inspect # => [one, two, three, etc.] Note that it's not clear how many elements the array has, or which are they, because #to_s doesn't guarantee that the string representation is clearly delimited (in the case of String the quotes are not shown). Also note that sometimes the output of #inspect will look like a Crystal expression that will compile, but this isn't always the case, nor is it necessary. Notably, Reference#inspect and Struct#inspect return values that don't compile. Classes must usually not override this method. Instead, they must override #inspect(io), which must append to the given IO object. def inv : BigRationalSource
Returns a new BigRational as 1/r. This will raise an exception if rational is 0. def numerator : BigIntSource
def to_big_d : BigDecimalSource
Converts self to BigDecimal. def to_big_f : BigFloatSource
def to_big_i : BigIntSource
def to_big_r : BigRationalSource
Returns self. require "big"
BigRational.new(4, 5).to_big_r # => 4/5 def to_f : Float64Source
Returns the Float64 representing this rational. def to_f! : Float64Source
def to_f32 : Float32Source
def to_f32! : Float32Source
def to_f64 : Float64Source
def to_f64! : Float64Source
def to_i16(*args, **options)Source
def to_i16(*args, **options, &)Source
def to_i32(*args, **options)Source
def to_i32(*args, **options, &)Source
def to_i64(*args, **options)Source
def to_i64(*args, **options, &)Source
def to_i8(*args, **options)Source
def to_i8(*args, **options, &)Source
def to_s(base : Int = 10) : StringSource
Returns the string representing this rational. Optionally takes a radix base (2 through 36). require "big"
r = BigRational.new(8243243, 562828882)
r.to_s # => "8243243/562828882"
r.to_s(16) # => "7dc82b/218c1652"
r.to_s(36) # => "4woiz/9b3djm" def to_s(io : IO, base : Int = 10) : NilSource
Description copied from class Object Appends a String representation of this object to the given IO object. An object must never append itself to the io argument, as this will in turn call #to_s(io) on it. def to_u16(*args, **options)Source
def to_u16(*args, **options, &)Source
def to_u32(*args, **options)Source
def to_u32(*args, **options, &)Source
def to_u64(*args, **options)Source
def to_u64(*args, **options, &)Source
def to_u8(*args, **options)Source
def to_u8(*args, **options, &)Source
def to_unsafeSource
def trunc : BigRationalSource
|
function node_content_form node_content_form($node, $form_state) Implements hook_form(). Related topics Hook implementations for user-created content types Functions that implement hooks for user-created content types. File
modules/node/node.module, line 3750 The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern. Code function node_content_form($node, $form_state) {
// It is impossible to define a content type without implementing hook_form()
// @todo: remove this requirement.
$form = array();
$type = node_type_get_type($node);
if ($type->has_title) {
$form['title'] = array(
'#type' => 'textfield',
'#title' => check_plain($type->title_label),
'#required' => TRUE,
'#default_value' => $node->title,
'#maxlength' => 255,
'#weight' => -5,
);
}
return $form;
}
|
Interface ResourceBundleProvider All Known Implementing Classes: AbstractResourceBundleProvider public interface ResourceBundleProvider
ResourceBundleProvider is a service provider interface for resource bundles. It is used by ResourceBundle.getBundle factory methods to locate and load the service providers that are deployed as modules via ServiceLoader. Developing resource bundle services A service for a resource bundle of a given baseName must have a fully-qualified class name of the form: <package of baseName> + ".spi." + <simple name of baseName> + "Provider" The service type is in a spi subpackage as it may be packaged in a module separate from the resource bundle providers. For example, the service for a resource bundle named com.example.app.MyResources must be com.example.app.spi.MyResourcesProvider:
package com.example.app.spi;
public interface MyResourcesProvider extends ResourceBundleProvider {
}
Deploying resource bundle service providers Resource bundles can be deployed in one or more service providers in modules. For example, a provider for a service named "com.example.app.spi.MyResourcesProvider" has the following implementation class:
import com.example.app.spi.MyResourcesProvider;
class MyResourcesProviderImpl extends AbstractResourceBundleProvider
implements MyResourcesProvider
{
public MyResourcesProviderImpl() {
super("java.properties");
}
// this provider maps the resource bundle to per-language package
protected String toBundleName(String baseName, Locale locale) {
return "p." + locale.getLanguage() + "." + baseName;
}
public ResourceBundle getBundle(String baseName, Locale locale) {
// this module only provides bundles in French
if (locale.equals(Locale.FRENCH)) {
return super.getBundle(baseName, locale);
}
// otherwise return null
return null;
}
} This example provides "com.example.app.MyResources" resource bundle of the French locale. Traditionally resource bundles of all locales are packaged in the same package as the resource bundle base name. When deploying resource bundles in more than one modules and two modules containing a package of the same name, split package, is not supported, resource bundles in each module can be packaged in a different package as shown in this example where this provider packages the resource bundles in per-language package, i.e. com.example.app.fr for French locale. A provider can provide more than one services, each of which is a service for a resource bundle of a different base name.
AbstractResourceBundleProvider provides the basic implementation for ResourceBundleProvider and a subclass can override the toBundleName method to return a provider-specific location of the resource to be loaded, for example, per-language package. A provider can override ResourceBundleProvider.getBundle method for example to only search the known supported locales or return resource bundles in other formats such as XML.
The module declaration of this provider module specifies the following directive:
provides com.example.app.spi.MyResourcesProvider with com.example.impl.MyResourcesProviderImpl;
Obtaining resource bundles from providers The module declaration of the consumer module that calls one of the ResourceBundle.getBundle factory methods to obtain a resource bundle from service providers must specify the following directive:
uses com.example.app.spi.MyResourcesProvider;
ResourceBundle.getBundle("com.example.app.MyResource", locale) locates and loads the providers for com.example.app.spi.MyResourcesProvider service and then invokes ResourceBundleProvider.getBundle("com.example.app.MyResource", locale) to find the resource bundle of the given base name and locale. If the consumer module is a resource bundle service provider for com.example.app.spi.MyResourcesProvider, ResourceBundle.getBundle will locate resource bundles only from service providers. Otherwise, ResourceBundle.getBundle may continue the search of the resource bundle in other modules and class path per the specification of the ResourceBundle.getBundle method being called. Since: 9 See Also: AbstractResourceBundleProvider Resource Bundles and Named Modules ServiceLoader Method Summary
Modifier and Type
Method
Description
ResourceBundle
getBundle(String baseName,
Locale locale)
Returns a ResourceBundle for the given bundle name and locale.
Method Details getBundle ResourceBundle getBundle(String baseName, Locale locale) Returns a ResourceBundle for the given bundle name and locale. This method returns null if there is no ResourceBundle found for the given parameters. Parameters:
baseName - the base bundle name of the resource bundle, a fully qualified class name
locale - the locale for which the resource bundle should be loaded Returns: the ResourceBundle created for the given parameters, or null if no ResourceBundle for the given parameters is found
|
Symfony\Component\Form\Util Classes FormUtil InheritDataAwareIterator Iterator that traverses an array of forms. OptionsResolverWrapper OrderedHashMap A hash map which keeps track of deletions and additions. OrderedHashMapIterator Iterator for {@link OrderedHashMap} objects. ServerParams StringUtil
|
logLik.lme Log-Likelihood of an lme Object Description If REML=FALSE, returns the log-likelihood value of the linear mixed-effects model represented by object evaluated at the estimated coefficients; else, the restricted log-likelihood evaluated at the estimated coefficients is returned. Usage
## S3 method for class 'lme'
logLik(object, REML, ...)
Arguments
object an object inheriting from class "lme", representing a fitted linear mixed-effects model.
REML an optional logical value. If TRUE the restricted log-likelihood is returned, else, if FALSE, the log-likelihood is returned. Defaults to the method of estimation used, that is TRUE if and only object was fitted with method =
"REML" (the default for these fitting functions) .
... some methods for this generic require additional arguments. None are used in this method.
Value the (restricted) log-likelihood of the model represented by object evaluated at the estimated coefficients. Author(s) José Pinheiro and Douglas Bates References Harville, D.A. (1974) “Bayesian Inference for Variance Components Using Only Error Contrasts”, Biometrika, 61, 383–385. Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. See Also lme,gls, logLik.corStruct, logLik.glsStruct, logLik.lmeStruct, logLik.lmList, logLik.reStruct, logLik.varFunc, Examples
fm1 <- lme(distance ~ Sex * age, Orthodont, random = ~ age, method = "ML")
logLik(fm1)
logLik(fm1, REML = TRUE)
Copyright (
|
RemoveEmptyControllerArgumentLocatorsPass class RemoveEmptyControllerArgumentLocatorsPass implements CompilerPassInterface Removes empty service-locators registered for ServiceValueResolver. Methods __construct($resolverServiceId = 'argument_resolver.service')
process(ContainerBuilder $container) You can modify the container here before it is dumped to PHP code.
Details
__construct($resolverServiceId = 'argument_resolver.service')
Parameters $resolverServiceId
process(ContainerBuilder $container)
You can modify the container here before it is dumped to PHP code. Parameters ContainerBuilder $container
|
Class scala.collection.mutable.HashSet
Companion object • Source code
final class HashSet[A](initialCapacity: Int, loadFactor: Double) extends AbstractSet[A] with SetOps[A, HashSet, HashSet[A]] with StrictOptimizedIterableOps[A, HashSet, HashSet[A]] with IterableFactoryDefaults[A, HashSet] with Serializable
This class implements mutable sets using a hashtable.
See also
"Scala's Collection Library overview" section on Hash Tables for more information.
Supertypes
26 types
trait Serializable
trait StrictOptimizedIterableOps[A, HashSet, HashSet[A]]
class AbstractSet[A]
trait Set[A]
trait SetOps[A, HashSet, HashSet[A]]
trait Shrinkable[A]
trait Builder[A, HashSet[A]]
trait Growable[A]
trait Clearable
trait Cloneable[HashSet[A]]
trait Cloneable
trait Iterable[A]
class AbstractSet[A]
trait Set[A]
trait Equals
trait SetOps[A, HashSet, HashSet[A]]
trait A => Boolean
class AbstractIterable[A]
trait Iterable[A]
trait IterableFactoryDefaults[A, HashSet]
trait IterableOps[A, HashSet, HashSet[A]]
trait IterableOnceOps[A, HashSet, HashSet[A]]
trait IterableOnce[A]
class Object
trait Matchable
class Any
Constructors
Source
def this()
Concrete methods
Source
override def add(elem: A): Boolean
Definition Classes
SetOps
Source
override def addAll(xs: IterableOnce[A]): HashSet[A]
Definition Classes
Growable
Source@inline
def addOne(elem: A): HashSet[A]
Source
def clear(): Unit
Source
override def contains(elem: A): Boolean
Definition Classes
SetOps
Source
override def filterInPlace(p: A => Boolean): HashSet[A]
Definition Classes
SetOps
Source
override def foreach[U](f: A => U): Unit
Definition Classes
IterableOnceOps
Source
override def hashCode: Int
Definition Classes
Set -> Any
Source
override def isEmpty: Boolean
Definition Classes
IterableOnceOps
Source
override def iterableFactory: IterableFactory[HashSet]
Definition Classes
Set -> Iterable -> Set -> Iterable -> IterableOps
Source
override def iterator: Iterator[A]
Definition Classes
IterableOnce
Source
override def knownSize: Int
Definition Classes
SetOps -> Growable -> IterableOnce
Source
override def remove(elem: A): Boolean
Definition Classes
SetOps
Source
override def size: Int
Definition Classes
IterableOnceOps
Source
override def sizeHint(size: Int): Unit
Definition Classes
Builder
Source
override def stepper[S <: Stepper[_]](implicit shape: StepperShape[A, S]): S & EfficientSplit
Definition Classes
IterableOnce
Source
override def subtractAll(xs: IterableOnce[A]): HashSet[A]
Definition Classes
Shrinkable
Source@inline
def subtractOne(elem: A): HashSet[A]
Inherited methods
Source@inline
final def &(that: Set[A]): HashSet[A]
Alias for intersect
Inherited from
SetOps
Source@inline
final def &~(that: Set[A]): HashSet[A]
Alias for diff
Inherited from
SetOps
Source@inline
final def ++[B >: A](suffix: IterableOnce[B]): HashSet[B]
Alias for concat
Inherited from
IterableOps
Source@inline
final def ++(that: IterableOnce[A]): HashSet[A]
Alias for concat
Inherited from
SetOps
Source@inline
final def ++=(xs: IterableOnce[A]): HashSet[A]
Alias for addAll
Inherited from
Growable
Source@inline
final def +=(elem: A): HashSet[A]
Alias for addOne
Inherited from
Growable
Source@inline
final def --=(xs: IterableOnce[A]): HashSet[A]
Alias for subtractAll
Inherited from
Shrinkable
Source@inline
final def -=(elem: A): HashSet[A]
Alias for subtractOne
Inherited from
Shrinkable
Source@inline
final def addString(b: StringBuilder): StringBuilder
Appends all elements of this collection to a string builder. The written text consists of the string representations (w.r.t. the method toString) of all elements of this collection without any separator string.
Example:
scala> val a = List(1,2,3,4)
a: List[Int] = List(1, 2, 3, 4)
scala> val b = new StringBuilder()
b: StringBuilder =
scala> val h = a.addString(b)
h: StringBuilder = 1234
Value parameters
b
the string builder to which elements are appended.
Returns
the string builder b to which elements were appended.
Inherited from
IterableOnceOps
Source@inline
final def addString(b: StringBuilder, sep: String): StringBuilder
Appends all elements of this collection to a string builder using a separator string. The written text consists of the string representations (w.r.t. the method toString) of all elements of this collection, separated by the string sep.
Example:
scala> val a = List(1,2,3,4)
a: List[Int] = List(1, 2, 3, 4)
scala> val b = new StringBuilder()
b: StringBuilder =
scala> a.addString(b, ", ")
res0: StringBuilder = 1, 2, 3, 4
Value parameters
b
the string builder to which elements are appended.
sep
the separator string.
Returns
the string builder b to which elements were appended.
Inherited from
IterableOnceOps
Source
def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder
Appends all elements of this collection to a string builder using start, end, and separator strings. The written text begins with the string start and ends with the string end. Inside, the string representations (w.r.t. the method toString) of all elements of this collection are separated by the string sep.
Example:
scala> val a = List(1,2,3,4)
a: List[Int] = List(1, 2, 3, 4)
scala> val b = new StringBuilder()
b: StringBuilder =
scala> a.addString(b , "List(" , ", " , ")")
res5: StringBuilder = List(1, 2, 3, 4)
Value parameters
b
the string builder to which elements are appended.
end
the ending string.
sep
the separator string.
start
the starting string.
Returns
the string builder b to which elements were appended.
Inherited from
IterableOnceOps
Source@unspecialized
def andThen[A](g: Boolean => A): A => A
Composes two instances of Function1 in a new Function1, with this function applied first.
Type parameters
A
the result type of function g
Value parameters
g
a function R => A
Returns
a new function f such that f(x) == g(apply(x))
Inherited from
Function1
Source@inline
final def apply(elem: A): Boolean
Tests if some element is contained in this set.
This method is equivalent to contains. It allows sets to be interpreted as predicates.
Value parameters
elem
the element to test for membership.
Returns
true if elem is contained in this set, false otherwise.
Inherited from
SetOps
Source
def canEqual(that: Any): Boolean
Inherited from
Set
Source
override def clone(): HashSet[A]
Definition Classes
SetOps -> Cloneable -> Object
Inherited from
SetOps
Source
override def collect[B](pf: PartialFunction[A, B]): HashSet[B]
Definition Classes
StrictOptimizedIterableOps -> IterableOps -> IterableOnceOps
Inherited from
StrictOptimizedIterableOps
Source
def collectFirst[B](pf: PartialFunction[A, B]): Option[B]
Finds the first element of the collection for which the given partial function is defined, and applies the partial function to it.
Note: may not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered.
Value parameters
pf
the partial function
Returns
an option value containing pf applied to the first value for which it is defined, or None if none exists.
Example
Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)
Inherited from
IterableOnceOps
Source@unspecialized
def compose[A](g: A => A): A => Boolean
Composes two instances of Function1 in a new Function1, with this function applied last.
Type parameters
A
the type to which function g can be applied
Value parameters
g
a function A => T1
Returns
a new function f such that f(x) == apply(g(x))
Inherited from
Function1
Source
def concat[B >: A](suffix: IterableOnce[B]): HashSet[B]
Returns a new iterable collection containing the elements from the left hand operand followed by the elements from the right hand operand. The element type of the iterable collection is the most specific superclass encompassing the element types of the two operands.
Type parameters
B
the element type of the returned collection.
Value parameters
suffix
the traversable to append.
Returns
a new iterable collection which contains all elements of this iterable collection followed by all elements of suffix.
Inherited from
IterableOps
Source
def concat(that: IterableOnce[A]): HashSet[A]
Creates a new set by adding all elements contained in another collection to this set, omitting duplicates.
This method takes a collection of elements and adds all elements, omitting duplicates, into set.
Example:
scala> val a = Set(1, 2) concat Set(2, 3)
a: scala.collection.immutable.Set[Int] = Set(1, 2, 3)
Value parameters
that
the collection containing the elements to add.
Returns
a new set with the given elements added, omitting duplicates.
Inherited from
SetOps
Source
def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Int
Copy elements to an array, returning the number of elements written.
Fills the given array xs starting at index start with at most len elements of this collection.
Copying will stop once either all the elements of this collection have been copied, or the end of the array is reached, or len elements have been copied.
Type parameters
B
the type of the elements of the array.
Value parameters
len
the maximal number of elements to copy.
start
the starting index of xs.
xs
the array to fill.
Returns
the number of elements written to the array
Note
Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.
Inherited from
IterableOnceOps
Source@deprecatedOverriding("This should always forward to the 3-arg version of this method", since = "2.13.4")
def copyToArray[B >: A](xs: Array[B], start: Int): Int
Copy elements to an array, returning the number of elements written.
Fills the given array xs starting at index start with values of this collection.
Copying will stop once either all the elements of this collection have been copied, or the end of the array is reached.
Type parameters
B
the type of the elements of the array.
Value parameters
start
the starting index of xs.
xs
the array to fill.
Returns
the number of elements written to the array
Note
Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.
Inherited from
IterableOnceOps
Source@deprecatedOverriding("This should always forward to the 3-arg version of this method", since = "2.13.4")
def copyToArray[B >: A](xs: Array[B]): Int
Copy elements to an array, returning the number of elements written.
Fills the given array xs starting at index start with values of this collection.
Copying will stop once either all the elements of this collection have been copied, or the end of the array is reached.
Type parameters
B
the type of the elements of the array.
Value parameters
xs
the array to fill.
Returns
the number of elements written to the array
Note
Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.
Inherited from
IterableOnceOps
Source
def corresponds[B](that: IterableOnce[B])(p: (A, B) => Boolean): Boolean
Tests whether every element of this collection's iterator relates to the corresponding element of another collection by satisfying a test predicate.
Note: will not terminate for infinite-sized collections.
Type parameters
B
the type of the elements of that
Value parameters
p
the test predicate, which relates elements from both collections
that
the other collection
Returns
true if both collections have the same length and p(x, y) is true for all corresponding elements x of this iterator and y of that, otherwise false
Inherited from
IterableOnceOps
Source
def count(p: A => Boolean): Int
Counts the number of elements in the collection which satisfy a predicate.
Note: will not terminate for infinite-sized collections.
Value parameters
p
the predicate used to test elements.
Returns
the number of elements satisfying the predicate p.
Inherited from
IterableOnceOps
Source
def diff(that: Set[A]): HashSet[A]
Inherited from
SetOps
Source
def drop(n: Int): HashSet[A]
Inherited from
IterableOps
Source
override def dropRight(n: Int): HashSet[A]
The rest of the collection without its n last elements. For linear, immutable collections this should avoid making a copy.
Note: Even when applied to a view or a lazy collection it will always force the elements.
Definition Classes
StrictOptimizedIterableOps -> IterableOps
Inherited from
StrictOptimizedIterableOps
Source
def dropWhile(p: A => Boolean): HashSet[A]
Inherited from
IterableOps
Source
override def empty: HashSet[A]
Definition Classes
IterableFactoryDefaults -> IterableOps
Inherited from
IterableFactoryDefaults
Source
override def equals(that: Any): Boolean
Equality of sets is implemented using the lookup method contains. This method returns true if
the argument that is a Set,
the two sets have the same size, and
for every element this set, other.contains(element) == true.
The implementation of equals checks the canEqual method, so subclasses of Set can narrow down the equality to specific set types. The Set implementations in the standard library can all be compared, their canEqual methods return true.
Note: The equals method only respects the equality laws (symmetry, transitivity) if the two sets use the same element equivalence function in their lookup operation. For example, the element equivalence operation in a scala.collection.immutable.TreeSet is defined by its ordering. Comparing a TreeSet with a HashSet leads to unexpected results if ordering.equiv(e1, e2) (used for lookup in TreeSet) is different from e1 == e2 (used for lookup in HashSet).
scala> import scala.collection.immutable._
scala> val ord: Ordering[String] = _ compareToIgnoreCase _
scala> TreeSet("A")(ord) == HashSet("a")
val res0: Boolean = false
scala> HashSet("a") == TreeSet("A")(ord)
val res1: Boolean = true
Value parameters
that
The set to which this set is compared
Returns
true if the two sets are equal according to the description
Definition Classes
Set -> Equals -> Any
Inherited from
Set
Source
def exists(p: A => Boolean): Boolean
Tests whether a predicate holds for at least one element of this collection.
Note: may not terminate for infinite-sized collections.
Value parameters
p
the predicate used to test elements.
Returns
true if the given predicate p is satisfied by at least one element of this collection, otherwise false
Inherited from
IterableOnceOps
Source
override def filter(pred: A => Boolean): HashSet[A]
Definition Classes
StrictOptimizedIterableOps -> IterableOps -> IterableOnceOps
Inherited from
StrictOptimizedIterableOps
Source
override def filterNot(pred: A => Boolean): HashSet[A]
Definition Classes
StrictOptimizedIterableOps -> IterableOps -> IterableOnceOps
Inherited from
StrictOptimizedIterableOps
Source
def find(p: A => Boolean): Option[A]
Finds the first element of the collection satisfying a predicate, if any.
Note: may not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered.
Value parameters
p
the predicate used to test elements.
Returns
an option value containing the first element in the collection that satisfies p, or None if none exists.
Inherited from
IterableOnceOps
Source
override def flatMap[B](f: A => IterableOnce[B]): HashSet[B]
Definition Classes
StrictOptimizedIterableOps -> IterableOps -> IterableOnceOps
Inherited from
StrictOptimizedIterableOps
Source
override def flatten[B](implicit toIterableOnce: A => IterableOnce[B]): HashSet[B]
Definition Classes
StrictOptimizedIterableOps -> IterableOps -> IterableOnceOps
Inherited from
StrictOptimizedIterableOps
Source
def fold[A1 >: A](z: A1)(op: (A1, A1) => A1): A1
Folds the elements of this collection using the specified associative binary operator. The default implementation in IterableOnce is equivalent to foldLeft but may be overridden for more efficient traversal orders.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
Note: will not terminate for infinite-sized collections.
Type parameters
A1
a type parameter for the binary operator, a supertype of A.
Value parameters
op
a binary operator that must be associative.
z
a neutral element for the fold operation; may be added to the result an arbitrary number of times, and must not change the result (e.g., Nil for list concatenation, 0 for addition, or 1 for multiplication).
Returns
the result of applying the fold operator op between all the elements and z, or z if this collection is empty.
Inherited from
IterableOnceOps
Source
def foldLeft[B](z: B)(op: (B, A) => B): B
Applies a binary operator to a start value and all elements of this collection, going left to right.
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
Type parameters
B
the result type of the binary operator.
Value parameters
op
the binary operator.
z
the start value.
Returns
the result of inserting op between consecutive elements of this collection, going left to right with the start value z on the left: op(...op(z, x1), x2, ..., xn) where x1, ..., xn are the elements of this collection. Returns z if this collection is empty.
Inherited from
IterableOnceOps
Source
def foldRight[B](z: B)(op: (A, B) => B): B
Applies a binary operator to all elements of this collection and a start value, going right to left.
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
Type parameters
B
the result type of the binary operator.
Value parameters
op
the binary operator.
z
the start value.
Returns
the result of inserting op between consecutive elements of this collection, going right to left with the start value z on the right: op(x1, op(x2, ... op(xn, z)...)) where x1, ..., xn are the elements of this collection. Returns z if this collection is empty.
Inherited from
IterableOnceOps
Source
def forall(p: A => Boolean): Boolean
Tests whether a predicate holds for all elements of this collection.
Note: may not terminate for infinite-sized collections.
Value parameters
p
the predicate used to test elements.
Returns
true if this collection is empty or the given predicate p holds for all elements of this collection, otherwise false.
Inherited from
IterableOnceOps
Source
protected def fromSpecific(coll: IterableOnce[A]): HashSet[A]
Inherited from
IterableFactoryDefaults
Source
def groupBy[K](f: A => K): Map[K, HashSet[A]]
Partitions this iterable collection into a map of iterable collections according to some discriminator function.
Note: Even when applied to a view or a lazy collection it will always force the elements.
Type parameters
K
the type of keys returned by the discriminator function.
Value parameters
f
the discriminator function.
Returns
A map from keys to iterable collections such that the following invariant holds:
(xs groupBy f)(k) = xs filter (x => f(x) == k)
That is, every key k is bound to a iterable collection of those elements x for which f(x) equals k.
Inherited from
IterableOps
Source
def groupMap[K, B](key: A => K)(f: A => B): Map[K, HashSet[B]]
Partitions this iterable collection into a map of iterable collections according to a discriminator function key. Each element in a group is transformed into a value of type B using the value function.
It is equivalent to groupBy(key).mapValues(_.map(f)), but more efficient.
case class User(name: String, age: Int)
def namesByAge(users: Seq[User]): Map[Int, Seq[String]] =
users.groupMap(_.age)(_.name)
Note: Even when applied to a view or a lazy collection it will always force the elements.
Type parameters
B
the type of values returned by the transformation function
K
the type of keys returned by the discriminator function
Value parameters
f
the element transformation function
key
the discriminator function
Inherited from
IterableOps
Source
def groupMapReduce[K, B](key: A => K)(f: A => B)(reduce: (B, B) => B): Map[K, B]
Partitions this iterable collection into a map according to a discriminator function key. All the values that have the same discriminator are then transformed by the f function and then reduced into a single value with the reduce function.
It is equivalent to groupBy(key).mapValues(_.map(f).reduce(reduce)), but more efficient.
def occurrences[A](as: Seq[A]): Map[A, Int] =
as.groupMapReduce(identity)(_ => 1)(_ + _)
Note: Even when applied to a view or a lazy collection it will always force the elements.
Inherited from
IterableOps
Source
def grouped(size: Int): Iterator[HashSet[A]]
Partitions elements in fixed size iterable collections.
Value parameters
size
the number of elements per group
Returns
An iterator producing iterable collections of size size, except the last will be less than size size if the elements don't divide evenly.
See also
scala.collection.Iterator, method grouped
Inherited from
IterableOps
Source
def head: A
Selects the first element of this iterable collection.
Note: might return different results for different runs, unless the underlying collection type is ordered.
Returns
the first element of this iterable collection.
Throws
NoSuchElementException
if the iterable collection is empty.
Inherited from
IterableOps
Source
def headOption: Option[A]
Optionally selects the first element.
Note: might return different results for different runs, unless the underlying collection type is ordered.
Returns
the first element of this iterable collection if it is nonempty, None if it is empty.
Inherited from
IterableOps
Source
def init: HashSet[A]
The initial part of the collection without its last element.
Note: Even when applied to a view or a lazy collection it will always force the elements.
Inherited from
IterableOps
Source
def inits: Iterator[HashSet[A]]
Iterates over the inits of this iterable collection. The first value will be this iterable collection and the final one will be an empty iterable collection, with the intervening values the results of successive applications of init.
Note: Even when applied to a view or a lazy collection it will always force the elements.
Returns
an iterator over all the inits of this iterable collection
Example
List(1,2,3).inits = Iterator(List(1,2,3), List(1,2), List(1), Nil)
Inherited from
IterableOps
Source
def intersect(that: Set[A]): HashSet[A]
Computes the intersection between this set and another set.
Value parameters
that
the set to intersect with.
Returns
a new set consisting of all elements that are both in this set and in the given set that.
Inherited from
SetOps
Source
override def isTraversableAgain: Boolean
Definition Classes
IterableOps -> IterableOnceOps
Inherited from
IterableOps
Source
def last: A
Selects the last element.
Note: might return different results for different runs, unless the underlying collection type is ordered.
Returns
The last element of this iterable collection.
Throws
NoSuchElementException
If the iterable collection is empty.
Inherited from
IterableOps
Source
def lastOption: Option[A]
Optionally selects the last element.
Note: might return different results for different runs, unless the underlying collection type is ordered.
Returns
the last element of this iterable collection$ if it is nonempty, None if it is empty.
Inherited from
IterableOps
Source
def lazyZip[B](that: Iterable[B]): LazyZip2[A, B, HashSet[A]]
Analogous to zip except that the elements in each collection are not consumed until a strict operation is invoked on the returned LazyZip2 decorator.
Calls to lazyZip can be chained to support higher arities (up to 4) without incurring the expense of constructing and deconstructing intermediary tuples.
val xs = List(1, 2, 3)
val res = (xs lazyZip xs lazyZip xs lazyZip xs).map((a, b, c, d) => a + b + c + d)
// res == List(4, 8, 12)
Type parameters
B
the type of the second element in each eventual pair
Value parameters
that
the iterable providing the second element of each eventual pair
Returns
a decorator LazyZip2 that allows strict operations to be performed on the lazily evaluated pairs or chained calls to lazyZip. Implicit conversion to Iterable[(A, B)] is also supported.
Inherited from
Iterable
Source
override def map[B](f: A => B): HashSet[B]
Definition Classes
StrictOptimizedIterableOps -> IterableOps -> IterableOnceOps
Inherited from
StrictOptimizedIterableOps
Source
def mapResult[NewTo](f: HashSet[A] => NewTo): Builder[A, NewTo]
A builder resulting from this builder my mapping the result using f.
Inherited from
Builder
Source
def max[B >: A](implicit ord: Ordering[B]): A
Finds the largest element.
Note: will not terminate for infinite-sized collections.
Type parameters
B
The type over which the ordering is defined.
Value parameters
ord
An ordering to be used for comparing elements.
Returns
the largest element of this collection with respect to the ordering ord.
Throws
UnsupportedOperationException
if this collection is empty.
Inherited from
IterableOnceOps
Source
def maxBy[B](f: A => B)(implicit cmp: Ordering[B]): A
Finds the first element which yields the largest value measured by function f.
Note: will not terminate for infinite-sized collections.
Type parameters
B
The result type of the function f.
Value parameters
cmp
An ordering to be used for comparing elements.
f
The measuring function.
Returns
the first element of this collection with the largest value measured by function f with respect to the ordering cmp.
Throws
UnsupportedOperationException
if this collection is empty.
Inherited from
IterableOnceOps
Source
def maxByOption[B](f: A => B)(implicit cmp: Ordering[B]): Option[A]
Finds the first element which yields the largest value measured by function f.
Note: will not terminate for infinite-sized collections.
Type parameters
B
The result type of the function f.
Value parameters
cmp
An ordering to be used for comparing elements.
f
The measuring function.
Returns
an option value containing the first element of this collection with the largest value measured by function f with respect to the ordering cmp.
Inherited from
IterableOnceOps
Source
def maxOption[B >: A](implicit ord: Ordering[B]): Option[A]
Finds the largest element.
Note: will not terminate for infinite-sized collections.
Type parameters
B
The type over which the ordering is defined.
Value parameters
ord
An ordering to be used for comparing elements.
Returns
an option value containing the largest element of this collection with respect to the ordering ord.
Inherited from
IterableOnceOps
Source
def min[B >: A](implicit ord: Ordering[B]): A
Finds the smallest element.
Note: will not terminate for infinite-sized collections.
Type parameters
B
The type over which the ordering is defined.
Value parameters
ord
An ordering to be used for comparing elements.
Returns
the smallest element of this collection with respect to the ordering ord.
Throws
UnsupportedOperationException
if this collection is empty.
Inherited from
IterableOnceOps
Source
def minBy[B](f: A => B)(implicit cmp: Ordering[B]): A
Finds the first element which yields the smallest value measured by function f.
Note: will not terminate for infinite-sized collections.
Type parameters
B
The result type of the function f.
Value parameters
cmp
An ordering to be used for comparing elements.
f
The measuring function.
Returns
the first element of this collection with the smallest value measured by function f with respect to the ordering cmp.
Throws
UnsupportedOperationException
if this collection is empty.
Inherited from
IterableOnceOps
Source
def minByOption[B](f: A => B)(implicit cmp: Ordering[B]): Option[A]
Finds the first element which yields the smallest value measured by function f.
Note: will not terminate for infinite-sized collections.
Type parameters
B
The result type of the function f.
Value parameters
cmp
An ordering to be used for comparing elements.
f
The measuring function.
Returns
an option value containing the first element of this collection with the smallest value measured by function f with respect to the ordering cmp.
Inherited from
IterableOnceOps
Source
def minOption[B >: A](implicit ord: Ordering[B]): Option[A]
Finds the smallest element.
Note: will not terminate for infinite-sized collections.
Type parameters
B
The type over which the ordering is defined.
Value parameters
ord
An ordering to be used for comparing elements.
Returns
an option value containing the smallest element of this collection with respect to the ordering ord.
Inherited from
IterableOnceOps
Source@inline
final def mkString: String
Displays all elements of this collection in a string.
Delegates to addString, which can be overridden.
Returns
a string representation of this collection. In the resulting string the string representations (w.r.t. the method toString) of all elements of this collection follow each other without any separator string.
Inherited from
IterableOnceOps
Source@inline
final def mkString(sep: String): String
Displays all elements of this collection in a string using a separator string.
Delegates to addString, which can be overridden.
Value parameters
sep
the separator string.
Returns
a string representation of this collection. In the resulting string the string representations (w.r.t. the method toString) of all elements of this collection are separated by the string sep.
Example
List(1, 2, 3).mkString("|") = "1|2|3"
Inherited from
IterableOnceOps
Source
final def mkString(start: String, sep: String, end: String): String
Displays all elements of this collection in a string using start, end, and separator strings.
Delegates to addString, which can be overridden.
Value parameters
end
the ending string.
sep
the separator string.
start
the starting string.
Returns
a string representation of this collection. The resulting string begins with the string start and ends with the string end. Inside, the string representations (w.r.t. the method toString) of all elements of this collection are separated by the string sep.
Example
List(1, 2, 3).mkString("(", "; ", ")") = "(1; 2; 3)"
Inherited from
IterableOnceOps
Source
protected def newSpecificBuilder: Builder[A, HashSet[A]]
Inherited from
IterableFactoryDefaults
Source@deprecatedOverriding("nonEmpty is defined as !isEmpty; override isEmpty instead", "2.13.0")
def nonEmpty: Boolean
Tests whether the collection is not empty.
Returns
true if the collection contains at least one element, false otherwise.
Inherited from
IterableOnceOps
Source
override def partition(p: A => Boolean): (HashSet[A], HashSet[A])
Definition Classes
StrictOptimizedIterableOps -> IterableOps
Inherited from
StrictOptimizedIterableOps
Source
override def partitionMap[A1, A2](f: A => Either[A1, A2]): (HashSet[A1], HashSet[A2])
Definition Classes
StrictOptimizedIterableOps -> IterableOps
Inherited from
StrictOptimizedIterableOps
Source
def product[B >: A](implicit num: Numeric[B]): B
Multiplies up the elements of this collection.
Note: will not terminate for infinite-sized collections.
Type parameters
B
the result type of the * operator.
Value parameters
num
an implicit parameter defining a set of numeric operations which includes the * operator to be used in forming the product.
Returns
the product of all elements of this collection with respect to the * operator in num.
Inherited from
IterableOnceOps
Source
def reduce[B >: A](op: (B, B) => B): B
Reduces the elements of this collection using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
Type parameters
B
A type parameter for the binary operator, a supertype of A.
Value parameters
op
A binary operator that must be associative.
Returns
The result of applying reduce operator op between all the elements if the collection is nonempty.
Throws
UnsupportedOperationException
if this collection is empty.
Inherited from
IterableOnceOps
Source
def reduceLeft[B >: A](op: (B, A) => B): B
Applies a binary operator to all elements of this collection, going left to right.
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
Type parameters
B
the result type of the binary operator.
Value parameters
op
the binary operator.
Returns
the result of inserting op between consecutive elements of this collection, going left to right: op( op( ... op(x1, x2) ..., xn-1), xn) where x1, ..., xn are the elements of this collection.
Throws
UnsupportedOperationException
if this collection is empty.
Inherited from
IterableOnceOps
Source
def reduceLeftOption[B >: A](op: (B, A) => B): Option[B]
Optionally applies a binary operator to all elements of this collection, going left to right.
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
Type parameters
B
the result type of the binary operator.
Value parameters
op
the binary operator.
Returns
an option value containing the result of reduceLeft(op) if this collection is nonempty, None otherwise.
Inherited from
IterableOnceOps
Source
def reduceOption[B >: A](op: (B, B) => B): Option[B]
Reduces the elements of this collection, if any, using the specified associative binary operator.
The order in which operations are performed on elements is unspecified and may be nondeterministic.
Type parameters
B
A type parameter for the binary operator, a supertype of A.
Value parameters
op
A binary operator that must be associative.
Returns
An option value containing result of applying reduce operator op between all the elements if the collection is nonempty, and None otherwise.
Inherited from
IterableOnceOps
Source
def reduceRight[B >: A](op: (A, B) => B): B
Applies a binary operator to all elements of this collection, going right to left.
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
Type parameters
B
the result type of the binary operator.
Value parameters
op
the binary operator.
Returns
the result of inserting op between consecutive elements of this collection, going right to left: op(x1, op(x2, ..., op(xn-1, xn)...)) where x1, ..., xn are the elements of this collection.
Throws
UnsupportedOperationException
if this collection is empty.
Inherited from
IterableOnceOps
Source
def reduceRightOption[B >: A](op: (A, B) => B): Option[B]
Optionally applies a binary operator to all elements of this collection, going right to left.
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.
Type parameters
B
the result type of the binary operator.
Value parameters
op
the binary operator.
Returns
an option value containing the result of reduceRight(op) if this collection is nonempty, None otherwise.
Inherited from
IterableOnceOps
Source
def result(): HashSet[A]
Inherited from
SetOps
Source
protected def reversed: Iterable[A]
Inherited from
IterableOnceOps
Source
def scan[B >: A](z: B)(op: (B, B) => B): HashSet[B]
Computes a prefix scan of the elements of the collection.
Note: The neutral element z may be applied more than once.
Type parameters
B
element type of the resulting collection
Value parameters
op
the associative operator for the scan
z
neutral element for the operator op
Returns
a new iterable collection containing the prefix scan of the elements in this iterable collection
Inherited from
IterableOps
Source
override def scanLeft[B](z: B)(op: (B, A) => B): HashSet[B]
Definition Classes
StrictOptimizedIterableOps -> IterableOps -> IterableOnceOps
Inherited from
StrictOptimizedIterableOps
Source
def scanRight[B](z: B)(op: (A, B) => B): HashSet[B]
Produces a collection containing cumulative results of applying the operator going right to left. The head of the collection is the last cumulative result.
Note: will not terminate for infinite-sized collections.
Note: might return different results for different runs, unless the underlying collection type is ordered.
Note: Even when applied to a view or a lazy collection it will always force the elements.
Example:
List(1, 2, 3, 4).scanRight(0)(_ + _) == List(10, 9, 7, 4, 0)
Type parameters
B
the type of the elements in the resulting collection
Value parameters
op
the binary operator applied to the intermediate result and the element
z
the initial value
Returns
collection with intermediate results
Inherited from
IterableOps
Source
def sizeCompare(that: Iterable[_]): Int
Compares the size of this iterable collection to the size of another Iterable.
Value parameters
that
the Iterable whose size is compared with this iterable collection's size.
Returns
A value x where
x < 0 if this.size < that.size
x == 0 if this.size == that.size
x > 0 if this.size > that.size
The method as implemented here does not call size directly; its running time is O(this.size min that.size) instead of O(this.size + that.size). The method should be overridden if computing size is cheap and knownSize returns -1.
Inherited from
IterableOps
Source
def sizeCompare(otherSize: Int): Int
Compares the size of this iterable collection to a test value.
Value parameters
otherSize
the test value that gets compared with the size.
Returns
A value x where
x < 0 if this.size < otherSize
x == 0 if this.size == otherSize
x > 0 if this.size > otherSize
The method as implemented here does not call size directly; its running time is O(size min otherSize) instead of O(size). The method should be overridden if computing size is cheap and knownSize returns -1.
See also
sizeIs
Inherited from
IterableOps
Source
final def sizeHint(coll: IterableOnce[_], delta: Int): Unit
Gives a hint that one expects the result of this builder to have the same size as the given collection, plus some delta. This will provide a hint only if the collection has a known size Some builder classes will optimize their representation based on the hint. However, builder implementations are still required to work correctly even if the hint is wrong, i.e. a different number of elements is added.
Value parameters
coll
the collection which serves as a hint for the result's size.
delta
a correction to add to the coll.size to produce the size hint.
Inherited from
Builder
Source
final def sizeHintBounded(size: Int, boundingColl: Iterable[_]): Unit
Gives a hint how many elements are expected to be added when the next result is called, together with an upper bound given by the size of some other collection. Some builder classes will optimize their representation based on the hint. However, builder implementations are still required to work correctly even if the hint is wrong, i.e. a different number of elements is added.
Value parameters
boundingColl
the bounding collection. If it is an IndexedSeqLike, then sizes larger than collection's size are reduced.
size
the hint how many elements will be added.
Inherited from
Builder
Source@inline
final def sizeIs: SizeCompareOps
Returns a value class containing operations for comparing the size of this iterable collection to a test value.
These operations are implemented in terms of sizeCompare(Int), and allow the following more readable usages:
this.sizeIs < size // this.sizeCompare(size) < 0
this.sizeIs <= size // this.sizeCompare(size) <= 0
this.sizeIs == size // this.sizeCompare(size) == 0
this.sizeIs != size // this.sizeCompare(size) != 0
this.sizeIs >= size // this.sizeCompare(size) >= 0
this.sizeIs > size // this.sizeCompare(size) > 0
Inherited from
IterableOps
Source
def slice(from: Int, until: Int): HashSet[A]
Inherited from
IterableOps
Source
def sliding(size: Int, step: Int): Iterator[HashSet[A]]
Groups elements in fixed size blocks by passing a "sliding window" over them (as opposed to partitioning them, as is done in grouped.)
The returned iterator will be empty when called on an empty collection. The last element the iterator produces may be smaller than the window size when the original collection isn't exhausted by the window before it and its last element isn't skipped by the step before it.
Value parameters
size
the number of elements per group
step
the distance between the first elements of successive groups
Returns
An iterator producing iterable collections of size size, except the last element (which may be the only element) will be smaller if there are fewer than size elements remaining to be grouped.
See also
scala.collection.Iterator, method sliding
Example
List(1, 2, 3, 4, 5).sliding(2, 2) = Iterator(List(1, 2), List(3, 4), List(5))
List(1, 2, 3, 4, 5, 6).sliding(2, 3) = Iterator(List(1, 2), List(4, 5))
Inherited from
IterableOps
Source
def sliding(size: Int): Iterator[HashSet[A]]
Groups elements in fixed size blocks by passing a "sliding window" over them (as opposed to partitioning them, as is done in grouped.)
An empty collection returns an empty iterator, and a non-empty collection containing fewer elements than the window size returns an iterator that will produce the original collection as its only element.
Value parameters
size
the number of elements per group
Returns
An iterator producing iterable collections of size size, except for a non-empty collection with less than size elements, which returns an iterator that produces the source collection itself as its only element.
See also
scala.collection.Iterator, method sliding
Example
List().sliding(2) = empty iterator
List(1).sliding(2) = Iterator(List(1))
List(1, 2).sliding(2) = Iterator(List(1, 2))
List(1, 2, 3).sliding(2) = Iterator(List(1, 2), List(2, 3))
Inherited from
IterableOps
Source
override def span(p: A => Boolean): (HashSet[A], HashSet[A])
Definition Classes
StrictOptimizedIterableOps -> IterableOps -> IterableOnceOps
Inherited from
StrictOptimizedIterableOps
Source
override def splitAt(n: Int): (HashSet[A], HashSet[A])
Definition Classes
IterableOps -> IterableOnceOps
Inherited from
IterableOps
Source
def subsetOf(that: Set[A]): Boolean
Tests whether this set is a subset of another set.
Value parameters
that
the set to test.
Returns
true if this set is a subset of that, i.e. if every element of this set is also an element of that.
Inherited from
SetOps
Source
def subsets(): Iterator[HashSet[A]]
An iterator over all subsets of this set.
Returns
the iterator.
Inherited from
SetOps
Source
def subsets(len: Int): Iterator[HashSet[A]]
An iterator over all subsets of this set of the given size. If the requested size is impossible, an empty iterator is returned.
Value parameters
len
the size of the subsets.
Returns
the iterator.
Inherited from
SetOps
Source
def sum[B >: A](implicit num: Numeric[B]): B
Sums up the elements of this collection.
Note: will not terminate for infinite-sized collections.
Type parameters
B
the result type of the + operator.
Value parameters
num
an implicit parameter defining a set of numeric operations which includes the + operator to be used in forming the sum.
Returns
the sum of all elements of this collection with respect to the + operator in num.
Inherited from
IterableOnceOps
Source
def tail: HashSet[A]
The rest of the collection without its first element.
Inherited from
IterableOps
Source
def tails: Iterator[HashSet[A]]
Iterates over the tails of this iterable collection. The first value will be this iterable collection and the final one will be an empty iterable collection, with the intervening values the results of successive applications of tail.
Returns
an iterator over all the tails of this iterable collection
Example
List(1,2,3).tails = Iterator(List(1,2,3), List(2,3), List(3), Nil)
Inherited from
IterableOps
Source
def take(n: Int): HashSet[A]
Inherited from
IterableOps
Source
override def takeRight(n: Int): HashSet[A]
A collection containing the last n elements of this collection.
Note: Even when applied to a view or a lazy collection it will always force the elements.
Definition Classes
StrictOptimizedIterableOps -> IterableOps
Inherited from
StrictOptimizedIterableOps
Source
def takeWhile(p: A => Boolean): HashSet[A]
Takes longest prefix of elements that satisfy a predicate.
Note: might return different results for different runs, unless the underlying collection type is ordered.
Value parameters
p
The predicate used to test elements.
Returns
the longest prefix of this iterable collection whose elements all satisfy the predicate p.
Inherited from
IterableOps
Source
override def tapEach[U](f: A => U): HashSet[A]
Definition Classes
StrictOptimizedIterableOps -> IterableOps -> IterableOnceOps
Inherited from
StrictOptimizedIterableOps
Source
def to[C1](factory: Factory[A, C1]): C1
Given a collection factory factory, convert this collection to the appropriate representation for the current element type A. Example uses:
xs.to(List) xs.to(ArrayBuffer) xs.to(BitSet) // for xs: Iterable[Int]
Inherited from
IterableOnceOps
Source
def toArray[B >: A : ClassTag]: Array[B]
Convert collection to array.
Implementation note: DO NOT call Array.from from this method.
Inherited from
IterableOnceOps
Source@inline
final def toBuffer[B >: A]: Buffer[B]
Inherited from
IterableOnceOps
Source
def toIndexedSeq: IndexedSeq[A]
Inherited from
IterableOnceOps
Source
def toList: List[A]
Inherited from
IterableOnceOps
Source
def toMap[K, V](implicit ev: A <:< (K, V)): Map[K, V]
Inherited from
IterableOnceOps
Source
def toSeq: Seq[A]
Returns
This collection as a Seq[A]. This is equivalent to to(Seq) but might be faster.
Inherited from
IterableOnceOps
Source
def toSet[B >: A]: Set[B]
Inherited from
IterableOnceOps
Source
override def toString(): String
Definition Classes
Set -> Function1 -> Iterable -> Any
Inherited from
Set
Source
def toVector: Vector[A]
Inherited from
IterableOnceOps
Source
def transpose[B](implicit asIterable: A => Iterable[B]): HashSet[HashSet[B]]
Transposes this iterable collection of iterable collections into a iterable collection of iterable collections.
The resulting collection's type will be guided by the static type of iterable collection. For example:
val xs = List(
Set(1, 2, 3),
Set(4, 5, 6)).transpose
// xs == List(
// List(1, 4),
// List(2, 5),
// List(3, 6))
val ys = Vector(
List(1, 2, 3),
List(4, 5, 6)).transpose
// ys == Vector(
// Vector(1, 4),
// Vector(2, 5),
// Vector(3, 6))
Note: Even when applied to a view or a lazy collection it will always force the elements.
Type parameters
B
the type of the elements of each iterable collection.
Value parameters
asIterable
an implicit conversion which asserts that the element type of this iterable collection is an Iterable.
Returns
a two-dimensional iterable collection of iterable collections which has as nth row the nth column of this iterable collection.
Throws
IllegalArgumentException
if all collections in this iterable collection are not of the same size.
Inherited from
IterableOps
Source@inline
final def union(that: Set[A]): HashSet[A]
Computes the union between of set and another set.
Value parameters
that
the set to form the union with.
Returns
a new set consisting of all elements that are in this set or in the given set that.
Inherited from
SetOps
Source
override def unzip[A1, A2](implicit asPair: A => (A1, A2)): (HashSet[A1], HashSet[A2])
Definition Classes
StrictOptimizedIterableOps -> IterableOps
Inherited from
StrictOptimizedIterableOps
Source
override def unzip3[A1, A2, A3](implicit asTriple: A => (A1, A2, A3)): (HashSet[A1], HashSet[A2], HashSet[A3])
Definition Classes
StrictOptimizedIterableOps -> IterableOps
Inherited from
StrictOptimizedIterableOps
Source
def update(elem: A, included: Boolean): Unit
Updates the presence of a single element in this set.
This method allows one to add or remove an element elem from this set depending on the value of parameter included. Typically, one would use the following syntax:
set(elem) = true // adds element
set(elem) = false // removes element
Value parameters
elem
the element to be added or removed
included
a flag indicating whether element should be included or excluded.
Inherited from
SetOps
Source
def view: View[A]
A view over the elements of this collection.
Inherited from
IterableOps
Source
def withFilter(p: A => Boolean): WithFilter[A, HashSet]
Creates a non-strict filter of this iterable collection.
Note: the difference between c filter p and c withFilter p is that the former creates a new collection, whereas the latter only restricts the domain of subsequent map, flatMap, foreach, and withFilter operations.
Note: might return different results for different runs, unless the underlying collection type is ordered.
Value parameters
p
the predicate used to test elements.
Returns
an object of class WithFilter, which supports map, flatMap, foreach, and withFilter operations. All these operations apply to those elements of this iterable collection which satisfy the predicate p.
Inherited from
IterableOps
Source
override def zip[B](that: IterableOnce[B]): HashSet[(A, B)]
Definition Classes
StrictOptimizedIterableOps -> IterableOps
Inherited from
StrictOptimizedIterableOps
Source
def zipAll[A1 >: A, B](that: Iterable[B], thisElem: A1, thatElem: B): HashSet[(A1, B)]
Returns a iterable collection formed from this iterable collection and another iterable collection by combining corresponding elements in pairs. If one of the two collections is shorter than the other, placeholder elements are used to extend the shorter collection to the length of the longer.
Value parameters
that
the iterable providing the second half of each result pair
thatElem
the element to be used to fill up the result if that is shorter than this iterable collection.
thisElem
the element to be used to fill up the result if this iterable collection is shorter than that.
Returns
a new collection of type That containing pairs consisting of corresponding elements of this iterable collection and that. The length of the returned collection is the maximum of the lengths of this iterable collection and that. If this iterable collection is shorter than that, thisElem values are used to pad the result. If that is shorter than this iterable collection, thatElem values are used to pad the result.
Inherited from
IterableOps
Source
override def zipWithIndex: HashSet[(A, Int)]
Definition Classes
StrictOptimizedIterableOps -> IterableOps -> IterableOnceOps
Inherited from
StrictOptimizedIterableOps
Source@inline
final def |(that: Set[A]): HashSet[A]
Alias for union
Inherited from
SetOps
|
9 Binary Compatibility Binary compatibility encompasses several related concepts:
application binary interface (ABI)
The set of runtime conventions followed by all of the tools that deal with binary representations of a program, including compilers, assemblers, linkers, and language runtime support. Some ABIs are formal with a written specification, possibly designed by multiple interested parties. Others are simply the way things are actually done by a particular set of tools.
ABI conformance
A compiler conforms to an ABI if it generates code that follows all of the specifications enumerated by that ABI. A library conforms to an ABI if it is implemented according to that ABI. An application conforms to an ABI if it is built using tools that conform to that ABI and does not contain source code that specifically changes behavior specified by the ABI.
calling conventions
Calling conventions are a subset of an ABI that specify of how arguments are passed and function results are returned.
interoperability
Different sets of tools are interoperable if they generate files that can be used in the same program. The set of tools includes compilers, assemblers, linkers, libraries, header files, startup files, and debuggers. Binaries produced by different sets of tools are not interoperable unless they implement the same ABI. This applies to different versions of the same tools as well as tools from different vendors.
intercallability
Whether a function in a binary built by one set of tools can call a function in a binary built by a different set of tools is a subset of interoperability.
implementation-defined features
Language standards include lists of implementation-defined features whose behavior can vary from one implementation to another. Some of these features are normally covered by a platform's ABI and others are not. The features that are not covered by an ABI generally affect how a program behaves, but not intercallability.
compatibility
Conformance to the same ABI and the same behavior of implementation-defined features are both relevant for compatibility.
The application binary interface implemented by a C or C++ compiler affects code generation and runtime support for:
size and alignment of data types
layout of structured types
calling conventions
register usage conventions
interfaces for runtime arithmetic support
object file formats
In addition, the application binary interface implemented by a C++ compiler affects code generation and runtime support for:
name mangling
exception handling
invoking constructors and destructors
layout, alignment, and padding of classes
layout and alignment of virtual tables
Some GCC compilation options cause the compiler to generate code that does not conform to the platform's default ABI. Other options cause different program behavior for implementation-defined features that are not covered by an ABI. These options are provided for consistency with other compilers that do not follow the platform's default ABI or the usual behavior of implementation-defined features for the platform. Be very careful about using such options.
Most platforms have a well-defined ABI that covers C code, but ABIs that cover C++ functionality are not yet common.
Starting with GCC 3.2, GCC binary conventions for C++ are based on a written, vendor-neutral C++ ABI that was designed to be specific to 64-bit Itanium but also includes generic specifications that apply to any platform. This C++ ABI is also implemented by other compiler vendors on some platforms, notably GNU/Linux and BSD systems. We have tried hard to provide a stable ABI that will be compatible with future GCC releases, but it is possible that we will encounter problems that make this difficult. Such problems could include different interpretations of the C++ ABI by different vendors, bugs in the ABI, or bugs in the implementation of the ABI in different compilers. GCC's -Wabi switch warns when G++ generates code that is probably not compatible with the C++ ABI.
The C++ library used with a C++ compiler includes the Standard C++ Library, with functionality defined in the C++ Standard, plus language runtime support. The runtime support is included in a C++ ABI, but there is no formal ABI for the Standard C++ Library. Two implementations of that library are interoperable if one follows the de-facto ABI of the other and if they are both built with the same compiler, or with compilers that conform to the same ABI for C++ compiler and runtime support.
When G++ and another C++ compiler conform to the same C++ ABI, but the implementations of the Standard C++ Library that they normally use do not follow the same ABI for the Standard C++ Library, object files built with those compilers can be used in the same program only if they use the same C++ library. This requires specifying the location of the C++ library header files when invoking the compiler whose usual library is not being used. The location of GCC's C++ header files depends on how the GCC build was configured, but can be seen by using the G++ -v option. With default configuration options for G++ 3.3 the compile line for a different C++ compiler needs to include
-Igcc_install_directory/include/c++/3.3 Similarly, compiling code with G++ that must use a C++ library other than the GNU C++ library requires specifying the location of the header files for that other library.
The most straightforward way to link a program to use a particular C++ library is to use a C++ driver that specifies that C++ library by default. The g++ driver, for example, tells the linker where to find GCC's C++ library (libstdc++) plus the other libraries and startup files it needs, in the proper order.
If a program must use a different C++ library and it's not possible to do the final link using a C++ driver that uses that library by default, it is necessary to tell g++ the location and name of that library. It might also be necessary to specify different startup files and other runtime support libraries, and to suppress the use of GCC's support libraries with one or more of the options -nostdlib, -nostartfiles, and -nodefaultlibs.
|
Interfaces
Interfaces in Kotlin can contain declarations of abstract methods, as well as method implementations. What makes them different from abstract classes is that interfaces cannot store state. They can have properties, but these need to be abstract or provide accessor implementations.
An interface is defined using the keyword interface:
interface MyInterface {
fun bar()
fun foo() {
// optional body
}
}
Implementing interfaces
A class or object can implement one or more interfaces:
class Child : MyInterface {
override fun bar() {
// body
}
}
Properties in interfaces
You can declare properties in interfaces. A property declared in an interface can either be abstract or provide implementations for accessors. Properties declared in interfaces can't have backing fields, and therefore accessors declared in interfaces can't reference them:
interface MyInterface {
val prop: Int // abstract
val propertyWithImplementation: String
get() = "foo"
fun foo() {
print(prop)
}
}
class Child : MyInterface {
override val prop: Int = 29
}
Interfaces Inheritance
An interface can derive from other interfaces, meaning it can both provide implementations for their members and declare new functions and properties. Quite naturally, classes implementing such an interface are only required to define the missing implementations:
interface Named {
val name: String
}
interface Person : Named {
val firstName: String
val lastName: String
override val name: String get() = "$firstName $lastName"
}
data class Employee(
// implementing 'name' is not required
override val firstName: String,
override val lastName: String,
val position: Position
) : Person
Resolving overriding conflicts
When you declare many types in your supertype list, you may inherit more than one implementation of the same method:
interface A {
fun foo() { print("A") }
fun bar()
}
interface B {
fun foo() { print("B") }
fun bar() { print("bar") }
}
class C : A {
override fun bar() { print("bar") }
}
class D : A, B {
override fun foo() {
super<A>.foo()
super<B>.foo()
}
override fun bar() {
super<B>.bar()
}
}
Interfaces A and B both declare functions foo() and bar(). Both of them implement foo(), but only B implements bar() (bar() is not marked as abstract in A, because this is the default for interfaces if the function has no body). Now, if you derive a concrete class C from A, you have to override bar() and provide an implementation.
However, if you derive D from A and B, you need to implement all the methods that you have inherited from multiple interfaces, and you need to specify how exactly D should implement them. This rule applies both to methods for which you've inherited a single implementation (bar()) and to those for which you've inherited multiple implementations (foo()). Last modified: 02 June 2022
Properties Functional (SAM) interfaces
|
function history_attach_timestamp history_attach_timestamp($node_id) #lazy_builder callback; attaches the last read timestamp for a node. Parameters int $node_id: The node ID for which to attach the last read timestamp. Return value array $element A renderable array containing the last read timestamp. File
core/modules/history/history.module, line 190 Records which users have read which content. Code function history_attach_timestamp($node_id) {
$element = [];
$element['#attached']['drupalSettings']['history']['lastReadTimestamps'][$node_id] = (int) history_read($node_id);
return $element;
}
|
SQLite3Stmt8b7c:f320:99b9:690f:4595:cd17:293a:c069indParam (PHP 5 >= 5.3.0, PHP 7, PHP 8)
SQLite3Stmt8b7c:f320:99b9:690f:4595:cd17:293a:c069indParam — Binds a parameter to a statement variable Description public SQLite3Stmt8b7c:f320:99b9:690f:4595:cd17:293a:c069indParam(string|int $param, mixed &$var, int $type = SQLITE3_TEXT): bool Binds a parameter to a statement variable.
Caution Before PHP 7.2.14 and 7.3.0, respectively, SQLite3Stmt8b7c:f320:99b9:690f:4595:cd17:293a:c069reset() must be called after the first call to SQLite3Stmt8b7c:f320:99b9:690f:4595:cd17:293a:c069xecute() if the bound value should be properly updated on following calls to SQLite3Stmt8b7c:f320:99b9:690f:4595:cd17:293a:c069xecute(). If SQLite3Stmt8b7c:f320:99b9:690f:4595:cd17:293a:c069reset() is not called, the bound value will not change, even if the value assigned to the variable passed to SQLite3Stmt8b7c:f320:99b9:690f:4595:cd17:293a:c069indParam() has changed, or SQLite3Stmt8b7c:f320:99b9:690f:4595:cd17:293a:c069indParam() has been called again. Parameters
param
Either a string (for named parameters) or an int (for positional parameters) identifying the statement variable to which the value should be bound. If a named parameter does not start with a colon (:) or an at sign (@), a colon (:) is automatically preprended. Positional parameters start with 1. var
The parameter to bind to a statement variable. type
The data type of the parameter to bind.
SQLITE3_INTEGER: The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value. SQLITE3_FLOAT: The value is a floating point value, stored as an 8-byte IEEE floating point number. SQLITE3_TEXT: The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16-LE). SQLITE3_BLOB: The value is a blob of data, stored exactly as it was input. SQLITE3_NULL: The value is a NULL value. As of PHP 7.0.7, if type is omitted, it is automatically detected from the type of the var: bool and int are treated as SQLITE3_INTEGER, float as SQLITE3_FLOAT, null as SQLITE3_NULL and all others as SQLITE3_TEXT. Formerly, if type has been omitted, it has defaulted to SQLITE3_TEXT.
Note:
If var is null, it is always treated as SQLITE3_NULL, regardless of the given type. Return Values Returns true if the parameter is bound to the statement variable, false on failure. Changelog Version Description 7.4.0 param now also supports the @param notation. Examples
Example #1 SQLite3Stmt8b7c:f320:99b9:690f:4595:cd17:293a:c069indParam() Usage This example shows how a single prepared statement with a single parameter binding can be used to insert multiple rows with different values. <?php
$db = new SQLite3(':memory:');
$db->exec("CREATE TABLE foo (bar TEXT)");
$stmt = $db->prepare("INSERT INTO foo VALUES (:bar)");
$stmt->bindParam(':bar', $bar, SQLITE3_TEXT);
$bar = 'baz';
$stmt->execute();
$bar = 42;
$stmt->execute();
$res = $db->query("SELECT * FROM foo");
while (($row = $res->fetchArray(SQLITE3_ASSOC))) {
var_dump($row);
}
?> The above example will output:
array(1) {
["bar"]=>
string(3) "baz"
}
array(1) {
["bar"]=>
string(2) "42"
}
See Also SQLite3Stmt8b7c:f320:99b9:690f:4595:cd17:293a:c069indValue() - Binds the value of a parameter to a statement variable SQLit8b7c:f320:99b9:690f:4595:cd17:293a:c069prepare() - Prepares an SQL statement for execution
|
WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069parent(): WP_Theme|false Returns reference to the parent theme. Return WP_Theme|false Parent theme, or false if the active theme is not a child theme. Source File: wp-includes/class-wp-theme.php. View all references public function parent() {
return isset( $this->parent ) ? $this->parent : false;
}
Related Used By Used By Description WP_Theme_JSON_Resolver8b7c:f320:99b9:690f:4595:cd17:293a:c069get_theme_data() wp-includes/class-wp-theme-json-resolver.php Returns the theme’s data. WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069get_template_directory() wp-includes/class-wp-theme.php Returns the absolute path to the directory of a theme’s “template” files. WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069get_template_directory_uri() wp-includes/class-wp-theme.php Returns the URL to the directory of a theme’s “template” files. WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069get_files() wp-includes/class-wp-theme.php Returns files in the theme’s directory. WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069__get() wp-includes/class-wp-theme.php __get() magic method for properties formerly returned by current_theme_info() WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069offsetGet() wp-includes/class-wp-theme.php
Changelog Version Description 3.4.0 Introduced.
|
class URI8b7c:f320:99b9:690f:4595:cd17:293a:c069LDAP
Parent:
URI8b7c:f320:99b9:690f:4595:cd17:293a:c069Generic
LDAP URI SCHEMA (described in RFC2255) Constants COMPONENT
An Array of the available components for URI8b7c:f320:99b9:690f:4595:cd17:293a:c069LDAP
DEFAULT_PORT
A Default port of 389 for URI8b7c:f320:99b9:690f:4595:cd17:293a:c069LDAP
SCOPE
Scopes available for the starting point.
SCOPE_BASE - the Base DN
SCOPE_ONE - one level under the Base DN, not including the base DN and not including any entries under this.
SCOPE_SUB - subtress, all entries at all levels
Public Class Methods build(args) Show source
# File lib/uri/ldap.rb, line 74
def self.build(args)
tmp = Util8b7c:f320:99b9:690f:4595:cd17:293a:c069make_components_hash(self, args)
if tmp[:dn]
tmp[:path] = tmp[:dn]
end
query = []
[:extensions, :filter, :scope, :attributes].collect do |x|
next if !tmp[x] && query.size == 0
query.unshift(tmp[x])
end
tmp[:query] = query.join('?')
return super(tmp)
end Description Create a new URI8b7c:f320:99b9:690f:4595:cd17:293a:c069LDAP object from components, with syntax checking. The components accepted are host, port, dn, attributes, scope, filter, and extensions. The components should be provided either as an Array, or as a Hash with keys formed by preceding the component names with a colon. If an Array is used, the components must be passed in the order [host, port, dn, attributes, scope, filter, extensions]. Example: newuri = URI8b7c:f320:99b9:690f:4595:cd17:293a:c069LDAP.build({:host => 'ldap.example.com',
:dn> => '/dc=example'})
newuri = URI8b7c:f320:99b9:690f:4595:cd17:293a:c069LDAP.build(["ldap.example.com", nil,
"/dc=example;dc=com", "query", nil, nil, nil]) Calls superclass method URI8b7c:f320:99b9:690f:4595:cd17:293a:c069Generic.build new(*arg) Show source
# File lib/uri/ldap.rb, line 109
def initialize(*arg)
super(*arg)
if @fragment
raise InvalidURIError, 'bad LDAP URL'
end
parse_dn
parse_query
end Description Create a new URI8b7c:f320:99b9:690f:4595:cd17:293a:c069LDAP object from generic URI components as per RFC 2396. No LDAP-specific syntax checking is performed. Arguments are scheme, userinfo, host, port, registry, path, opaque, query and fragment, in that order. Example: uri = URI8b7c:f320:99b9:690f:4595:cd17:293a:c069LDAP.new("ldap", nil, "ldap.example.com", nil,
"/dc=example;dc=com", "query", nil, nil, nil, nil)
See also URI8b7c:f320:99b9:690f:4595:cd17:293a:c069Generic.new Calls superclass method URI8b7c:f320:99b9:690f:4595:cd17:293a:c069Generic.new Public Instance Methods attributes() Show source
# File lib/uri/ldap.rb, line 178
def attributes
@attributes
end returns attributes. attributes=(val) Show source
# File lib/uri/ldap.rb, line 191
def attributes=(val)
set_attributes(val)
val
end setter for attributes val dn() Show source
# File lib/uri/ldap.rb, line 159
def dn
@dn
end returns dn. dn=(val) Show source
# File lib/uri/ldap.rb, line 172
def dn=(val)
set_dn(val)
val
end setter for dn val extensions() Show source
# File lib/uri/ldap.rb, line 235
def extensions
@extensions
end returns extensions. extensions=(val) Show source
# File lib/uri/ldap.rb, line 248
def extensions=(val)
set_extensions(val)
val
end setter for extensions val filter() Show source
# File lib/uri/ldap.rb, line 216
def filter
@filter
end returns filter. filter=(val) Show source
# File lib/uri/ldap.rb, line 229
def filter=(val)
set_filter(val)
val
end setter for filter val hierarchical?() Show source
# File lib/uri/ldap.rb, line 255
def hierarchical?
false
end Checks if URI has a path For URI8b7c:f320:99b9:690f:4595:cd17:293a:c069LDAP this will return false scope() Show source
# File lib/uri/ldap.rb, line 197
def scope
@scope
end returns scope. scope=(val) Show source
# File lib/uri/ldap.rb, line 210
def scope=(val)
set_scope(val)
val
end setter for scope val Protected Instance Methods set_attributes(val) Show source
# File lib/uri/ldap.rb, line 183
def set_attributes(val)
@attributes = val
build_path_query
@attributes
end private setter for attributes val set_dn(val) Show source
# File lib/uri/ldap.rb, line 164
def set_dn(val)
@dn = val
build_path_query
@dn
end private setter for dn val set_extensions(val) Show source
# File lib/uri/ldap.rb, line 240
def set_extensions(val)
@extensions = val
build_path_query
@extensions
end private setter for extensions val set_filter(val) Show source
# File lib/uri/ldap.rb, line 221
def set_filter(val)
@filter = val
build_path_query
@filter
end private setter for filter val set_scope(val) Show source
# File lib/uri/ldap.rb, line 202
def set_scope(val)
@scope = val
build_path_query
@scope
end private setter for scope val Private Instance Methods build_path_query() Show source
# File lib/uri/ldap.rb, line 146
def build_path_query
@path = '/' + @dn
query = []
[@extensions, @filter, @scope, @attributes].each do |x|
next if !x && query.size == 0
query.unshift(x)
end
@query = query.join('?')
end private method to assemble query from attributes, scope, filter and extensions. parse_dn() Show source
# File lib/uri/ldap.rb, line 121
def parse_dn
@dn = @path[1..-1]
end private method to cleanup dn from using the path component attribute parse_query() Show source
# File lib/uri/ldap.rb, line 128
def parse_query
@attributes = nil
@scope = nil
@filter = nil
@extensions = nil
if @query
attrs, scope, filter, extensions = @query.split('?')
@attributes = attrs if attrs && attrs.size > 0
@scope = scope if scope && scope.size > 0
@filter = filter if filter && filter.size > 0
@extensions = extensions if extensions && extensions.size > 0
end
end private method to cleanup attributes, scope, filter and extensions, from using the query component attribute
Ruby Core © 1993–2017 Yukihiro MatsumotoLicensed under the Ruby License.Ruby Standard Library
|
dart:web_gl CURRENT_PROGRAM constant int const CURRENT_PROGRAM Implementation static const int CURRENT_PROGRAM = 0x8B8D;
|
st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_ios Defined in header <ios> template<
class CharT,
class Traits = st8b7c:f320:99b9:690f:4595:cd17:293a:c069char_traits<CharT>
> class basic_ios : public st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base
The class st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_ios provides facilities for interfacing with objects that have st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_streambuf interface. Several st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_ios objects can refer to one actual st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_streambuf object.
Inheritance diagram.
Two specializations for common character types are also provided:
Type Definition
ios basic_ios<char>
wios basic_ios<wchar_t>
Member types Member type Definition
char_type CharT
traits_type Traits; the program is ill-formed if Traits8b7c:f320:99b9:690f:4595:cd17:293a:c069har_type is not CharT.
int_type Traits8b7c:f320:99b9:690f:4595:cd17:293a:c069int_type
pos_type Traits8b7c:f320:99b9:690f:4595:cd17:293a:c069pos_type
off_type Traits8b7c:f320:99b9:690f:4595:cd17:293a:c069off_type
Public member functions (constructor) constructs the object (public member function)
(destructor)
[virtual] destructs the object (virtual public member function)
operator= the copy assignment operator is deleted (public member function)
State functions
good checks if no error has occurred i.e. I/O operations are available (public member function)
eof checks if end-of-file has been reached (public member function)
fail checks if an error has occurred (public member function)
bad checks if a non-recoverable error has occurred (public member function)
operator! checks if an error has occurred (synonym of fail()) (public member function)
operator void*operator bool
(until C++11)(since C++11) checks if no error has occurred (synonym of !fail()) (public member function)
rdstate returns state flags (public member function)
setstate sets state flags (public member function)
clear modifies state flags (public member function)
Formatting
copyfmt copies formatting information (public member function)
fill manages the fill character (public member function)
Miscellaneous
exceptions manages exception mask (public member function)
imbue sets the locale (public member function)
rdbuf manages associated stream buffer (public member function)
tie manages tied stream (public member function)
narrow narrows characters (public member function)
widen widens characters (public member function)
Protected member functions init initializes a default-constructed st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_ios (protected member function)
move
(C++11) moves from another st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_ios except for rdbuf (protected member function)
swap
(C++11) swaps with another st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_ios except for rdbuf (protected member function)
set_rdbuf replaces the rdbuf without clearing its error state (protected member function)
Inherited from st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base Member functions Formatting
flags manages format flags (public member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
setf sets specific format flag (public member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
unsetf clears specific format flag (public member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
precision manages decimal precision of floating point operations (public member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
width manages field width (public member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
Locales
imbue sets locale (public member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
getloc returns current locale (public member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
Internal extensible array
xalloc
[static] returns a program-wide unique integer that is safe to use as index to pword() and iword() (public static member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
iword resizes the private storage if necessary and access to the long element at the given index (public member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
pword resizes the private storage if necessary and access to the void* element at the given index (public member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
Miscellaneous
register_callback registers event callback function (public member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
sync_with_stdio
[static] sets whether C++ and C I/O libraries are interoperable (public static member function of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
Member classes
failure stream exception (public member class of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
Init initializes standard stream objects (public member class of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base)
Member types and constants
Type Explanation
openmode stream open mode type The following constants are also defined:
Constant Explanation
app seek to the end of stream before each write
binary open in binary mode
in open for reading
out open for writing
trunc discard the contents of the stream when opening
ate seek to the end of stream immediately after open
(typedef)
fmtflags formatting flags type The following constants are also defined:
Constant Explanation
dec use decimal base for integer I/O: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069dec
oct use octal base for integer I/O: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069oct
hex use hexadecimal base for integer I/O: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069hex
basefield dec|oct|hex. Useful for masking operations
left left adjustment (adds fill characters to the right): see st8b7c:f320:99b9:690f:4595:cd17:293a:c069left
right right adjustment (adds fill characters to the left): see st8b7c:f320:99b9:690f:4595:cd17:293a:c069right
internal internal adjustment (adds fill characters to the internal designated point): see st8b7c:f320:99b9:690f:4595:cd17:293a:c069internal
adjustfield left|right|internal. Useful for masking operations
scientific generate floating point types using scientific notation, or hex notation if combined with fixed: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069scientific
fixed generate floating point types using fixed notation, or hex notation if combined with scientific: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069fixed
floatfield scientific|fixed. Useful for masking operations
boolalpha insert and extract bool type in alphanumeric format: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069boolalpha
showbase generate a prefix indicating the numeric base for integer output, require the currency indicator in monetary I/O: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069showbase
showpoint generate a decimal-point character unconditionally for floating-point number output: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069showpoint
showpos generate a + character for non-negative numeric output: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069showpos
skipws skip leading whitespace before certain input operations: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069skipws
unitbuf flush the output after each output operation: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069unitbuf
uppercase replace certain lowercase letters with their uppercaseequivalents in certain output operations: see st8b7c:f320:99b9:690f:4595:cd17:293a:c069uppercase
(typedef)
iostate state of the stream type The following constants are also defined:
Constant Explanation
goodbit no error
badbit irrecoverable stream error
failbit input/output operation failed (formatting or extraction error)
eofbit associated input sequence has reached end-of-file
(typedef)
seekdir seeking direction type The following constants are also defined:
Constant Explanation
beg the beginning of a stream
end the ending of a stream
cur the current position of stream position indicator
(typedef)
event specifies event type (enum)
event_callback callback function type (typedef)
Notes Straightforward implementation of st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_ios stores only the following members (which all depend on the template parameters and thus cannot be part of st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_base):
the fill character (see fill())
the tied stream pointer (see tie())
the associated stream buffer pointer (see rdbuf())
Actual implementations vary:
Microsoft Visual Studio stores just those three members.
LLVM libc++ stores 1 less member: it maintains the rdbuf pointer as a void* member of ios_base.
GNU libstdc++ stores 4 additional members: three cached facets and a flag to indicate that fill was initialized.
|
cp Usage: docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH | -
docker cp [OPTIONS] SRC_PATH | - CONTAINER:DEST_PATH
Copy files/folders between a container and the local filesystem
-L, --follow-link Always follow symbol link in SRC_PATH
--help Print usage
The docker cp utility copies the contents of SRC_PATH to the DEST_PATH. You can copy from the container’s file system to the local machine or the reverse, from the local filesystem to the container. If - is specified for either the SRC_PATH or DEST_PATH, you can also stream a tar archive from STDIN or to STDOUT. The CONTAINER can be a running or stopped container. The SRC_PATH or DEST_PATH can be a file or directory. The docker cp command assumes container paths are relative to the container’s / (root) directory. This means supplying the initial forward slash is optional; The command sees compassionate_darwin:/tmp/foo/myfile.txt and compassionate_darwin:tmp/foo/myfile.txt as identical. Local machine paths can be an absolute or relative value. The command interprets a local machine’s relative paths as relative to the current working directory where docker cp is run. The cp command behaves like the Unix cp -a command in that directories are copied recursively with permissions preserved if possible. Ownership is set to the user and primary group at the destination. For example, files copied to a container are created with UID:GID of the root user. Files copied to the local machine are created with the UID:GID of the user which invoked the docker cp command. If you specify the -L option, docker cp follows any symbolic link in the SRC_PATH. Assuming a path separator of /, a first argument of SRC_PATH and second argument of DEST_PATH, the behavior is as follows:
SRC_PATH specifies a file
DEST_PATH does not exist the file is saved to a file created at DEST_PATH
DEST_PATH does not exist and ends with / Error condition: the destination directory must exist.
DEST_PATH exists and is a file the destination is overwritten with the source file’s contents
DEST_PATH exists and is a directory the file is copied into this directory using the basename from SRC_PATH
SRC_PATH specifies a directory
DEST_PATH does not exist
DEST_PATH is created as a directory and the contents of the source directory are copied into this directory
DEST_PATH exists and is a file Error condition: cannot copy a directory to a file
DEST_PATH exists and is a directory
SRC_PATH does not end with /. the source directory is copied into this directory
SRC_PATH does end with /. the content of the source directory is copied into this directory
The command requires SRC_PATH and DEST_PATH to exist according to the above rules. If SRC_PATH is local and is a symbolic link, the symbolic link, not the target, is copied by default. To copy the link target and not the link, specify the -L option. A colon (:) is used as a delimiter between CONTAINER and its path. You can also use : when specifying paths to a SRC_PATH or DEST_PATH on a local machine, for example file:name.txt. If you use a : in a local machine path, you must be explicit with a relative or absolute path, for example: `/path/to/file:name.txt` or `./file:name.txt`
It is not possible to copy certain system files such as resources under /proc, /sys, /dev, and mounts created by the user in the container. Using - as the SRC_PATH streams the contents of STDIN as a tar archive. The command extracts the content of the tar to the DEST_PATH in container’s filesystem. In this case, DEST_PATH must specify a directory. Using - as the DEST_PATH streams the contents of the resource as a tar archive to STDOUT.
|
update_site_cache( array $sites, bool $update_meta_cache = true ) Updates sites in cache. Parameters $sites array Required Array of site objects. $update_meta_cache bool Optional Whether to update site meta cache. Default: true Source File: wp-includes/ms-site.php. View all references function update_site_cache( $sites, $update_meta_cache = true ) {
if ( ! $sites ) {
return;
}
$site_ids = array();
$site_data = array();
$blog_details_data = array();
foreach ( $sites as $site ) {
$site_ids[] = $site->blog_id;
$site_data[ $site->blog_id ] = $site;
$blog_details_data[ $site->blog_id . 'short' ] = $site;
}
wp_cache_add_multiple( $site_data, 'sites' );
wp_cache_add_multiple( $blog_details_data, 'blog-details' );
if ( $update_meta_cache ) {
update_sitemeta_cache( $site_ids );
}
}
Related Uses Uses Description wp_cache_add_multiple() wp-includes/cache.php Adds multiple values to the cache in one call. update_sitemeta_cache() wp-includes/ms-site.php Updates metadata cache for list of site IDs.
Used By Used By Description _prime_site_caches() wp-includes/ms-site.php Adds any sites from the given IDs to the cache that do not already exist in cache. WP_MS_Sites_List_Tabl8b7c:f320:99b9:690f:4595:cd17:293a:c069prepare_items() wp-admin/includes/class-wp-ms-sites-list-table.php Prepares the list of sites for display.
Changelog Version Description 5.1.0 Introduced the $update_meta_cache parameter. 4.6.0 Introduced.
|
D.4 How to Distinguish Between Octave and Matlab Octave and MATLAB are very similar, but handle Java slightly different. Therefore it may be necessary to detect the environment and use the appropriate functions. The following function can be used to detect the environment. Due to the persistent variable it can be called repeatedly without a heavy performance hit. Example: %%
%% Return: true if the environment is Octave.
%%
function retval = isOctave
persistent cacheval; % speeds up repeated calls
if isempty (cacheval)
cacheval = (exist ("OCTAVE_VERSION", "builtin") > 0);
end
retval = cacheval;
end
|
sklearn.datasets.make_multilabel_classification sklearn.datasets.make_multilabel_classification(n_samples=100, n_features=20, *, n_classes=5, n_labels=2, length=50, allow_unlabeled=True, sparse=False, return_indicator='dense', return_distributions=False, random_state=None)[source]
Generate a random multilabel classification problem. For each sample, the generative process is:
pick the number of labels: n ~ Poisson(n_labels) n times, choose a class c: c ~ Multinomial(theta) pick the document length: k ~ Poisson(length) k times, choose a word: w ~ Multinomial(theta_c) In the above process, rejection sampling is used to make sure that n is never zero or more than n_classes, and that the document length is never zero. Likewise, we reject classes which have already been chosen. Read more in the User Guide. Parameters:
n_samplesint, default=100
The number of samples.
n_featuresint, default=20
The total number of features.
n_classesint, default=5
The number of classes of the classification problem.
n_labelsint, default=2
The average number of labels per instance. More precisely, the number of labels per sample is drawn from a Poisson distribution with n_labels as its expected value, but samples are bounded (using rejection sampling) by n_classes, and must be nonzero if allow_unlabeled is False.
lengthint, default=50
The sum of the features (number of words if documents) is drawn from a Poisson distribution with this expected value.
allow_unlabeledbool, default=True
If True, some instances might not belong to any class.
sparsebool, default=False
If True, return a sparse feature matrix. New in version 0.17: parameter to allow sparse output.
return_indicator{‘dense’, ‘sparse’} or False, default=’dense’
If 'dense' return Y in the dense binary indicator format. If 'sparse' return Y in the sparse binary indicator format. False returns a list of lists of labels.
return_distributionsbool, default=False
If True, return the prior class probability and conditional probabilities of features given classes, from which the data was drawn.
random_stateint, RandomState instance or None, default=None
Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary. Returns:
Xndarray of shape (n_samples, n_features)
The generated samples.
Y{ndarray, sparse matrix} of shape (n_samples, n_classes)
The label sets. Sparse matrix should be of CSR format.
p_cndarray of shape (n_classes,)
The probability of each class being drawn. Only returned if return_distributions=True.
p_w_cndarray of shape (n_features, n_classes)
The probability of each feature being drawn given each class. Only returned if return_distributions=True.
Examples using sklearn.datasets.make_multilabel_classification
Plot randomly generated multilabel dataset
Multilabel classification
|
SyntaxError
The SyntaxError object represents an error when trying to interpret syntactically invalid code. It is thrown when the JavaScript engine encounters tokens or token order that does not conform to the syntax of the language when parsing code. SyntaxError is a serializable object, so it can be cloned with structuredClone() or copied between Workers using postMessage().
Constructor
SyntaxError() Creates a new SyntaxError object. Instance properties
SyntaxError.prototype.message Error message. Inherited from Error. SyntaxError.prototype.name Error name. Inherited from Error. SyntaxError.prototype.cause Error cause. Inherited from Error.
SyntaxError.prototype.fileName Non-standard
Path to file that raised this error. Inherited from Error.
SyntaxError.prototype.lineNumber Non-standard
Line number in file that raised this error. Inherited from Error.
SyntaxError.prototype.columnNumber Non-standard
Column number in line that raised this error. Inherited from Error.
SyntaxError.prototype.stack Non-standard
Stack trace. Inherited from Error. Examples
Catching a SyntaxError
try {
eval('hoo bar');
} catch (e) {
console.error(e instanceof SyntaxError);
console.error(e.message);
console.error(e.name);
console.error(e.fileName);
console.error(e.lineNumber);
console.error(e.columnNumber);
console.error(e.stack);
}
Creating a SyntaxError
try {
throw new SyntaxError('Hello', 'someFile.js', 10);
} catch (e) {
console.error(e instanceof SyntaxError); // true
console.error(e.message); // Hello
console.error(e.name); // SyntaxError
console.error(e.fileName); // someFile.js
console.error(e.lineNumber); // 10
console.error(e.columnNumber); // 0
console.error(e.stack); // @debugger eval code:3:9
}
Specifications
Specification
ECMAScript Language Specification # sec-native-error-types-used-in-this-standard-syntaxerror
Browser compatibility
Desktop
Mobile
Server
Chrome
Edge
Firefox
Internet Explorer
Opera
Safari
WebView Android
Chrome Android
Firefox for Android
Opera Android
Safari on IOS
Samsung Internet
Deno
Node.js
SyntaxError
1
12
1
5.5
5
1
4.4
18
4
10.1
1
1.0
1.0
0.10.0
SyntaxError
1
12
1
5.5
5
1
4.4
18
4
10.1
1
1.0
1.0
0.10.0
serializable_object
77
79
103
["Version 103 serializable properties: name, message, cause, fileName, lineNumber and columnNumber.", "Version 104 also serializes stack in window.postMessage() and structuredClone()."]
No
64
No
77
77
103
["Version 103 serializable properties: name, message, cause, fileName, lineNumber and columnNumber.", "Version 104 also serializes stack in window.postMessage() and structuredClone()."]
55
No
12.0
No
No
See also
Error
Found a problem with this page?
Edit on GitHub
Source on GitHub
Report a problem with this content on GitHub
Want to fix the problem yourself? See our Contribution guide.
Last modified: Sep 5, 2022, by MDN contributors
|
avi_cloudproperties - Module for setup of CloudProperties Avi RESTful Object New in version 2.4.
Synopsis Requirements Parameters Notes Examples Return Values Status
Maintenance Author Synopsis This module is used to configure CloudProperties object more examples at https://github.com/avinetworks/devops
Requirements The below requirements are needed on the host that executes this module. avisdk Parameters Parameter Choices/Defaults Comments api_context (added in 2.5) Avi API context that includes current session ID and CSRF Token. This allows user to perform single login and re-use the session. api_version Default:"16.4.4" Avi API version of to use for Avi API and objects. avi_api_patch_op (added in 2.5)
Choices: add replace delete Patch operation to use when using avi_api_update_method as patch. avi_api_update_method (added in 2.5)
Choices:
put ← patch Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. avi_credentials (added in 2.5) Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. cc_props Cloudconnector properties. cc_vtypes Cloud types supported by cloudconnector. Enum options - CLOUD_NONE, CLOUD_VCENTER, CLOUD_OPENSTACK, CLOUD_AWS, CLOUD_VCA, CLOUD_APIC, CLOUD_MESOS, CLOUD_LINUXSERVER, CLOUD_DOCKER_UCP, CLOUD_RANCHER, CLOUD_OSHIFT_K8S, CLOUD_AZURE. controller Default:"" IP address or hostname of the controller. The default value is the environment variable AVI_CONTROLLER. hyp_props Hypervisor properties. info Properties specific to a cloud type. password Default:"" Password of Avi user in Avi controller. The default value is the environment variable AVI_PASSWORD. state
Choices: absent
present ← The state that should be applied on the entity. tenant Default:"admin" Name of tenant used for all Avi API calls and context of object. tenant_uuid Default:"" UUID of tenant used for all Avi API calls and context of object. url Avi controller URL of the object. username Default:"" Username used for accessing Avi controller. The default value is the environment variable AVI_USERNAME. uuid Unique object identifier of the object. Notes Note For more information on using Ansible to manage Avi Network devices see https://www.ansible.com/ansible-avi-networks. Examples - name: Example to create CloudProperties object
avi_cloudproperties:
controller: +1-909-522-6430
username: admin
password: something
state: present
name: sample_cloudproperties
Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description obj dict success, changed CloudProperties (api/cloudproperties) object Status This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface. Maintenance This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info. For a list of other modules that are also maintained by the Ansible Community, see here. Author Gaurav Rastogi ([email protected]) Hint If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
|
6.5.6. Record puns
NamedFieldPuns
Since:
6.10.1 Allow use of record puns.
Record puns are enabled by the language extension NamedFieldPuns. When using records, it is common to write a pattern that binds a variable with the same name as a record field, such as: data C = C {a 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Int}
f (C {a = a}) = a
Record punning permits the variable name to be elided, so one can simply write f (C {a}) = a
to mean the same pattern as above. That is, in a record pattern, the pattern a expands into the pattern a = a for the same name a. Note that:
Record punning can also be used in an expression, writing, for example, let a = 1 in C {a}
instead of let a = 1 in C {a = a}
The expansion is purely syntactic, so the expanded right-hand side expression refers to the nearest enclosing variable that is spelled the same as the field name.
Puns and other patterns can be mixed in the same record: data C = C {a 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Int, b 8b7c:f320:99b9:690f:4595:cd17:293a:c069 Int}
f (C {a, b = 4}) = a
Puns can be used wherever record patterns occur (e.g. in let bindings or at the top-level).
A pun on a qualified field name is expanded by stripping off the module qualifier. For example: f (C {M.a}) = a
means f (M.C {M.a = a}) = a
(This is useful if the field selector a for constructor M.C is only in scope in qualified form.)
|
Components
Components are the main building blocks of Yii applications. Components are instances of yii\base\Component, or an extended class. The three main features that components provide to other classes are: Properties Events Behaviors Separately and combined, these features make Yii classes much more customizable and easier to use. For example, the included date picker widget, a user interface component, can be used in a view to generate an interactive date picker: use yii\jui\DatePicker;
echo DatePicker8b7c:f320:99b9:690f:4595:cd17:293a:c069widget([
'language' => 'ru',
'name' => 'country',
'clientOptions' => [
'dateFormat' => 'yy-mm-dd',
],
]);
The widget's properties are easily writable because the class extends yii\base\Component. While components are very powerful, they are a bit heavier than normal objects, due to the fact that it takes extra memory and CPU time to support event and behavior functionality in particular. If your components do not need these two features, you may consider extending your component class from yii\base\Object instead of yii\base\Component. Doing so will make your components as efficient as normal PHP objects, but with added support for properties. When extending your class from yii\base\Component or yii\base\Object, it is recommended that you follow these conventions: If you override the constructor, specify a $config parameter as the constructor's last parameter, and then pass this parameter to the parent constructor. Always call the parent constructor at the end of your overriding constructor. If you override the yii\base\Object8b7c:f320:99b9:690f:4595:cd17:293a:c069init() method, make sure you call the parent implementation of init() at the beginning of your init() method. For example: <?php
namespace yii\components\MyClass;
use yii\base\Object;
class MyClass extends Object
{
public $prop1;
public $prop2;
public function __construct($param1, $param2, $config = [])
{
// ... initialization before configuration is applied
parent8b7c:f320:99b9:690f:4595:cd17:293a:c069__construct($config);
}
public function init()
{
parent8b7c:f320:99b9:690f:4595:cd17:293a:c069init();
// ... initialization after configuration is applied
}
}
Following these guidelines will make your components configurable when they are created. For example: $component = new MyClass(1, 2, ['prop1' => 3, 'prop2' => 4]);
// alternatively
$component = \Yii8b7c:f320:99b9:690f:4595:cd17:293a:c069reateObject([
'class' => MyClass8b7c:f320:99b9:690f:4595:cd17:293a:c069lassName(),
'prop1' => 3,
'prop2' => 4,
], [1, 2]);
Info: While the approach of calling Yii8b7c:f320:99b9:690f:4595:cd17:293a:c069reateObject() looks more complicated, it is more powerful because it is implemented on top of a dependency injection container. The yii\base\Object class enforces the following object lifecycle: Pre-initialization within the constructor. You can set default property values here. Object configuration via $config. The configuration may overwrite the default values set within the constructor. Post-initialization within init(). You may override this method to perform sanity checks and normalization of the properties. Object method calls. The first three steps all happen within the object's constructor. This means that once you get a class instance (i.e., an object), that object has already been initialized to a proper, reliable state.
|
Class RecordedObject
java.lang.Object jdk.jfr.consumer.RecordedObject Direct Known Subclasses:
RecordedClass, RecordedClassLoader, RecordedEvent, RecordedFrame, RecordedMethod, RecordedStackTrace, RecordedThread, RecordedThreadGroup
public class RecordedObject extends Object A complex data type that consists of one or more fields. This class provides methods to select and query nested objects by passing a dot "." delimited String object (for instance, "aaa.bbb"). A method evaluates a nested object from left to right, and if a part is null, it throws NullPointerException.
Since: 9 Method Summary
Modifier and Type
Method
Description
final boolean
getBoolean(String name)
Returns the value of a field of type boolean.
final byte
getByte(String name)
Returns the value of a field of type byte.
final char
getChar(String name)
Returns the value of a field of type char.
final RecordedClass
getClass(String name)
Returns the value of a field of type Class.
final double
getDouble(String name)
Returns the value of a field of type double or of another primitive type that is convertible to type double by a widening conversion.
final Duration
getDuration(String name)
Returns the value of a timespan field.
List<ValueDescriptor>
getFields()
Returns an immutable list of the fields for this object.
final float
getFloat(String name)
Returns the value of a field of type float or of another primitive type convertible to type float by a widening conversion.
final Instant
getInstant(String name)
Returns the value of a timestamp field.
final int
getInt(String name)
Returns the value of a field of type int or of another primitive type that is convertible to type int by a widening conversion.
final long
getLong(String name)
Returns the value of a field of type long or of another primitive type that is convertible to type long by a widening conversion.
final short
getShort(String name)
Returns the value of a field of type short or of another primitive type convertible to type short by a widening conversion.
final String
getString(String name)
Returns the value of a field of type String.
final RecordedThread
getThread(String name)
Returns the value of a field of type Thread.
final <T> T
getValue(String name)
Returns the value of the field with the given name.
boolean
hasField(String name)
Returns true if a field with the given name exists, false otherwise.
final String
toString()
Returns a textual representation of this object.
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Method Details hasField public boolean hasField(String name) Returns true if a field with the given name exists, false otherwise. It's possible to index into a nested field by using "." (for instance "thread.group.parent.name").
Parameters:
name - name of the field to get, not null
Returns:
true if the field exists, false otherwise See Also: getFields() getValue public final <T> T getValue(String name) Returns the value of the field with the given name. The return type may be a primitive type or a subclass of RecordedObject.
It's possible to index into a nested object by using "." (for instance "thread.group.parent.name").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Example
if (event.hasField("intValue")) {
int intValue = event.getValue("intValue");
System.out.println("Int value: " + intValue);
}
if (event.hasField("objectClass")) {
RecordedClass clazz = event.getValue("objectClass");
System.out.println("Class name: " + clazz.getName());
}
if (event.hasField("sampledThread")) {
RecordedThread sampledThread = event.getValue("sampledThread");
System.out.println("Sampled thread: " + sampledThread.getJavaName());
}
Type Parameters:
T - the return type Parameters:
name - of the field to get, not null
Returns: the value, can be null
Throws:
IllegalArgumentException - if no field called name exists See Also: hasField(String) getFields public List<ValueDescriptor> getFields() Returns an immutable list of the fields for this object. Returns: the fields, not null
getBoolean public final boolean getBoolean(String name) Returns the value of a field of type boolean. It's possible to index into a nested object using "." (for example, "aaa.bbb").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - name of the field to get, not null
Returns: the value of the field, true or false
Throws:
IllegalArgumentException - if the field doesn't exist, or the field is not of type boolean
See Also: hasField(String) getValue(String) getByte public final byte getByte(String name) Returns the value of a field of type byte. It's possible to index into a nested object using "." (for example, "foo.bar").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: the value of the field Throws:
IllegalArgumentException - if the field doesn't exist, or the field is not of type byte
See Also: hasField(String) getValue(String) getChar public final char getChar(String name) Returns the value of a field of type char. It's possible to index into a nested object using "." (for example, "aaa.bbb").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: the value of the field as a char
Throws:
IllegalArgumentException - if the field doesn't exist, or the field is not of type char
See Also: hasField(String) getValue(String) getShort public final short getShort(String name) Returns the value of a field of type short or of another primitive type convertible to type short by a widening conversion. This method can be used on the following types: short and byte.
If the field has the @Unsigned annotation and is of a narrower type than short, then the value is returned as an unsigned.
It's possible to index into a nested object using "." (for example, "aaa.bbb").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: the value of the field converted to type short
Throws:
IllegalArgumentException - if the field doesn't exist, or the field value can't be converted to the type short by a widening conversion See Also: hasField(String) getValue(String) getInt public final int getInt(String name) Returns the value of a field of type int or of another primitive type that is convertible to type int by a widening conversion. This method can be used on fields of the following types: int, short, char, and byte.
If the field has the @Unsigned annotation and is of a narrower type than int, then the value will be returned as an unsigned.
It's possible to index into a nested object using "." (for example, "aaa.bbb").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: the value of the field converted to type int
Throws:
IllegalArgumentException - if the field doesn't exist, or the field value can't be converted to the type int by a widening conversion See Also: hasField(String) getValue(String) getFloat public final float getFloat(String name) Returns the value of a field of type float or of another primitive type convertible to type float by a widening conversion. This method can be used on fields of the following types: float, long, int, short, char, and byte.
It's possible to index into a nested object using "." (for example, "aaa.bbb").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: the value of the field converted to type float
Throws:
IllegalArgumentException - if the field doesn't exist, or the field value can't be converted to the type float by a widening conversion See Also: hasField(String) getValue(String) getLong public final long getLong(String name) Returns the value of a field of type long or of another primitive type that is convertible to type long by a widening conversion. This method can be used on fields of the following types: long, int, short, char, and byte.
If the field has the @Unsigned annotation and is of a narrower type than long, then the value will be returned as an unsigned.
It's possible to index into a nested object using "." (for example, "aaa.bbb").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: the value of the field converted to type long
Throws:
IllegalArgumentException - if the field doesn't exist, or the field value can't be converted to the type long via a widening conversion See Also: hasField(String) getValue(String) getDouble public final double getDouble(String name) Returns the value of a field of type double or of another primitive type that is convertible to type double by a widening conversion. This method can be used on fields of the following types: double, float, long, int, short, char, and byte.
It's possible to index into a nested object using "." (for example, "aaa.bbb").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: the value of the field converted to type double
Throws:
IllegalArgumentException - if the field doesn't exist, or the field value can't be converted to the type double by a widening conversion See Also: hasField(String) getValue(String) getString public final String getString(String name) Returns the value of a field of type String. It's possible to index into a nested object using "." (for example, "foo.bar").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: the value of the field as a String, can be null
Throws:
IllegalArgumentException - if the field doesn't exist, or the field isn't of type String
See Also: hasField(String) getValue(String) getDuration public final Duration getDuration(String name) Returns the value of a timespan field. This method can be used on fields annotated with @Timespan, and of the following types: long, int, short, char, and byte.
It's possible to index into a nested object using "." (for example, "aaa.bbb").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: a time span represented as a Duration, not null
Throws:
IllegalArgumentException - if the field doesn't exist, or the field value can't be converted to a Duration object See Also: hasField(String) getValue(String) getInstant public final Instant getInstant(String name) Returns the value of a timestamp field. This method can be used on fields annotated with @Timestamp, and of the following types: long, int, short, char and byte.
It's possible to index into a nested object using "." (for example, "aaa.bbb").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: a timstamp represented as an Instant, not null
Throws:
IllegalArgumentException - if the field doesn't exist, or the field value can't be converted to an Instant object See Also: hasField(String) getValue(String) getClass public final RecordedClass getClass(String name) Returns the value of a field of type Class. It's possible to index into a nested object using "." (for example, "aaa.bbb").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: the value of the field as a RecordedClass, can be null
Throws:
IllegalArgumentException - if the field doesn't exist, or the field isn't of type Class
See Also: hasField(String) getValue(String) getThread public final RecordedThread getThread(String name) Returns the value of a field of type Thread. It's possible to index into a nested object using "." (for example, "foo.bar").
A field might change or be removed in a future JDK release. A best practice for callers of this method is to validate the field before attempting access.
Parameters:
name - of the field to get, not null
Returns: the value of the field as a RecordedThread object, can be null
Throws:
IllegalArgumentException - if the field doesn't exist, or the field isn't of type Thread
See Also: hasField(String) getValue(String) toString public final String toString() Returns a textual representation of this object. Overrides:
toString in class Object
Returns: textual description of this object
|
WP_oEm8b7c:f320:99b9:690f:4595:cd17:293a:c069_parse_xml_body( string $response_body ): stdClass|false
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness. Serves as a helper function for parsing an XML response body. Parameters $response_body string Required Return stdClass|false Source File: wp-includes/class-wp-oembed.php. View all references private function _parse_xml_body( $response_body ) {
if ( ! function_exists( 'simplexml_import_dom' ) || ! class_exists( 'DOMDocument', false ) ) {
return false;
}
$dom = new DOMDocument;
$success = $dom->loadXML( $response_body );
if ( ! $success ) {
return false;
}
if ( isset( $dom->doctype ) ) {
return false;
}
foreach ( $dom->childNodes as $child ) {
if ( XML_DOCUMENT_TYPE_NODE === $child->nodeType ) {
return false;
}
}
$xml = simplexml_import_dom( $dom );
if ( ! $xml ) {
return false;
}
$return = new stdClass;
foreach ( $xml as $key => $value ) {
$return->$key = (string) $value;
}
return $return;
}
Related Used By Used By Description WP_oEm8b7c:f320:99b9:690f:4595:cd17:293a:c069_parse_xml() wp-includes/class-wp-oembed.php Parses an XML response body.
Changelog Version Description 3.6.0 Introduced.
|
public function Stat8b7c:f320:99b9:690f:4595:cd17:293a:c069getMultiple public Stat8b7c:f320:99b9:690f:4595:cd17:293a:c069getMultiple(array $keys) Returns the stored key/value pairs for a given set of keys. Parameters array $keys: A list of keys to retrieve. Return value array An associative array of items successfully returned, indexed by key. Overrides StateInter8b7c:f320:99b9:690f:4595:cd17:293a:c069getMultiple File
core/lib/Drupal/Core/State/State.php, line 47 Class
State Provides the state system using a key value store. Namespace Drupal\Core\State Code public function getMultiple(array $keys) {
$values = array();
$load = array();
foreach ($keys as $key) {
// Check if we have a value in the cache.
if (isset($this->cache[$key])) {
$values[$key] = $this->cache[$key];
}
// Load the value if we don't have an explicit NULL value.
elseif (!array_key_exists($key, $this->cache)) {
$load[] = $key;
}
}
if ($load) {
$loaded_values = $this->keyValueStore->getMultiple($load);
foreach ($load as $key) {
// If we find a value, even one that is NULL, add it to the cache and
// return it.
if (isset($loaded_values[$key]) || array_key_exists($key, $loaded_values)) {
$values[$key] = $loaded_values[$key];
$this->cache[$key] = $loaded_values[$key];
}
else {
$this->cache[$key] = NULL;
}
}
}
return $values;
}
|
aci_interface_policy_ospf – Manage OSPF interface policies (ospf:IfPol) New in version 2.7. Synopsis Parameters Notes See Also Examples Return Values Status Synopsis Manage OSPF interface policies on Cisco ACI fabrics. Parameters Parameter Choices/Defaults Comments certificate_name - The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. It defaults to the private_key basename, without extension.
aliases: cert_name controls list
Choices: advert-subnet bfd mtu-ignore passive The interface policy controls. This is a list of one or more of the following controls:
advert-subnet -- Advertise IP subnet instead of a host mask in the router LSA.
bfd -- Bidirectional Forwarding Detection
mtu-ignore -- Disables MTU mismatch detection on an interface.
passive -- The interface does not participate in the OSPF protocol and will not establish adjacencies or send routing updates. However the interface is announced as part of the routing network. cost - The OSPF cost of the interface. The cost (also called metric) of an interface in OSPF is an indication of the overhead required to send packets across a certain interface. The cost of an interface is inversely proportional to the bandwidth of that interface. A higher bandwidth indicates a lower cost. There is more overhead (higher cost) and time delays involved in crossing a 56k serial line than crossing a 10M ethernet line. The formula used to calculate the cost is cost= 10000 0000/bandwith in bps For example, it will cost 10 EXP8/10 EXP7 = 10 to cross a 10M Ethernet line and will cost 10 EXP8/1544000 = 64 to cross a T1 line. By default, the cost of an interface is calculated based on the bandwidth; you can force the cost of an interface with the ip ospf cost value interface subconfiguration mode command. Accepted values range between 1 and 450. The APIC defaults to 0 when unset during creation. dead_interval integer The interval between hello packets from a neighbor before the router declares the neighbor as down. This value must be the same for all networking devices on a specific network. Specifying a smaller dead interval (seconds) will give faster detection of a neighbor being down and improve convergence, but might cause more routing instability. Accepted values range between 1 and 65535. The APIC defaults to 40 when unset during creation. description - The description for the OSPF interface.
aliases: descr hello_interval integer The interval between hello packets that OSPF sends on the interface. Note that the smaller the hello interval, the faster topological changes will be detected, but more routing traffic will ensue. This value must be the same for all routers and access servers on a specific network. Accepted values range between 1 and 65535. The APIC defaults to 10 when unset during creation. host - / required IP Address or hostname of APIC resolvable by Ansible control host.
aliases: hostname network_type -
Choices: bcast p2p The OSPF interface policy network type. OSPF supports broadcast and point-to-point. The APIC defaults to unspecified when unset during creation. ospf - / required The OSPF interface policy name. This name can be between 1 and 64 alphanumeric characters. Note that you cannot change this name after the object has been saved.
aliases: ospf_interface, name output_level -
Choices: debug info
normal ← Influence the output of this ACI module.
normal means the standard output, incl. current dict
info adds informational output, incl. previous, proposed and sent dicts
debug adds debugging output, incl. filter_string, method, response, status and url information password - / required The password to use for authentication. This option is mutual exclusive with private_key. If private_key is provided too, it will be used instead. port - Port number to be used for REST connection. The default value depends on parameter `use_ssl`. prefix_suppression boolean
Choices: no yes Whether prefix suppressions is enabled or disabled. The APIC defaults to inherit when unset during creation. priority integer The priority for the OSPF interface profile. Accepted values ranges between 0 and 255. The APIC defaults to 1 when unset during creation. private_key - / required PEM formatted file that contains your private key to be used for signature-based authentication. The name of the key (without extension) is used as the certificate name in ACI, unless certificate_name is specified. This option is mutual exclusive with password. If password is provided too, it will be ignored.
aliases: cert_key retransmit_interval integer The interval between LSA retransmissions. The retransmit interval occurs while the router is waiting for an acknowledgement from the neighbor router that it received the LSA. If no acknowlegment is received at the end of the interval, then the LSA is resent. Accepted values range between 1 and 65535. The APIC defaults to 5 when unset during creation. state -
Choices: absent
present ← query Use present or absent for adding or removing. Use query for listing an object or multiple objects. tenant - / required The name of the Tenant the OSPF interface policy should belong to.
aliases: tenant_name timeout integer Default:30 The socket level timeout in seconds. transmit_delay integer The delay time needed to send an LSA update packet. OSPF increments the LSA age time by the transmit delay amount before transmitting the LSA update. You should take into account the transmission and propagation delays for the interface when you set this value. Accepted values range between 1 and 450. The APIC defaults to 1 when unset during creation. use_proxy boolean
Choices: no
yes ← If no, it will not use a proxy, even if one is defined in an environment variable on the target hosts. use_ssl boolean
Choices: no
yes ← If no, an HTTP connection will be used instead of the default HTTPS connection. username - Default:"admin" The username to use for authentication.
aliases: user validate_certs boolean
Choices: no
yes ← If no, SSL certificates will not be validated. This should only set to no when used on personally controlled sites using self-signed certificates. Notes Note More information about the internal APIC class ospf:IfPol from the APIC Management Information Model reference. See Also See also Cisco ACI Guide Detailed information on how to manage your ACI infrastructure using Ansible. Developing Cisco ACI modules Detailed guide on how to write your own Cisco ACI modules to contribute. Examples - name: Ensure ospf interface policy exists
aci_interface_policy_ospf:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
ospf: ospf1
state: present
delegate_to: localhost
- name: Ensure ospf interface policy does not exist
aci_interface_policy_ospf:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
ospf: ospf1
state: present
delegate_to: localhost
- name: Query an ospf interface policy
aci_interface_policy_ospf:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
ospf: ospf1
state: query
delegate_to: localhost
register: query_result
- name: Query all ospf interface policies in tenant production
aci_interface_policy_ospf:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
state: query
delegate_to: localhost
register: query_result
Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description current list success The existing configuration from the APIC after the module has finished Sample: [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] error dictionary failure The error information as returned from the APIC Sample: {'code': '122', 'text': 'unknown managed object class foo'} filter_string string failure or debug The filter string used for the request Sample: ?rsp-prop-include=config-only method string failure or debug The HTTP method used for the request to the APIC Sample: POST previous list info The original configuration from the APIC before the module has started Sample: [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] proposed dictionary info The assembled configuration from the user-provided parameters Sample: {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} raw string parse error The raw output returned by the APIC REST API (xml or json) Sample: <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> response string failure or debug The HTTP response from the APIC Sample: OK (30 bytes) sent list info The actual/minimal configuration pushed to the APIC Sample: {'fvTenant': {'attributes': {'descr': 'Production environment'}}} status integer failure or debug The HTTP status from the APIC Sample: 200 url string failure or debug The HTTP url used for the request to the APIC Sample: https://603-937-5007/api/mo/uni/tn-production.json Status This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by an Ansible Partner. [certified]
Authors Dag Wieers (@dagwieers) Hint If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
|
XMLWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069setIndentString xmlwriter_set_indent_string (PHP 5 >= 5.1.2, PHP 7, PHP 8, PECL xmlwriter >= 0.1.0)
XMLWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069setIndentString -- xmlwriter_set_indent_string — Set string used for indenting Description Object-oriented style public XMLWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069setIndentString(string $indentation): bool Procedural style xmlwriter_set_indent_string(XMLWriter $writer, string $indentation): bool Sets the string which will be used to indent each element/attribute of the resulting xml. Parameters
writer
Only for procedural calls. The XMLWriter instance that is being modified. This object is returned from a call to xmlwriter_open_uri() or xmlwriter_open_memory().
indentation
The indentation string. Return Values Returns true on success or false on failure. Changelog Version Description 8.0.0 writer expects an XMLWriter instance now; previously, a resource was expected. Notes
Note:
The indent is reset when an xmlwriter is opened. See Also
XMLWriter8b7c:f320:99b9:690f:4595:cd17:293a:c069setIndent() - Toggle indentation on/off
|
ngine_io.cloudstack.cs_role – Manages user roles on Apache CloudStack based clouds. Note This plugin is part of the ngine_io.cloudstack collection (version 1.1.0). To install it use: ansible-galaxy collection install ngine_io.cloudstack. To use it in a playbook, specify: ngine_io.cloudstack.cs_role. New in version 0.1.0: of ngine_io.cloudstack Synopsis Requirements Parameters Notes Examples Return Values Synopsis Create, update, delete user roles. Requirements The below requirements are needed on the host that executes this module. python >= 2.6 cs >= 0.9.0 Parameters Parameter Choices/Defaults Comments api_http_method string
Choices: get post HTTP method used to query the API endpoint. If not given, the CLOUDSTACK_METHOD env variable is considered. As the last option, the value is taken from the ini config file, also see the notes. Fallback value is get if not specified. api_key string API key of the CloudStack API. If not given, the CLOUDSTACK_KEY env variable is considered. As the last option, the value is taken from the ini config file, also see the notes. api_region string Default:"cloudstack" Name of the ini section in the cloustack.ini file. If not given, the CLOUDSTACK_REGION env variable is considered. api_secret string Secret key of the CloudStack API. If not set, the CLOUDSTACK_SECRET env variable is considered. As the last option, the value is taken from the ini config file, also see the notes. api_timeout integer HTTP timeout in seconds. If not given, the CLOUDSTACK_TIMEOUT env variable is considered. As the last option, the value is taken from the ini config file, also see the notes. Fallback value is 10 seconds if not specified. api_url string URL of the CloudStack API e.g. https://cloud.example.com/client/api. If not given, the CLOUDSTACK_ENDPOINT env variable is considered. As the last option, the value is taken from the ini config file, also see the notes. api_verify_ssl_cert string CA authority cert file. If not given, the CLOUDSTACK_VERIFY env variable is considered. As the last option, the value is taken from the ini config file, also see the notes. Fallback value is null if not specified. description string Description of the role. name string / required Name of the role. role_type string
Choices:
User ← DomainAdmin ResourceAdmin Admin Type of the role. Only considered for creation. state string
Choices:
present ← absent State of the role. uuid string ID of the role. If provided, uuid is used as key.
aliases: id Notes Note Ansible uses the cs library’s configuration method if credentials are not provided by the arguments api_url, api_key, api_secret. Configuration is read from several locations, in the following order. The CLOUDSTACK_ENDPOINT, CLOUDSTACK_KEY, CLOUDSTACK_SECRET and CLOUDSTACK_METHOD. CLOUDSTACK_TIMEOUT environment variables. A CLOUDSTACK_CONFIG environment variable pointing to an .ini file. A cloudstack.ini file in the current working directory. A .cloudstack.ini file in the users home directory. Optionally multiple credentials and endpoints can be specified using ini sections in cloudstack.ini. Use the argument api_region to select the section name, default section is cloudstack. See https://github.com/exoscale/cs for more information. A detailed guide about cloudstack modules can be found in the CloudStack Cloud Guide. This module supports check mode. Examples - name: Ensure an user role is present
ngine_io.cloudstack.cs_role:
name: myrole_user
- name: Ensure a role having particular ID is named as myrole_user
ngine_io.cloudstack.cs_role:
name: myrole_user
id: 04589590-ac63-4ffc-93f5-b698b8ac38b6
- name: Ensure a role is absent
ngine_io.cloudstack.cs_role:
name: myrole_user
state: absent
Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description description string success Description of the role. Sample: This is my role description id string success UUID of the role. Sample: 04589590-ac63-4ffc-93f5-b698b8ac38b6 name string success Name of the role. Sample: myrole role_type string success Type of the role. Sample: User Authors René Moser (@resmo)
© 2012–2018 Michael DeHaan
|
bigip_gtm_monitor_bigip – Manages F5 BIG-IP GTM BIG-IP monitors New in version 2.6. Synopsis Requirements Parameters Notes Examples Return Values Status Synopsis Manages F5 BIG-IP GTM BIG-IP monitors. This monitor is used by GTM to monitor BIG-IPs themselves. Requirements The below requirements are needed on the host that executes this module. f5-sdk >= 3.0.16 Parameters Parameter Choices/Defaults Comments aggregate_dynamic_ratios -
Choices: none average-nodes sum-nodes average-members sum-members Specifies how the system combines the module values to create the proportion (score) for the load balancing operation. The score represents the module's estimated capacity for handing traffic. Averaged values are appropriate for downstream Web Accelerator or Application Security Manager virtual servers. When creating a new monitor, if this parameter is not specified, the default of none is used, meaning that the system does not use the scores in the load balancing operation. When none, specifies that the monitor ignores the nodes and pool member scores. When average-nodes, specifies that the system averages the dynamic ratios on the nodes associated with the monitor's target virtual servers and returns that average as the virtual servers' score. When sum-nodes, specifies that the system adds together the scores of the nodes associated with the monitor's target virtual servers and uses that value in the load balancing operation. When average-members, specifies that the system averages the dynamic ratios on the pool members associated with the monitor's target virtual servers and returns that average as the virtual servers' score. When sum-members, specifies that the system adds together the scores of the pool members associated with the monitor's target virtual servers and uses that value in the load balancing operation. ignore_down_response boolean
Choices: no yes Specifies that the monitor allows more than one probe attempt per interval. When yes, specifies that the monitor ignores down responses for the duration of the monitor timeout. Once the monitor timeout is reached without the system receiving an up response, the system marks the object down. When no, specifies that the monitor immediately marks an object down when it receives a down response. When creating a new monitor, if this parameter is not provided, then the default value will be no. interval - Specifies, in seconds, the frequency at which the system issues the monitor check when either the resource is down or the status of the resource is unknown. When creating a new monitor, if this parameter is not provided, then the default value will be 30. This value must be less than the timeout value. ip - IP address part of the IP/port definition. If this parameter is not provided when creating a new monitor, then the default value will be '*'. name - / required Monitor name. parent - Default:"/Common/bigip" The parent template of this monitor template. Once this value has been set, it cannot be changed. By default, this value is the bigip parent on the Common partition. partition - Default:"Common" Device partition to manage resources on. password - / required The password for the user account used to connect to the BIG-IP. You may omit this option by setting the environment variable F5_PASSWORD.
aliases: pass, pwd port - Port address part of the IP/port definition. If this parameter is not provided when creating a new monitor, then the default value will be '*'. Note that if specifying an IP address, a value between 1 and 65535 must be specified provider - added in 2.5 Default:null A dict object containing connection details. password - / required The password for the user account used to connect to the BIG-IP. You may omit this option by setting the environment variable F5_PASSWORD.
aliases: pass, pwd server - / required The BIG-IP host. You may omit this option by setting the environment variable F5_SERVER. server_port - Default:443 The BIG-IP server port. You may omit this option by setting the environment variable F5_SERVER_PORT. ssh_keyfile - Specifies the SSH keyfile to use to authenticate the connection to the remote device. This argument is only used for cli transports. You may omit this option by setting the environment variable ANSIBLE_NET_SSH_KEYFILE. timeout - Default:10 Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. transport - / required
Choices: rest
cli ← Configures the transport connection to use when connecting to the remote device. user - / required The username to connect to the BIG-IP with. This user must have administrative privileges on the device. You may omit this option by setting the environment variable F5_USER. validate_certs boolean
Choices: no
yes ← If no, SSL certificates are not validated. Use this only on personally controlled sites using self-signed certificates. You may omit this option by setting the environment variable F5_VALIDATE_CERTS. server - / required The BIG-IP host. You may omit this option by setting the environment variable F5_SERVER. server_port - added in 2.2 Default:443 The BIG-IP server port. You may omit this option by setting the environment variable F5_SERVER_PORT. state -
Choices:
present ← absent When present, ensures that the monitor exists. When absent, ensures the monitor is removed. timeout - Specifies the number of seconds the target has in which to respond to the monitor request. If the target responds within the set time period, it is considered up. If the target does not respond within the set time period, it is considered down. When this value is set to 0 (zero), the system uses the interval from the parent monitor. When creating a new monitor, if this parameter is not provided, then the default value will be 90. user - / required The username to connect to the BIG-IP with. This user must have administrative privileges on the device. You may omit this option by setting the environment variable F5_USER. validate_certs boolean added in 2.0
Choices: no
yes ← If no, SSL certificates are not validated. Use this only on personally controlled sites using self-signed certificates. You may omit this option by setting the environment variable F5_VALIDATE_CERTS. Notes Note Requires BIG-IP software version >= 12 For more information on using Ansible to manage F5 Networks devices see https://www.ansible.com/integrations/networks/f5. Requires the f5-sdk Python package on the host. This is as easy as pip install f5-sdk. Requires BIG-IP software version >= 12. The F5 modules only manipulate the running configuration of the F5 product. To ensure that BIG-IP specific configuration persists to disk, be sure to include at least one task that uses the bigip_config module to save the running configuration. Refer to the module’s documentation for the correct usage of the module to save your running configuration. Examples - name: Create BIG-IP Monitor
bigip_gtm_monitor_bigip:
state: present
ip: (607)661-0016
server: lb.mydomain.com
user: admin
password: secret
name: my_monitor
delegate_to: localhost
- name: Remove BIG-IP Monitor
bigip_gtm_monitor_bigip:
state: absent
server: lb.mydomain.com
user: admin
password: secret
name: my_monitor
delegate_to: localhost
- name: Add BIG-IP monitor for all addresses, port 514
bigip_gtm_monitor_bigip:
server: lb.mydomain.com
user: admin
port: 514
password: secret
name: my_monitor
delegate_to: localhost
Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description aggregate_dynamic_ratios string changed The new aggregate of to the monitor. Sample: sum-members ignore_down_response boolean changed Whether to ignore the down response or not. Sample: True interval integer changed The new interval in which to run the monitor check. Sample: 2 ip string changed The new IP of IP/port definition. Sample: (607)661-0016 parent string changed New parent template of the monitor. Sample: bigip timeout integer changed The new timeout in which the remote system must respond to the monitor. Sample: 10 Status This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by an Ansible Partner. [certified]
Authors Tim Rupp (@caphrim007) Hint If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
|
tf.compat.v1.train.init_from_checkpoint Replaces tf.Variable initializers so they load from a checkpoint file.
tf.compat.v1.train.init_from_checkpoint(
ckpt_dir_or_file, assignment_map
)
Migrate to TF2 Caution: This API was designed for TensorFlow v1. Continue reading for details on how to migrate from this API to a native TensorFlow v2 equivalent. See the TensorFlow v1 to TensorFlow v2 migration guide for instructions on how to migrate the rest of your code. tf.compat.v1.train.init_from_checkpoint is not recommended for restoring variable values in TF2. To restore checkpoints in TF2, please use tf.keras.Model.load_weights or tf.train.Checkpoint.restore. These APIs use use an object-based method of checkpointing, while tf.compat.v1.init_from_checkpoint relies on a more-fragile variable-name based method of checkpointing. There is no object-based equivalent of init_from_checkpoint in TF2. Please re-write your checkpoints immediately using the object-based APIs, see migration guide for more details. You can load a name-based checkpoint written by tf.compat.v1.train.Saver using tf.train.Checkpoint.restore or tf.keras.Model.load_weights. However, you may have to change the names of the variables in your model to match the variable names in the name-based checkpoint, which can be viewed with tf.train.list_variables(path). Another option is to create an assignment_map that maps the name of the variables in the name-based checkpoint to the variables in your model, eg: {
'sequential/dense/bias': model.variables[0],
'sequential/dense/kernel': model.variables[1]
}
and use tf.compat.v1.train.init_from_checkpoint(path, assignment_map) to restore the name-based checkpoint. After restoring, re-encode your checkpoint using tf.train.Checkpoint.save or tf.keras.Model.save_weights. Description Values are not loaded immediately, but when the initializer is run (typically by running a tf.compat.v1.global_variables_initializer op).
Note: This overrides default initialization ops of specified variables and redefines dtype.
Assignment map supports following syntax:
'checkpoint_scope_name/': 'scope_name/' - will load all variables in current scope_name from checkpoint_scope_name with matching tensor names.
'checkpoint_scope_name/some_other_variable': 'scope_name/variable_name' - will initialize scope_name/variable_name variable from checkpoint_scope_name/some_other_variable.
'scope_variable_name': variable - will initialize given tf.Variable object with tensor 'scope_variable_name' from the checkpoint.
'scope_variable_name': list(variable) - will initialize list of partitioned variables with tensor 'scope_variable_name' from the checkpoint.
'/': 'scope_name/' - will load all variables in current scope_name from checkpoint's root (e.g. no scope). Supports loading into partitioned variables, which are represented as '<variable>/part_<part #>'. Assignment map can be a dict, or a list of pairs. The latter is necessary to initialize multiple variables in the current graph from the same variable in the checkpoint. Example:
# Say, '/tmp/model.ckpt' has the following tensors:
# -- name='old_scope_1/var1', shape=[20, 2]
# -- name='old_scope_1/var2', shape=[50, 4]
# -- name='old_scope_2/var3', shape=[100, 100]
# Create new model's variables
with tf.compat.v1.variable_scope('new_scope_1'):
var1 = tf.compat.v1.get_variable('var1', shape=[20, 2],
initializer=tf.compat.v1.zeros_initializer())
with tf.compat.v1.variable_scope('new_scope_2'):
var2 = tf.compat.v1.get_variable('var2', shape=[50, 4],
initializer=tf.compat.v1.zeros_initializer())
# Partition into 5 variables along the first axis.
var3 = tf.compat.v1.get_variable(name='var3', shape=[100, 100],
initializer=tf.compat.v1.zeros_initializer(),
partitioner=lambda shape, dtype: [5, 1])
# Initialize all variables in `new_scope_1` from `old_scope_1`.
init_from_checkpoint('/tmp/model.ckpt', {'old_scope_1/': 'new_scope_1/'})
# Use names to specify which variables to initialize from checkpoint.
init_from_checkpoint('/tmp/model.ckpt',
{'old_scope_1/var1': 'new_scope_1/var1',
'old_scope_1/var2': 'new_scope_2/var2'})
# Or use tf.Variable objects to identify what to initialize.
init_from_checkpoint('/tmp/model.ckpt',
{'old_scope_1/var1': var1,
'old_scope_1/var2': var2})
# Initialize partitioned variables using variable's name
init_from_checkpoint('/tmp/model.ckpt',
{'old_scope_2/var3': 'new_scope_2/var3'})
# Or specify the list of tf.Variable objects.
init_from_checkpoint('/tmp/model.ckpt',
{'old_scope_2/var3': var3._get_variable_list()})
Args
ckpt_dir_or_file Directory with checkpoints file or path to checkpoint.
assignment_map Dict, or a list of key-value pairs, where keys are names of the variables in the checkpoint and values are current variables or names of current variables (in default graph).
Raises
ValueError If missing variables in current graph, or if missing checkpoints or tensors in checkpoints.
|
consul_services The consul_services data source returns a list of Consul services that have been registered with the Consul cluster in a given datacenter. By specifying a different datacenter in the query_options it is possible to retrieve a list of services from a different WAN-attached Consul datacenter. This data source is different from the consul_service (singular) data source, which provides a detailed response about a specific Consul service. Example Usage data "consul_services" "read-dc1" {
query_options {
# Optional parameter: implicitly uses the current datacenter of the agent
datacenter = "dc1"
}
}
# Set the description to a whitespace delimited list of the services
resource "example_resource" "app" {
description = "${join(" ", data.consul_services.names)}"
# ...
}
Argument Reference The following arguments are supported:
datacenter - (Optional) The Consul datacenter to query. Defaults to the same value found in query_options parameter specified below, or if that is empty, the datacenter value found in the Consul agent that this provider is configured to talk to.
query_options - (Optional) See below. The query_options block supports the following:
allow_stale - (Optional) When true, the default, allow responses from Consul servers that are followers.
require_consistent - (Optional) When true force the client to perform a read on at least quorum servers and verify the result is the same. Defaults to false.
token - (Optional) Specify the Consul ACL token to use when performing the request. This defaults to the same API token configured by the consul provider but may be overriden if necessary.
wait_index - (Optional) Index number used to enable blocking quereis.
wait_time - (Optional) Max time the client should wait for a blocking query to return. Attributes Reference The following attributes are exported:
datacenter - The datacenter the keys are being read from to.
names - A list of the Consul services found. This will always contain the list of services found.
services.<service> - For each name given, the corresponding attribute is a Terraform map of services and their tags. The value is an alphanumerically sorted, whitespace delimited set of tags associated with the service.
tags - A map of the tags found for each service. If more than one service shares the same tag, unique service names will be joined by whitespace (this is the inverse of services and can be used to lookup the services that match a single tag).
|
WeakMap.prototype.get()
The get() method returns a specified element from a WeakMap object.
Try it
Syntax
get(key)
Parameters
key Required. The key of the element to return from the WeakMap object. Return value
The element associated with the specified key in the WeakMap object. If the key can't be found, undefined is returned. Examples
Using the get() method
const wm = new WeakMap();
wm.set(window, 'foo');
wm.get(window); // Returns "foo".
wm.get('baz'); // Returns undefined.
Specifications
Specification
ECMAScript Language Specification # sec-weakmap.prototype.get
Browser compatibility
Desktop
Mobile
Server
Chrome
Edge
Firefox
Internet Explorer
Opera
Safari
WebView Android
Chrome Android
Firefox for Android
Opera Android
Safari on IOS
Samsung Internet
Deno
Node.js
get
36
12
6
Before Firefox 38, this method threw a TypeError when the key parameter was not an object. However, the ES2015 specification specifies to return undefined instead. Furthermore, WeakMap.prototype.get accepted an optional second argument as a fallback value, which is not part of the standard. Both non-standard behaviors are removed in version 38 and higher.
11
23
8
37
36
6
Before Firefox 38, this method threw a TypeError when the key parameter was not an object. However, the ES2015 specification specifies to return undefined instead. Furthermore, WeakMap.prototype.get accepted an optional second argument as a fallback value, which is not part of the standard. Both non-standard behaviors are removed in version 38 and higher.
24
8
3.0
1.0
0.12.0
0.10.0
See also
WeakMap WeakMap.prototype.set() WeakMap.prototype.has()
Found a problem with this page?
Edit on GitHub
Source on GitHub
Report a problem with this content on GitHub
Want to fix the problem yourself? See our Contribution guide.
Last modified: Sep 5, 2022, by MDN contributors
|
platform-browser-dynamic module JitCompilerFactory
RESOURCE_CACHE_PROVIDER
platformBrowserDynamic
|
Buffer-Local Variables Global and local variable bindings are found in most programming languages in one form or another. Emacs, however, also supports additional, unusual kinds of variable binding, such as buffer-local bindings, which apply only in one buffer. Having different values for a variable in different buffers is an important customization method. (Variables can also have bindings that are local to each terminal. See Multiple Terminals.)
• Intro to Buffer-Local
Introduction and concepts.
• Creating Buffer-Local
Creating and destroying buffer-local bindings.
• Default Value
The default value is seen in buffers that don’t have their own buffer-local values.
Copyright
|
Thenable<T>(ThenableStruct<T>)
package js.lib
from ThenableStruct<T>
import js.lib.Promise
Available on js
A value with a then method.
|
WP_Theme_Install_List_Tabl8b7c:f320:99b9:690f:4595:cd17:293a:c069display_rows() Source File: wp-admin/includes/class-wp-theme-install-list-table.php. View all references public function display_rows() {
$themes = $this->items;
foreach ( $themes as $theme ) {
?>
<div class="available-theme installable-theme">
<?php
$this->single_row( $theme );
?>
</div>
<?php
} // End foreach $theme_names.
$this->theme_installer();
}
Related Uses Uses Description WP_Theme_Install_List_Tabl8b7c:f320:99b9:690f:4595:cd17:293a:c069single_row() wp-admin/includes/class-wp-theme-install-list-table.php Prints a theme from the WordPress.org API. WP_Theme_Install_List_Tabl8b7c:f320:99b9:690f:4595:cd17:293a:c069theme_installer() wp-admin/includes/class-wp-theme-install-list-table.php Prints the wrapper for the theme installer.
|
statsmodels.tsa.statespace.varmax.VARMAXResults.test_normality
VARMAXResults.test_normality(method)
Test for normality of standardized residuals. Null hypothesis is normality.
Parameters:
method (string {'jarquebera'} or None) – The statistical test for normality. Must be ‘jarquebera’ for Jarque-Bera normality test. If None, an attempt is made to select an appropriate test. Notes If the first d loglikelihood values were burned (i.e. in the specified model, loglikelihood_burn=d), then this test is calculated ignoring the first d residuals. In the case of missing data, the maintained hypothesis is that the data are missing [email protected]. This test is then run on the standardized residuals excluding those corresponding to missing observations. See also statsmodels.stats.stattools.jarque_bera
© 2009–2012 Statsmodels Developers© 2006–2008 Scipy Developers
|
Class SimpleRelinkableCallSite java.lang.Object java.lang.invoke.CallSite java.lang.invoke.MutableCallSite jdk.dynalink.support.AbstractRelinkableCallSite jdk.dynalink.support.SimpleRelinkableCallSite All Implemented Interfaces: RelinkableCallSite public class SimpleRelinkableCallSite
extends AbstractRelinkableCallSite A relinkable call site that implements monomorphic inline caching strategy, only being linked to a single GuardedInvocation at any given time. If the guard of that single invocation fails, or it has an invalidated switch point, or its invalidating exception triggered, then the call site will throw it away and ask its associated DynamicLinker to relink it. Constructors Constructor Description SimpleRelinkableCallSite(CallSiteDescriptor descriptor) Creates a new call site with monomorphic inline caching strategy. Methods Methods declared in class java.lang.invoke.MutableCallSite
getTarget, setTarget, syncAll Methods declared in class java.lang.invoke.CallSite
dynamicInvoker, type Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Methods declared in interface jdk.dynalink.RelinkableCallSite
getDescriptor, initialize, relink, resetAndRelink Constructors SimpleRelinkableCallSite public SimpleRelinkableCallSite(CallSiteDescriptor descriptor) Creates a new call site with monomorphic inline caching strategy. Parameters:
descriptor - the descriptor for this call site
|
protected function EntityFieldManager8b7c:f320:99b9:690f:4595:cd17:293a:c069uildBundleFieldDefinitions protected EntityFieldManager8b7c:f320:99b9:690f:4595:cd17:293a:c069uildBundleFieldDefinitions($entity_type_id, $bundle, array $base_field_definitions) Builds field definitions for a specific bundle within an entity type. Parameters string $entity_type_id: The entity type ID. Only entity types that implement \Drupal\Core\Entity\FieldableEntityInterface are supported. string $bundle: The bundle. \Drupal\Core\Field\FieldDefinitionInterface[] $base_field_definitions: The list of base field definitions. Return value \Drupal\Core\Field\FieldDefinitionInterface[] An array of bundle field definitions, keyed by field name. Does not include base fields. File
core/lib/Drupal/Core/Entity/EntityFieldManager.php, line 325 Class
EntityFieldManager Manages the discovery of entity fields. Namespace Drupal\Core\Entity Code protected function buildBundleFieldDefinitions($entity_type_id, $bundle, array $base_field_definitions) {
$entity_type = $this->entityTypeManager->getDefinition($entity_type_id);
$class = $entity_type->getClass();
// Allow the entity class to provide bundle fields and bundle-specific
// overrides of base fields.
$bundle_field_definitions = $class8b7c:f320:99b9:690f:4595:cd17:293a:c069undleFieldDefinitions($entity_type, $bundle, $base_field_definitions);
// Load base field overrides from configuration. These take precedence over
// base field overrides returned above.
$base_field_override_ids = array_map(function($field_name) use ($entity_type_id, $bundle) {
return $entity_type_id . '.' . $bundle . '.' . $field_name;
}, array_keys($base_field_definitions));
$base_field_overrides = $this->entityTypeManager->getStorage('base_field_override')->loadMultiple($base_field_override_ids);
foreach ($base_field_overrides as $base_field_override) {
/** @var \Drupal\Core\Field\Entity\BaseFieldOverride $base_field_override */
$field_name = $base_field_override->getName();
$bundle_field_definitions[$field_name] = $base_field_override;
}
$provider = $entity_type->getProvider();
foreach ($bundle_field_definitions as $definition) {
// @todo Remove this check once FieldDefinitionInterface exposes a proper
// provider setter. See https://www.drupal.org/node/2225961.
if ($definition instanceof BaseFieldDefinition) {
$definition->setProvider($provider);
}
}
// Retrieve base field definitions from modules.
foreach ($this->moduleHandler->getImplementations('entity_bundle_field_info') as $module) {
$module_definitions = $this->moduleHandler->invoke($module, 'entity_bundle_field_info', [$entity_type, $bundle, $base_field_definitions]);
if (!empty($module_definitions)) {
// Ensure the provider key actually matches the name of the provider
// defining the field.
foreach ($module_definitions as $field_name => $definition) {
// @todo Remove this check once FieldDefinitionInterface exposes a
// proper provider setter. See https://www.drupal.org/node/2225961.
if ($definition instanceof BaseFieldDefinition) {
$definition->setProvider($module);
}
$bundle_field_definitions[$field_name] = $definition;
}
}
}
// Automatically set the field name, target entity type and bundle
// for non-configurable fields.
foreach ($bundle_field_definitions as $field_name => $field_definition) {
if ($field_definition instanceof BaseFieldDefinition) {
$field_definition->setName($field_name);
$field_definition->setTargetEntityTypeId($entity_type_id);
$field_definition->setTargetBundle($bundle);
}
}
// Invoke 'per bundle' alter hook.
$this->moduleHandler->alter('entity_bundle_field_info', $bundle_field_definitions, $entity_type, $bundle);
return $bundle_field_definitions;
}
|
useMounted
Category
Component
Export Size
777 B
Last Changed
10 months ago
Mounted state in ref.
Usage
import { useMounted } from '@vueuse/core'
const isMounted = useMounted()
Which is essentially a shorthand of:
const isMounted = ref(false)
onMounted(() => {
isMounted.value = true
})
Type Declarations
/**
* Mounted state in ref.
*
* @see https://vueuse.org/useMounted
* @param options
*/
export declare function useMounted(): Ref<boolean>
Source
Source • Demo • Docs
|
dart:html
onSoundStart property Stream<Event> onSoundStart Stream of soundstart events handled by this SpeechRecognition. Source @DomName('SpeechRecognition.onsoundstart')
@DocsEditable()
Stream<Event> get onSoundStart => soundStartEvent.forTarget(this);
|
backends matplotlib.backend_bases matplotlib.backend_managers matplotlib.backends.backend_mixed matplotlib.backend_tools matplotlib.backends.backend_agg
matplotlib.backends.backend_cairo A Cairo backend for matplotlib matplotlib.backends.backend_gtk3agg matplotlib.backends.backend_gtk3cairo matplotlib.backends.backend_nbagg matplotlib.backends.backend_pdf matplotlib.backends.backend_pgf matplotlib.backends.backend_ps matplotlib.backends.backend_qt4agg matplotlib.backends.backend_qt4cairo matplotlib.backends.backend_qt5agg matplotlib.backends.backend_qt5cairo matplotlib.backends.backend_svg matplotlib.backends.backend_tkagg matplotlib.backends.backend_webagg matplotlib.backends.backend_wxagg
|
MatchObject
package python.lib import python.lib.Re
Available on python
Variables
read onlyendpos:Int
read onlylastgroup:Int
read onlylastindex:Int
read onlypos:Int
read onlyre:Regex
read onlystring:String
Methods
end(i:Int = 0):Int
end(x:String):Int
inlineendById(s:String):Int
expand(template:String):String
group(i:Int = 0):String
group(x:String):String
inlinegroupById(s:String):String
groupdict(?defaultVal:Dict<String, String>):Dict<String, String>
groups(?defaultVal:String):Tuple<String>
span(?i:Int):Tuple2<Int, Int>
start(i:Int = 0):Int
start(x:String):Int
inlinestartById(s:String):Int
|
QAbstractCameraController Class (Qt3DExtras8b7c:f320:99b9:690f:4595:cd17:293a:c069QAbstractCameraController) The QAbstractCameraController class provides basic functionality for camera controllers. More...
Header:
#include <QAbstractCameraController>
qmake:
QT += 3dextras
Since:
Qt 5.10
Inherits:
Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QEntity
Inherited By:
Qt3DExtras8b7c:f320:99b9:690f:4595:cd17:293a:c069QFirstPersonCameraController and Qt3DExtras8b7c:f320:99b9:690f:4595:cd17:293a:c069QOrbitCameraController
This class was introduced in Qt 5.10. List of all members, including inherited members Properties
acceleration : float
camera : Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QCamera*
deceleration : float
linearSpeed : float
lookSpeed : float
Public Functions
float
acceleration() const
Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QCamera *
camera() const
float
deceleration() const
float
linearSpeed() const
float
lookSpeed() const
void
setAcceleration(float acceleration)
void
setCamera(Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QCamera *camera)
void
setDeceleration(float deceleration)
void
setLinearSpeed(float linearSpeed)
void
setLookSpeed(float lookSpeed)
Signals
void
accelerationChanged(float acceleration)
void
cameraChanged()
void
decelerationChanged(float deceleration)
void
linearSpeedChanged()
void
lookSpeedChanged()
Protected Functions
Qt3DInput8b7c:f320:99b9:690f:4595:cd17:293a:c069QKeyboardDevice *
keyboardDevice() const
Qt3DInput8b7c:f320:99b9:690f:4595:cd17:293a:c069QMouseDevice *
mouseDevice() const
Detailed Description
QAbstractCameraController sets up and handles input from keyboard, mouse, and other devices. QAbstractCameraController is an abstract class and cannot itself be instantiated. It provides a standard interface for camera controllers. Derived classes need only implement the frameActionTriggered() method to move the camera. Property Documentation
acceleration : float
Holds the current acceleration of the camera controller. Access functions:
float
acceleration() const
void
setAcceleration(float acceleration)
Notifier signal:
void
accelerationChanged(float acceleration)
camera : Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QCamera*
Holds the currently controlled camera. Access functions:
Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QCamera *
camera() const
void
setCamera(Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QCamera *camera)
Notifier signal:
void
cameraChanged()
deceleration : float
Holds the current deceleration of the camera controller. Access functions:
float
deceleration() const
void
setDeceleration(float deceleration)
Notifier signal:
void
decelerationChanged(float deceleration)
linearSpeed : float
Holds the current linear speed of the camera controller. Linear speed determines the movement speed of the camera. The default is 10.0. Access functions:
float
linearSpeed() const
void
setLinearSpeed(float linearSpeed)
Notifier signal:
void
linearSpeedChanged()
lookSpeed : float
Holds the current look speed of the camera controller. The look speed determines the turn rate of the camera pan and tilt. The default is 180.0. Access functions:
float
lookSpeed() const
void
setLookSpeed(float lookSpeed)
Notifier signal:
void
lookSpeedChanged()
Member Function Documentation
[protected] Qt3DInput8b7c:f320:99b9:690f:4595:cd17:293a:c069QKeyboardDevice *QAbstractCameraController8b7c:f320:99b9:690f:4595:cd17:293a:c069keyboardDevice() const
Provides access to the keyboard device.
[protected] Qt3DInput8b7c:f320:99b9:690f:4595:cd17:293a:c069QMouseDevice *QAbstractCameraController8b7c:f320:99b9:690f:4595:cd17:293a:c069mouseDevice() const
Provides access to the mouse device.
|
Struct st8b7c:f320:99b9:690f:4595:cd17:293a:c069collections8b7c:f320:99b9:690f:4595:cd17:293a:c069linked_list8b7c:f320:99b9:690f:4595:cd17:293a:c069ursorMut
pub struct CursorMut<'a, T>where T: 'a,{ /* private fields */ }
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
A cursor over a LinkedList with editing operations. A Cursor is like an iterator, except that it can freely seek back-and-forth, and can safely mutate the list during iteration. This is because the lifetime of its yielded references is tied to its own lifetime, instead of just the underlying list. This means cursors cannot yield multiple [email protected]. Cursors always rest between two elements in the list, and index in a logically circular way. To accommodate this, there is a “ghost” non-element that yields None between the head and tail of the list. Implementations
sourceimpl<'a, T> CursorMut<'a, T>
sourcepub fn index(&self) -> Option<usize>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Returns the cursor position index within the LinkedList. This returns None if the cursor is currently pointing to the “ghost” non-element.
sourcepub fn move_next(&mut self)
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Moves the cursor to the next element of the LinkedList. If the cursor is pointing to the “ghost” non-element then this will move it to the first element of the LinkedList. If it is pointing to the last element of the LinkedList then this will move it to the “ghost” non-element.
sourcepub fn move_prev(&mut self)
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Moves the cursor to the previous element of the LinkedList. If the cursor is pointing to the “ghost” non-element then this will move it to the last element of the LinkedList. If it is pointing to the first element of the LinkedList then this will move it to the “ghost” non-element.
sourcepub fn current(&mut self) -> Option<&mut T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Returns a reference to the element that the cursor is currently pointing to. This returns None if the cursor is currently pointing to the “ghost” non-element.
sourcepub fn peek_next(&mut self) -> Option<&mut T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Returns a reference to the next element. If the cursor is pointing to the “ghost” non-element then this returns the first element of the LinkedList. If it is pointing to the last element of the LinkedList then this returns None.
sourcepub fn peek_prev(&mut self) -> Option<&mut T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Returns a reference to the previous element. If the cursor is pointing to the “ghost” non-element then this returns the last element of the LinkedList. If it is pointing to the first element of the LinkedList then this returns None.
sourcepub fn as_cursor(&self) -> Cursor<'_, T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Returns a read-only cursor pointing to the current element. The lifetime of the returned Cursor is bound to that of the CursorMut, which means it cannot outlive the CursorMut and that the CursorMut is frozen for the lifetime of the Cursor.
sourceimpl<'a, T> CursorMut<'a, T>
sourcepub fn insert_after(&mut self, item: T)
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Inserts a new element into the LinkedList after the current one. If the cursor is pointing at the “ghost” non-element then the new element is inserted at the front of the LinkedList.
sourcepub fn insert_before(&mut self, item: T)
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Inserts a new element into the LinkedList before the current one. If the cursor is pointing at the “ghost” non-element then the new element is inserted at the end of the LinkedList.
sourcepub fn remove_current(&mut self) -> Option<T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Removes the current element from the LinkedList. The element that was removed is returned, and the cursor is moved to point to the next element in the LinkedList. If the cursor is currently pointing to the “ghost” non-element then no element is removed and None is returned.
sourcepub fn remove_current_as_list(&mut self) -> Option<LinkedList<T>>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Removes the current element from the LinkedList without deallocating the list node. The node that was removed is returned as a new LinkedList containing only this node. The cursor is moved to point to the next element in the current LinkedList. If the cursor is currently pointing to the “ghost” non-element then no element is removed and None is returned.
sourcepub fn splice_after(&mut self, list: LinkedList<T>)
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Inserts the elements from the given LinkedList after the current one. If the cursor is pointing at the “ghost” non-element then the new elements are inserted at the start of the LinkedList.
sourcepub fn splice_before(&mut self, list: LinkedList<T>)
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Inserts the elements from the given LinkedList before the current one. If the cursor is pointing at the “ghost” non-element then the new elements are inserted at the end of the LinkedList.
sourcepub fn split_after(&mut self) -> LinkedList<T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Splits the list into two after the current element. This will return a new list consisting of everything after the cursor, with the original list retaining everything before. If the cursor is pointing at the “ghost” non-element then the entire contents of the LinkedList are moved.
sourcepub fn split_before(&mut self) -> LinkedList<T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Splits the list into two before the current element. This will return a new list consisting of everything before the cursor, with the original list retaining everything after. If the cursor is pointing at the “ghost” non-element then the entire contents of the LinkedList are moved.
sourcepub fn push_front(&mut self, elt: T)
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Appends an element to the front of the cursor’s parent list. The node that the cursor points to is unchanged, even if it is the “ghost” node. This operation should compute in O(1) time.
sourcepub fn push_back(&mut self, elt: T)
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Appends an element to the back of the cursor’s parent list. The node that the cursor points to is unchanged, even if it is the “ghost” node. This operation should compute in O(1) time.
sourcepub fn pop_front(&mut self) -> Option<T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Removes the first element from the cursor’s parent list and returns it, or None if the list is empty. The element the cursor points to remains unchanged, unless it was pointing to the front element. In that case, it points to the new front element. This operation should compute in O(1) time.
sourcepub fn pop_back(&mut self) -> Option<T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Removes the last element from the cursor’s parent list and returns it, or None if the list is empty. The element the cursor points to remains unchanged, unless it was pointing to the back element. In that case, it points to the “ghost” element. This operation should compute in O(1) time.
sourcepub fn front(&self) -> Option<&T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Provides a reference to the front element of the cursor’s parent list, or None if the list is empty.
sourcepub fn front_mut(&mut self) -> Option<&mut T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Provides a mutable reference to the front element of the cursor’s parent list, or None if the list is empty.
sourcepub fn back(&self) -> Option<&T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Provides a reference to the back element of the cursor’s parent list, or None if the list is empty.
sourcepub fn back_mut(&mut self) -> Option<&mut T>
🔬This is a nightly-only experimental API. (linked_list_cursors #58533)
Provides a mutable reference to back element of the cursor’s parent list, or None if the list is empty. Examples Building and mutating a list with a cursor, then getting the back element: #![feature(linked_list_cursors)]
use st8b7c:f320:99b9:690f:4595:cd17:293a:c069collections8b7c:f320:99b9:690f:4595:cd17:293a:c069LinkedList;
let mut dl = LinkedList8b7c:f320:99b9:690f:4595:cd17:293a:c069new();
dl.push_front(3);
dl.push_front(2);
dl.push_front(1);
let mut cursor = dl.cursor_front_mut();
*cursor.current().unwrap() = 99;
*cursor.back_mut().unwrap() = 0;
let mut contents = dl.into_iter();
assert_eq!(contents.next(), Some(99));
assert_eq!(contents.next(), Some(2));
assert_eq!(contents.next(), Some(0));
assert_eq!(contents.next(), None);
Trait Implementations
sourceimpl<T> Debug for CursorMut<'_, T>where T: Debug,
sourcefn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>Formats the value using the given formatter. Read more
sourceimpl<T> Send for CursorMut<'_, T>where T: Send,
sourceimpl<T> Sync for CursorMut<'_, T>where T: Sync,
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for CursorMut<'a, T>where T: RefUnwindSafe,
impl<'a, T> Unpin for CursorMut<'a, T>impl<'a, T> !UnwindSafe for CursorMut<'a, T>
Blanket Implementations
sourceimpl<T> Any for Twhere T: 'static + ?Sized,
sourcefn type_id(&self) -> TypeIdGets the TypeId of self. Read more
sourceimpl<T> Borrow<T> for Twhere T: ?Sized,
sourceconst: unstable · fn borrow(&self) -> &TImmutably borrows from an owned value. Read more
sourceimpl<T> BorrowMut<T> for Twhere T: ?Sized,
sourceconst: unstable · fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
sourceimpl<T> From<T> for T
sourceconst: unstable · fn from(t: T) -> T
Returns the argument unchanged.
sourceimpl<T, U> Into<U> for Twhere U: From<T>,
sourceconst: unstable · fn into(self) -> U
Calls U8b7c:f320:99b9:690f:4595:cd17:293a:c069rom(self). That is, this conversion is whatever the implementation of From<T> for U chooses to do.
sourceimpl<T, U> TryFrom<U> for Twhere U: Into<T>,
type Error = InfallibleThe type returned in the event of a conversion error.
sourceconst: unstable · fn try_from(value: U) -> Result<T, <T as TryFrom<U>>8b7c:f320:99b9:690f:4595:cd17:293a:c069rror>Performs the conversion.
sourceimpl<T, U> TryInto<U> for Twhere U: TryFrom<T>,
type Error = <U as TryFrom<T>>8b7c:f320:99b9:690f:4595:cd17:293a:c069rrorThe type returned in the event of a conversion error.
sourceconst: unstable · fn try_into(self) -> Result<U, <U as TryFrom<T>>8b7c:f320:99b9:690f:4595:cd17:293a:c069rror>Performs the conversion.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.