text
stringlengths 0
13M
|
---|
Deno.unrefTimer
Make the timer of the given id not block the event loop from finishing.
function unrefTimer(id: number): void;
unrefTimer(id: number): void
Parameters
id: number
Return Type
void
|
ShouldQueue interface ShouldQueue (View source)
|
Elixir API Reference Modules Access
Key-based access to data structures using the data[key] syntax Agent
Agents are a simple abstraction around state Application
A module for working with applications and defining application callbacks Atom
Convenience functions for working with atoms Base
This module provides data encoding and decoding functions according to RFC 4648 Behaviour
This module has been deprecated Bitwise
A set of macros that perform calculations on bits Calendar
This module defines the responsibilities for working with calendars, dates, times and datetimes in Elixir Calendar.ISO
A calendar implementation that follows to ISO8601 Code
Utilities for managing code compilation, code evaluation and code loading Collectable
A protocol to traverse data structures Date
A Date struct and functions DateTime
A datetime implementation with a time zone Dict
WARNING: this module is deprecated Enum
Provides a set of algorithms that enumerate over enumerables according to the Enumerable protocol Enumerable
Enumerable protocol used by Enum and Stream modules Exception
Functions to format throw/catch/exit and exceptions File
This module contains functions to manipulate files File.Stat
A struct that holds file information File.Stream
Defines a File.Stream struct returned by File.stream!/3 Float
Functions for working with floating point numbers GenEvent
A behaviour module for implementing event handling functionality GenServer
A behaviour module for implementing the server of a client-server relation HashDict
WARNING: this module is deprecated HashSet
WARNING: this module is deprecated IO
Functions handling input/output (IO) IO.ANSI
Functionality to render ANSI escape sequences IO.Stream
Defines an IO.Stream struct returned by IO.stream/2 and IO.binstream/2 Inspect
The Inspect protocol is responsible for converting any Elixir data structure into an algebra document. This document is then formatted, either in pretty printing format or a regular one Inspect.Algebra
A set of functions for creating and manipulating algebra documents Inspect.Opts
Defines the Inspect.Opts used by the Inspect protocol Integer
Functions for working with integers Kernel
Provides the default macros and functions Elixir imports into your environment Kernel.ParallelCompiler
A module responsible for compiling files in parallel Kernel.ParallelRequire
A module responsible for requiring files in parallel Kernel.SpecialForms
Special forms are the basic building blocks of Elixir, and therefore cannot be overridden by the developer Keyword
A set of functions for working with keywords List
Functions that work on (linked) lists List.Chars
The List.Chars protocol is responsible for converting a structure to a list (only if applicable). The only function required to be implemented is to_charlist which does the conversion Macro
Conveniences for working with macros Macro.Env
A struct that holds compile time environment information Map
A set of functions for working with maps MapSet
Functions that work on sets Module
Provides functions to deal with modules during compilation time NaiveDateTime
A NaiveDateTime struct (without a time zone) and functions Node
Functions related to VM nodes OptionParser
This module contains functions to parse command line options Path
This module provides conveniences for manipulating or retrieving file system paths Port
Functions for interacting with the external world through ports Process
Conveniences for working with processes and the process dictionary Protocol
Functions for working with protocols Range
Defines a range Record
Module to work with, define, and import records Regex
Provides regular expressions for Elixir Registry
A local, decentralized and scalable key-value process storage Set
WARNING: this module is deprecated Stream
Module for creating and composing streams String
A String in Elixir is a UTF-8 encoded binary String.Chars
The String.Chars protocol is responsible for converting a structure to a binary (only if applicable). The only function required to be implemented is to_string which does the conversion StringIO
Controls an IO device process that wraps a string Supervisor
A behaviour module for implementing supervision functionality Supervisor.Spec
Convenience functions for defining supervisor specifications System
The System module provides functions that interact directly with the VM or the host system Task
Conveniences for spawning and awaiting tasks Task.Supervisor
A task supervisor Time
A Time struct and functions Tuple
Functions for working with tuples URI
Utilities for working with URIs Version
Functions for parsing and matching versions against requirements Version.Requirement Exceptions ArgumentError ArithmeticError BadArityError BadBooleanError BadFunctionError BadMapError BadStructError CaseClauseError Code.LoadError CompileError CondClauseError Enum.EmptyError Enum.OutOfBoundsError ErlangError File.CopyError File.Error FunctionClauseError IO.StreamError Inspect.Error
Raised when a struct cannot be inspected KeyError MatchError OptionParser.ParseError Protocol.UndefinedError Regex.CompileError RuntimeError SyntaxError SystemLimitError TokenMissingError TryClauseError UndefinedFunctionError UnicodeConversionError Version.InvalidRequirementError Version.InvalidVersionError WithClauseError
|
Imagick8b7c:f320:99b9:690f:4595:cd17:293a:c069subImageMatch (PECL imagick 3 >= 3.3.0)
Imagick8b7c:f320:99b9:690f:4595:cd17:293a:c069subImageMatch — Description Description public Imagick8b7c:f320:99b9:690f:4595:cd17:293a:c069subImageMatch(Imagick $Imagick, array &$offset = ?, float &$similarity = ?): Imagick Searches for a subimage in the current image and returns a similarity image such that an exact match location is completely white and if none of the pixels match, black, otherwise some gray level in-between. You can also pass in the optional parameters bestMatch and similarity. After calling the function similarity will be set to the 'score' of the similarity between the subimage and the matching position in the larger image, bestMatch will contain an associative array with elements x, y, width, height that describe the matching region. Parameters Imagick
offset
similarity
A new image that displays the amount of similarity at each pixel. Return Values Examples
Example #1 Imagick8b7c:f320:99b9:690f:4595:cd17:293a:c069subImageMatch() <?php
function subImageMatch($imagePath) {
$imagick = new \Imagick(realpath($imagePath));
$imagick2 = clone $imagick;
$imagick2->cropimage(40, 40, 250, 110);
$imagick2->vignetteimage(0, 1, 3, 3);
$similarity = null;
$bestMatch = null;
$comparison = $imagick->subImageMatch($imagick2, $bestMatch, $similarity);
$comparison->setImageFormat('png');
header("Content-Type: image/png");
echo $imagick->getImageBlob();
}
?>
|
st8b7c:f320:99b9:690f:4595:cd17:293a:c069span<T,Extent>8b7c:f320:99b9:690f:4595:cd17:293a:c069gin constexpr iterator begin() const noexcept;
Returns an iterator to the first element of the span.
If the span is empty, the returned iterator will be equal to end().
Parameters (none).
Return value Iterator to the first element.
Complexity Constant.
Example #include <span>
#include <iostream>
void print(st8b7c:f320:99b9:690f:4595:cd17:293a:c069span<const int> sp)
{
for(auto it = sp.begin(); it != sp.end(); ++it) {
st8b7c:f320:99b9:690f:4595:cd17:293a:c069cout << *it << ' ';
}
st8b7c:f320:99b9:690f:4595:cd17:293a:c069cout << '\n';
}
void transmogrify(st8b7c:f320:99b9:690f:4595:cd17:293a:c069span<int> sp)
{
if (!sp.empty()) {
st8b7c:f320:99b9:690f:4595:cd17:293a:c069cout << *sp.begin() << '\n';
*sp.begin() = 2;
}
}
int main()
{
int array[] { 1, 3, 4, 5 };
print(array);
transmogrify(array);
print(array);
} Output:
1 3 4 5
1
2 3 4 5 See also end
(C++20) returns an iterator to the end (public member function)
begincbegin
(C++11)(C++14) returns an iterator to the beginning of a container or array (function template)
|
numpy.testing.assert_ testing.assert_(val, msg='')[source]
Assert that works in release mode. Accepts callable msg to allow deferring evaluation until failure. The Python built-in assert does not work when executing code in optimized mode (the -O flag) - no byte-code is generated for it. For documentation on usage, refer to the Python documentation.
|
CREATE LANGUAGE CREATE LANGUAGE — define a new procedural language Synopsis
CREATE [ OR REPLACE ] [ TRUSTED ] [ PROCEDURAL ] LANGUAGE name
HANDLER call_handler [ INLINE inline_handler ] [ VALIDATOR valfunction ]
CREATE [ OR REPLACE ] [ TRUSTED ] [ PROCEDURAL ] LANGUAGE name
Description CREATE LANGUAGE registers a new procedural language with a PostgreSQL database. Subsequently, functions and procedures can be defined in this new language. CREATE LANGUAGE effectively associates the language name with handler function(s) that are responsible for executing functions written in the language. Refer to Chapter 55 for more information about language handlers. CREATE OR REPLACE LANGUAGE will either create a new language, or replace an existing definition. If the language already exists, its parameters are updated according to the command, but the language's ownership and permissions settings do not change, and any existing functions written in the language are assumed to still be valid. One must have the PostgreSQL superuser privilege to register a new language or change an existing language's parameters. However, once the language is created it is valid to assign ownership of it to a non-superuser, who may then drop it, change its permissions, rename it, or assign it to a new owner. (Do not, however, assign ownership of the underlying C functions to a non-superuser; that would create a privilege escalation path for that user.) The form of CREATE LANGUAGE that does not supply any handler function is obsolete. For backwards compatibility with old dump files, it is interpreted as CREATE EXTENSION. That will work if the language has been packaged into an extension of the same name, which is the conventional way to set up procedural languages. Parameters TRUSTED TRUSTED specifies that the language does not grant access to data that the user would not otherwise have. If this key word is omitted when registering the language, only users with the PostgreSQL superuser privilege can use this language to create new functions. PROCEDURAL This is a noise word. name The name of the new procedural language. The name must be unique among the languages in the database. For backward compatibility, the name can be enclosed by single quotes.
HANDLER call_handler
call_handler is the name of a previously registered function that will be called to execute the procedural language's functions. The call handler for a procedural language must be written in a compiled language such as C with version 1 call convention and registered with PostgreSQL as a function taking no arguments and returning the language_handler type, a placeholder type that is simply used to identify the function as a call handler.
INLINE inline_handler
inline_handler is the name of a previously registered function that will be called to execute an anonymous code block (DO command) in this language. If no inline_handler function is specified, the language does not support anonymous code blocks. The handler function must take one argument of type internal, which will be the DO command's internal representation, and it will typically return void. The return value of the handler is ignored.
VALIDATOR valfunction
valfunction is the name of a previously registered function that will be called when a new function in the language is created, to validate the new function. If no validator function is specified, then a new function will not be checked when it is created. The validator function must take one argument of type oid, which will be the OID of the to-be-created function, and will typically return void. A validator function would typically inspect the function body for syntactical correctness, but it can also look at other properties of the function, for example if the language cannot handle certain argument types. To signal an error, the validator function should use the ereport() function. The return value of the function is ignored. Notes Use DROP LANGUAGE to drop procedural languages. The system catalog pg_language (see Section 51.29) records information about the currently installed languages. Also, the psql command \dL lists the installed languages. To create functions in a procedural language, a user must have the USAGE privilege for the language. By default, USAGE is granted to PUBLIC (i.e., everyone) for trusted languages. This can be revoked if desired. Procedural languages are local to individual databases. However, a language can be installed into the template1 database, which will cause it to be available automatically in all subsequently-created databases. Examples A minimal sequence for creating a new procedural language is:
CREATE FUNCTION plsample_call_handler() RETURNS language_handler
AS '$libdir/plsample'
LANGUAGE C;
CREATE LANGUAGE plsample
HANDLER plsample_call_handler;
Typically that would be written in an extension's creation script, and users would do this to install the extension:
CREATE EXTENSION plsample;
Compatibility CREATE LANGUAGE is a PostgreSQL extension. See Also
ALTER LANGUAGE, CREATE FUNCTION, DROP LANGUAGE, GRANT, REVOKE
Prev Up Next
CREATE INDEX Home CREATE MATERIALIZED VIEW
|
DOM Manipulation
DOM Manipulation An exploration into the HTMLElement type In the 20+ years since its standardization, JavaScript has come a very long way. While in 2020, JavaScript can be used on servers, in data science, and even on IoT devices, it is important to remember its most popular use case: web browsers. Websites are made up of HTML and/or XML documents. These documents are static, they do not change. The Document Object Model (DOM) is a programming interface implemented by browsers in order to make static websites functional. The DOM API can be used to change the document structure, style, and content. The API is so powerful that countless frontend frameworks (jQuery, React, Angular, etc.) have been developed around it in order to make dynamic websites even easier to develop. TypeScript is a typed superset of JavaScript, and it ships type definitions for the DOM API. These definitions are readily available in any default TypeScript project. Of the 20,000+ lines of definitions in lib.dom.d.ts, one stands out among the rest: HTMLElement . This type is the backbone for DOM manipulation with TypeScript. You can explore the source code for the DOM type definitions Basic Example Given a simplified index.html file: <!DOCTYPE html>
<html lang="en">
<head><title>TypeScript Dom Manipulation</title></head>
<body>
<div id="app"></div>
<!-- Assume index.js is the compiled output of index.ts -->
<script src="index.js"></script>
</body>
</html> Let’s explore a TypeScript script that adds a <p>Hello, World!</p> element to the #app element. // 1. Select the div element using the id property
const app = document.getElementById("app");
// 2. Create a new <p></p> element programmatically
const p = document.createElement("p");
// 3. Add the text content
p.textContent = "Hello, World!";
// 4. Append the p element to the div element
app?.appendChild(p); After compiling and running the index.html page, the resulting HTML will be: <div id="app">
<p>Hello, World!</p>
</div> The Document Interface The first line of the TypeScript code uses a global variable document. Inspecting the variable shows it is defined by the Document interface from the lib.dom.d.ts file. The code snippet contains calls to two methods, getElementById and createElement. Document.getElementById The definition for this method is as follows: getElementById(elementId: string): HTMLElement | null; Pass it an element id string and it will return either HTMLElement or null . This method introduces one of the most important types, HTMLElement. It serves as the base interface for every other element interface. For example, the p variable in the code example is of type HTMLParagraphElement. Also take note that this method can return null. This is because the method can’t be certain pre-runtime if it will be able to actually find the specified element or not. In the last line of the code snippet, the new optional chaining operator is used in order to call appendChild. Document.createElement The definition for this method is (I have omitted the deprecated definition): createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K];
createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; This is an overloaded function definition. The second overload is simplest and works a lot like the getElementById method does. Pass it any string and it will return a standard HTMLElement. This definition is what enables developers to create unique HTML element tags. For example document.createElement('xyz') returns a <xyz></xyz> element, clearly not an element that is specified by the HTML specification. For those interested, you can interact with custom tag elements using the document.getElementsByTagName For the first definition of createElement, it is using some advanced generic patterns. It is best understood broken down into chunks, starting with the generic expression: <K extends keyof HTMLElementTagNameMap>. This expression defines a generic parameter K that is constrained to the keys of the interface HTMLElementTagNameMap. The map interface contains every specified HTML tag name and its corresponding type interface. For example here are the first 5 mapped values: interface HTMLElementTagNameMap {
"a": HTMLAnchorElement;
"abbr": HTMLElement;
"address": HTMLElement;
"applet": HTMLAppletElement;
"area": HTMLAreaElement;
...
} Some elements do not exhibit unique properties and so they just return HTMLElement, but other types do have unique properties and methods so they return their specific interface (which will extend from or implement HTMLElement). Now, for the remainder of the createElement definition: (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]. The first argument tagName is defined as the generic parameter K . The TypeScript interpreter is smart enough to infer the generic parameter from this argument. This means that the developer does not actually have to specify the generic parameter when using the method; whatever value is passed to the tagName argument will be inferred as K and thus can be used throughout the remainder of the definition. Which is exactly what happens; the return value HTMLElementTagNameMap[K] takes the tagName argument and uses it to return the corresponding type. This definition is how the p variable from the code snippet gets a type of HTMLParagraphElement. And if the code was document.createElement('a'), then it would be an element of type HTMLAnchorElement. The Node interface The document.getElementById function returns an HTMLElement. HTMLElement interface extends the Element interface which extends the Node interface. This prototypal extension allows for all HTMLElements to utilize a subset of standard methods. In the code snippet, we use a property defined on the Node interface to append the new p element to the website. Node.appendChild The last line of the code snippet is app?.appendChild(p). The previous, document.getElementById , section detailed that the optional chaining operator is used here because app can potentially be [email protected]. The appendChild method is defined by: appendChild<T extends Node>(newChild: T): T; This method works similarly to the createElement method as the generic parameter T is inferred from the newChild argument. T is constrained to another base interface Node. Difference between children and childNodes
Previously, this document details the HTMLElement interface extends from Element which extends from Node. In the DOM API there is a concept of children elements. For example in the following HTML, the p tags are children of the div element <div>
<p>Hello, World</p>
<p>TypeScript!</p>
</div>;
const div = document.getElementsByTagName("div")[0];
div.children;
// HTMLCollection(2) [p, p]
div.childNodes;
// NodeList(2) [p, p] After capturing the div element, the children prop will return a HTMLCollection list containing the HTMLParagraphElements. The childNodes property will return a similar NodeList list of nodes. Each p tag will still be of type HTMLParagraphElements, but the NodeList can contain additional HTML nodes that the HTMLCollection list cannot. Modify the html by removing one of the p tags, but keep the text. <div>
<p>Hello, World</p>
TypeScript!
</div>;
const div = document.getElementsByTagName("div")[0];
div.children;
// HTMLCollection(1) [p]
div.childNodes;
// NodeList(2) [p, text] See how both lists change. children now only contains the <p>Hello, World</p> element, and the childNodes contains a text node rather than two p nodes. The text part of the NodeList is the literal Node containing the text TypeScript!. The children list does not contain this Node because it is not considered an HTMLElement. The querySelector and querySelectorAll methods Both of these methods are great tools for getting lists of dom elements that fit a more unique set of constraints. They are defined in lib.dom.d.ts as: /**
* Returns the first element that is a descendant of node that matches selectors.
*/
querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
querySelector<E extends Element = Element>(selectors: string): E | null;
/**
* Returns all element descendants of node that match selectors.
*/
querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>; The querySelectorAll definition is similar to getElementsByTagName, except it returns a new type: NodeListOf. This return type is essentially a custom implementation of the standard JavaScript list element. Arguably, replacing NodeListOf<E> with E[] would result in a very similar user experience. NodeListOf only implements the following properties and methods: length , item(index), forEach((value, key, parent) => void) , and numeric indexing. Additionally, this method returns a list of elements, not nodes, which is what NodeList was returning from the .childNodes method. While this may appear as a discrepancy, take note that interface Element extends from Node. To see these methods in action modify the existing code to: <ul>
<li>First :)</li>
<li>Second!</li>
<li>Third times a charm.</li>
</ul>;
const first = document.querySelector("li"); // returns the first li element
const all = document.querySelectorAll("li"); // returns the list of all li elements Interested in learning more? The best part about the lib.dom.d.ts type definitions is that they are reflective of the types annotated in the Mozilla Developer Network (MDN) documentation site. For example, the HTMLElement interface is documented by this HTMLElement page on MDN. These pages list all available properties, methods, and sometimes even examples. Another great aspect of the pages is that they provide links to the corresponding standard documents. Here is the link to the W3C Recommendation for HTMLElement. Sources: ECMA-262 Standard Introduction to the DOM
|
SVGAnimatedLengthList
SVG animated length list interface
The SVGAnimatedLengthList interface is used for attributes of type SVGLengthList which can be animated.
Interface overview
Also implement None Methods None Properties readonly SVGLengthList baseVal readonly SVGLengthList animVal Normative document SVG 1.1 (2nd Edition)
Properties
Name Type Description baseVal SVGLengthList The base value of the given attribute before applying any animations. animVal SVGLengthList A read only SVGLengthList representing the current animated value of the given attribute. If the given attribute is not currently being animated, then the SVGLengthList will have the same contents as baseVal. The object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated.
Methods
The SVGAnimatedLengthList interface do not provide any specific methods.
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
SVGAnimatedLengthList
1
12
1.5
9
≤12.1
3
3
18
4
≤12.1
1
1.0
animVal
1
12
1.5
9
≤12.1
3
3
18
4
≤12.1
1
1.0
baseVal
1
12
1.5
9
≤12.1
3
3
18
4
≤12.1
1
1.0
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: Feb 18, 2022, by MDN contributors
|
CMAKE_<LANG>_GHS_KERNEL_FLAGS_RELWITHDEBINFO GHS kernel flags for RelWithDebInfo type or configuration. <LANG> flags used when CMAKE_BUILD_TYPE is RelWithDebInfo (short for Release With Debug Information).
|
Class HTML.UnknownTag
java.lang.Object
javax.swing.text.html.HTML.Tag javax.swing.text.html.HTML.UnknownTag All Implemented Interfaces: Serializable Enclosing class: HTML public static class HTML.UnknownTag extends HTML.Tag implements Serializable Class represents unknown HTML tag. Field Summary Fields declared in class javax.swing.text.html.HTML.Tag
A, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BIG, BLOCKQUOTE, BODY, BR, CAPTION, CENTER, CITE, CODE, COMMENT, CONTENT, DD, DFN, DIR, DIV, DL, DT, EM, FONT, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IMG, IMPLIED, INPUT, ISINDEX, KBD, LI, LINK, MAP, MENU, META, NOFRAMES, OBJECT, OL, OPTION, P, PARAM, PRE, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TD, TEXTAREA, TH, TITLE, TR, TT, U, UL, VAR
Constructor Summary
Constructor
Description
UnknownTag(String id)
Creates a new UnknownTag with the specified id.
Method Summary
Modifier and Type
Method
Description
boolean
equals(Object obj)
Compares this object to the specified object.
int
hashCode()
Returns the hash code which corresponds to the string for this tag.
Methods declared in class javax.swing.text.html.HTML.Tag
breaksFlow, isBlock, isPreformatted, toString
Methods declared in class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Constructor Details UnknownTag public UnknownTag(String id) Creates a new UnknownTag with the specified id. Parameters:
id - the id of the new tag Method Details hashCode public int hashCode() Returns the hash code which corresponds to the string for this tag. Overrides:
hashCode in class Object
Returns: a hash code value for this object. See Also: Object.equals(java.lang.Object) System.identityHashCode(java.lang.Object) equals public boolean equals(Object obj) Compares this object to the specified object. The result is true if and only if the argument is not null and is an UnknownTag object with the same name. Overrides:
equals in class Object
Parameters:
obj - the object to compare this tag with Returns:
true if the objects are equal; false otherwise See Also: Object.hashCode() HashMap
|
QGraphicsVideoItem Class The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaObject. More...
Header:
#include <QGraphicsVideoItem>
qmake:
QT += multimediawidgets
Inherits:
QGraphicsObject and QMediaBindableInterface
List of all members, including inherited members Properties
aspectRatioMode : Qt8b7c:f320:99b9:690f:4595:cd17:293a:c069spectRatioMode
mediaObject : QMediaObject * const
nativeSize : const QSizeF
offset : QPointF
size : QSizeF
12 properties inherited from QGraphicsObject
1 property inherited from QObject
Public Functions
QGraphicsVideoItem(QGraphicsItem *parent = Q_NULLPTR)
~QGraphicsVideoItem()
Qt8b7c:f320:99b9:690f:4595:cd17:293a:c069spectRatioMode
aspectRatioMode() const
QSizeF
nativeSize() const
QPointF
offset() const
void
setAspectRatioMode(Qt8b7c:f320:99b9:690f:4595:cd17:293a:c069spectRatioMode mode)
void
setOffset(const QPointF &offset)
void
setSize(const QSizeF &size)
QSizeF
size() const
Reimplemented Public Functions
virtual QRectF
boundingRect() const override
virtual QMediaObject *
mediaObject() const override
virtual void
paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) override
2 public functions inherited from QGraphicsObject
1 public function inherited from QMediaBindableInterface
32 public functions inherited from QObject
176 public functions inherited from QGraphicsItem
Signals
void
nativeSizeChanged(const QSizeF &size)
9 signals inherited from QGraphicsObject
2 signals inherited from QObject
Additional Inherited Members 1 public slot inherited from QObject
11 static public members inherited from QObject
2 static public members inherited from QGraphicsItem
1 protected function inherited from QGraphicsObject
1 protected function inherited from QMediaBindableInterface
9 protected functions inherited from QObject
24 protected functions inherited from QGraphicsItem
1 protected slot inherited from QGraphicsObject
Detailed Description The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaObject. Attaching a QGraphicsVideoItem to a QMediaObject allows it to display the video or image output of that media object. A QGraphicsVideoItem is attached to a media object by passing a pointer to the QMediaObject to the setMediaObject() function. player = new QMediaPlayer(this);
QGraphicsVideoItem *item = new QGraphicsVideoItem;
player->setVideoOutput(item);
graphicsView->scene()->addItem(item);
graphicsView->show();
player->setMedia(QUrl("http://example.com/myclip4.ogv"));
player->play(); Note: Only a single display output can be attached to a media object at one time. See also QMediaObject, QMediaPlayer, and QVideoWidget. Property Documentation
aspectRatioMode : Qt8b7c:f320:99b9:690f:4595:cd17:293a:c069spectRatioMode
how a video is scaled to fit the graphics item's size. Access functions:
Qt8b7c:f320:99b9:690f:4595:cd17:293a:c069spectRatioMode
aspectRatioMode() const
void
setAspectRatioMode(Qt8b7c:f320:99b9:690f:4595:cd17:293a:c069spectRatioMode mode)
mediaObject : QMediaObject * const This property holds the media object which provides the video displayed by a graphics item. Access functions:
virtual QMediaObject *
mediaObject() const override
nativeSize : const QSizeF
This property holds the native size of the video. Access functions:
QSizeF
nativeSize() const
Notifier signal:
void
nativeSizeChanged(const QSizeF &size)
offset : QPointF
This property holds the video item's offset. QGraphicsVideoItem will draw video using the offset for its top left corner. Access functions:
QPointF
offset() const
void
setOffset(const QPointF &offset)
size : QSizeF
This property holds the video item's size. QGraphicsVideoItem will draw video scaled to fit size according to its fillMode. Access functions:
QSizeF
size() const
void
setSize(const QSizeF &size)
Member Function Documentation
QGraphicsVideoItem8b7c:f320:99b9:690f:4595:cd17:293a:c069QGraphicsVideoItem(QGraphicsItem *parent = Q_NULLPTR) Constructs a graphics item that displays video. The parent is passed to QGraphicsItem.
QGraphicsVideoItem8b7c:f320:99b9:690f:4595:cd17:293a:c069~QGraphicsVideoItem() Destroys a video graphics item.
[override virtual] QRectF QGraphicsVideoItem8b7c:f320:99b9:690f:4595:cd17:293a:c069oundingRect() const Reimplemented from QGraphicsItem8b7c:f320:99b9:690f:4595:cd17:293a:c069oundingRect().
[signal] void QGraphicsVideoItem8b7c:f320:99b9:690f:4595:cd17:293a:c069nativeSizeChanged(const QSizeF &size) Signals that the native size of the video has changed. Note: Notifier signal for property nativeSize.
[override virtual] void QGraphicsVideoItem8b7c:f320:99b9:690f:4595:cd17:293a:c069paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Reimplemented from QGraphicsItem8b7c:f320:99b9:690f:4595:cd17:293a:c069paint().
|
Object NameTransformer.NameTransformer
Source code
object NameTransformer
Provides functions to encode and decode Scala symbolic names. Also provides some constants.
Supertypes
class Object
trait Matchable
class Any
Self type
NameTransformer.type
Concrete methods
Source
def decode(name0: String): String
Replace $opname by corresponding operator symbol.
Value parameters
name0
the string to decode
Returns
the string with all recognized operator symbol encodings replaced with their name
Source
def encode(name: String): String
Replace operator symbols by corresponding $opname.
Value parameters
name
the string to encode
Returns
the string with all recognized opchars replaced with their encoding
Concrete fields
Source
final val LAZY_LOCAL_SUFFIX_STRING: "$lzy"
Source
final val LOCAL_SUFFIX_STRING: " "
Source
final val MODULE_INSTANCE_NAME: "MODULE$"
Source
final val MODULE_SUFFIX_STRING: "$"
Source
final val MODULE_VAR_SUFFIX_STRING: "$module"
Source
final val NAME_JOIN_STRING: "$"
Source
final val SETTER_SUFFIX_STRING: "_$eq"
Source
final val TRAIT_SETTER_SEPARATOR_STRING: "$_setter_$"
|
protected function PhpBacken8b7c:f320:99b9:690f:4595:cd17:293a:c069getByHash protected PhpBacken8b7c:f320:99b9:690f:4595:cd17:293a:c069getByHash($cidhash, $allow_invalid = FALSE) Fetch a cache item using a hashed cache ID. Parameters string $cidhash: The hashed version of the original cache ID after being normalized. bool $allow_invalid: (optional) If TRUE, a cache item may be returned even if it is expired or has been invalidated. Return value bool|mixed File
core/lib/Drupal/Core/Cache/PhpBackend.php, line 71 Class
PhpBackend Defines a PHP cache implementation. Namespace Drupal\Core\Cache Code protected function getByHash($cidhash, $allow_invalid = FALSE) {
if ($file = $this->storage()->getFullPath($cidhash)) {
$cache = @include $file;
}
if (isset($cache)) {
return $this->prepareItem($cache, $allow_invalid);
}
return FALSE;
}
|
[Groovy] Class GeneratedBytecodeAwareGroovyClassLoader
groovy.inspect.swingui.GeneratedBytecodeAwareGroovyClassLoader
Constructor Summary
Constructors
Constructor and description GeneratedBytecodeAwareGroovyClassLoader
(GroovyClassLoader parent)
Methods Summary
Methods
Type Params Return Type Name and description void
clearBytecodeTable()
protected ClassCollector
createCollector(CompilationUnit unit, SourceUnit su)
byte[]
getBytecode(String className)
Inherited Methods Summary
Inherited Methods
Methods inherited from class Name class GroovyClassLoader loadClass, loadClass, loadClass, defineClass, defineClass, addURL, clearCache, setResourceLoader, getResourceLoader, generateScriptName, setShouldRecompile, isShouldRecompile, getLoadedClasses, parseClass, parseClass, parseClass, parseClass, parseClass, parseClass, addClasspath, getResourceAsStream, newInstance, newInstance, findResource, findResources, close, getURLs, getSystemClassLoader, getResource, getSystemResource, getSystemResourceAsStream, clearAssertionStatus, getParent, getResources, getSystemResources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll class URLClassLoader getResourceAsStream, newInstance, newInstance, findResource, findResources, close, getURLs, loadClass, getSystemClassLoader, getResource, getSystemResource, getSystemResourceAsStream, clearAssertionStatus, getParent, getResources, getSystemResources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll Constructor Detail
GeneratedBytecodeAwareGroovyClassLoader(GroovyClassLoader parent) Method Detail void clearBytecodeTable() @Override protected ClassCollector createCollector(CompilationUnit unit, SourceUnit su) byte[] getBytecode(String className)
|
PacketPeerDTLS Inherits: PacketPeer < Reference < Object DTLS packet peer. Description This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by DTLSServer.take_connection. Methods
Error connect_to_peer ( PacketPeerUDP packet_peer, bool validate_certs=true, String for_hostname="", X509Certificate valid_certificate=null )
void disconnect_from_peer ( )
Status get_status ( ) const
void poll ( ) Enumerations enum Status:
STATUS_DISCONNECTED = 0 --- A status representing a PacketPeerDTLS that is disconnected.
STATUS_HANDSHAKING = 1 --- A status representing a PacketPeerDTLS that is currently performing the handshake with a remote peer.
STATUS_CONNECTED = 2 --- A status representing a PacketPeerDTLS that is connected to a remote peer.
STATUS_ERROR = 3 --- A status representing a PacketPeerDTLS in a generic error state.
STATUS_ERROR_HOSTNAME_MISMATCH = 4 --- An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation. Method Descriptions Error connect_to_peer ( PacketPeerUDP packet_peer, bool validate_certs=true, String for_hostname="", X509Certificate valid_certificate=null ) Connects a peer beginning the DTLS handshake using the underlying PacketPeerUDP which must be connected (see PacketPeerUDP.connect_to_host). If validate_certs is true, PacketPeerDTLS will validate that the certificate presented by the remote peer and match it with the for_hostname argument. You can specify a custom X509Certificate to use for validation via the valid_certificate argument. void disconnect_from_peer ( ) Disconnects this peer, terminating the DTLS session. Status get_status ( ) const Returns the status of the connection. See Status for values. void poll ( ) Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working.
|
Clipboard.read()
The read() method of the Clipboard interface requests a copy of the clipboard's contents, delivering the data to the returned Promise when the promise is resolved. Unlike readText(), the read() method can return arbitrary data, such as images. This method can also return text. To read from the clipboard, you must first have the "clipboard-read" permission. Note: The asynchronous Clipboard and Permissions APIs are still in the process of being integrated into most browsers, so they often deviate from the official rules for permissions and the like. Be sure to review the compatibility table before using these methods.
Syntax
read()
Parameters
None.
Return value
A Promise that resolves with an array of ClipboardItem objects containing the clipboard's contents. The promise is rejected if permission to access the clipboard is not granted.
Examples
Reading image data
This example uses the read() method to read image data from the clipboard. Try copying the butterfly image on the left using the "Copy image" context menu item, then click in the empty frame on the right. The example will check or ask for permission to read the clipboard, then fetch the image data and display the image data in the empty frame. Note: At this time, while Firefox does implement read(), it does not recognize the "clipboard-read" permission, so attempting to use the Permissions API to manage access to the API will not work. HTML <img id="source" src="butterfly.jpg" alt="A butterfly">
<img id="destination">
CSS img {
height: 100px;
width: 100px;
margin: 0 1rem;
border: 1px solid black;
}
JavaScript const destinationImage = document.querySelector('#destination')
destinationImage.addEventListener('click', pasteImage);
async function pasteImage() {
try {
const permission = await navigator.permissions.query({ name: 'clipboard-read' });
if (permission.state === 'denied') {
throw new Error('Not allowed to read clipboard.');
}
const clipboardContents = await navigator.clipboard.read();
for (const item of clipboardContents) {
if (!item.types.includes('image/png')) {
throw new Error('Clipboard contains non-image data.');
}
const blob = await item.getType('image/png');
destinationImage.src = URL.createObjectURL(blob);
}
}
catch (error) {
console.error(error.message);
}
}
Result
Specifications
Specification
Clipboard API and events # dom-clipboard-read
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
read
86
From version 86, the text/html MIME type is supported.
76
From version 76, the image/png MIME type is supported.
66
Images are not supported.
79
90
Firefox only supports reading the clipboard in browser extensions, using the "clipboardRead" extension permission.
87-90
Firefox only supports reading the clipboard in browser extensions, using the "clipboardRead" extension permission.
63-87
["This method returns a DataTransfer object instead of an array of ClipboardItem objects.", "Firefox only supports reading the clipboard in browser extensions, using the \"clipboardRead\" extension permission."]
No
63
13.1
84
From version 84, the image/png MIME type is supported.
66
Images are not supported.
86
From version 86, the text/html MIME type is supported.
84
From version 84, the image/png MIME type is supported.
66
Images are not supported.
No
54
13.4
12.0
See also
Clipboard API Async Clipboard API demo on Glitch Image support for Async Clipboard article
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 19, 2022, by MDN contributors
|
public function ConditionAggregat8b7c:f320:99b9:690f:4595:cd17:293a:c069exists public ConditionAggregat8b7c:f320:99b9:690f:4595:cd17:293a:c069exists($field, $function, $langcode = NULL) Queries for the existence of a field. Parameters $field: string $langcode: Return value ConditionInterface Overrides ConditionAggregateInter8b7c:f320:99b9:690f:4595:cd17:293a:c069exists See also \Drupal\Core\Entity\Query\QueryInter8b7c:f320:99b9:690f:4595:cd17:293a:c069exists() File
core/lib/Drupal/Core/Entity/Query/Sql/ConditionAggregate.php, line 50 Class
ConditionAggregate Defines the aggregate condition for sql based storage. Namespace Drupal\Core\Entity\Query\Sql Code public function exists($field, $function, $langcode = NULL) {
return $this->condition($field, $function, NULL, 'IS NOT NULL', $langcode);
}
|
Class Mirror.SingletonProxy
Source code
class SingletonProxy(val value: AnyRef) extends Product
A proxy for Scala 2 singletons, which do not inherit Singleton directly
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Types
Source
type MirroredElemLabels = EmptyTuple
The names of the product elements
Source
type MirroredElemTypes = EmptyTuple
Source
type MirroredMonoType = AnyRef
The mirrored *-type
Source
type MirroredType = AnyRef
Inherited types
Source
type MirroredLabel <: String
The name of the type
Inherited from
Mirror
Concrete methods
Source
def fromProduct(p: Product): MirroredMonoType
Create a new instance of type T with elements taken from product p.
Concrete fields
Source
val value: AnyRef
|
accdeaths Accidental Deaths in the US 1973-1978 Description A regular time series giving the monthly totals of accidental deaths in the USA. Usage
accdeaths
Details The values for first six months of 1979 (p. 326) were 7798 7406 8363 8460 9217 9316. Source P. J. Brockwell and R. A. Davis (1991) Time Series: Theory and Methods. Springer, New York. References Venables, W. N. and Ripley, B. D. (1999) Modern Applied Statistics with S-PLUS. Third Edition. Springer.
Copyright ( |
bigip_snmp – Manipulate general SNMP settings on a BIG-IP New in version 2.4. Synopsis Requirements Parameters Notes Examples Return Values Status Synopsis Manipulate general SNMP settings on a BIG-IP. Requirements The below requirements are needed on the host that executes this module. f5-sdk >= 3.0.16 Parameters Parameter Choices/Defaults Comments agent_authentication_traps -
Choices: enabled disabled When enabled, ensures that the system sends authentication warning traps to the trap destinations. This is usually disabled by default on a BIG-IP. agent_status_traps -
Choices: enabled disabled When enabled, ensures that the system sends a trap whenever the SNMP agent starts running or stops running. This is usually enabled by default on a BIG-IP. allowed_addresses - added in 2.6 Configures the IP addresses of the SNMP clients from which the snmpd daemon accepts requests. This value can be hostnames, IP addresses, or IP networks. You may specify a single list item of default to set the value back to the system's default of 2092071236/8. You can remove all allowed addresses by either providing the word none, or by providing the empty string "". contact - Specifies the name of the person who administers the SNMP service for this system. device_warning_traps -
Choices: enabled disabled When enabled, ensures that the system sends device warning traps to the trap destinations. This is usually enabled by default on a BIG-IP. location - Specifies the description of this system's physical location. 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 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. 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 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: Set snmp contact
bigip_snmp:
contact: Joe User
password: secret
server: lb.mydomain.com
user: admin
validate_certs: false
delegate_to: localhost
- name: Set snmp location
bigip_snmp:
location: US West 1
password: secret
server: lb.mydomain.com
user: admin
validate_certs: no
delegate_to: localhost
Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description agent_authentication_traps string changed Value that the authentication status traps was set to. Sample: enabled agent_status_traps string changed Value that the agent status traps was set to. Sample: enabled allowed_addresses list changed The new allowed addresses for SNMP client connections. Sample: ['2092071236/8', 'foo.bar.com', '2092071236'] contact string changed The new value for the person who administers SNMP on the device. Sample: Joe User device_warning_traps string changed Value that the warning status traps was set to. Sample: enabled location string changed The new value for the system's physical location. Sample: US West 1a Status This module is guaranteed to have no backward incompatible interface changes going forward. [stableinterface]
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 |
dart:html velocityY property num? velocityY Implementation num? get velocityY native;
|
tf.raw_ops.RFFT Real-valued fast Fourier transform. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.RFFT
tf.raw_ops.RFFT(
input,
fft_length,
Tcomplex=tf.dtypes.complex64,
name=None
)
Computes the 1-dimensional discrete Fourier transform of a real-valued signal over the inner-most dimension of input. Since the DFT of a real signal is Hermitian-symmetric, RFFT only returns the fft_length / 2 + 1 unique components of the FFT: the zero-frequency term, followed by the fft_length / 2 positive-frequency terms. Along the axis RFFT is computed on, if fft_length is smaller than the corresponding dimension of input, the dimension is cropped. If it is larger, the dimension is padded with zeros.
Args
input A Tensor. Must be one of the following types: float32, float64. A float32 tensor.
fft_length A Tensor of type int32. An int32 tensor of shape [1]. The FFT length.
Tcomplex An optional tf.DType from: tf.complex64, tf.complex128. Defaults to tf.complex64.
name A name for the operation (optional).
Returns A Tensor of type Tcomplex.
|
fortios_web_proxy_profile – Configure web proxy profiles in Fortinet’s FortiOS and FortiGate New in version 2.8. Synopsis Requirements Parameters Notes Examples Return Values Status Synopsis This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify web_proxy feature and profile category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.5 Requirements The below requirements are needed on the host that executes this module. fortiosapi>=0.9.8 Parameters Parameter Choices/Defaults Comments host string FortiOS or FortiGate IP address. https boolean
Choices: no
yes ← Indicates if the requests towards FortiGate must use HTTPS protocol. password string Default:"" FortiOS or FortiGate password. ssl_verify boolean added in 2.9
Choices: no
yes ← Ensures FortiGate certificate must be verified by a proper CA. state string added in 2.9
Choices: present absent Indicates whether to create or remove the object. This attribute was present already in previous version in a deeper level. It has been moved out to this outer level. username string FortiOS or FortiGate username. 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. web_proxy_profile dictionary Default:null Configure web proxy profiles. header_client_ip string
Choices: pass add remove Action to take on the HTTP client-IP header in forwarded requests: forwards (pass), adds, or removes the HTTP header. header_front_end_https string
Choices: pass add remove Action to take on the HTTP front-end-HTTPS header in forwarded requests: forwards (pass), adds, or removes the HTTP header. header_via_request string
Choices: pass add remove Action to take on the HTTP via header in forwarded requests: forwards (pass), adds, or removes the HTTP header. header_via_response string
Choices: pass add remove Action to take on the HTTP via header in forwarded responses: forwards (pass), adds, or removes the HTTP header. header_x_authenticated_groups string
Choices: pass add remove Action to take on the HTTP x-authenticated-groups header in forwarded requests: forwards (pass), adds, or removes the HTTP header. header_x_authenticated_user string
Choices: pass add remove Action to take on the HTTP x-authenticated-user header in forwarded requests: forwards (pass), adds, or removes the HTTP header. header_x_forwarded_for string
Choices: pass add remove Action to take on the HTTP x-forwarded-for header in forwarded requests: forwards (pass), adds, or removes the HTTP header. headers list Configure HTTP forwarded requests headers. action string
Choices: add-to-request add-to-response remove-from-request remove-from-response Action when HTTP the header forwarded. content string HTTP header's content. id integer / required HTTP forwarded header id. name string HTTP forwarded header name. log_header_change string
Choices: enable disable Enable/disable logging HTTP header changes. name string / required Profile name. state string
Choices: present absent Deprecated Starting with Ansible 2.9 we recommend using the top-level 'state' parameter. Indicates whether to create or remove the object. strip_encoding string
Choices: enable disable Enable/disable stripping unsupported encoding from the request header. Notes Note Requires fortiosapi library developed by Fortinet Run as a local_action in your playbook Examples - hosts: localhost
vars:
host: "248-973-5056"
username: "admin"
password: ""
vdom: "root"
ssl_verify: "False"
tasks:
- name: Configure web proxy profiles.
fortios_web_proxy_profile:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
vdom: "{{ vdom }}"
https: "False"
state: "present"
web_proxy_profile:
header_client_ip: "pass"
header_front_end_https: "pass"
header_via_request: "pass"
header_via_response: "pass"
header_x_authenticated_groups: "pass"
header_x_authenticated_user: "pass"
header_x_forwarded_for: "pass"
headers:
-
action: "add-to-request"
content: "<your_own_value>"
id: "13"
name: "default_name_14"
log_header_change: "enable"
name: "default_name_16"
strip_encoding: "enable"
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.202-26-51708 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 Status This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors Miguel Angel Munoz (@mamunozgonzalez) Nicolas Thomas (@thomnico) Hint If you notice any issues in this documentation, you can edit this document to improve it.
© 2012–2018 Michael DeHaan |
pandas.DatetimeIndex.astype
DatetimeIndex.astype(dtype, copy=True) [source]
Create an Index with values cast to dtypes. The class of a new Index is determined by dtype. When conversion is impossible, a ValueError exception is raised.
Parameters:
dtype : numpy dtype or pandas type copy : bool, default True By default, astype always returns a newly allocated object. If copy is set to False and internal requirements on dtype are satisfied, the original data is used to create a new Index or the original Index is returned. New in version 0.19.0.
|
tf.compat.v1.lite.TFLiteConverter Convert a TensorFlow model into output_format.
tf.compat.v1.lite.TFLiteConverter(
graph_def, input_tensors, output_tensors, input_arrays_with_shape=None,
output_arrays=None, experimental_debug_info_func=None
)
This is used to convert from a TensorFlow GraphDef, SavedModel or tf.keras model into either a TFLite FlatBuffer or graph visualization. Example usage: # Converting a GraphDef from session.
converter = tf.compat.v1.TFLiteConverter.from_session(
sess, in_tensors, out_tensors)
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)
# Converting a GraphDef from file.
converter = tf.compat.v1.TFLiteConverter.from_frozen_graph(
graph_def_file, input_arrays, output_arrays)
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)
# Converting a SavedModel.
converter = tf.compat.v1.TFLiteConverter.from_saved_model(saved_model_dir)
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)
# Converting a tf.keras model.
converter = tf.compat.v1.TFLiteConverter.from_keras_model_file(keras_model)
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)
Args
graph_def Frozen TensorFlow GraphDef.
input_tensors List of input tensors. Type and shape are computed using foo.shape and foo.dtype.
output_tensors List of output tensors (only .name is used from this).
input_arrays_with_shape Tuple of strings representing input tensor names and list of integers representing input shapes (e.g., [("foo" : [1, 16, 16, 3])]). Use only when graph cannot be loaded into TensorFlow and when input_tensors and output_tensors are None. (default None)
output_arrays List of output tensors to freeze graph with. Use only when graph cannot be loaded into TensorFlow and when input_tensors and output_tensors are None. (default None)
experimental_debug_info_func An experimental function to retrieve the graph debug info for a set of nodes from the graph_def.
Raises
ValueError Invalid arguments.
Attributes
inference_type Target data type of real-number arrays in the output file. Must be {tf.float32, tf.uint8}. If optimzations are provided, this parameter is ignored. (default tf.float32)
inference_input_type Target data type of real-number input arrays. Allows for a different type for input arrays. If an integer type is provided and optimizations are not used, quantized_inputs_stats must be provided. If inference_type is tf.uint8, signaling conversion to a fully quantized model from a quantization-aware trained input model, then inference_input_type defaults to tf.uint8. In all other cases, inference_input_type defaults to tf.float32. Must be {tf.float32, tf.uint8, tf.int8}
inference_output_type Target data type of real-number output arrays. Allows for a different type for output arrays. If inference_type is tf.uint8, signaling conversion to a fully quantized model from a quantization-aware trained output model, then inference_output_type defaults to tf.uint8. In all other cases, inference_output_type must be tf.float32, an error will be thrown otherwise. Must be {tf.float32, tf.uint8, tf.int8}
output_format Output file format. Currently must be {TFLITE, GRAPHVIZ_DOT}. (default TFLITE)
quantized_input_stats Dict of strings representing input tensor names mapped to tuple of floats representing the mean and standard deviation of the training data (e.g., {"foo" : (0., 1.)}). Only need if inference_input_type is QUANTIZED_UINT8. real_input_value = (quantized_input_value - mean_value) / std_dev_value. (default {})
default_ranges_stats Tuple of integers representing (min, max) range values for all arrays without a specified range. Intended for experimenting with quantization via "dummy quantization". (default None)
drop_control_dependency Boolean indicating whether to drop control dependencies silently. This is due to TFLite not supporting control dependencies. (default True)
reorder_across_fake_quant Boolean indicating whether to reorder FakeQuant nodes in unexpected locations. Used when the location of the FakeQuant nodes is preventing graph transformations necessary to convert the graph. Results in a graph that differs from the quantized training graph, potentially causing differing arithmetic behavior. (default False)
change_concat_input_ranges Boolean to change behavior of min/max ranges for inputs and outputs of the concat operator for quantized models. Changes the ranges of concat operator overlap when true. (default False)
allow_custom_ops Boolean indicating whether to allow custom operations. When false any unknown operation is an error. When true, custom ops are created for any op that is unknown. The developer will need to provide these to the TensorFlow Lite runtime with a custom resolver. (default False)
post_training_quantize Deprecated. Please specify [Optimize.DEFAULT] for optimizations instead. Boolean indicating whether to quantize the weights of the converted float model. Model size will be reduced and there will be latency improvements (at the cost of accuracy). (default False)
dump_graphviz_dir Full filepath of folder to dump the graphs at various stages of processing GraphViz .dot files. Preferred over --output_format=GRAPHVIZ_DOT in order to keep the requirements of the output file. (default None)
dump_graphviz_video Boolean indicating whether to dump the graph after every graph transformation. (default False)
conversion_summary_dir A string indicating the path to the generated conversion logs.
target_ops Deprecated. Please specify target_spec.supported_ops instead. Set of OpsSet options indicating which converter to use. (default set([OpsSet.TFLITE_BUILTINS]))
target_spec Experimental flag, subject to change. Specification of target device.
optimizations Experimental flag, subject to change. A list of optimizations to apply when converting the model. E.g. [Optimize.DEFAULT]
representative_dataset A representative dataset that can be used to generate input and output samples for the model. The converter can use the dataset to evaluate different optimizations.
experimental_new_converter Experimental flag, subject to change. Enables MLIR-based conversion instead of TOCO conversion. (default True) Methods convert View source
convert()
Converts a TensorFlow GraphDef based on instance variables.
Returns The converted data in serialized format. Either a TFLite Flatbuffer or a Graphviz graph depending on value in output_format.
Raises
ValueError Input shape is not specified. None value for dimension in input_tensor. from_frozen_graph View source
@classmethod
from_frozen_graph(
graph_def_file, input_arrays, output_arrays, input_shapes=None
)
Creates a TFLiteConverter class from a file containing a frozen GraphDef.
Args
graph_def_file Full filepath of file containing frozen GraphDef.
input_arrays List of input tensors to freeze graph with.
output_arrays List of output tensors to freeze graph with.
input_shapes Dict of strings representing input tensor names to list of integers representing input shapes (e.g., {"foo" : [1, 16, 16, 3]}). Automatically determined when input shapes is None (e.g., {"foo" : None}). (default None)
Returns TFLiteConverter class.
Raises
IOError File not found. Unable to parse input file.
ValueError The graph is not frozen. input_arrays or output_arrays contains an invalid tensor name. input_shapes is not correctly defined when required from_keras_model_file View source
@classmethod
from_keras_model_file(
model_file, input_arrays=None, input_shapes=None, output_arrays=None,
custom_objects=None
)
Creates a TFLiteConverter class from a tf.keras model file.
Args
model_file Full filepath of HDF5 file containing the tf.keras model.
input_arrays List of input tensors to freeze graph with. Uses input arrays from SignatureDef when none are provided. (default None)
input_shapes Dict of strings representing input tensor names to list of integers representing input shapes (e.g., {"foo" : [1, 16, 16, 3]}). Automatically determined when input shapes is None (e.g., {"foo" : None}). (default None)
output_arrays List of output tensors to freeze graph with. Uses output arrays from SignatureDef when none are provided. (default None)
custom_objects Dict mapping names (strings) to custom classes or functions to be considered during model deserialization. (default None)
Returns TFLiteConverter class.
from_saved_model View source
@classmethod
from_saved_model(
saved_model_dir, input_arrays=None, input_shapes=None, output_arrays=None,
tag_set=None, signature_key=None
)
Creates a TFLiteConverter class from a SavedModel.
Args
saved_model_dir SavedModel directory to convert.
input_arrays List of input tensors to freeze graph with. Uses input arrays from SignatureDef when none are provided. (default None)
input_shapes Dict of strings representing input tensor names to list of integers representing input shapes (e.g., {"foo" : [1, 16, 16, 3]}). Automatically determined when input shapes is None (e.g., {"foo" : None}). (default None)
output_arrays List of output tensors to freeze graph with. Uses output arrays from SignatureDef when none are provided. (default None)
tag_set Set of tags identifying the MetaGraphDef within the SavedModel to analyze. All tags in the tag set must be present. (default set("serve"))
signature_key Key identifying SignatureDef containing inputs and outputs. (default DEFAULT_SERVING_SIGNATURE_DEF_KEY)
Returns TFLiteConverter class.
from_session View source
@classmethod
from_session(
sess, input_tensors, output_tensors
)
Creates a TFLiteConverter class from a TensorFlow Session.
Args
sess TensorFlow Session.
input_tensors List of input tensors. Type and shape are computed using foo.shape and foo.dtype.
output_tensors List of output tensors (only .name is used from this).
Returns TFLiteConverter class.
get_input_arrays View source
get_input_arrays()
Returns a list of the names of the input tensors.
Returns List of strings.
|
anscombe Anscombe's Quartet of ‘Identical’ Simple Linear Regressions Description Four x-y datasets which have the same traditional statistical properties (mean, variance, correlation, regression line, etc.), yet are quite different. Usage anscombe Format A data frame with 11 observations on 8 variables. x1 == x2 == x3
the integers 4:14, specially arranged x4
values 8 and 19 y1, y2, y3, y4
numbers in (3, 12.5) with mean 7.5 and sdev 2.03 Source Tufte, Edward R. (1989). The Visual Display of Quantitative Information, 13–14. Graphics Press. References Anscombe, Francis J. (1973). Graphs in statistical analysis. The American Statistician, 27, 17–21. doi: 10.2307/2682899. Examples
require(stats); require(graphics)
summary(anscombe)
##-- now some "magic" to do the 4 regressions in a loop:
ff <- y ~ x
mods <- setNames(as.list(1:4), paste0("lm", 1:4))
for(i in 1:4) {
ff[2:3] <- lapply(paste0(c("y","x"), i), as.name)
## or ff[[2]] <- as.name(paste0("y", i))
## ff[[3]] <- as.name(paste0("x", i))
mods[[i]] <- lmi <- lm(ff, data = anscombe)
print(anova(lmi))
}
## See how close they are (numerically!)
sapply(mods, coef)
lapply(mods, function(fm) coef(summary(fm)))
## Now, do what you should have done in the first place: PLOTS
op <- par(mfrow = c(2, 2), mar = 0.1+c(4,4,1,1), oma = c(0, 0, 2, 0))
for(i in 1:4) {
ff[2:3] <- lapply(paste0(c("y","x"), i), as.name)
plot(ff, data = anscombe, col = "red", pch = 21, bg = "orange", cex = 1.2,
xlim = c(3, 19), ylim = c(3, 13))
abline(mods[[i]], col = "blue")
}
mtext("Anscombe's 4 Regression data sets", outer = TRUE, cex = 1.5)
par(op)
Copyright ( |
JsonTConstant<T>
package haxe.display
import haxe.display.JsonModuleTypes
Available on all platforms
Fields
kind:JsonTConstantKind<T>
args:T
|
pandas.CategoricalIndex.reorder_categories
CategoricalIndex.reorder_categories(*args, **kwargs) [source]
Reorders categories as specified in new_categories. new_categories need to include all old categories and no new category items.
Parameters:
new_categories : Index-like The categories in new order. ordered : boolean, optional Whether or not the categorical is treated as a ordered categorical. If not given, do not change the ordered information. inplace : boolean (default: False) Whether or not to reorder the categories inplace or return a copy of this categorical with reordered categories.
Returns:
cat : Categorical with reordered categories or None if inplace.
Raises:
ValueError If the new categories do not contain all old category items or any new ones See also rename_categories, add_categories, remove_categories, remove_unused_categories, set_categories
|
Function st8b7c:f320:99b9:690f:4595:cd17:293a:c069ptr8b7c:f320:99b9:690f:4595:cd17:293a:c069q
pub fn eq<T>(a: *const T, b: *const T) -> boolwhere T: ?Sized,
Compares raw pointers for equality. This is the same as using the == operator, but less generic: the arguments have to be *const T raw pointers, not anything that implements PartialEq. This can be used to compare &T references (which coerce to *const T implicitly) by their address rather than comparing the values they point to (which is what the PartialEq for &T implementation does). Examples use st8b7c:f320:99b9:690f:4595:cd17:293a:c069ptr;
let five = 5;
let other_five = 5;
let five_ref = &five;
let same_five_ref = &five;
let other_five_ref = &other_five;
assert!(five_ref == same_five_ref);
assert!(ptr8b7c:f320:99b9:690f:4595:cd17:293a:c069q(five_ref, same_five_ref));
assert!(five_ref == other_five_ref);
assert!(!ptr8b7c:f320:99b9:690f:4595:cd17:293a:c069q(five_ref, other_five_ref)); Slices are also compared by their length (fat pointers): let a = [1, 2, 3];
assert!(st8b7c:f320:99b9:690f:4595:cd17:293a:c069ptr8b7c:f320:99b9:690f:4595:cd17:293a:c069q(&a[..3], &a[..3]));
assert!(!st8b7c:f320:99b9:690f:4595:cd17:293a:c069ptr8b7c:f320:99b9:690f:4595:cd17:293a:c069q(&a[..2], &a[..3]));
assert!(!st8b7c:f320:99b9:690f:4595:cd17:293a:c069ptr8b7c:f320:99b9:690f:4595:cd17:293a:c069q(&a[0..2], &a[1..3])); Traits are also compared by their implementation: #[repr(transparent)]
struct Wrapper { member: i32 }
trait Trait {}
impl Trait for Wrapper {}
impl Trait for i32 {}
let wrapper = Wrapper { member: 10 };
// Pointers have equal addresses.
assert!(st8b7c:f320:99b9:690f:4595:cd17:293a:c069ptr8b7c:f320:99b9:690f:4595:cd17:293a:c069q(
&wrapper as *const Wrapper as *const u8,
&wrapper.member as *const i32 as *const u8
));
// Objects have equal addresses, but `Trait` has different implementations.
assert!(!st8b7c:f320:99b9:690f:4595:cd17:293a:c069ptr8b7c:f320:99b9:690f:4595:cd17:293a:c069q(
&wrapper as &dyn Trait,
&wrapper.member as &dyn Trait,
));
assert!(!st8b7c:f320:99b9:690f:4595:cd17:293a:c069ptr8b7c:f320:99b9:690f:4595:cd17:293a:c069q(
&wrapper as &dyn Trait as *const dyn Trait,
&wrapper.member as &dyn Trait as *const dyn Trait,
));
// Converting the reference to a `*const u8` compares by address.
assert!(st8b7c:f320:99b9:690f:4595:cd17:293a:c069ptr8b7c:f320:99b9:690f:4595:cd17:293a:c069q(
&wrapper as &dyn Trait as *const dyn Trait as *const u8,
&wrapper.member as &dyn Trait as *const dyn Trait as *const u8,
));
|
SessionHandler8b7c:f320:99b9:690f:4595:cd17:293a:c069gc (PHP 5 >= 5.4.0, PHP 7, PHP 8)
SessionHandler8b7c:f320:99b9:690f:4595:cd17:293a:c069gc — Cleanup old sessions Description public SessionHandler8b7c:f320:99b9:690f:4595:cd17:293a:c069gc(int $max_lifetime): int|false Cleans up expired sessions. Called randomly by PHP internally when a session starts or when session_start() is invoked. The frequency this is called is based on the session.gc_divisor and session.gc_probability configuration directives. This method wraps the internal PHP save handler defined in the session.save_handler ini setting that was set before this handler was set by session_set_save_handler(). If this class is extended by inheritiance, calling the parent gc method will invoke the wrapper for this method and therefore invoke the associated internal callback. This allows this method to be overridden and or intercepted and filtered. For more information on what this method is expected to do, please refer to the documentation at SessionHandlerInter8b7c:f320:99b9:690f:4595:cd17:293a:c069gc(). Parameters max_lifetime
Sessions that have not updated for the last max_lifetime seconds will be removed. Return Values Returns the number of deleted sessions on success, or false on failure. Note this value is returned internally to PHP for processing. Changelog Version Description 7.1.0 Prior to this version, the function returned true on success.
|
mpl_toolkits.mplot3d.art3d.Patch3DCollection classmpl_toolkits.mplot3d.art3d.Patch3DCollection(*args, zs=0, zdir='z', depthshade=True, **kwargs)[source]
Bases: matplotlib.collections.PatchCollection A collection of 3D patches. Create a collection of flat 3D patches with its normal vector pointed in zdir direction, and located at zs on the zdir axis. 'zs' can be a scalar or an array-like of the same length as the number of patches in the collection. Constructor arguments are the same as for PatchCollection. In addition, keywords zs=0 and zdir='z' are available. Also, the keyword argument depthshade is available to indicate whether or not to shade the patches in order to give the appearance of depth (default is True). This is typically desired in scatter plots. do_3d_projection(renderer=<deprecated parameter>)[source]
get_depthshade()[source]
get_edgecolor()[source]
get_facecolor()[source]
set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, array=<UNSET>, capstyle=<UNSET>, clim=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, cmap=<UNSET>, color=<UNSET>, depthshade=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, norm=<UNSET>, offset_transform=<UNSET>, offsets=<UNSET>, path_effects=<UNSET>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source]
Set multiple [email protected]. Supported properties are
Property Description
3d_properties unknown
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha array-like or scalar or None
animated bool
antialiased or aa or antialiaseds bool or list of bools
array array-like or None
capstyle CapStyle or {'butt', 'projecting', 'round'}
clim (vmin: float, vmax: float)
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
cmap Colormap or str or None
color color or list of rgba tuples
depthshade bool
edgecolor or ec or edgecolors color or list of colors or 'face'
facecolor or facecolors or fc color or list of colors
figure Figure
gid str
hatch {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout bool
joinstyle JoinStyle or {'miter', 'round', 'bevel'}
label object
linestyle or dashes or linestyles or ls str or tuple or list thereof
linewidth or linewidths or lw float or list of floats
norm Normalize or None
offset_transform Transform
offsets (N, 2) or (2,) array-like
path_effects AbstractPathEffect
paths unknown
picker None or bool or float or callable
pickradius float
rasterized bool
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
sort_zpos unknown
transform Transform
url str
urls list of str or None
visible bool
zorder float
set_3d_properties(zs, zdir)[source]
set_depthshade(depthshade)[source]
Set whether depth shading is performed on collection members. Parameters
depthshadebool
Whether to shade the patches in order to give the appearance of depth.
set_sort_zpos(val)[source]
Set the position to use for z-sorting.
|
tf.RaggedTensor View source on GitHub Represents a ragged tensor. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.RaggedTensor tf.RaggedTensor( values, row_partition, internal=False ) A RaggedTensor is a tensor with one or more ragged dimensions, which are dimensions whose slices may have different lengths. For example, the inner (column) dimension of rt=[[3, 1, 4, 1], [], [5, 9, 2], [6], []] is ragged, since the column slices (rt[0, :], ..., rt[4, :]) have different lengths. Dimensions whose slices all have the same length are called uniform dimensions. The outermost dimension of a RaggedTensor is always uniform, since it consists of a single slice (and so there is no possibility for differing slice lengths). The total number of dimensions in a RaggedTensor is called its rank, and the number of ragged dimensions in a RaggedTensor is called its ragged-rank. A RaggedTensor's ragged-rank is fixed at graph creation time: it can't depend on the runtime values of Tensors, and can't vary dynamically for different session runs. Potentially Ragged Tensors Many ops support both Tensors and RaggedTensors. The term "potentially ragged tensor" may be used to refer to a tensor that might be either a Tensor or a RaggedTensor. The ragged-rank of a Tensor is zero. Documenting RaggedTensor Shapes When documenting the shape of a RaggedTensor, ragged dimensions can be indicated by enclosing them in parentheses. For example, the shape of a 3-D RaggedTensor that stores the fixed-size word embedding for each word in a sentence, for each sentence in a batch, could be written as [num_sentences, (num_words), embedding_size]. The parentheses around (num_words) indicate that dimension is ragged, and that the length of each element list in that dimension may vary for each item. Component Tensors Internally, a RaggedTensor consists of a concatenated list of values that are partitioned into variable-length rows. In particular, each RaggedTensor consists of: A values tensor, which concatenates the variable-length rows into a flattened list. For example, the values tensor for [[3, 1, 4, 1], [], [5, 9, 2], [6], []] is [3, 1, 4, 1, 5, 9, 2, 6]. A row_splits vector, which indicates how those flattened values are divided into rows. In particular, the values for row rt[i] are stored in the slice rt.values[rt.row_splits[i]:rt.row_splits[i+1]]. Example: print(tf.RaggedTensor.from_row_splits( values=[3, 1, 4, 1, 5, 9, 2, 6], row_splits=[0, 4, 4, 7, 8, 8])) <tf.RaggedTensor [[3, 1, 4, 1], [], [5, 9, 2], [6], []]> Alternative Row-Partitioning Schemes In addition to row_splits, ragged tensors provide support for five other row-partitioning schemes: row_lengths: a vector with shape [nrows], which specifies the length of each row. value_rowids and nrows: value_rowids is a vector with shape [nvals], corresponding one-to-one with values, which specifies each value's row index. In particular, the row rt[row] consists of the values rt.values[j] where value_rowids[j]==row. nrows is an integer scalar that specifies the number of rows in the RaggedTensor. (nrows is used to indicate trailing empty rows.) row_starts: a vector with shape [nrows], which specifies the start offset of each row. Equivalent to row_splits[:-1]. row_limits: a vector with shape [nrows], which specifies the stop offset of each row. Equivalent to row_splits[1:]. uniform_row_length: A scalar tensor, specifying the length of every row. This row-partitioning scheme may only be used if all rows have the same length. Example: The following ragged tensors are equivalent, and all represent the nested list [[3, 1, 4, 1], [], [5, 9, 2], [6], []]. values = [3, 1, 4, 1, 5, 9, 2, 6] rt1 = RaggedTensor.from_row_splits(values, row_splits=[0, 4, 4, 7, 8, 8]) rt2 = RaggedTensor.from_row_lengths(values, row_lengths=[4, 0, 3, 1, 0]) rt3 = RaggedTensor.from_value_rowids( values, value_rowids=[0, 0, 0, 0, 2, 2, 2, 3], nrows=5) rt4 = RaggedTensor.from_row_starts(values, row_starts=[0, 4, 4, 7, 8]) rt5 = RaggedTensor.from_row_limits(values, row_limits=[4, 4, 7, 8, 8]) Multiple Ragged Dimensions RaggedTensors with multiple ragged dimensions can be defined by using a nested RaggedTensor for the values tensor. Each nested RaggedTensor adds a single ragged dimension. inner_rt = RaggedTensor.from_row_splits( # =rt1 from above values=[3, 1, 4, 1, 5, 9, 2, 6], row_splits=[0, 4, 4, 7, 8, 8]) outer_rt = RaggedTensor.from_row_splits( values=inner_rt, row_splits=[0, 3, 3, 5]) print(outer_rt.to_list()) [[[3, 1, 4, 1], [], [5, 9, 2]], [], [[6], []]] print(outer_rt.ragged_rank) 2 The factory function RaggedTensor.from_nested_row_splits may be used to construct a RaggedTensor with multiple ragged dimensions directly, by providing a list of row_splits tensors: RaggedTensor.from_nested_row_splits( flat_values=[3, 1, 4, 1, 5, 9, 2, 6], nested_row_splits=([0, 3, 3, 5], [0, 4, 4, 7, 8, 8])).to_list() [[[3, 1, 4, 1], [], [5, 9, 2]], [], [[6], []]] Uniform Inner Dimensions RaggedTensors with uniform inner dimensions can be defined by using a multidimensional Tensor for values. rt = RaggedTensor.from_row_splits(values=tf.ones([5, 3], tf.int32), row_splits=[0, 2, 5]) print(rt.to_list()) [[[1, 1, 1], [1, 1, 1]], [[1, 1, 1], [1, 1, 1], [1, 1, 1]]] print(rt.shape) (2, None, 3) Uniform Outer Dimensions RaggedTensors with uniform outer dimensions can be defined by using one or more RaggedTensor with a uniform_row_length row-partitioning tensor. For example, a RaggedTensor with shape [2, 2, None] can be constructed with this method from a RaggedTensor values with shape [4, None]: values = tf.ragged.constant([[1, 2, 3], [4], [5, 6], [7, 8, 9, 10]]) print(values.shape) (4, None) rt6 = tf.RaggedTensor.from_uniform_row_length(values, 2) print(rt6) <tf.RaggedTensor [[[1, 2, 3], [4]], [[5, 6], [7, 8, 9, 10]]]> print(rt6.shape) (2, 2, None) Note that rt6 only contains one ragged dimension (the innermost dimension). In contrast, if from_row_splits is used to construct a similar RaggedTensor, then that RaggedTensor will have two ragged dimensions: rt7 = tf.RaggedTensor.from_row_splits(values, [0, 2, 4]) print(rt7.shape) (2, None, None) Uniform and ragged outer dimensions may be interleaved, meaning that a tensor with any combination of ragged and uniform dimensions may be created. For example, a RaggedTensor t4 with shape [3, None, 4, 8, None, 2] could be constructed as follows: t0 = tf.zeros([1000, 2]) # Shape: [1000, 2] t1 = RaggedTensor.from_row_lengths(t0, [...]) # [160, None, 2] t2 = RaggedTensor.from_uniform_row_length(t1, 8) # [20, 8, None, 2] t3 = RaggedTensor.from_uniform_row_length(t2, 4) # [5, 4, 8, None, 2] t4 = RaggedTensor.from_row_lengths(t3, [...]) # [3, None, 4, 8, None, 2] Args values A potentially ragged tensor of any dtype and shape [nvals, ...]. row_partition A RowPartition object, representing the arrangement of the lists at the top level. internal True if the constructor is being called by one of the factory methods. If false, an exception will be raised. Raises ValueError If internal = False. Note that this method is intended only for internal use. TypeError If values is not a RaggedTensor or Tensor, or row_partition is not a RowPartition. Attributes dtype The DType of values in this tensor. flat_values The innermost values tensor for this ragged tensor. Concretely, if rt.values is a Tensor, then rt.flat_values is rt.values; otherwise, rt.flat_values is rt.values.flat_values. Conceptually, flat_values is the tensor formed by flattening the outermost dimension and all of the ragged dimensions into a single dimension. rt.flat_values.shape = [nvals] + rt.shape[rt.ragged_rank + 1:] (where nvals is the number of items in the flattened dimensions). Example: rt = tf.ragged.constant([[[3, 1, 4, 1], [], [5, 9, 2]], [], [[6], []]]) print(rt.flat_values) tf.Tensor([3 1 4 1 5 9 2 6], shape=(8,), dtype=int32) nested_row_splits A tuple containing the row_splits for all ragged dimensions. rt.nested_row_splits is a tuple containing the row_splits tensors for all ragged dimensions in rt, ordered from outermost to innermost. In particular, rt.nested_row_splits = (rt.row_splits,) + value_splits where: value_splits = () if rt.values is a Tensor. value_splits = rt.values.nested_row_splits otherwise. Example: rt = tf.ragged.constant( [[[[3, 1, 4, 1], [], [5, 9, 2]], [], [[6], []]]]) for i, splits in enumerate(rt.nested_row_splits): print('Splits for dimension %d: %s' % (i+1, splits.numpy())) Splits for dimension 1: [0 3] Splits for dimension 2: [0 3 3 5] Splits for dimension 3: [0 4 4 7 8 8] ragged_rank The number of ragged dimensions in this ragged tensor. row_splits The row-split indices for this ragged tensor's values. rt.row_splits specifies where the values for each row begin and end in rt.values. In particular, the values for row rt[i] are stored in the slice rt.values[rt.row_splits[i]:rt.row_splits[i+1]]. Example: rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) print(rt.row_splits) # indices of row splits in rt.values tf.Tensor([0 4 4 7 8 8], shape=(6,), dtype=int64) shape The statically known shape of this ragged tensor. tf.ragged.constant([[0], [1, 2]]).shape TensorShape([2, None]) tf.ragged.constant([[[0, 1]], [[1, 2], [3, 4]]], ragged_rank=1).shape TensorShape([2, None, 2]) uniform_row_length The length of each row in this ragged tensor, or None if rows are ragged. rt1 = tf.ragged.constant([[1, 2, 3], [4], [5, 6], [7, 8, 9, 10]]) print(rt1.uniform_row_length) # rows are ragged. None rt2 = tf.RaggedTensor.from_uniform_row_length( values=rt1, uniform_row_length=2) print(rt2) <tf.RaggedTensor [[[1, 2, 3], [4]], [[5, 6], [7, 8, 9, 10]]]> print(rt2.uniform_row_length) # rows are not ragged (all have size 2). tf.Tensor(2, shape=(), dtype=int64) A RaggedTensor's rows are only considered to be uniform (i.e. non-ragged) if it can be determined statically (at graph construction time) that the rows all have the same length. values The concatenated rows for this ragged tensor. rt.values is a potentially ragged tensor formed by flattening the two outermost dimensions of rt into a single dimension. rt.values.shape = [nvals] + rt.shape[2:] (where nvals is the number of items in the outer two dimensions of rt). rt.ragged_rank = self.ragged_rank - 1 Example: rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) print(rt.values) tf.Tensor([3 1 4 1 5 9 2 6], shape=(8,), dtype=int32) Methods bounding_shape View source bounding_shape( axis=None, name=None, out_type=None ) Returns the tight bounding box shape for this RaggedTensor. Args axis An integer scalar or vector indicating which axes to return the bounding box for. If not specified, then the full bounding box is returned. name A name prefix for the returned tensor (optional). out_type dtype for the returned tensor. Defaults to self.row_splits.dtype. Returns An integer Tensor (dtype=self.row_splits.dtype). If axis is not specified, then output is a vector with output.shape=[self.shape.ndims]. If axis is a scalar, then the output is a scalar. If axis is a vector, then output is a vector, where output[i] is the bounding size for dimension axis[i]. Example: rt = tf.ragged.constant([[1, 2, 3, 4], [5], [], [6, 7, 8, 9], [10]]) rt.bounding_shape().numpy() array([5, 4]) consumers View source consumers() from_nested_row_lengths View source @classmethod from_nested_row_lengths( flat_values, nested_row_lengths, name=None, validate=True ) Creates a RaggedTensor from a nested list of row_lengths tensors. Equivalent to: result = flat_values for row_lengths in reversed(nested_row_lengths): result = from_row_lengths(result, row_lengths) Args flat_values A potentially ragged tensor. nested_row_lengths A list of 1-D integer tensors. The ith tensor is used as the row_lengths for the ith ragged dimension. name A name prefix for the RaggedTensor (optional). validate If true, then use assertions to check that the arguments form a valid RaggedTensor. Note: these assertions incur a runtime cost, since they must be checked for each tensor value. Returns A RaggedTensor (or flat_values if nested_row_lengths is empty). from_nested_row_splits View source @classmethod from_nested_row_splits( flat_values, nested_row_splits, name=None, validate=True ) Creates a RaggedTensor from a nested list of row_splits tensors. Equivalent to: result = flat_values for row_splits in reversed(nested_row_splits): result = from_row_splits(result, row_splits) Args flat_values A potentially ragged tensor. nested_row_splits A list of 1-D integer tensors. The ith tensor is used as the row_splits for the ith ragged dimension. name A name prefix for the RaggedTensor (optional). validate If true, then use assertions to check that the arguments form a valid RaggedTensor. Note: these assertions incur a runtime cost, since they must be checked for each tensor value. Returns A RaggedTensor (or flat_values if nested_row_splits is empty). from_nested_value_rowids View source @classmethod from_nested_value_rowids( flat_values, nested_value_rowids, nested_nrows=None, name=None, validate=True ) Creates a RaggedTensor from a nested list of value_rowids tensors. Equivalent to: result = flat_values for (rowids, nrows) in reversed(zip(nested_value_rowids, nested_nrows)): result = from_value_rowids(result, rowids, nrows) Args flat_values A potentially ragged tensor. nested_value_rowids A list of 1-D integer tensors. The ith tensor is used as the value_rowids for the ith ragged dimension. nested_nrows A list of integer scalars. The ith scalar is used as the nrows for the ith ragged dimension. name A name prefix for the RaggedTensor (optional). validate If true, then use assertions to check that the arguments form a valid RaggedTensor. Note: these assertions incur a runtime cost, since they must be checked for each tensor value. Returns A RaggedTensor (or flat_values if nested_value_rowids is empty). Raises ValueError If len(nested_values_rowids) != len(nested_nrows). from_row_lengths View source @classmethod from_row_lengths( values, row_lengths, name=None, validate=True ) Creates a RaggedTensor with rows partitioned by row_lengths. The returned RaggedTensor corresponds with the python list defined by: result = [[values.pop(0) for i in range(length)] for length in row_lengths] Args values A potentially ragged tensor with shape [nvals, ...]. row_lengths A 1-D integer tensor with shape [nrows]. Must be nonnegative. sum(row_lengths) must be nvals. name A name prefix for the RaggedTensor (optional). validate If true, then use assertions to check that the arguments form a valid RaggedTensor. Note: these assertions incur a runtime cost, since they must be checked for each tensor value. Returns A RaggedTensor. result.rank = values.rank + 1. result.ragged_rank = values.ragged_rank + 1. Example: print(tf.RaggedTensor.from_row_lengths( values=[3, 1, 4, 1, 5, 9, 2, 6], row_lengths=[4, 0, 3, 1, 0])) <tf.RaggedTensor [[3, 1, 4, 1], [], [5, 9, 2], [6], []]> from_row_limits View source @classmethod from_row_limits( values, row_limits, name=None, validate=True ) Creates a RaggedTensor with rows partitioned by row_limits. Equivalent to: from_row_splits(values, concat([0, row_limits])). Args values A potentially ragged tensor with shape [nvals, ...]. row_limits A 1-D integer tensor with shape [nrows]. Must be sorted in ascending order. If nrows>0, then row_limits[-1] must be nvals. name A name prefix for the RaggedTensor (optional). validate If true, then use assertions to check that the arguments form a valid RaggedTensor. Note: these assertions incur a runtime cost, since they must be checked for each tensor value. Returns A RaggedTensor. result.rank = values.rank + 1. result.ragged_rank = values.ragged_rank + 1. Example: print(tf.RaggedTensor.from_row_limits( values=[3, 1, 4, 1, 5, 9, 2, 6], row_limits=[4, 4, 7, 8, 8])) <tf.RaggedTensor [[3, 1, 4, 1], [], [5, 9, 2], [6], []]> from_row_splits View source @classmethod from_row_splits( values, row_splits, name=None, validate=True ) Creates a RaggedTensor with rows partitioned by row_splits. The returned RaggedTensor corresponds with the python list defined by: result = [values[row_splits[i]:row_splits[i + 1]] for i in range(len(row_splits) - 1)] Args values A potentially ragged tensor with shape [nvals, ...]. row_splits A 1-D integer tensor with shape [nrows+1]. Must not be empty, and must be sorted in ascending order. row_splits[0] must be zero and row_splits[-1] must be nvals. name A name prefix for the RaggedTensor (optional). validate If true, then use assertions to check that the arguments form a valid RaggedTensor. Note: these assertions incur a runtime cost, since they must be checked for each tensor value. Returns A RaggedTensor. result.rank = values.rank + 1. result.ragged_rank = values.ragged_rank + 1. Raises ValueError If row_splits is an empty list. Example: print(tf.RaggedTensor.from_row_splits( values=[3, 1, 4, 1, 5, 9, 2, 6], row_splits=[0, 4, 4, 7, 8, 8])) <tf.RaggedTensor [[3, 1, 4, 1], [], [5, 9, 2], [6], []]> from_row_starts View source @classmethod from_row_starts( values, row_starts, name=None, validate=True ) Creates a RaggedTensor with rows partitioned by row_starts. Equivalent to: from_row_splits(values, concat([row_starts, nvals])). Args values A potentially ragged tensor with shape [nvals, ...]. row_starts A 1-D integer tensor with shape [nrows]. Must be nonnegative and sorted in ascending order. If nrows>0, then row_starts[0] must be zero. name A name prefix for the RaggedTensor (optional). validate If true, then use assertions to check that the arguments form a valid RaggedTensor. Note: these assertions incur a runtime cost, since they must be checked for each tensor value. Returns A RaggedTensor. result.rank = values.rank + 1. result.ragged_rank = values.ragged_rank + 1. Example: print(tf.RaggedTensor.from_row_starts( values=[3, 1, 4, 1, 5, 9, 2, 6], row_starts=[0, 4, 4, 7, 8])) <tf.RaggedTensor [[3, 1, 4, 1], [], [5, 9, 2], [6], []]> from_sparse View source @classmethod from_sparse( st_input, name=None, row_splits_dtype=tf.dtypes.int64 ) Converts a 2D tf.sparse.SparseTensor to a RaggedTensor. Each row of the output RaggedTensor will contain the explicit values from the same row in st_input. st_input must be ragged-right. If not it is not ragged-right, then an error will be generated. Example: indices = [[0, 0], [0, 1], [0, 2], [1, 0], [3, 0]] st = tf.sparse.SparseTensor(indices=indices, values=[1, 2, 3, 4, 5], dense_shape=[4, 3]) tf.RaggedTensor.from_sparse(st).to_list() [[1, 2, 3], [4], [], [5]] Currently, only two-dimensional SparseTensors are supported. Args st_input The sparse tensor to convert. Must have rank 2. name A name prefix for the returned tensors (optional). row_splits_dtype dtype for the returned RaggedTensor's row_splits tensor. One of tf.int32 or tf.int64. Returns A RaggedTensor with the same values as st_input. output.ragged_rank = rank(st_input) - 1. output.shape = [st_input.dense_shape[0], None]. Raises ValueError If the number of dimensions in st_input is not known statically, or is not two. from_tensor View source @classmethod from_tensor( tensor, lengths=None, padding=None, ragged_rank=1, name=None, row_splits_dtype=tf.dtypes.int64 ) Converts a tf.Tensor into a RaggedTensor. The set of absent/default values may be specified using a vector of lengths or a padding value (but not both). If lengths is specified, then the output tensor will satisfy output[row] = tensor[row][:lengths[row]]. If 'lengths' is a list of lists or tuple of lists, those lists will be used as nested row lengths. If padding is specified, then any row suffix consisting entirely of padding will be excluded from the returned RaggedTensor. If neither lengths nor padding is specified, then the returned RaggedTensor will have no absent/default values. Examples: dt = tf.constant([[5, 7, 0], [0, 3, 0], [6, 0, 0]]) tf.RaggedTensor.from_tensor(dt) <tf.RaggedTensor [[5, 7, 0], [0, 3, 0], [6, 0, 0]]> tf.RaggedTensor.from_tensor(dt, lengths=[1, 0, 3]) <tf.RaggedTensor [[5], [], [6, 0, 0]]> tf.RaggedTensor.from_tensor(dt, padding=0) <tf.RaggedTensor [[5, 7], [0, 3], [6]]> dt = tf.constant([[[5, 0], [7, 0], [0, 0]], [[0, 0], [3, 0], [0, 0]], [[6, 0], [0, 0], [0, 0]]]) tf.RaggedTensor.from_tensor(dt, lengths=([2, 0, 3], [1, 1, 2, 0, 1])) <tf.RaggedTensor [[[5], [7]], [], [[6, 0], [], [0]]]> Args tensor The Tensor to convert. Must have rank ragged_rank + 1 or higher. lengths An optional set of row lengths, specified using a 1-D integer Tensor whose length is equal to tensor.shape[0] (the number of rows in tensor). If specified, then output[row] will contain tensor[row][:lengths[row]]. Negative lengths are treated as zero. You may optionally pass a list or tuple of lengths to this argument, which will be used as nested row lengths to construct a ragged tensor with multiple ragged dimensions. padding An optional padding value. If specified, then any row suffix consisting entirely of padding will be excluded from the returned RaggedTensor. padding is a Tensor with the same dtype as tensor and with shape=tensor.shape[ragged_rank + 1:]. ragged_rank Integer specifying the ragged rank for the returned RaggedTensor. Must be greater than zero. name A name prefix for the returned tensors (optional). row_splits_dtype dtype for the returned RaggedTensor's row_splits tensor. One of tf.int32 or tf.int64. Returns A RaggedTensor with the specified ragged_rank. The shape of the returned ragged tensor is compatible with the shape of tensor. Raises ValueError If both lengths and padding are specified. from_uniform_row_length View source @classmethod from_uniform_row_length( values, uniform_row_length, nrows=None, validate=True, name=None ) Creates a RaggedTensor with rows partitioned by uniform_row_length. This method can be used to create RaggedTensors with multiple uniform outer dimensions. For example, a RaggedTensor with shape [2, 2, None] can be constructed with this method from a RaggedTensor values with shape [4, None]: values = tf.ragged.constant([[1, 2, 3], [4], [5, 6], [7, 8, 9, 10]]) print(values.shape) (4, None) rt1 = tf.RaggedTensor.from_uniform_row_length(values, 2) print(rt1) <tf.RaggedTensor [[[1, 2, 3], [4]], [[5, 6], [7, 8, 9, 10]]]> print(rt1.shape) (2, 2, None) Note that rt1 only contains one ragged dimension (the innermost dimension). In contrast, if from_row_splits is used to construct a similar RaggedTensor, then that RaggedTensor will have two ragged dimensions: rt2 = tf.RaggedTensor.from_row_splits(values, [0, 2, 4]) print(rt2.shape) (2, None, None) Args values A potentially ragged tensor with shape [nvals, ...]. uniform_row_length A scalar integer tensor. Must be nonnegative. The size of the outer axis of values must be evenly divisible by uniform_row_length. nrows The number of rows in the constructed RaggedTensor. If not specified, then it defaults to nvals/uniform_row_length (or 0 if uniform_row_length==0). nrows only needs to be specified if uniform_row_length might be zero. uniform_row_length*nrows must be nvals. validate If true, then use assertions to check that the arguments form a valid RaggedTensor. Note: these assertions incur a runtime cost, since they must be checked for each tensor value. name A name prefix for the RaggedTensor (optional). Returns A RaggedTensor that corresponds with the python list defined by: result = [[values.pop(0) for i in range(uniform_row_length)] for _ in range(nrows)] result.rank = values.rank + 1. result.ragged_rank = values.ragged_rank + 1. from_value_rowids View source @classmethod from_value_rowids( values, value_rowids, nrows=None, name=None, validate=True ) Creates a RaggedTensor with rows partitioned by value_rowids. The returned RaggedTensor corresponds with the python list defined by: result = [[values[i] for i in range(len(values)) if value_rowids[i] == row] for row in range(nrows)] Args values A potentially ragged tensor with shape [nvals, ...]. value_rowids A 1-D integer tensor with shape [nvals], which corresponds one-to-one with values, and specifies each value's row index. Must be nonnegative, and must be sorted in ascending order. nrows An integer scalar specifying the number of rows. This should be specified if the RaggedTensor may containing empty training rows. Must be greater than value_rowids[-1] (or zero if value_rowids is empty). Defaults to value_rowids[-1] (or zero if value_rowids is empty). name A name prefix for the RaggedTensor (optional). validate If true, then use assertions to check that the arguments form a valid RaggedTensor. Note: these assertions incur a runtime cost, since they must be checked for each tensor value. Returns A RaggedTensor. result.rank = values.rank + 1. result.ragged_rank = values.ragged_rank + 1. Raises ValueError If nrows is incompatible with value_rowids. Example: print(tf.RaggedTensor.from_value_rowids( values=[3, 1, 4, 1, 5, 9, 2, 6], value_rowids=[0, 0, 0, 0, 2, 2, 2, 3], nrows=5)) <tf.RaggedTensor [[3, 1, 4, 1], [], [5, 9, 2], [6], []]> merge_dims View source merge_dims( outer_axis, inner_axis ) Merges outer_axis...inner_axis into a single dimension. Returns a copy of this RaggedTensor with the specified range of dimensions flattened into a single dimension, with elements in row-major order. Examples: rt = tf.ragged.constant([[[1, 2], [3]], [[4, 5, 6]]]) print(rt.merge_dims(0, 1)) <tf.RaggedTensor [[1, 2], [3], [4, 5, 6]]> print(rt.merge_dims(1, 2)) <tf.RaggedTensor [[1, 2, 3], [4, 5, 6]]> print(rt.merge_dims(0, 2)) tf.Tensor([1 2 3 4 5 6], shape=(6,), dtype=int32) To mimic the behavior of np.flatten (which flattens all dimensions), use rt.merge_dims(0, -1). To mimic the behavior oftf.layers.Flatten(which flattens all dimensions except the outermost batch dimension), usert.merge_dims(1, -1)`. Args outer_axis int: The first dimension in the range of dimensions to merge. May be negative if self.shape.rank is statically known. inner_axis int: The last dimension in the range of dimensions to merge. May be negative if self.shape.rank is statically known. Returns A copy of this tensor, with the specified dimensions merged into a single dimension. The shape of the returned tensor will be self.shape[:outer_axis] + [N] + self.shape[inner_axis + 1:], where N is the total number of slices in the merged dimensions. nested_row_lengths View source nested_row_lengths( name=None ) Returns a tuple containing the row_lengths for all ragged dimensions. rt.nested_row_lengths() is a tuple containing the row_lengths tensors for all ragged dimensions in rt, ordered from outermost to innermost. Args name A name prefix for the returned tensors (optional). Returns A tuple of 1-D integer Tensors. The length of the tuple is equal to self.ragged_rank. nested_value_rowids View source nested_value_rowids( name=None ) Returns a tuple containing the value_rowids for all ragged dimensions. rt.nested_value_rowids is a tuple containing the value_rowids tensors for all ragged dimensions in rt, ordered from outermost to innermost. In particular, rt.nested_value_rowids = (rt.value_rowids(),) + value_ids where: * `value_ids = ()` if `rt.values` is a `Tensor`. * `value_ids = rt.values.nested_value_rowids` otherwise. Args name A name prefix for the returned tensors (optional). Returns A tuple of 1-D integer Tensors. Example: rt = tf.ragged.constant( [[[[3, 1, 4, 1], [], [5, 9, 2]], [], [[6], []]]]) for i, ids in enumerate(rt.nested_value_rowids()): print('row ids for dimension %d: %s' % (i+1, ids.numpy())) row ids for dimension 1: [0 0 0] row ids for dimension 2: [0 0 0 2 2] row ids for dimension 3: [0 0 0 0 2 2 2 3] nrows View source nrows( out_type=None, name=None ) Returns the number of rows in this ragged tensor. I.e., the size of the outermost dimension of the tensor. Args out_type dtype for the returned tensor. Defaults to self.row_splits.dtype. name A name prefix for the returned tensor (optional). Returns A scalar Tensor with dtype out_type. Example: rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) print(rt.nrows()) # rt has 5 rows. tf.Tensor(5, shape=(), dtype=int64) numpy View source numpy() Returns a numpy array with the values for this RaggedTensor. Requires that this RaggedTensor was constructed in eager execution mode. Ragged dimensions are encoded using numpy arrays with dtype=object and rank=1, where each element is a single row. Examples In the following example, the value returned by RaggedTensor.numpy() contains three numpy array objects: one for each row (with rank=1 and dtype=int64), and one to combine them (with rank=1 and dtype=object): tf.ragged.constant([[1, 2, 3], [4, 5]], dtype=tf.int64).numpy() array([array([1, 2, 3]), array([4, 5])], dtype=object) Uniform dimensions are encoded using multidimensional numpy arrays. In the following example, the value returned by RaggedTensor.numpy() contains a single numpy array object, with rank=2 and dtype=int64: tf.ragged.constant([[1, 2, 3], [4, 5, 6]], dtype=tf.int64).numpy() array([[1, 2, 3], [4, 5, 6]]) Returns A numpy array. row_lengths View source row_lengths( axis=1, name=None ) Returns the lengths of the rows in this ragged tensor. rt.row_lengths()[i] indicates the number of values in the ith row of rt. Args axis An integer constant indicating the axis whose row lengths should be returned. name A name prefix for the returned tensor (optional). Returns A potentially ragged integer Tensor with shape self.shape[:axis]. Raises ValueError If axis is out of bounds. Example: rt = tf.ragged.constant( [[[3, 1, 4], [1]], [], [[5, 9], [2]], [[6]], []]) print(rt.row_lengths()) # lengths of rows in rt tf.Tensor([2 0 2 1 0], shape=(5,), dtype=int64) print(rt.row_lengths(axis=2)) # lengths of axis=2 rows. <tf.RaggedTensor [[3, 1], [], [2, 1], [1], []]> row_limits View source row_limits( name=None ) Returns the limit indices for rows in this ragged tensor. These indices specify where the values for each row end in self.values. rt.row_limits(self) is equal to rt.row_splits[:-1]. Args name A name prefix for the returned tensor (optional). Returns A 1-D integer Tensor with shape [nrows]. The returned tensor is nonnegative, and is sorted in ascending order. Example: rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) print(rt.values) tf.Tensor([3 1 4 1 5 9 2 6], shape=(8,), dtype=int32) print(rt.row_limits()) # indices of row limits in rt.values tf.Tensor([4 4 7 8 8], shape=(5,), dtype=int64) row_starts View source row_starts( name=None ) Returns the start indices for rows in this ragged tensor. These indices specify where the values for each row begin in self.values. rt.row_starts() is equal to rt.row_splits[:-1]. Args name A name prefix for the returned tensor (optional). Returns A 1-D integer Tensor with shape [nrows]. The returned tensor is nonnegative, and is sorted in ascending order. Example: rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) print(rt.values) tf.Tensor([3 1 4 1 5 9 2 6], shape=(8,), dtype=int32) print(rt.row_starts()) # indices of row starts in rt.values tf.Tensor([0 4 4 7 8], shape=(5,), dtype=int64) to_list View source to_list() Returns a nested Python list with the values for this RaggedTensor. Requires that rt was constructed in eager execution mode. Returns A nested Python list. to_sparse View source to_sparse( name=None ) Converts this RaggedTensor into a tf.sparse.SparseTensor. Example: rt = tf.ragged.constant([[1, 2, 3], [4], [], [5, 6]]) print(rt.to_sparse()) SparseTensor(indices=tf.Tensor( [[0 0] [0 1] [0 2] [1 0] [3 0] [3 1]], shape=(6, 2), dtype=int64), values=tf.Tensor([1 2 3 4 5 6], shape=(6,), dtype=int32), dense_shape=tf.Tensor([4 3], shape=(2,), dtype=int64)) Args name A name prefix for the returned tensors (optional). Returns A SparseTensor with the same values as self. to_tensor View source to_tensor( default_value=None, name=None, shape=None ) Converts this RaggedTensor into a tf.Tensor. If shape is specified, then the result is padded and/or truncated to the specified shape. Examples: rt = tf.ragged.constant([[9, 8, 7], [], [6, 5], [4]]) print(rt.to_tensor()) tf.Tensor( [[9 8 7] [0 0 0] [6 5 0] [4 0 0]], shape=(4, 3), dtype=int32) print(rt.to_tensor(shape=[5, 2])) tf.Tensor( [[9 8] [0 0] [6 5] [4 0] [0 0]], shape=(5, 2), dtype=int32) Args default_value Value to set for indices not specified in self. Defaults to zero. default_value must be broadcastable to self.shape[self.ragged_rank + 1:]. name A name prefix for the returned tensors (optional). shape The shape of the resulting dense tensor. In particular, result.shape[i] is shape[i] (if shape[i] is not None), or self.bounding_shape(i) (otherwise).shape.rank must be None or equal to self.rank. Returns A Tensor with shape ragged.bounding_shape(self) and the values specified by the non-empty values in self. Empty values are assigned default_value. value_rowids View source value_rowids( name=None ) Returns the row indices for the values in this ragged tensor. rt.value_rowids() corresponds one-to-one with the outermost dimension of rt.values, and specifies the row containing each value. In particular, the row rt[row] consists of the values rt.values[j] where rt.value_rowids()[j] == row. Args name A name prefix for the returned tensor (optional). Returns A 1-D integer Tensor with shape self.values.shape[:1]. The returned tensor is nonnegative, and is sorted in ascending order. Example: rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) print(rt.values) tf.Tensor([3 1 4 1 5 9 2 6], shape=(8,), dtype=int32) print(rt.value_rowids()) # corresponds 1:1 with rt.values tf.Tensor([0 0 0 0 2 2 2 3], shape=(8,), dtype=int64) with_flat_values View source with_flat_values( new_values ) Returns a copy of self with flat_values replaced by new_value. Preserves cached row-partitioning tensors such as self.cached_nrows and self.cached_value_rowids if they have values. Args new_values Potentially ragged tensor that should replace self.flat_values. Must have rank > 0, and must have the same number of rows as self.flat_values. Returns A RaggedTensor. result.rank = self.ragged_rank + new_values.rank. result.ragged_rank = self.ragged_rank + new_values.ragged_rank. with_row_splits_dtype View source with_row_splits_dtype( dtype ) Returns a copy of this RaggedTensor with the given row_splits dtype. For RaggedTensors with multiple ragged dimensions, the row_splits for all nested RaggedTensor objects are cast to the given dtype. Args dtype The dtype for row_splits. One of tf.int32 or tf.int64. Returns A copy of this RaggedTensor, with the row_splits cast to the given type. with_values View source with_values( new_values ) Returns a copy of self with values replaced by new_value. Preserves cached row-partitioning tensors such as self.cached_nrows and self.cached_value_rowids if they have values. Args new_values Potentially ragged tensor to use as the values for the returned RaggedTensor. Must have rank > 0, and must have the same number of rows as self.values. Returns A RaggedTensor. result.rank = 1 + new_values.rank. result.ragged_rank = 1 + new_values.ragged_rank __abs__ View source __abs__( x, name=None ) Computes the absolute value of a tensor. Given a tensor of integer or floating-point values, this operation returns a tensor of the same type, where each element contains the absolute value of the corresponding element in the input. Given a tensor x of complex numbers, this operation returns a tensor of type float32 or float64 that is the absolute value of each element in x. For a complex number \(a + bj\), its absolute value is computed as \(\sqrt{a^2 b^2}\). For example: x = tf.constant([[-2.25 + 4.75j], [-3.25 + 5.75j]]) tf.abs(x) <tf.Tensor: shape=(2, 1), dtype=float64, numpy= array([[5.25594901], [6.60492241]])> Args x A Tensor or SparseTensor of type float16, float32, float64, int32, int64, complex64 or complex128. name A name for the operation (optional). Returns A Tensor or SparseTensor of the same size, type and sparsity as x, with absolute values. Note, for complex64 or complex128 input, the returned Tensor will be of type float32 or float64, respectively. If x is a SparseTensor, returns SparseTensor(x.indices, tf.math.abs(x.values, ...), x.dense_shape) __add__ __add__( x, y, name=None ) Returns x + y element-wise. Note: math.add supports broadcasting. AddN does not. More about broadcasting here Args x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int8, int16, int32, int64, complex64, complex128, string. y A Tensor. Must have the same type as x. name A name for the operation (optional). Returns A Tensor. Has the same type as x. __and__ View source __and__( x, y, name=None ) Logical AND function. The operation works for the following input types: Two single elements of type bool One tf.Tensor of type bool and one single bool, where the result will be calculated by applying logical AND with the single element to each element in the larger Tensor. Two tf.Tensor objects of type bool of the same shape. In this case, the result will be the element-wise logical AND of the two input tensors. Usage: a = tf.constant([True]) b = tf.constant([False]) tf.math.logical_and(a, b) <tf.Tensor: shape=(1,), dtype=bool, numpy=array([False])> c = tf.constant([True]) x = tf.constant([False, True, True, False]) tf.math.logical_and(c, x) <tf.Tensor: shape=(4,), dtype=bool, numpy=array([False, True, True, False])> y = tf.constant([False, False, True, True]) z = tf.constant([False, True, False, True]) tf.math.logical_and(y, z) <tf.Tensor: shape=(4,), dtype=bool, numpy=array([False, False, False, True])> Args x A tf.Tensor type bool. y A tf.Tensor of type bool. name A name for the operation (optional). Returns A tf.Tensor of type bool with the same size as that of x or y. __bool__ View source __bool__( _ ) Dummy method to prevent a RaggedTensor from being used as a Python bool. __div__ View source __div__( x, y, name=None ) Divides x / y elementwise (using Python 2 division operator semantics). (deprecated) Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Deprecated in favor of operator or tf.math.divide. Note: Prefer using the Tensor division operator or tf.divide which obey Python 3 division operator semantics. This function divides x and y, forcing Python 2 semantics. That is, if x and y are both integers then the result will be an integer. This is in contrast to Python 3, where division with / is always a float while division with // is always an integer. Args x Tensor numerator of real numeric type. y Tensor denominator of real numeric type. name A name for the operation (optional). Returns x / y returns the quotient of x and y. __floordiv__ View source __floordiv__( x, y, name=None ) Divides x / y elementwise, rounding toward the most negative integer. The same as tf.compat.v1.div(x,y) for integers, but uses tf.floor(tf.compat.v1.div(x,y)) for floating point arguments so that the result is always an integer (though possibly an integer represented as floating point). This op is generated by x // y floor division in Python 3 and in Python 2.7 with from __future__ import division. x and y must have the same type, and the result will have the same type as well. Args x Tensor numerator of real numeric type. y Tensor denominator of real numeric type. name A name for the operation (optional). Returns x / y rounded down. Raises TypeError If the inputs are complex. __ge__ __ge__( x, y, name=None ) Returns the truth value of (x >= y) element-wise. Note: math.greater_equal supports broadcasting. More about broadcasting here Example: x = tf.constant([5, 4, 6, 7]) y = tf.constant([5, 2, 5, 10]) tf.math.greater_equal(x, y) ==> [True, True, True, False] x = tf.constant([5, 4, 6, 7]) y = tf.constant([5]) tf.math.greater_equal(x, y) ==> [True, False, True, True] Args x A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. y A Tensor. Must have the same type as x. name A name for the operation (optional). Returns A Tensor of type bool. __getitem__ View source __getitem__( key ) Returns the specified piece of this RaggedTensor. Supports multidimensional indexing and slicing, with one restriction: indexing into a ragged inner dimension is not allowed. This case is problematic because the indicated value may exist in some rows but not others. In such cases, it's not obvious whether we should (1) report an IndexError; (2) use a default value; or (3) skip that value and return a tensor with fewer rows than we started with. Following the guiding principles of Python ("In the face of ambiguity, refuse the temptation to guess"), we simply disallow this operation. Args self The RaggedTensor to slice. key Indicates which piece of the RaggedTensor to return, using standard Python semantics (e.g., negative values index from the end). key may have any of the following types: int constant Scalar integer Tensor slice containing integer constants and/or scalar integer Tensors Ellipsis tf.newaxis tuple containing any of the above (for multidimensional indexing) Returns A Tensor or RaggedTensor object. Values that include at least one ragged dimension are returned as RaggedTensor. Values that include no ragged dimensions are returned as Tensor. See above for examples of expressions that return Tensors vs RaggedTensors. Raises ValueError If key is out of bounds. ValueError If key is not supported. TypeError If the indices in key have an unsupported type. Examples: # A 2-D ragged tensor with 1 ragged dimension. rt = tf.ragged.constant([['a', 'b', 'c'], ['d', 'e'], ['f'], ['g']]) rt[0].numpy() # First row (1-D `Tensor`) array([b'a', b'b', b'c'], dtype=object) rt[:3].to_list() # First three rows (2-D RaggedTensor) [[b'a', b'b', b'c'], [b'd', b'e'], [b'f']] rt[3, 0].numpy() # 1st element of 4th row (scalar) b'g' # A 3-D ragged tensor with 2 ragged dimensions. rt = tf.ragged.constant([[[1, 2, 3], [4]], [[5], [], [6]], [[7]], [[8, 9], [10]]]) rt[1].to_list() # Second row (2-D RaggedTensor) [[5], [], [6]] rt[3, 0].numpy() # First element of fourth row (1-D Tensor) array([8, 9], dtype=int32) rt[:, 1:3].to_list() # Items 1-3 of each row (3-D RaggedTensor) [[[4]], [[], [6]], [], [[10]]] rt[:, -1:].to_list() # Last item of each row (3-D RaggedTensor) [[[4]], [[6]], [[7]], [[10]]] __gt__ __gt__( x, y, name=None ) Returns the truth value of (x > y) element-wise. Note: math.greater supports broadcasting. More about broadcasting here Example: x = tf.constant([5, 4, 6]) y = tf.constant([5, 2, 5]) tf.math.greater(x, y) ==> [False, True, True] x = tf.constant([5, 4, 6]) y = tf.constant([5]) tf.math.greater(x, y) ==> [False, False, True] Args x A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. y A Tensor. Must have the same type as x. name A name for the operation (optional). Returns A Tensor of type bool. __invert__ __invert__( x, name=None ) Returns the truth value of NOT x element-wise. Example: tf.math.logical_not(tf.constant([True, False])) <tf.Tensor: shape=(2,), dtype=bool, numpy=array([False, True])> Args x A Tensor of type bool. A Tensor of type bool. name A name for the operation (optional). Returns A Tensor of type bool. __le__ __le__( x, y, name=None ) Returns the truth value of (x <= y) element-wise. Note: math.less_equal supports broadcasting. More about broadcasting here Example: x = tf.constant([5, 4, 6]) y = tf.constant([5]) tf.math.less_equal(x, y) ==> [True, True, False] x = tf.constant([5, 4, 6]) y = tf.constant([5, 6, 6]) tf.math.less_equal(x, y) ==> [True, True, True] Args x A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. y A Tensor. Must have the same type as x. name A name for the operation (optional). Returns A Tensor of type bool. __lt__ __lt__( x, y, name=None ) Returns the truth value of (x < y) element-wise. Note: math.less supports broadcasting. More about broadcasting here Example: x = tf.constant([5, 4, 6]) y = tf.constant([5]) tf.math.less(x, y) ==> [False, True, False] x = tf.constant([5, 4, 6]) y = tf.constant([5, 6, 7]) tf.math.less(x, y) ==> [False, True, True] Args x A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. y A Tensor. Must have the same type as x. name A name for the operation (optional). Returns A Tensor of type bool. __mod__ __mod__( x, y, name=None ) Returns element-wise remainder of division. When x < 0 xor y < 0 is true, this follows Python semantics in that the result here is consistent with a flooring divide. E.g. floor(x / y) * y + mod(x, y) = x. Note: math.floormod supports broadcasting. More about broadcasting here Args x A Tensor. Must be one of the following types: int32, int64, uint64, bfloat16, half, float32, float64. y A Tensor. Must have the same type as x. name A name for the operation (optional). Returns A Tensor. Has the same type as x. __mul__ View source __mul__( x, y, name=None ) Returns an element-wise x * y. For example: x = tf.constant(([1, 2, 3, 4])) tf.math.multiply(x, x) <tf.Tensor: shape=(4,), dtype=..., numpy=array([ 1, 4, 9, 16], dtype=int32)> Since tf.math.multiply will convert its arguments to Tensors, you can also pass in non-Tensor arguments: tf.math.multiply(7,6) <tf.Tensor: shape=(), dtype=int32, numpy=42> If x.shape is not thes same as y.shape, they will be broadcast to a compatible shape. (More about broadcasting here.) For example: x = tf.ones([1, 2]); y = tf.ones([2, 1]); x * y # Taking advantage of operator overriding <tf.Tensor: shape=(2, 2), dtype=float32, numpy= array([[1., 1.], [1., 1.]], dtype=float32)> Args x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int8, uint16, int16, int32, int64, complex64, complex128. y A Tensor. Must have the same type as x. name A name for the operation (optional). Returns A Tensor. Has the same type as x. Raises InvalidArgumentError: When x and y have incomptatible shapes or types. __neg__ __neg__( x, name=None ) Computes numerical negative value element-wise. I.e., \(y = -x\). Args x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, int8, int16, int32, int64, complex64, complex128. name A name for the operation (optional). Returns A Tensor. Has the same type as x. If x is a SparseTensor, returns SparseTensor(x.indices, tf.math.negative(x.values, ...), x.dense_shape) __nonzero__ View source __nonzero__( _ ) Dummy method to prevent a RaggedTensor from being used as a Python bool. __or__ __or__( x, y, name=None ) Returns the truth value of x OR y element-wise. Note: math.logical_or supports broadcasting. More about broadcasting here Args x A Tensor of type bool. y A Tensor of type bool. name A name for the operation (optional). Returns A Tensor of type bool. __pow__ View source __pow__( x, y, name=None ) Computes the power of one value to another. Given a tensor x and a tensor y, this operation computes \(x^y\) for corresponding elements in x and y. For example: x = tf.constant([[2, 2], [3, 3]]) y = tf.constant([[8, 16], [2, 3]]) tf.pow(x, y) # [[256, 65536], [9, 27]] Args x A Tensor of type float16, float32, float64, int32, int64, complex64, or complex128. y A Tensor of type float16, float32, float64, int32, int64, complex64, or complex128. name A name for the operation (optional). Returns A Tensor. __radd__ __radd__( x, y, name=None ) Returns x + y element-wise. Note: math.add supports broadcasting. AddN does not. More about broadcasting here Args x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int8, int16, int32, int64, complex64, complex128, string. y A Tensor. Must have the same type as x. name A name for the operation (optional). Returns A Tensor. Has the same type as x. __rand__ View source __rand__( x, y, name=None ) Logical AND function. The operation works for the following input types: Two single elements of type bool One tf.Tensor of type bool and one single bool, where the result will be calculated by applying logical AND with the single element to each element in the larger Tensor. Two tf.Tensor objects of type bool of the same shape. In this case, the result will be the element-wise logical AND of the two input tensors. Usage: a = tf.constant([True]) b = tf.constant([False]) tf.math.logical_and(a, b) <tf.Tensor: shape=(1,), dtype=bool, numpy=array([False])> c = tf.constant([True]) x = tf.constant([False, True, True, False]) tf.math.logical_and(c, x) <tf.Tensor: shape=(4,), dtype=bool, numpy=array([False, True, True, False])> y = tf.constant([False, False, True, True]) z = tf.constant([False, True, False, True]) tf.math.logical_and(y, z) <tf.Tensor: shape=(4,), dtype=bool, numpy=array([False, False, False, True])> Args x A tf.Tensor type bool. y A tf.Tensor of type bool. name A name for the operation (optional). Returns A tf.Tensor of type bool with the same size as that of x or y. __rdiv__ View source __rdiv__( x, y, name=None ) Divides x / y elementwise (using Python 2 division operator semantics). (deprecated) Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Deprecated in favor of operator or tf.math.divide. Note: Prefer using the Tensor division operator or tf.divide which obey Python 3 division operator semantics. This function divides x and y, forcing Python 2 semantics. That is, if x and y are both integers then the result will be an integer. This is in contrast to Python 3, where division with / is always a float while division with // is always an integer. Args x Tensor numerator of real numeric type. y Tensor denominator of real numeric type. name A name for the operation (optional). Returns x / y returns the quotient of x and y. __rfloordiv__ View source __rfloordiv__( x, y, name=None ) Divides x / y elementwise, rounding toward the most negative integer. The same as tf.compat.v1.div(x,y) for integers, but uses tf.floor(tf.compat.v1.div(x,y)) for floating point arguments so that the result is always an integer (though possibly an integer represented as floating point). This op is generated by x // y floor division in Python 3 and in Python 2.7 with from __future__ import division. x and y must have the same type, and the result will have the same type as well. Args x Tensor numerator of real numeric type. y Tensor denominator of real numeric type. name A name for the operation (optional). Returns x / y rounded down. Raises TypeError If the inputs are complex. __rmod__ __rmod__( x, y, name=None ) Returns element-wise remainder of division. When x < 0 xor y < 0 is true, this follows Python semantics in that the result here is consistent with a flooring divide. E.g. floor(x / y) * y + mod(x, y) = x. Note: math.floormod supports broadcasting. More about broadcasting here Args x A Tensor. Must be one of the following types: int32, int64, uint64, bfloat16, half, float32, float64. y A Tensor. Must have the same type as x. name A name for the operation (optional). Returns A Tensor. Has the same type as x. __rmul__ View source __rmul__( x, y, name=None ) Returns an element-wise x * y. For example: x = tf.constant(([1, 2, 3, 4])) tf.math.multiply(x, x) <tf.Tensor: shape=(4,), dtype=..., numpy=array([ 1, 4, 9, 16], dtype=int32)> Since tf.math.multiply will convert its arguments to Tensors, you can also pass in non-Tensor arguments: tf.math.multiply(7,6) <tf.Tensor: shape=(), dtype=int32, numpy=42> If x.shape is not thes same as y.shape, they will be broadcast to a compatible shape. (More about broadcasting here.) For example: x = tf.ones([1, 2]); y = tf.ones([2, 1]); x * y # Taking advantage of operator overriding <tf.Tensor: shape=(2, 2), dtype=float32, numpy= array([[1., 1.], [1., 1.]], dtype=float32)> Args x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int8, uint16, int16, int32, int64, complex64, complex128. y A Tensor. Must have the same type as x. name A name for the operation (optional). Returns A Tensor. Has the same type as x. Raises InvalidArgumentError: When x and y have incomptatible shapes or types. __ror__ __ror__( x, y, name=None ) Returns the truth value of x OR y element-wise. Note: math.logical_or supports broadcasting. More about broadcasting here Args x A Tensor of type bool. y A Tensor of type bool. name A name for the operation (optional). Returns A Tensor of type bool. __rpow__ View source __rpow__( x, y, name=None ) Computes the power of one value to another. Given a tensor x and a tensor y, this operation computes \(x^y\) for corresponding elements in x and y. For example: x = tf.constant([[2, 2], [3, 3]]) y = tf.constant([[8, 16], [2, 3]]) tf.pow(x, y) # [[256, 65536], [9, 27]] Args x A Tensor of type float16, float32, float64, int32, int64, complex64, or complex128. y A Tensor of type float16, float32, float64, int32, int64, complex64, or complex128. name A name for the operation (optional). Returns A Tensor. __rsub__ View source __rsub__( x, y, name=None ) Returns x - y element-wise. Note: Subtract supports broadcasting. More about broadcasting here Args x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int8, uint16, int16, int32, int64, complex64, complex128, uint32. y A Tensor. Must have the same type as x. name A name for the operation (optional). Returns A Tensor. Has the same type as x. __rtruediv__ View source __rtruediv__( x, y, name=None ) Divides x / y elementwise (using Python 3 division operator semantics). Note: Prefer using the Tensor operator or tf.divide which obey Python division operator semantics. This function forces Python 3 division operator semantics where all integer arguments are cast to floating types first. This op is generated by normal x / y division in Python 3 and in Python 2.7 with from __future__ import division. If you want integer division that rounds down, use x // y or tf.math.floordiv. x and y must have the same numeric type. If the inputs are floating point, the output will have the same type. If the inputs are integral, the inputs are cast to float32 for int8 and int16 and float64 for int32 and int64 (matching the behavior of Numpy). Args x Tensor numerator of numeric type. y Tensor denominator of numeric type. name A name for the operation (optional). Returns x / y evaluated in floating point. Raises TypeError If x and y have different dtypes. __rxor__ View source __rxor__( x, y, name='LogicalXor' ) Logical XOR function. x ^ |
dart:core operator % method num operator %(
num other ) Euclidean modulo of this number by other. Returns the remainder of the Euclidean division. The Euclidean division of two integers a and b yields two integers q and r such that a == b * q + r and 0 <= r < b.abs(). The Euclidean division is only defined for integers, but can be easily extended to work with doubles. In that case, q is still an integer, but r may have a non-integer value that still satisfies 0 <= r < |b|. The sign of the returned value r is always positive. See remainder for the remainder of the truncating division. The result is an int, as described by int.%, if both this number and other are integers, otherwise the result is a double. Example: print(5 % 3); // 2
print(-5 % 3); // 1
print(5 % -3); // 2
print(-5 % -3); // 1 Implementation num operator %(num other);
|
dart:web_gl getShaderParameter method @Creates('int|bool|Null') @Returns('int|bool|Null') Object? getShaderParameter(
Shader shader,
int pname ) @Creates('int|bool|Null'), @Returns('int|bool|Null') Implementation @Creates('int|bool|Null')
@Returns('int|bool|Null')
Object? getShaderParameter(Shader shader, int pname) native;
|
st8b7c:f320:99b9:690f:4595:cd17:293a:c069fgetwc Defined in header <cwchar> wint_t fgetwc( st8b7c:f320:99b9:690f:4595:cd17:293a:c069FILE* stream );
wint_t getwc( st8b7c:f320:99b9:690f:4595:cd17:293a:c069FILE* stream );
Reads the next wide character from the given input stream. getwc() may be implemented as a macro and may evaluate stream more than once.
Parameters stream - to read the wide character from
Return value The next wide character from the stream or WEOF if an error has occurred or the end of file has been reached. If an encoding error occurred, errno is set to EILSEQ.
See also fgetcgetc gets a character from a file stream (function)
fgetws gets a wide string from a file stream (function)
fputwcputwc writes a wide character to a file stream (function)
ungetwc puts a wide character back into a file stream (function)
C documentation for fgetwc
|
cisco.nxos.nxos_vrf_interface – Manages interface specific VRF configuration. Note This plugin is part of the cisco.nxos collection (version 2.7.0). 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 cisco.nxos. To use it in a playbook, specify: cisco.nxos.nxos_vrf_interface. New in version 1.0.0: of cisco.nxos Synopsis Parameters Notes Examples Return Values Synopsis Manages interface specific VRF configuration. Note This module has a corresponding action plugin. Parameters Parameter Choices/Defaults Comments interface string / required Full name of interface to be managed, i.e. Ethernet1/1. provider dictionary Deprecated Starting with Ansible 2.5 we recommend using connection: network_cli. Starting with Ansible 2.6 we recommend using connection: httpapi for NX-API. This option will be removed in a release after 2022-06-01. For more information please see the https://docs.ansible.com/ansible/latest/network/user_guide/platform_nxos.html. A dict object containing connection details. auth_pass string Specifies the password to use if required to enter privileged mode on the remote device. If authorize is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_AUTH_PASS will be used instead. authorize boolean
Choices:
no ← yes Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_AUTHORIZE will be used instead. host string Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. password string Specifies the password to use to authenticate the connection to the remote device. This is a common argument used for either cli or nxapi transports. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_PASSWORD will be used instead. port integer Specifies the port to use when building the connection to the remote device. This value applies to either cli or nxapi. The port value will default to the appropriate transport common port if none is provided in the task. (cli=22, http=80, https=443). ssh_keyfile string Specifies the SSH key to use to authenticate the connection to the remote device. This argument is only used for the cli transport. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_SSH_KEYFILE will be used instead. timeout integer 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. NX-API can be slow to return on long-running commands (sh mac, sh bgp, etc). transport string
Choices:
cli ← nxapi Configures the transport connection to use when connecting to the remote device. The transport argument supports connectivity to the device over cli (ssh) or nxapi. use_proxy boolean
Choices: no
yes ← If no, the environment variables http_proxy and https_proxy will be ignored. use_ssl boolean
Choices:
no ← yes Configures the transport to use SSL if set to yes only when the transport=nxapi, otherwise this value is ignored. username string Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate either the CLI login or the nxapi authentication depending on which transport is used. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_USERNAME will be used instead. validate_certs boolean
Choices:
no ← yes If no, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. If the transport argument is not nxapi, this value is ignored. state string
Choices:
present ← absent Manages desired state of the resource. vrf string / required Name of VRF to be managed. Notes Note Tested against NXOSv 7.3.(0)D1(1) on VIRL Unsupported for Cisco MDS VRF needs to be added globally with cisco.nxos.nxos_vrf before adding a VRF to an interface. Remove a VRF from an interface will still remove all L3 attributes just as it does from CLI. VRF is not read from an interface until IP address is configured on that interface. For information on using CLI and NX-API see the NXOS Platform Options guide
For more information on using Ansible to manage network devices see the Ansible Network Guide
For more information on using Ansible to manage Cisco devices see the Cisco integration page. Examples - name: Ensure vrf ntc exists on Eth1/1
cisco.nxos.nxos_vrf_interface:
vrf: ntc
interface: Ethernet1/1
state: present
- name: Ensure ntc VRF does not exist on Eth1/1
cisco.nxos.nxos_vrf_interface:
vrf: ntc
interface: Ethernet1/1
state: absent
Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description commands list / elements=string always commands sent to the device Sample: ['interface loopback16', 'vrf member ntc'] Authors Jason Edelman (@jedelman8) Gabriele Gerbino (@GGabriele)
© 2012–2018 Michael DeHaan |
BitMap Inherits: Resource < Reference < Object Boolean matrix. Description A two-dimensional array of boolean values, can be used to efficiently store a binary matrix (every matrix element takes only one bit) and query the values using natural cartesian coordinates. Methods
void create ( Vector2 size )
void create_from_image_alpha ( Image image, float threshold=0.1 )
bool get_bit ( Vector2 position ) const
Vector2 get_size ( ) const
int get_true_bit_count ( ) const
void grow_mask ( int pixels, Rect2 rect )
Array opaque_to_polygons ( Rect2 rect, float epsilon=2.0 ) const
void set_bit ( Vector2 position, bool bit )
void set_bit_rect ( Rect2 rect, bool bit ) Method Descriptions void create ( Vector2 size ) Creates a bitmap with the specified size, filled with false. void create_from_image_alpha ( Image image, float threshold=0.1 ) Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to false if the alpha value of the image at that position is equal to threshold or less, and true in other case. bool get_bit ( Vector2 position ) const Returns bitmap's value at the specified position. Vector2 get_size ( ) const Returns bitmap's dimensions. int get_true_bit_count ( ) const Returns the amount of bitmap elements that are set to true. void grow_mask ( int pixels, Rect2 rect ) Applies morphological dilation to the bitmap. The first argument is the dilation amount, Rect2 is the area where the dilation will be applied. Array opaque_to_polygons ( Rect2 rect, float epsilon=2.0 ) const void set_bit ( Vector2 position, bool bit ) Sets the bitmap's element at the specified position, to the specified value. void set_bit_rect ( Rect2 rect, bool bit ) Sets a rectangular portion of the bitmap to the specified value.
|
numpy.isfinite
numpy.isfinite(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'isfinite'>
Test element-wise for finiteness (not infinity or not Not a Number). The result is returned as a boolean array.
Parameters:
x : array_like
Input values.
out : ndarray, None, or tuple of ndarray and None, optional
A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.
where : array_like, optional
This condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original value. Note that if an uninitialized out array is created via the default out=None, locations within it where the condition is False will remain uninitialized. **kwargs
For other keyword-only arguments, see the ufunc docs.
Returns:
y : ndarray, bool
True where x is not positive infinity, negative infinity, or NaN; false otherwise. This is a scalar if x is a scalar. See also isinf, isneginf, isposinf, isnan Notes Not a Number, positive infinity and negative infinity are considered to be non-finite. NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic (IEEE 754). This means that Not a Number is not equivalent to infinity. Also that positive infinity is not equivalent to negative infinity. But infinity is equivalent to positive infinity. Errors result if the second argument is also supplied when x is a scalar input, or if first and second arguments have different shapes. Examples >>> np.isfinite(1)
True
>>> np.isfinite(0)
True
>>> np.isfinite(np.nan)
False
>>> np.isfinite(np.inf)
False
>>> np.isfinite(np.NINF)
False
>>> np.isfinite([np.log(-1.),1.,np.log(0)])
array([False, True, False])
>>> x = np.array([-np.inf, 0., np.inf])
>>> y = np.array([2, 2, 2])
>>> np.isfinite(x, y)
array([0, 1, 0])
>>> y
array([0, 1, 0])
|
Improve this Doc View Source a directive in module ng Modifies the default behavior of the html A tag so that the default action is prevented when the href attribute is empty. This change permits the easy creation of action links with the ngClick directive without changing the location or causing page reloads, e.g.: <a href="" ng-click="list.addItem()">Add Item</a> Directive Info This directive executes at priority level 0. Usage as element: <a>
...
</a>
|
Interface JdbcRowSet All Superinterfaces:
AutoCloseable, Joinable, ResultSet, RowSet, Wrapper
public interface JdbcRowSet extends RowSet, Joinable The standard interface that all standard implementations of JdbcRowSet must implement. 1.0 Overview A wrapper around a ResultSet object that makes it possible to use the result set as a JavaBeans component. Thus, a JdbcRowSet object can be one of the Beans that a tool makes available for composing an application. Because a JdbcRowSet is a connected rowset, that is, it continually maintains its connection to a database using a JDBC technology-enabled driver, it also effectively makes the driver a JavaBeans component. Because it is always connected to its database, an instance of JdbcRowSet can simply take calls invoked on it and in turn call them on its ResultSet object. As a consequence, a result set can, for example, be a component in a Swing application.
Another advantage of a JdbcRowSet object is that it can be used to make a ResultSet object scrollable and updatable. All RowSet objects are by default scrollable and updatable. If the driver and database being used do not support scrolling and/or updating of result sets, an application can populate a JdbcRowSet object with the data of a ResultSet object and then operate on the JdbcRowSet object as if it were the ResultSet object.
2.0 Creating a JdbcRowSet Object The reference implementation of the JdbcRowSet interface, JdbcRowSetImpl, provides an implementation of the default constructor. A new instance is initialized with default values, which can be set with new values as needed. A new instance is not really functional until its execute method is called. In general, this method does the following: establishes a connection with a database
creates a PreparedStatement object and sets any of its placeholder parameters
executes the statement to create a ResultSet object
If the execute method is successful, it will set the appropriate private JdbcRowSet fields with the following: a Connection object -- the connection between the rowset and the database
a PreparedStatement object -- the query that produces the result set
a ResultSet object -- the result set that the rowset's command produced and that is being made, in effect, a JavaBeans component
If these fields have not been set, meaning that the execute method has not executed successfully, no methods other than execute and close may be called on the rowset. All other public methods will throw an exception. Before calling the execute method, however, the command and properties needed for establishing a connection must be set. The following code fragment creates a JdbcRowSetImpl object, sets the command and connection properties, sets the placeholder parameter, and then invokes the method execute.
JdbcRowSetImpl jrs = new JdbcRowSetImpl();
jrs.setCommand("SELECT * FROM TITLES WHERE TYPE = ?");
jrs.setURL("jdbc:myDriver:myAttribute");
jrs.setUsername("cervantes");
jrs.setPassword("sancho");
jrs.setString(1, "BIOGRAPHY");
jrs.execute();
The variable jrs now represents an instance of JdbcRowSetImpl that is a thin wrapper around the ResultSet object containing all the rows in the table TITLES where the type of book is biography. At this point, operations called on jrs will affect the rows in the result set, which is effectively a JavaBeans component. The implementation of the RowSet method execute in the JdbcRowSet reference implementation differs from that in the CachedRowSet reference implementation to account for the different requirements of connected and disconnected RowSet objects.
Since: 1.5 Field Summary Fields declared in interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
Method Summary
Modifier and Type
Method
Description
void
commit()
Each JdbcRowSet contains a Connection object from the ResultSet or JDBC properties passed to it's constructors.
boolean
getAutoCommit()
Each JdbcRowSet contains a Connection object from the original ResultSet or JDBC properties passed to it.
RowSetWarning
getRowSetWarnings()
Retrieves the first warning reported by calls on this JdbcRowSet object.
boolean
getShowDeleted()
Retrieves a boolean indicating whether rows marked for deletion appear in the set of current rows.
void
rollback()
Each JdbcRowSet contains a Connection object from the original ResultSet or JDBC properties passed to it.
void
rollback(Savepoint s)
Each JdbcRowSet contains a Connection object from the original ResultSet or JDBC properties passed to it.
void
setAutoCommit(boolean autoCommit)
Each JdbcRowSet contains a Connection object from the original ResultSet or JDBC properties passed to it.
void
setShowDeleted(boolean b)
Sets the property showDeleted to the given boolean value.
Methods declared in interface javax.sql.rowset.Joinable
getMatchColumnIndexes, getMatchColumnNames, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn
Methods declared in interface java.sql.ResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
Methods declared in interface javax.sql.RowSet
addRowSetListener, clearParameters, execute, getCommand, getDataSourceName, getEscapeProcessing, getMaxFieldSize, getMaxRows, getPassword, getQueryTimeout, getTransactionIsolation, getTypeMap, getUrl, getUsername, isReadOnly, removeRowSetListener, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBlob, setBlob, setBlob, setBoolean, setBoolean, setByte, setByte, setBytes, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setClob, setClob, setClob, setCommand, setConcurrency, setDataSourceName, setDate, setDate, setDate, setDate, setDouble, setDouble, setEscapeProcessing, setFloat, setFloat, setInt, setInt, setLong, setLong, setMaxFieldSize, setMaxRows, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNClob, setNClob, setNClob, setNString, setNString, setNull, setNull, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setObject, setPassword, setQueryTimeout, setReadOnly, setRef, setRowId, setRowId, setShort, setShort, setSQLXML, setSQLXML, setString, setString, setTime, setTime, setTime, setTime, setTimestamp, setTimestamp, setTimestamp, setTimestamp, setTransactionIsolation, setType, setTypeMap, setUrl, setURL, setUsername
Methods declared in interface java.sql.Wrapper
isWrapperFor, unwrap
Method Details getShowDeleted boolean getShowDeleted() throws SQLException Retrieves a boolean indicating whether rows marked for deletion appear in the set of current rows. If true is returned, deleted rows are visible with the current rows. If false is returned, rows are not visible with the set of current rows. The default value is false. Standard rowset implementations may choose to restrict this behavior for security considerations or for certain deployment scenarios. The visibility of deleted rows is implementation-defined and does not represent standard behavior.
Note: Allowing deleted rows to remain visible complicates the behavior of some standard JDBC RowSet implementations methods. However, most rowset users can simply ignore this extra detail because only very specialized applications will likely want to take advantage of this feature.
Returns:
true if deleted rows are visible; false otherwise Throws:
SQLException - if a rowset implementation is unable to to determine whether rows marked for deletion remain visible See Also: setShowDeleted(boolean) setShowDeleted void setShowDeleted(boolean b) throws SQLException Sets the property showDeleted to the given boolean value. This property determines whether rows marked for deletion continue to appear in the set of current rows. If the value is set to true, deleted rows are immediately visible with the set of current rows. If the value is set to false, the deleted rows are set as invisible with the current set of rows. Standard rowset implementations may choose to restrict this behavior for security considerations or for certain deployment scenarios. This is left as implementation-defined and does not represent standard behavior.
Parameters:
b - true if deleted rows should be shown; false otherwise Throws:
SQLException - if a rowset implementation is unable to to reset whether deleted rows should be visible See Also: getShowDeleted() getRowSetWarnings RowSetWarning getRowSetWarnings() throws SQLException Retrieves the first warning reported by calls on this JdbcRowSet object. If a second warning was reported on this JdbcRowSet object, it will be chained to the first warning and can be retrieved by calling the method RowSetWarning.getNextWarning on the first warning. Subsequent warnings on this JdbcRowSet object will be chained to the RowSetWarning objects returned by the method RowSetWarning.getNextWarning. The warning chain is automatically cleared each time a new row is read. This method may not be called on a RowSet object that has been closed; doing so will cause an SQLException to be thrown. Because it is always connected to its data source, a JdbcRowSet object can rely on the presence of active Statement, Connection, and ResultSet instances. This means that applications can obtain additional SQLWarning notifications by calling the getNextWarning methods that they provide. Disconnected Rowset objects, such as a CachedRowSet object, do not have access to these getNextWarning methods.
Returns: the first RowSetWarning object reported on this JdbcRowSet object or null if there are none Throws:
SQLException - if this method is called on a closed JdbcRowSet object See Also: RowSetWarning commit void commit() throws SQLException Each JdbcRowSet contains a Connection object from the ResultSet or JDBC properties passed to it's constructors. This method wraps the Connection commit method to allow flexible auto commit or non auto commit transactional control support. Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.
Throws:
SQLException - if a database access error occurs or this Connection object within this JdbcRowSet is in auto-commit mode See Also: Connection.setAutoCommit(boolean) getAutoCommit boolean getAutoCommit() throws SQLException Each JdbcRowSet contains a Connection object from the original ResultSet or JDBC properties passed to it. This method wraps the Connection's getAutoCommit method to allow an application to determine the JdbcRowSet transaction behavior. Sets this connection's auto-commit mode to the given state. If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. By default, new connections are in auto-commit mode.
Returns:
true if auto-commit is enabled; false otherwise Throws:
SQLException - if a database access error occurs See Also: Connection.getAutoCommit() setAutoCommit void setAutoCommit(boolean autoCommit) throws SQLException Each JdbcRowSet contains a Connection object from the original ResultSet or JDBC properties passed to it. This method wraps the Connection's getAutoCommit method to allow an application to set the JdbcRowSet transaction behavior. Sets the current auto-commit mode for this Connection object.
Parameters:
autoCommit - true to enable auto-commit; false to disable auto-commit Throws:
SQLException - if a database access error occurs See Also: Connection.setAutoCommit(boolean) rollback void rollback() throws SQLException Each JdbcRowSet contains a Connection object from the original ResultSet or JDBC properties passed to it. Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled. Throws:
SQLException - if a database access error occurs or this Connection object within this JdbcRowSet is in auto-commit mode. See Also: rollback(Savepoint) rollback void rollback(Savepoint s) throws SQLException Each JdbcRowSet contains a Connection object from the original ResultSet or JDBC properties passed to it. Undoes all changes made in the current transaction to the last set savepoint and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled. Parameters:
s - The Savepoint to rollback to Throws:
SQLException - if a database access error occurs or this Connection object within this JdbcRowSet is in auto-commit mode. See Also: rollback()
|
swdepot – Manage packages with swdepot package manager (HP-UX) New in version 1.4. Synopsis Parameters Examples Status Synopsis Will install, upgrade and remove packages with swdepot package manager (HP-UX) Parameters Parameter Choices/Defaults Comments depot - added in 1.4 The source repository from which install or upgrade a package. name - / required added in 1.4 package name. state - / required added in 1.4
Choices: present latest absent whether to install (present, latest), or remove (absent) a package. Examples - swdepot:
name: unzip-6.0
state: installed
depot: 'repository:/path'
- swdepot:
name: unzip
state: latest
depot: 'repository:/path'
- swdepot:
name: unzip
state: absent
Status This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors Raul Melo (@melodous) Hint If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan |
overflow-clip-margin
Experimental: This is an experimental technologyCheck the Browser compatibility table carefully before using this in production. The overflow-clip-margin CSS property determines how far outside its bounds an element with overflow: clip may be painted before being clipped.
Syntax
overflow-clip-margin: 20px;
overflow-clip-margin: 1em;
/* Global values */
overflow-clip-margin: inherit;
overflow-clip-margin: initial;
overflow-clip-margin: revert;
overflow-clip-margin: revert-layer;
overflow-clip-margin: unset;
The overflow-clip-margin property is specified as a length, negative values are not allowed. Note: If the element does not have overflow: clip then this property will be ignored.
Formal definition
Initial value
0px
Applies to
all elements
Inherited
no
Computed value
the computed
Animation type
discrete
Formal syntax
overflow-clip-margin = <visual-box> || <length [0,∞]> <visual-box> = content-box | padding-box | border-box Examples
HTML
<div class="box">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</div>
CSS
.box {
border: 3px solid black;
width: 250px;
height: 100px;
overflow: clip;
overflow-clip-margin: 20px;
}
Result
Specifications
Specification
CSS Overflow Module Level 3 # overflow-clip-margin
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
overflow-clip-margin
90
90
No
See bug 1661582.
No
76
No
90
90
No
See bug 1661582.
64
No
15.0
See also
Related CSS properties: text-overflow, white-space, overflow, overflow-inline, overflow-x, overflow-y, clip, display
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: Aug 28, 2022, by MDN contributors
|
redirect_guess_404_permalink(): string|false Attempts to guess the correct URL for a 404 request based on query vars. Return string|false The correct URL if one is found. False on failure. Source File: wp-includes/canonical.php. View all references function redirect_guess_404_permalink() {
global $wpdb;
/**
* Filters whether to attempt to guess a redirect URL for a 404 request.
*
* Returning a false value from the filter will disable the URL guessing
* and return early without performing a redirect.
*
* @since 5.5.0
*
* @param bool $do_redirect_guess Whether to attempt to guess a redirect URL
* for a 404 request. Default true.
*/
if ( false === apply_filters( 'do_redirect_guess_404_permalink', true ) ) {
return false;
}
/**
* Short-circuits the redirect URL guessing for 404 requests.
*
* Returning a non-null value from the filter will effectively short-circuit
* the URL guessing, returning the passed value instead.
*
* @since 5.5.0
*
* @param null|string|false $pre Whether to short-circuit guessing the redirect for a 404.
* Default null to continue with the URL guessing.
*/
$pre = apply_filters( 'pre_redirect_guess_404_permalink', null );
if ( null !== $pre ) {
return $pre;
}
if ( get_query_var( 'name' ) ) {
/**
* Filters whether to perform a strict guess for a 404 redirect.
*
* Returning a truthy value from the filter will redirect only exact post_name matches.
*
* @since 5.5.0
*
* @param bool $strict_guess Whether to perform a strict guess. Default false (loose guess).
*/
$strict_guess = apply_filters( 'strict_redirect_guess_404_permalink', false );
if ( $strict_guess ) {
$where = $wpdb->prepare( 'post_name = %s', get_query_var( 'name' ) );
} else {
$where = $wpdb->prepare( 'post_name LIKE %s', $wpdb->esc_like( get_query_var( 'name' ) ) . '%' );
}
// If any of post_type, year, monthnum, or day are set, use them to refine the query.
if ( get_query_var( 'post_type' ) ) {
if ( is_array( get_query_var( 'post_type' ) ) ) {
// phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare
$where .= " AND post_type IN ('" . join( "', '", esc_sql( get_query_var( 'post_type' ) ) ) . "')";
} else {
$where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) );
}
} else {
$where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')";
}
if ( get_query_var( 'year' ) ) {
$where .= $wpdb->prepare( ' AND YEAR(post_date) = %d', get_query_var( 'year' ) );
}
if ( get_query_var( 'monthnum' ) ) {
$where .= $wpdb->prepare( ' AND MONTH(post_date) = %d', get_query_var( 'monthnum' ) );
}
if ( get_query_var( 'day' ) ) {
$where .= $wpdb->prepare( ' AND DAYOFMONTH(post_date) = %d', get_query_var( 'day' ) );
}
$publicly_viewable_statuses = array_filter( get_post_stati(), 'is_post_status_viewable' );
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$post_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE $where AND post_status IN ('" . implode( "', '", esc_sql( $publicly_viewable_statuses ) ) . "')" );
if ( ! $post_id ) {
return false;
}
if ( get_query_var( 'feed' ) ) {
return get_post_comments_feed_link( $post_id, get_query_var( 'feed' ) );
} elseif ( get_query_var( 'page' ) > 1 ) {
return trailingslashit( get_permalink( $post_id ) ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' );
} else {
return get_permalink( $post_id );
}
}
return false;
}
Hooks apply_filters( 'do_redirect_guess_404_permalink', bool $do_redirect_guess )
Filters whether to attempt to guess a redirect URL for a 404 request. apply_filters( 'pre_redirect_guess_404_permalink', null|string|false $pre )
Short-circuits the redirect URL guessing for 404 requests. apply_filters( 'strict_redirect_guess_404_permalink', bool $strict_guess )
Filters whether to perform a strict guess for a 404 redirect. Related Uses Uses Description wp8b7c:f320:99b9:690f:4595:cd17:293a:c069esc_like() wp-includes/class-wpdb.php First half of escaping for LIKE special characters % and _ before preparing for SQL. esc_sql() wp-includes/formatting.php Escapes data for use in a MySQL query. get_query_var() wp-includes/query.php Retrieves the value of a query variable in the WP_Query class. get_post_comments_feed_link() wp-includes/link-template.php Retrieves the permalink for the post comments feed. user_trailingslashit() wp-includes/link-template.php Retrieves a trailing-slashed string if the site is set for adding trailing slashes. get_post_stati() wp-includes/post.php Gets a list of post statuses. trailingslashit() wp-includes/formatting.php Appends a trailing slash. get_permalink() wp-includes/link-template.php Retrieves the full permalink for the current post or post ID. apply_filters() wp-includes/plugin.php Calls the callback functions that have been added to a filter hook. get_post_types() wp-includes/post.php Gets a list of all registered post type objects. wp8b7c:f320:99b9:690f:4595:cd17:293a:c069get_var() wp-includes/class-wpdb.php Retrieves one variable from the database. wp8b7c:f320:99b9:690f:4595:cd17:293a:c069prepare() wp-includes/class-wpdb.php Prepares a SQL query for safe execution.
Used By Used By Description redirect_canonical() wp-includes/canonical.php Redirects incoming links to the proper URL based on the site url.
Changelog Version Description 2.3.0 Introduced.
|
dart:svg library Scalable Vector Graphics: Two-dimensional vector graphics with support for events and animation. For details about the features and syntax of SVG, a W3C standard, refer to the Scalable Vector Graphics Specification. Properties svgBlinkMap → dynamic @Deprecated("Internal Use Only"), final
Classes AElement Angle AnimatedAngle AnimatedBoolean AnimatedEnumeration AnimatedInteger AnimatedLength AnimatedLengthList AnimatedNumber AnimatedNumberList AnimatedPreserveAspectRatio AnimatedRect AnimatedString AnimatedTransformList AnimateElement AnimateMotionElement AnimateTransformElement AnimationElement AttributeClassSet CircleElement ClipPathElement DefsElement DescElement DiscardElement EllipseElement FEBlendElement FEColorMatrixElement FEComponentTransferElement FECompositeElement FEConvolveMatrixElement FEDiffuseLightingElement FEDisplacementMapElement FEDistantLightElement FEFloodElement FEFuncAElement FEFuncBElement FEFuncGElement FEFuncRElement FEGaussianBlurElement FEImageElement FEMergeElement FEMergeNodeElement FEMorphologyElement FEOffsetElement FEPointLightElement FESpecularLightingElement FESpotLightElement FETileElement FETurbulenceElement FilterElement FilterPrimitiveStandardAttributes FitToViewBox ForeignObjectElement GElement GeometryElement GraphicsElement ImageElement Length LengthList LinearGradientElement LineElement MarkerElement MaskElement Matrix MetadataElement Number NumberList PathElement PatternElement Point PointList PolygonElement PolylineElement PreserveAspectRatio RadialGradientElement Rect RectElement ScriptElement SetElement StopElement StringList StyleElement SvgElement SvgSvgElement SwitchElement SymbolElement Tests TextContentElement TextElement TextPathElement TextPositioningElement TitleElement Transform TransformList TSpanElement UnitTypes UriReference UseElement ViewElement ViewSpec ZoomAndPan ZoomEvent
|
module ActiveModel8b7c:f320:99b9:690f:4595:cd17:293a:c069ttributes8b7c:f320:99b9:690f:4595:cd17:293a:c069lassMethods Public Instance Methods attribute(name, cast_type = nil, default: NO_DEFAULT_PROVIDED, **options) Show source
# File activemodel/lib/active_model/attributes.rb, line 19
def attribute(name, cast_type = nil, default: NO_DEFAULT_PROVIDED, **options)
name = name.to_s
cast_type = Type.lookup(cast_type, **options) if Symbol === cast_type
cast_type ||= attribute_types[name]
self.attribute_types = attribute_types.merge(name => cast_type)
define_default_attribute(name, default, cast_type)
define_attribute_method(name)
end attribute_names() Show source
# File activemodel/lib/active_model/attributes.rb, line 41
def attribute_names
attribute_types.keys
end Returns an array of attribute names as strings class Person
include ActiveModel8b7c:f320:99b9:690f:4595:cd17:293a:c069ttributes
attribute :name, :string
attribute :age, :integer
end
Person.attribute_names
# => ["name", "age"]
|
module ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Http8b7c:f320:99b9:690f:4595:cd17:293a:c069URL Constants HOST_REGEXP
IP_HOST_REGEXP
PROTOCOL_REGEXP
Public Class Methods extract_domain(host, tld_length) Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 20
def extract_domain(host, tld_length)
extract_domain_from(host, tld_length) if named_host?(host)
end Returns the domain part of a host given the domain level. # Top-level domain example
extract_domain('www.example.com', 1) # => "example.com"
# Second-level domain example
extract_domain('dev.www.example.co.uk', 2) # => "example.co.uk"
extract_subdomain(host, tld_length) Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 44
def extract_subdomain(host, tld_length)
extract_subdomains(host, tld_length).join(".")
end Returns the subdomains of a host as a String given the domain level. # Top-level domain example
extract_subdomain('www.example.com', 1) # => "www"
# Second-level domain example
extract_subdomain('dev.www.example.co.uk', 2) # => "dev.www"
extract_subdomains(host, tld_length) Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 30
def extract_subdomains(host, tld_length)
if named_host?(host)
extract_subdomains_from(host, tld_length)
else
[]
end
end Returns the subdomains of a host as an Array given the domain level. # Top-level domain example
extract_subdomains('www.example.com', 1) # => ["www"]
# Second-level domain example
extract_subdomains('dev.www.example.co.uk', 2) # => ["dev", "www"]
full_url_for(options) Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 56
def full_url_for(options)
host = options[:host]
protocol = options[:protocol]
port = options[:port]
unless host
raise ArgumentError, "Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true"
end
build_host_url(host, port, protocol, options, path_for(options))
end new() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 187
def initialize
super
@protocol = nil
@port = nil
end Calls superclass method path_for(options) Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 68
def path_for(options)
path = options[:script_name].to_s.chomp("/".freeze)
path << options[:path] if options.key?(:path)
add_trailing_slash(path) if options[:trailing_slash]
add_params(path, options[:params]) if options.key?(:params)
add_anchor(path, options[:anchor]) if options.key?(:anchor)
path
end url_for(options) Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 48
def url_for(options)
if options[:only_path]
path_for options
else
full_url_for options
end
end Public Instance Methods domain(tld_length = @@tld_length) Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 330
def domain(tld_length = @@tld_length)
ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Http8b7c:f320:99b9:690f:4595:cd17:293a:c069URL.extract_domain(host, tld_length)
end Returns the domain part of a host, such as “rubyonrails.org” in “www.rubyonrails.org”. You can specify a different tld_length, such as 2 to catch rubyonrails.co.uk in “www.rubyonrails.co.uk”. host() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 234
def host
raw_host_with_port.sub(/:\d+$/, "".freeze)
end Returns the host for this request, such as “example.com”. req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:8080'
req.host # => "example.com"
host_with_port() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 250
def host_with_port
"#{host}#{port_string}"
end Returns a host:port string for this request, such as “example.com” or “example.com:8080”. Port is only included if it is not a default port (80 or 443) req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com'
req.host_with_port # => "example.com"
req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:80'
req.host_with_port # => "example.com"
req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:8080'
req.host_with_port # => "example.com:8080"
optional_port() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 301
def optional_port
standard_port? ? nil : port
end Returns a number port suffix like 8080 if the port number of this request is not the default HTTP port 80 or HTTPS port 443. req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:80'
req.optional_port # => nil
req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:8080'
req.optional_port # => 8080
port() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 261
def port
@port ||= begin
if raw_host_with_port =~ /:(\d+)$/
$1.to_i
else
standard_port
end
end
end Returns the port number of this request as an integer. req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com'
req.port # => 80
req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:8080'
req.port # => 8080
port_string() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 313
def port_string
standard_port? ? "" : ":#{port}"
end Returns a string port suffix, including colon, like “:8080” if the port number of this request is not the default HTTP port 80 or HTTPS port 443. req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:80'
req.port_string # => ""
req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:8080'
req.port_string # => ":8080"
protocol() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 208
def protocol
@protocol ||= ssl? ? "https://" : "http://"
end Returns 'https://' if this is an SSL request and 'http://' otherwise. req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com'
req.protocol # => "http://"
req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com', 'HTTPS' => 'on'
req.protocol # => "https://"
raw_host_with_port() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 222
def raw_host_with_port
if forwarded = x_forwarded_host.presence
forwarded.split(/,\s?/).last
else
get_header("HTTP_HOST") || "#{server_name || server_addr}:#{get_header('SERVER_PORT')}"
end
end Returns the host and port for this request, such as “example.com:8080”. req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com'
req.raw_host_with_port # => "example.com"
req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:80'
req.raw_host_with_port # => "example.com:80"
req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:8080'
req.raw_host_with_port # => "example.com:8080"
server_port() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 324
def server_port
get_header("SERVER_PORT").to_i
end Returns the requested port, such as 8080, based on SERVER_PORT req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'SERVER_PORT' => '80'
req.server_port # => 80
req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'SERVER_PORT' => '8080'
req.server_port # => 8080
standard_port() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 275
def standard_port
case protocol
when "https://" then 443
else 80
end
end Returns the standard port number for this request's protocol. req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:8080'
req.standard_port # => 80
standard_port?() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 289
def standard_port?
port == standard_port
end Returns whether this request is using the standard port req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:80'
req.standard_port? # => true
req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com:8080'
req.standard_port? # => false
subdomain(tld_length = @@tld_length) Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 346
def subdomain(tld_length = @@tld_length)
ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Http8b7c:f320:99b9:690f:4595:cd17:293a:c069URL.extract_subdomain(host, tld_length)
end Returns all the subdomains as a string, so "dev.www" would be returned for “dev.www.rubyonrails.org”. You can specify a different tld_length, such as 2 to catch "www" instead of "www.rubyonrails" in “www.rubyonrails.co.uk”. subdomains(tld_length = @@tld_length) Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 338
def subdomains(tld_length = @@tld_length)
ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Http8b7c:f320:99b9:690f:4595:cd17:293a:c069URL.extract_subdomains(host, tld_length)
end Returns all the subdomains as an array, so ["dev",
"www"] would be returned for “dev.www.rubyonrails.org”. You can specify a different tld_length, such as 2 to catch ["www"] instead of ["www",
"rubyonrails"] in “www.rubyonrails.co.uk”. url() Show source
# File actionpack/lib/action_dispatch/http/url.rb, line 197
def url
protocol + host_with_port + fullpath
end Returns the complete URL used for this request. req = ActionDispatch8b7c:f320:99b9:690f:4595:cd17:293a:c069Request.new 'HTTP_HOST' => 'example.com'
req.url # => "http://example.com"
|
dart:html has method bool has(
FontFace arg ) Implementation bool has(FontFace arg) native;
|
tf.compat.v1.keras.layers.LSTM Long Short-Term Memory layer - Hochreiter 1997. Inherits From: RNN, Layer, Module
tf.compat.v1.keras.layers.LSTM(
units,
activation='tanh',
recurrent_activation='hard_sigmoid',
use_bias=True,
kernel_initializer='glorot_uniform',
recurrent_initializer='orthogonal',
bias_initializer='zeros',
unit_forget_bias=True,
kernel_regularizer=None,
recurrent_regularizer=None,
bias_regularizer=None,
activity_regularizer=None,
kernel_constraint=None,
recurrent_constraint=None,
bias_constraint=None,
dropout=0.0,
recurrent_dropout=0.0,
return_sequences=False,
return_state=False,
go_backwards=False,
stateful=False,
unroll=False,
**kwargs
)
Note that this cell is not optimized for performance on GPU. Please use tf.compat.v1.keras.layers.CuDNNLSTM for better performance on GPU.
Args
units Positive integer, dimensionality of the output space.
activation Activation function to use. Default: hyperbolic tangent (tanh). If you pass None, no activation is applied (ie. "linear" activation: a(x) = x).
recurrent_activation Activation function to use for the recurrent step. Default: hard sigmoid (hard_sigmoid). If you pass None, no activation is applied (ie. "linear" activation: a(x) = x).
use_bias Boolean, whether the layer uses a bias vector.
kernel_initializer Initializer for the kernel weights matrix, used for the linear transformation of the inputs..
recurrent_initializer Initializer for the recurrent_kernel weights matrix, used for the linear transformation of the recurrent state.
bias_initializer Initializer for the bias vector.
unit_forget_bias Boolean. If True, add 1 to the bias of the forget [email protected]. Setting it to true will also force bias_initializer="zeros". This is recommended in Jozefowicz et al., 2015.
kernel_regularizer Regularizer function applied to the kernel weights matrix.
recurrent_regularizer Regularizer function applied to the recurrent_kernel weights matrix.
bias_regularizer Regularizer function applied to the bias vector.
activity_regularizer Regularizer function applied to the output of the layer (its "activation").
kernel_constraint Constraint function applied to the kernel weights matrix.
recurrent_constraint Constraint function applied to the recurrent_kernel weights matrix.
bias_constraint Constraint function applied to the bias vector.
dropout Float between 0 and 1. Fraction of the units to drop for the linear transformation of the inputs.
recurrent_dropout Float between 0 and 1. Fraction of the units to drop for the linear transformation of the recurrent state.
return_sequences Boolean. Whether to return the last output in the output sequence, or the full sequence.
return_state Boolean. Whether to return the last state in addition to the output.
go_backwards Boolean (default False). If True, process the input sequence backwards and return the reversed sequence.
stateful Boolean (default False). If True, the last state for each sample at index i in a batch will be used as initial state for the sample of index i in the following batch.
unroll Boolean (default False). If True, the network will be unrolled, else a symbolic loop will be used. Unrolling can speed-up a RNN, although it tends to be more memory-intensive. Unrolling is only suitable for short sequences.
time_major The shape format of the inputs and outputs tensors. If True, the inputs and outputs will be in shape (timesteps, batch, ...), whereas in the False case, it will be (batch, timesteps, ...). Using time_major = True is a bit more efficient because it avoids transposes at the beginning and end of the RNN calculation. However, most TensorFlow data is batch-major, so by default this function accepts input and emits output in batch-major form. Call arguments:
inputs: A 3D tensor.
mask: Binary tensor of shape (samples, timesteps) indicating whether a given timestep should be masked. An individual True entry indicates that the corresponding timestep should be utilized, while a False entry indicates that the corresponding timestep should be ignored.
training: Python boolean indicating whether the layer should behave in training mode or in inference mode. This argument is passed to the cell when calling it. This is only relevant if dropout or recurrent_dropout is used.
initial_state: List of initial state tensors to be passed to the first call of the cell.
Attributes
activation
bias_constraint
bias_initializer
bias_regularizer
dropout
implementation
kernel_constraint
kernel_initializer
kernel_regularizer
recurrent_activation
recurrent_constraint
recurrent_dropout
recurrent_initializer
recurrent_regularizer
states
unit_forget_bias
units
use_bias
Methods reset_states View source
reset_states(
states=None
)
Reset the recorded states for the stateful RNN layer. Can only be used when RNN layer is constructed with stateful = True. Args: states: Numpy arrays that contains the value for the initial state, which will be feed to cell at the first time step. When the value is None, zero filled numpy array will be created based on the cell state size.
Raises
AttributeError When the RNN layer is not stateful.
ValueError When the batch size of the RNN layer is unknown.
ValueError When the input numpy array is not compatible with the RNN layer state, either size wise or dtype wise.
|
Document
package js.html
extends Node › EventTarget extended by HTMLDocument, XMLDocument
Available on js
The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree.HTMLElement Documentation Document by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
https://developer.mozilla.org/en-US/docs/Web/API/Document
Constructor
new()
Throws:
null
DOMError
Variables
read onlyURL:String
Returns the document location as a string.
read onlyactiveElement:Element
read onlyanchors:HTMLCollection
Returns a list of all of the anchors in the document.
read onlyapplets:HTMLCollection
Returns an ordered list of the applets within a document.
body:Element
Returns the body or frameset node of the current document.
read onlycharacterSet:String
Returns the character set being used by the document.
read onlycharset:String
Alias of Document.characterSet. Use this property instead.
read onlychildElementCount:Int
read onlychildren:HTMLCollection
read onlycompatMode:String
Indicates whether the document is rendered in quirks or strict mode.
read onlycontentType:String
Returns the Content-Type from the MIME Header of the current document.
read onlycurrentScript:Element
read onlydefaultView:Window
Returns a reference to the window object.
dir:String
Gets/sets directionality (rtl/ltr) of the document.
read onlydoctype:DocumentType
Returns the Document Type Definition (DTD) of the current document.
read onlydocumentElement:Element
Returns the Element that is a direct child of the document. For HTML documents, this is normally the HTMLElement element.
read onlydocumentURI:String
Returns the document location as a string.
read onlyembeds:HTMLCollection
Returns a list of the embedded embed elements within the current document.
read onlyfirstElementChild:Element
read onlyfonts:FontFaceSet
read onlyforms:HTMLCollection
Returns a list of the form elements within the current document.
read onlyfullscreen:Bool
true when the document is in Using_full-screen_mode.
read onlyfullscreenElement:Element
The element that's currently in full screen mode for this document.
read onlyfullscreenEnabled:Bool
read onlyhead:HeadElement
Returns the head element of the current document.
read onlyhidden:Bool
…
read onlyimages:HTMLCollection
Returns a list of the images in the current document.
read onlyimplementation:DOMImplementation
Returns the DOM implementation associated with the current document.
read onlyinputEncoding:String
Alias of Document.characterSet. Use this property instead.
read onlylastElementChild:Element
read onlylastModified:String
Returns the date on which the document was last modified.
read onlylastStyleSheetSet:String
Returns the name of the style sheet set that was last enabled. Has the value null until the style sheet is changed by setting the value of document.selectedStyleSheetSet.
read onlylinks:HTMLCollection
Returns a list of all the hyperlinks in the document.
read onlylocation:Location
Returns the URI of the current document.
onabort:Function
onafterscriptexecute:Function
Represents the event handling code for the afterscriptexecute event.
onanimationcancel:Function
onanimationend:Function
onanimationiteration:Function
onanimationstart:Function
onauxclick:Function
onbeforescriptexecute:Function
Represents the event handling code for the beforescriptexecute event.
onblur:Function
oncanplay:Function
oncanplaythrough:Function
onchange:Function
onclick:Function
onclose:Function
oncontextmenu:Function
oncopy:Function
Represents the event handling code for the copy event.
oncut:Function
Represents the event handling code for the cut event.
ondblclick:Function
ondrag:Function
ondragend:Function
ondragenter:Function
ondragexit:Function
ondragleave:Function
ondragover:Function
ondragstart:Function
ondrop:Function
ondurationchange:Function
onemptied:Function
onended:Function
onerror:Function
onfocus:Function
onfullscreenchange:Function
Is an EventHandler representing the code to be called when the fullscreenchange event is raised.
onfullscreenerror:Function
Is an EventHandler representing the code to be called when the fullscreenerror event is raised.
ongotpointercapture:Function
oninput:Function
oninvalid:Function
onkeydown:Function
onkeypress:Function
onkeyup:Function
onload:Function
onloadeddata:Function
onloadedmetadata:Function
onloadend:Function
onloadstart:Function
onlostpointercapture:Function
onmousedown:Function
onmouseenter:Function
onmouseleave:Function
onmousemove:Function
onmouseout:Function
onmouseover:Function
onmouseup:Function
onpaste:Function
Represents the event handling code for the paste event.
onpause:Function
onplay:Function
onplaying:Function
onpointercancel:Function
onpointerdown:Function
onpointerenter:Function
onpointerleave:Function
onpointerlockchange:Function
Represents the event handling code for the pointerlockchange event.
onpointerlockerror:Function
Represents the event handling code for the pointerlockerror event.
onpointermove:Function
onpointerout:Function
onpointerover:Function
onpointerup:Function
onprogress:Function
onratechange:Function
onreadystatechange:Function
Represents the event handling code for the readystatechange event.
onreset:Function
onresize:Function
onscroll:Function
onseeked:Function
onseeking:Function
onselect:Function
onselectionchange:Function
Is an EventHandler representing the code to be called when the selectionchange event is raised.
onselectstart:Function
onshow:Function
onstalled:Function
onsubmit:Function
onsuspend:Function
ontimeupdate:Function
ontoggle:Function
ontouchcancel:Function
ontouchend:Function
ontouchmove:Function
ontouchstart:Function
ontransitioncancel:Function
ontransitionend:Function
ontransitionrun:Function
ontransitionstart:Function
onvisibilitychange:Function
Is an EventHandler representing the code to be called when the visibilitychange event is raised.
onvolumechange:Function
onwaiting:Function
onwebkitanimationend:Function
onwebkitanimationiteration:Function
onwebkitanimationstart:Function
onwebkittransitionend:Function
onwheel:Function
Represents the event handling code for the wheel event.
read onlyplugins:HTMLCollection
Returns a list of the available plugins.
read onlypointerLockElement:Element
read onlypreferredStyleSheetSet:String
Returns the preferred style sheet set as specified by the page author.
read onlyreadyState:String
Returns loading status of the document.
read onlyreferrer:String
Returns the URI of the page that linked to this page.
read onlyrootElement:SVGElement
read onlyscripts:HTMLCollection
Returns all the script elements on the document.
read onlyscrollingElement:Element
Returns a reference to the Element that scrolls the document.
selectedStyleSheetSet:String
Returns which style sheet set is currently in use.
read onlystyleSheetSets:DOMStringList
Returns a list of the style sheet sets available on the document.
read onlystyleSheets:StyleSheetList
read onlytimeline:DocumentTimeline
…
title:String
Sets or gets the title of the current document.
read onlyvisibilityState:VisibilityState
Returns a string denoting the visibility state of the document. Possible values are visible, hidden, prerender, and unloaded.
Methods
adoptNode(node:Node):Node
Adopt node from an external document.
Throws:
null
DOMError
append(nodes:Rest<Node>):Void
append(nodes:Rest<String>):Void
Throws:
null
DOMError
caretPositionFromPoint(x:Float, y:Float):CaretPosition
convertPointFromNode(point:DOMPointInit, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMPoint
convertPointFromNode(point:DOMPointInit, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMPoint
convertPointFromNode(point:DOMPointInit, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMPoint
Throws:
null
DOMError
convertQuadFromNode(quad:DOMQuad, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertQuadFromNode(quad:DOMQuad, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertQuadFromNode(quad:DOMQuad, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMQuad
Throws:
null
DOMError
convertRectFromNode(rect:DOMRectReadOnly, from:Text, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertRectFromNode(rect:DOMRectReadOnly, from:Element, ?options:Null<ConvertCoordinateOptions>):DOMQuad
convertRectFromNode(rect:DOMRectReadOnly, from:HTMLDocument, ?options:Null<ConvertCoordinateOptions>):DOMQuad
Throws:
null
DOMError
createAttribute(name:String):Attr
Creates a new Attr object and returns it.
Throws:
null
DOMError
createAttributeNS(namespace:String, name:String):Attr
Creates a new attribute node in a given namespace and returns it.
Throws:
null
DOMError
createCDATASection(data:String):CDATASection
Creates a new CDATA node and returns it.
Throws:
null
DOMError
createComment(data:String):Comment
Creates a new comment node and returns it.
createDocumentFragment():DocumentFragment
Creates a new document fragment.
createElement(localName:String, ?options:Null<ElementCreationOptions>):Element
createElement(localName:String, ?options:String):Element
Creates a new element with the given tag name.
Throws:
null
DOMError
createElementNS(namespace:String, qualifiedName:String, ?options:Null<ElementCreationOptions>):Element
createElementNS(namespace:String, qualifiedName:String, ?options:String):Element
Creates a new element with the given tag name and namespace URI.
Throws:
null
DOMError
createEvent(interface_:String):Event
Creates an event object.
Throws:
null
DOMError
createExpression(expression:String, ?resolver:String ‑> Null<String>):XPathExpression
createExpression(expression:String, ?resolver:Function):XPathExpression
createExpression(expression:String, ?resolver:Null<XPathNSResolver>):XPathExpression
Throws:
null
DOMError
createNSResolver(nodeResolver:Node):Node
createNodeIterator(root:Node, whatToShow:Int = cast 4294967295, ?filter:Node ‑> Int):NodeIterator
createNodeIterator(root:Node, whatToShow:Int = cast 4294967295, ?filter:Function):NodeIterator
createNodeIterator(root:Node, whatToShow:Int = cast 4294967295, ?filter:NodeFilter):NodeIterator
Creates a NodeIterator object.
Throws:
null
DOMError
createProcessingInstruction(target:String, data:String):ProcessingInstruction
Creates a new ProcessingInstruction object.
Throws:
null
DOMError
createRange():Range
Creates a Range object.
Throws:
null
DOMError
createTextNode(data:String):Text
Creates a text node.
createTouch(?view:Window, ?target:EventTarget, identifier:Int = 0, pageX:Int = 0, pageY:Int = 0, screenX:Int = 0, screenY:Int = 0, clientX:Int = 0, clientY:Int = 0, radiusX:Int = 0, radiusY:Int = 0, rotationAngle:Float = 0.0, force:Float = 0.0):Touch
Creates a Touch object.
createTouchList(touches:Array<Touch>):TouchList
createTouchList(touch:Touch, touches:Rest<Touch>):TouchList
createTouchList():TouchList
Creates a TouchList object.
createTreeWalker(root:Node, whatToShow:Int = cast 4294967295, ?filter:Node ‑> Int):TreeWalker
createTreeWalker(root:Node, whatToShow:Int = cast 4294967295, ?filter:Function):TreeWalker
createTreeWalker(root:Node, whatToShow:Int = cast 4294967295, ?filter:NodeFilter):TreeWalker
Creates a TreeWalker object.
Throws:
null
DOMError
elementFromPoint(x:Float, y:Float):Element
elementsFromPoint(x:Float, y:Float):Array<Element>
enableStyleSheetsForSet(name:String):Void
Enables the style sheets for the specified style sheet set.
evaluate(expression:String, contextNode:Node, ?resolver:String ‑> Null<String>, type:Int = 0, ?result:Dynamic):XPathResult
evaluate(expression:String, contextNode:Node, ?resolver:Function, type:Int = 0, ?result:Dynamic):XPathResult
evaluate(expression:String, contextNode:Node, ?resolver:Null<XPathNSResolver>, type:Int = 0, ?result:Dynamic):XPathResult
Throws:
null
DOMError
exitFullscreen():Void
exitPointerLock():Void
Release the pointer lock.
getAnimations():Array<Animation>
Returns an array of all Animation objects currently in effect, whose target elements are descendants of the document.
getElementById(elementId:String):Element
getElementsByClassName(classNames:String):HTMLCollection
Returns a list of elements with the given class name.
getElementsByName(elementName:String):NodeList
getElementsByTagName(localName:String):HTMLCollection
Returns a list of elements with the given tag name.
getElementsByTagNameNS(namespace:String, localName:String):HTMLCollection
Returns a list of elements with the given tag name and namespace.
Throws:
null
DOMError
getSelection():Selection
Throws:
null
DOMError
hasFocus():Bool
Returns true if the focus is currently located anywhere inside the specified document.
Throws:
null
DOMError
importNode(node:Node, deep:Bool = false):Node
Returns a clone of a node from an external document.
Throws:
null
DOMError
prepend(nodes:Rest<Node>):Void
prepend(nodes:Rest<String>):Void
Throws:
null
DOMError
querySelector(selectors:String):Element
Throws:
null
DOMError
querySelectorAll(selectors:String):NodeList
Throws:
null
DOMError
releaseCapture():Void
Releases the current mouse capture if it's on an element in this document.
|
DeleteStackedWidgetPageCommand Class (qdesigner_internal8b7c:f320:99b9:690f:4595:cd17:293a:c069leteStackedWidgetPageCommand)
Inherits:
qdesigner_internal8b7c:f320:99b9:690f:4595:cd17:293a:c069StackedWidgetCommand
List of all members, including inherited members
|
CMAKE_STATIC_LINKER_FLAGS Linker flags to be used to create static libraries. These flags will be used by the linker when creating a static library.
|
gmp_fact (PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)
gmp_fact — Factorial Description gmp_fact(GMP|int|string $num): GMP Calculates factorial (num!) of num. Parameters
num
The factorial number. A GMP object, an int or a numeric string. Return Values A GMP object. Examples
Example #1 gmp_fact() example <?php
$fact1 = gmp_fact(5); // 5 * 4 * 3 * 2 * 1
echo gmp_strval($fact1) . "\n";
$fact2 = gmp_fact(50); // 50 * 49 * 48, ... etc
echo gmp_strval($fact2) . "\n";
?> The above example will output:
120
30414093201713378043612608166064768844377641568960512000000000000
|
Interface Validator
Deprecated.
since JAXB 2.0 public interface Validator
As of JAXB 2.0, this class is deprecated and optional.
The Validator class is responsible for controlling the validation of content trees during runtime.
Three Forms of Validation
Unmarshal-Time Validation This form of validation enables a client application to receive information about validation errors and warnings detected while unmarshalling XML data into a Java content tree and is completely orthogonal to the other types of validation. To enable or disable it, see the javadoc for Unmarshaller.setValidating. All JAXB 1.0 Providers are required to support this operation. On-Demand Validation This form of validation enables a client application to receive information about validation errors and warnings detected in the Java content tree. At any point, client applications can call the Validator.validate method on the Java content tree (or any sub-tree of it). All JAXB 1.0 Providers are required to support this operation. Fail-Fast Validation This form of validation enables a client application to receive immediate feedback about modifications to the Java content tree that violate type constraints on Java Properties as defined in the specification. JAXB Providers are not required support this type of validation. Of the JAXB Providers that do support this type of validation, some may require you to decide at schema compile time whether or not a client application will be allowed to request fail-fast [email protected]. The Validator class is responsible for managing On-Demand Validation. The Unmarshaller class is responsible for managing Unmarshal-Time Validation during the unmarshal operations. Although there is no formal method of enabling validation during the marshal operations, the Marshaller may detect errors, which will be reported to the ValidationEventHandler registered on it.
Using the Default EventHandler
If the client application does not set an event handler on their Validator, Unmarshaller, or Marshaller prior to calling the validate, unmarshal, or marshal methods, then a default event handler will receive notification of any errors or warnings encountered. The default event handler will cause the current operation to halt after encountering the first error or fatal error (but will attempt to continue after receiving warnings). Handling Validation Events
Use the default event handler The default event handler will be used if you do not specify one via the setEventHandler API's on Validator, Unmarshaller, or Marshaller. Implement and register a custom event handler Client applications that require sophisticated event processing can implement the ValidationEventHandler interface and register it with the Unmarshaller and/or Validator. Use the ValidationEventCollector utility For convenience, a specialized event handler is provided that simply collects any ValidationEvent objects created during the unmarshal, validate, and marshal operations and returns them to the client application as a java.util.Collection. Validation and Well-Formedness
Validation events are handled differently depending on how the client application is configured to process them as described in the previous section. However, there are certain cases where a JAXB Provider indicates that it is no longer able to reliably detect and report errors. In these cases, the JAXB Provider will set the severity of the ValidationEvent to FATAL_ERROR to indicate that the unmarshal, validate, or marshal operations should be terminated. The default event handler and ValidationEventCollector utility class must terminate processing after being notified of a fatal error. Client applications that supply their own ValidationEventHandler should also terminate processing after being notified of a fatal error. If not, unexpected behaviour may occur.
Supported Properties
There currently are not any properties required to be supported by all JAXB Providers on Validator. However, some providers may support their own set of provider specific properties.
Since: JAXB1.0 See Also:
JAXBContext, Unmarshaller, ValidationEventHandler, ValidationEvent, ValidationEventCollector
Methods Modifier and Type Method and Description ValidationEventHandler
getEventHandler()
Deprecated.
since JAXB2.0 Object
getProperty(String name)
Deprecated.
since JAXB2.0 void
setEventHandler(ValidationEventHandler handler)
Deprecated.
since JAXB2.0 void
setProperty(String name,
Object value)
Deprecated.
since JAXB2.0 boolean
validate(Object subrootObj)
Deprecated.
since JAXB2.0 boolean
validateRoot(Object rootObj)
Deprecated.
since JAXB2.0 Methods setEventHandler void setEventHandler(ValidationEventHandler handler)
throws JAXBException Deprecated. since JAXB2.0
Allow an application to register a validation event handler.
The validation event handler will be called by the JAXB Provider if any validation errors are encountered during calls to validate. If the client application does not register a validation event handler before invoking the validate method, then validation events will be handled by the default event handler which will terminate the validate operation after the first error or fatal error is encountered.
Calling this method with a null parameter will cause the Validator to revert back to the default default event handler.
Parameters:
handler - the validation event handler Throws:
JAXBException - if an error was encountered while setting the event handler getEventHandler ValidationEventHandler getEventHandler()
throws JAXBException Deprecated. since JAXB2.0 Return the current event handler or the default event handler if one hasn't been set. Returns: the current ValidationEventHandler or the default event handler if it hasn't been set Throws:
JAXBException - if an error was encountered while getting the current event handler validate boolean validate(Object subrootObj)
throws JAXBException Deprecated. since JAXB2.0
Validate the Java content tree [email protected].
Client applications can use this method to validate Java content trees [email protected]. This method can be used to validate any arbitrary subtree of the Java content tree. Global constraint checking will not be performed as part of this operation (i.e. ID/IDREF constraints).
Parameters:
subrootObj - the obj to begin validation at Returns: true if the subtree rooted at subrootObj is valid, false otherwise Throws:
JAXBException - if any unexpected problem occurs during validation
ValidationException - If the ValidationEventHandler returns false from its handleEvent method or the Validator is unable to validate the content tree rooted at subrootObj
IllegalArgumentException - If the subrootObj parameter is null validateRoot boolean validateRoot(Object rootObj)
throws JAXBException Deprecated. since JAXB2.0
Validate the Java content tree [email protected].
Client applications can use this method to validate Java content trees [email protected]. This method is used to validate an entire Java content tree. Global constraint checking will be performed as part of this operation (i.e. ID/IDREF constraints).
Parameters:
rootObj - the root obj to begin validation at Returns: true if the tree rooted at rootObj is valid, false otherwise Throws:
JAXBException - if any unexpected problem occurs during validation
ValidationException - If the ValidationEventHandler returns false from its handleEvent method or the Validator is unable to validate the content tree rooted at rootObj
IllegalArgumentException - If the rootObj parameter is null setProperty void setProperty(String name,
Object value)
throws PropertyException Deprecated. since JAXB2.0 Set the particular property in the underlying implementation of Validator. This method can only be used to set one of the standard JAXB defined properties above or a provider specific property. Attempting to set an undefined property will result in a PropertyException being thrown. See Supported Properties. Parameters:
name - the name of the property to be set. This value can either be specified using one of the constant fields or a user supplied string.
value - the value of the property to be set Throws:
PropertyException - when there is an error processing the given property or value
IllegalArgumentException - If the name parameter is null getProperty Object getProperty(String name)
throws PropertyException Deprecated. since JAXB2.0 Get the particular property in the underlying implementation of Validator. This method can only be used to get one of the standard JAXB defined properties above or a provider specific property. Attempting to get an undefined property will result in a PropertyException being thrown. See Supported Properties. Parameters:
name - the name of the property to retrieve Returns: the value of the requested property Throws:
PropertyException - when there is an error retrieving the given property or value property name
IllegalArgumentException - If the name parameter is null
|
UserProvider interface UserProvider (View source) Methods Authenticatable|null retrieveById(mixed $identifier) Retrieve a user by their unique identifier. Authenticatable|null retrieveByToken(mixed $identifier, string $token) Retrieve a user by their unique identifier and "remember me" token. void updateRememberToken(Authenticatable $user, string $token) Update the "remember me" token for the given user in storage. Authenticatable|null retrieveByCredentials(array $credentials) Retrieve a user by the given credentials. bool validateCredentials(Authenticatable $user, array $credentials) Validate a user against the given credentials. Details Authenticatable|null
retrieveById(mixed $identifier)
Retrieve a user by their unique identifier. Parameters mixed $identifier Return Value
Authenticatable|null Authenticatable|null
retrieveByToken(mixed $identifier, string $token)
Retrieve a user by their unique identifier and "remember me" token. Parameters mixed $identifier string $token Return Value
Authenticatable|null void
updateRememberToken(Authenticatable $user, string $token)
Update the "remember me" token for the given user in storage. Parameters Authenticatable $user string $token Return Value void Authenticatable|null
retrieveByCredentials(array $credentials)
Retrieve a user by the given credentials. Parameters array $credentials Return Value
Authenticatable|null bool
validateCredentials(Authenticatable $user, array $credentials)
Validate a user against the given credentials. Parameters Authenticatable $user array $credentials Return Value bool
|
numpy.nditer.iterrange attribute
nditer.iterrange
|
51.41. pg_range
The catalog pg_range stores information about range types. This is in addition to the types' entries in pg_type. Table 51.41. pg_range Columns Column Type Description rngtypid oid (references pg_type.oid) OID of the range type rngsubtype oid (references pg_type.oid) OID of the element type (subtype) of this range type rngcollation oid (references pg_collation.oid) OID of the collation used for range comparisons, or 0 if none rngsubopc oid (references pg_opclass.oid) OID of the subtype's operator class used for range comparisons rngcanonical regproc (references pg_proc.oid) OID of the function to convert a range value into canonical form, or 0 if none rngsubdiff regproc (references pg_proc.oid) OID of the function to return the difference between two element values as double precision, or 0 if none rngsubopc (plus rngcollation, if the element type is collatable) determines the sort ordering used by the range type. rngcanonical is used when the element type is discrete. rngsubdiff is optional but should be supplied to improve performance of GiST indexes on the range type.
Prev Up Next
51.40. pg_publication_rel Home 51.42. pg_replication_origin
|
do_action( 'check_comment_flood', string $comment_author_ip, string $comment_author_email, string $comment_date_gmt, bool $wp_error ) Fires immediately before a comment is marked approved. Description Allows checking for comment flooding. Parameters $comment_author_ip string Comment author's IP address. $comment_author_email string Comment author's email. $comment_date_gmt string GMT date the comment was posted. $wp_error bool Whether to return a WP_Error object instead of executing wp_die() or die() if a comment flood is occurring. More Arguments from wp_die( ... $args ) Arguments to control behavior. If $args is an integer, then it is treated as the response code.
responseintThe HTTP response code. Default 200 for Ajax requests, 500 otherwise.
link_urlstringA URL to include a link to. Only works in combination with $link_text. Default empty string.
link_textstringA label for the link to include. Only works in combination with $link_url. Default empty string.
back_linkboolWhether to include a link to go back. Default false.
text_directionstringThe text direction. This is only useful internally, when WordPress is still loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'. Default is the value of is_rtl() .
charsetstringCharacter set of the HTML output. Default 'utf-8'.
codestringError code to use. Default is 'wp_die', or the main error code if $message is a WP_Error.
exitboolWhether to exit the process after completion. Default true.
Source File: wp-includes/comment.php. View all references do_action(
'check_comment_flood',
$commentdata['comment_author_IP'],
$commentdata['comment_author_email'],
$commentdata['comment_date_gmt'],
$wp_error
);
Related Used By Used By Description wp_allow_comment() wp-includes/comment.php Validates whether this comment is allowed to be made.
Changelog Version Description 5.5.0 The $avoid_die parameter was renamed to $wp_error. 4.7.0 The $avoid_die parameter was added. 2.3.0 Introduced.
|
function menu_load menu_load($menu_name) Load the data for a single custom menu. Parameters $menu_name: The unique name of a custom menu to load. Return value Array defining the custom menu, or FALSE if the menu doesn't exist. File
modules/menu/menu.module, line 219 Allows administrators to customize the site's navigation menus. Code function menu_load($menu_name) {
$all_menus = menu_load_all();
return isset($all_menus[$menu_name]) ? $all_menus[$menu_name] : FALSE;
}
|
docker service rm Remove one or more services Swarm This command works with the Swarm orchestrator. Usage $ docker service rm SERVICE [SERVICE...]
Description Removes the specified services from the swarm. Note This is a cluster management command, and must be executed on a swarm manager node. To learn about managers and workers, refer to the Swarm mode section in the documentation. For example uses of this command, refer to the examples section below. Examples Remove the redis service: $ docker service rm redis
redis
$ docker service ls
ID NAME MODE REPLICAS IMAGE
Warning Unlike docker rm, this command does not ask for confirmation before removing a running service. Parent command Command Description docker service Manage services Related commands Command Description docker service create Create a new service docker service inspect Display detailed information on one or more services docker service logs Fetch the logs of a service or task docker service ls List services docker service ps List the tasks of one or more services docker service rm Remove one or more services docker service rollback Revert changes to a service’s configuration docker service scale Scale one or multiple replicated services docker service update Update a service
|
statsmodels.genmod.families.links.Link
class statsmodels.genmod.families.links.Link [source]
A generic link function for one-parameter exponential family. Link does nothing, but lays out the methods expected of any subclass. Methods
deriv(p) Derivative of the link function g’(p).
deriv2(p) Second derivative of the link function g’‘(p)
inverse(z) Inverse of the link function.
inverse_deriv(z) Derivative of the inverse link function g^(-1)(z).
© 2009–2012 Statsmodels Developers© 2006–2008 Scipy Developers |
Interface DSAKey All Known Subinterfaces:
DSAPrivateKey, DSAPublicKey
public interface DSAKey The interface to a DSA public or private key. DSA (Digital Signature Algorithm) is defined in NIST's FIPS-186. Since: 1.1 See Also: DSAParams Key Signature Method Summary
Modifier and Type
Method
Description
DSAParams
getParams()
Returns the DSA-specific key parameters.
Method Details getParams DSAParams getParams() Returns the DSA-specific key parameters. These parameters are never secret. Returns: the DSA-specific key parameters. See Also: DSAParams
|
SolrQuery8b7c:f320:99b9:690f:4595:cd17:293a:c069setFacetMissing (PECL solr >= 0.9.2)
SolrQuery8b7c:f320:99b9:690f:4595:cd17:293a:c069setFacetMissing — Maps to facet.missing Description public SolrQuery8b7c:f320:99b9:690f:4595:cd17:293a:c069setFacetMissing(bool $flag, string $field_override = ?): SolrQuery Used to indicate that in addition to the Term-based constraints of a facet field, a count of all matching results which have no value for the field should be computed Parameters
flag
true turns this feature on. false disables it. field_override
The name of the field. Return Values Returns the current SolrQuery object, if the return value is used.
|
ovirt_permissions_facts - Retrieve facts about one or more oVirt/RHV permissions New in version 2.3.
Synopsis Requirements Parameters Notes Examples Return Values
Status Author Synopsis Retrieve facts about one or more oVirt/RHV permissions. Requirements The below requirements are needed on the host that executes this module. python >= 2.7 ovirt-engine-sdk-python >= 4.2.4 Parameters Parameter Choices/Defaults Comments auth required Dictionary with values needed to create HTTP/HTTPS connection to oVirt:
username[required] - The name of the user, something like [email protected]. Default value is set by OVIRT_USERNAME environment variable.
password[required] - The password of the user. Default value is set by OVIRT_PASSWORD environment variable.
url[required] - A string containing the base URL of the server, usually something like `https://server.example.com/ovirt-engine/api`. Default value is set by OVIRT_URL environment variable.
token - Token to be used instead of login with username/password. Default value is set by OVIRT_TOKEN environment variable.
insecure - A boolean flag that indicates if the server TLS certificate and host name should be checked.
ca_file - A PEM file containing the trusted CA certificates. The certificate presented by the server will be verified using these CA certificates. If `ca_file` parameter is not set, system wide CA certificate store is used. Default value is set by OVIRT_CAFILE environment variable.
kerberos - A boolean flag indicating if Kerberos authentication should be used instead of the default basic authentication.
headers - Dictionary of HTTP headers to be added to each API call. authz_name required Authorization provider of the user/group. In previous versions of oVirt/RHV known as domain.
aliases: domain fetch_nested (added in 2.3) If True the module will fetch additional data from the API. It will fetch IDs of the VMs disks, snapshots, etc. User can configure to fetch other attributes of the nested entities by specifying nested_attributes. group_name Name of the group to manage. namespace Namespace of the authorization provider, where user/group resides. nested_attributes (added in 2.3) Specifies list of the attributes which should be fetched from the API. This parameter apply only when fetch_nested is true. user_name Username of the user to manage. In most LDAPs it's uid of the user, but in Active Directory you must specify UPN of the user. Notes Note This module creates a new top-level ovirt_permissions fact, which contains a list of permissions. In order to use this module you have to install oVirt Python SDK. To ensure it’s installed with correct version you can create the following task: pip: name=ovirt-engine-sdk-python version=4.0.0 Examples # Examples don't contain auth parameter for simplicity,
# look at ovirt_auth module to see how to reuse authentication:
# Gather facts about all permissions of user with username C(john):
- ovirt_permissions_facts:
user_name: john
authz_name: example.com-authz
- debug:
var: ovirt_permissions
Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description ovirt_permissions list On success. List of dictionaries describing the permissions. Permission attribues are mapped to dictionary keys, all permissions attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/permission. Status This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface. Author Ondra Machacek (@machacekondra) Hint If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan |
class Resolv
Parent:
Object
Resolv is a thread-aware DNS resolver library written in Ruby. Resolv can handle multiple DNS requests concurrently without blocking the entire Ruby interpreter. See also resolv-replace.rb to replace the libc resolver with Resolv. Resolv can look up various DNS resources using the DNS module directly. Examples: p Resolv.getaddress "www.ruby-lang.org"
p Resolv.getname "217-757-9687"
Resolv8b7c:f320:99b9:690f:4595:cd17:293a:c069NS.open do |dns|
ress = dns.getresources "www.ruby-lang.org", Resolv8b7c:f320:99b9:690f:4595:cd17:293a:c069NS8b7c:f320:99b9:690f:4595:cd17:293a:c069Resour8b7c:f320:99b9:690f:4595:cd17:293a:c069IN8b7c:f320:99b9:690f:4595:cd17:293a:c069
p ress.map { |r| r.address }
ress = dns.getresources "ruby-lang.org", Resolv8b7c:f320:99b9:690f:4595:cd17:293a:c069NS8b7c:f320:99b9:690f:4595:cd17:293a:c069Resour8b7c:f320:99b9:690f:4595:cd17:293a:c069IN8b7c:f320:99b9:690f:4595:cd17:293a:c069MX
p ress.map { |r| [r.exchange.to_s, r.preference] }
end
Bugs
NIS is not supported.
/etc/nsswitch.conf is not supported.
Constants AddressRegex
Address Regexp to use for matching IP addresses.
DefaultResolver
Default resolver to use for Resolv class methods.
Public Class Methods each_address(name, &block) Show source
# File lib/resolv.rb, line 58
def self.each_address(name, &block)
DefaultResolver.each_address(name, &block)
end Iterates over all IP addresses for name. each_name(address, &proc) Show source
# File lib/resolv.rb, line 79
def self.each_name(address, &proc)
DefaultResolver.each_name(address, &proc)
end Iterates over all hostnames for address. getaddress(name) Show source
# File lib/resolv.rb, line 44
def self.getaddress(name)
DefaultResolver.getaddress(name)
end Looks up the first IP address for name. getaddresses(name) Show source
# File lib/resolv.rb, line 51
def self.getaddresses(name)
DefaultResolver.getaddresses(name)
end Looks up all IP address for name. getname(address) Show source
# File lib/resolv.rb, line 65
def self.getname(address)
DefaultResolver.getname(address)
end Looks up the hostname of address. getnames(address) Show source
# File lib/resolv.rb, line 72
def self.getnames(address)
DefaultResolver.getnames(address)
end Looks up all hostnames for address. new(resolvers=[Hosts.new, DNS.new]) Show source
# File lib/resolv.rb, line 86
def initialize(resolvers=[Hosts.new, DNS.new])
@resolvers = resolvers
end Creates a new Resolv using resolvers. Public Instance Methods each_address(name) { |name| ... } Show source
# File lib/resolv.rb, line 110
def each_address(name)
if AddressRegex =~ name
yield name
return
end
yielded = false
@resolvers.each {|r|
r.each_address(name) {|address|
yield address.to_s
yielded = true
}
return if yielded
}
end Iterates over all IP addresses for name. each_name(address) { |name| ... } Show source
# File lib/resolv.rb, line 145
def each_name(address)
yielded = false
@resolvers.each {|r|
r.each_name(address) {|name|
yield name.to_s
yielded = true
}
return if yielded
}
end Iterates over all hostnames for address. getaddress(name) Show source
# File lib/resolv.rb, line 93
def getaddress(name)
each_address(name) {|address| return address}
raise ResolvError.new("no address for #{name}")
end Looks up the first IP address for name. getaddresses(name) Show source
# File lib/resolv.rb, line 101
def getaddresses(name)
ret = []
each_address(name) {|address| ret << address}
return ret
end Looks up all IP address for name. getname(address) Show source
# File lib/resolv.rb, line 128
def getname(address)
each_name(address) {|name| return name}
raise ResolvError.new("no name for #{address}")
end Looks up the hostname of address. getnames(address) Show source
# File lib/resolv.rb, line 136
def getnames(address)
ret = []
each_name(address) {|name| ret << name}
return ret
end Looks up all hostnames for address.
Ruby Core © 1993–2017 Yukihiro MatsumotoLicensed under the Ruby License.Ruby Standard Library |
IdleDetector: change event
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers. The change event of the IdleDetector interface fires when the value of userState or screenState has changed.
Syntax
Use the event name in methods like addEventListener(), or set an event handler property. addEventListener('change', event => { });
onchange = event => { };
Event type
A generic Event.
Example
In the following example, the change callback prints the status of userState and screenState to the console. idleDetector.addEventListener('change', () => {
const userState = idleDetector.userState;
const screenState = idleDetector.screenState;
console.log(`Idle change: ${userState}, ${screenState}.`);
});
Specifications
Specification
Idle Detection API # api-idledetector-onchange
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
change_event
94
94
No
No
80
No
94
94
No
66
No
17.0
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: Mar 10, 2022, by MDN contributors
|
map_deep( mixed $value, callable $callback ): mixed Maps a function to all non-iterable elements of an array or an object. Description This is similar to array_walk_recursive() but acts upon objects too. Parameters $value mixed Required The array, object, or scalar. $callback callable Required The function to map onto $value. Return mixed The value with the callback applied to all non-arrays and non-objects inside it. Source File: wp-includes/formatting.php. View all references function map_deep( $value, $callback ) {
if ( is_array( $value ) ) {
foreach ( $value as $index => $item ) {
$value[ $index ] = map_deep( $item, $callback );
}
} elseif ( is_object( $value ) ) {
$object_vars = get_object_vars( $value );
foreach ( $object_vars as $property_name => $property_value ) {
$value->$property_name = map_deep( $property_value, $callback );
}
} else {
$value = call_user_func( $callback, $value );
}
return $value;
}
Related Uses Uses Description map_deep() wp-includes/formatting.php Maps a function to all non-iterable elements of an array or an object.
Used By Used By Description wp_slash_strings_only() wp-includes/deprecated.php Adds slashes to only string values in an array of values. wp_kses_post_deep() wp-includes/kses.php Navigates through an array, object, or scalar, and sanitizes content for allowed HTML tags for post content. map_deep() wp-includes/formatting.php Maps a function to all non-iterable elements of an array or an object. urldecode_deep() wp-includes/formatting.php Navigates through an array, object, or scalar, and decodes URL-encoded values stripslashes_deep() wp-includes/formatting.php Navigates through an array, object, or scalar, and removes slashes from the values. urlencode_deep() wp-includes/formatting.php Navigates through an array, object, or scalar, and encodes the values to be used in a URL. rawurlencode_deep() wp-includes/formatting.php Navigates through an array, object, or scalar, and raw-encodes the values to be used in a URL.
Changelog Version Description 4.4.0 Introduced.
|
na_ontap_qtree – NetApp ONTAP manage qtrees New in version 2.6. Synopsis Requirements Parameters Notes Examples Status Synopsis Create or destroy Qtrees. Requirements The below requirements are needed on the host that executes this module. A physical or virtual clustered Data ONTAP system. The modules support Data ONTAP 9.1 and onward Ansible 2.6 Python2 netapp-lib (2017.10.30) or later. Install using ‘pip install netapp-lib’ Python3 netapp-lib (2018.11.13) or later. Install using ‘pip install netapp-lib’ To enable http on the cluster you must run the following commands ‘set -privilege advanced;’ ‘system services web modify -http-enabled true;’ Parameters Parameter Choices/Defaults Comments flexvol_name - The name of the FlexVol the qtree should exist on. Required when state=present. from_name - added in 2.7 Name of the qtree to be renamed. hostname string / required The hostname or IP address of the ONTAP instance. http_port integer Override the default port (80 or 443) with this port https boolean
Choices:
no ← yes Enable and disable https name - / required The name of the qtree to manage. ontapi integer The ontap api version to use password string / required Password for the specified user.
aliases: pass state -
Choices:
present ← absent Whether the specified qtree should exist or not. username string / required This can be a Cluster-scoped or SVM-scoped account, depending on whether a Cluster-level or SVM-level API is required. For more information, please read the documentation https://mysupport.netapp.com/NOW/download/software/nmsdk/9.4/.
aliases: user validate_certs boolean
Choices: no
yes ← If set to no, the SSL certificates will not be validated. This should only set to False used on personally controlled sites using self-signed certificates. vserver - / required The name of the vserver to use. Notes Note The modules prefixed with na\_ontap are built to support the ONTAP storage platform. Examples - name: Create Qtrees
na_ontap_qtree:
state: present
name: ansibleQTree
flexvol_name: ansibleVolume
vserver: ansibleVServer
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: Rename Qtrees
na_ontap_qtree:
state: present
from_name: ansibleQTree_rename
name: ansibleQTree
flexvol_name: ansibleVolume
vserver: ansibleVServer
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
Status This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by an Ansible Partner. [certified]
Authors NetApp Ansible Team (@carchi8py) <[email protected]> Hint If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan |
Class: Phaser.GameObjectCreator Constructor
new GameObjectCreator(game)
The GameObjectCreator is a quick way to create common game objects without adding them to the game world.The object creator can be accessed with game.make. Parameters Name Type Description game Phaser.Game A reference to the currently running game. Source code: gameobjects/GameObjectCreator.js (Line 15) Public Properties
<internal> game : Phaser.Game
A reference to the currently running Game. Internal: This member is internal (protected) and may be modified or removed in the future. Source code: gameobjects/GameObjectCreator.js (Line 21)
<internal> world : Phaser.World
A reference to the game world. Internal: This member is internal (protected) and may be modified or removed in the future. Source code: gameobjects/GameObjectCreator.js (Line 27) Public Methods
audio(key, volume, loop, connect) → {Phaser.Sound}
Creates a new Sound object. Parameters Name Type Argument Default Description key string The Game.cache key of the sound that this object will use. volume number <optional> 1 The volume at which the sound will be played. loop boolean <optional> false Whether or not the sound will loop. connect boolean <optional> true Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio. Returns Phaser.Sound - The newly created text object. Source code: gameobjects/GameObjectCreator.js (Line 118)
audioSprite(key) → {Phaser.AudioSprite}
Creates a new AudioSprite object. Parameters Name Type Description key string The Game.cache key of the sound that this object will use. Returns Phaser.AudioSprite - The newly created AudioSprite object. Source code: gameobjects/GameObjectCreator.js (Line 134)
bitmapData(width, height, key, addToCache) → {Phaser.BitmapData}
Create a BitmpaData object. A BitmapData object can be manipulated and drawn to like a traditional Canvas object and used to texture Sprites. Parameters Name Type Argument Default Description width number <optional> 256 The width of the BitmapData in pixels. height number <optional> 256 The height of the BitmapData in pixels. key string <optional> '' Asset key for the BitmapData when stored in the Cache (see addToCache parameter). addToCache boolean <optional> false Should this BitmapData be added to the Game.Cache? If so you can retrieve it with Cache.getBitmapData(key) Returns Phaser.BitmapData - The newly created BitmapData object. Source code: gameobjects/GameObjectCreator.js (Line 379)
bitmapText(x, y, font, text, size, align) → {Phaser.BitmapText}
Create a new BitmapText object. BitmapText objects work by taking a texture file and an XML file that describes the font structure.It then generates a new Sprite object for each letter of the text, proportionally spaced out and aligned tomatch the font structure. BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the abilityto use Web Fonts. However you trade this flexibility for pure rendering speed. You can also create visually compelling BitmapTexts byprocessing the font texture in an image editor first, applying fills and any other effects required. To create multi-line text insert \r, \n or \r\n escape codes into the text string. To create a BitmapText data files you can use: BMFont (Windows, free): http://www.angelcode.com/products/bmfont/Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesignerLittera (Web-based, free): http://kvazars.com/littera/ Parameters Name Type Argument Default Description x number X coordinate to display the BitmapText object at. y number Y coordinate to display the BitmapText object at. font string The key of the BitmapText as stored in Phaser.Cache. text string <optional> '' The text that will be rendered. This can also be set later via BitmapText.text. size number <optional> 32 The size the font will be rendered at in pixels. align string <optional> 'left' The alignment of multi-line text. Has no effect if there is only one line of text. Returns Phaser.BitmapText - The newly created bitmapText object. Source code: gameobjects/GameObjectCreator.js (Line 297)
button(x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame) → {Phaser.Button}
Creates a new Button object. Parameters Name Type Argument Description x number <optional> X position of the new button object. y number <optional> Y position of the new button object. key string <optional> The image key as defined in the Game.Cache to use as the texture for this button. callback function <optional> The function to call when this button is pressed callbackContext object <optional> The context in which the callback will be called (usually 'this') overFrame string | number <optional> This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name. outFrame string | number <optional> This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name. downFrame string | number <optional> This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name. upFrame string | number <optional> This is the frame or frameName that will be set when this button is in an up state. Give either a number to use a frame ID or a string for a frame name. Returns Phaser.Button - The newly created button object. Source code: gameobjects/GameObjectCreator.js (Line 215)
emitter(x, y, maxParticles) → {Phaser.Emitter}
Creat a new Emitter. An Emitter is a lightweight particle emitter. It can be used for one-time explosions or forcontinuous effects like rain and fire. All it really does is launch Particle objects outat set intervals, and fixes their positions and velocities accorindgly. Parameters Name Type Argument Default Description x number <optional> 0 The x coordinate within the Emitter that the particles are emitted from. y number <optional> 0 The y coordinate within the Emitter that the particles are emitted from. maxParticles number <optional> 50 The total number of particles in this emitter. Returns Phaser.Emitter - The newly created emitter object. Source code: gameobjects/GameObjectCreator.js (Line 250)
filter(filter) → {Phaser.Filter}
A WebGL shader/filter that can be applied to Sprites. Parameters Name Type Description filter string The name of the filter you wish to create, for example HueRotate or SineWave. any Whatever parameters are needed to be passed to the filter init function. Returns Phaser.Filter - The newly created Phaser.Filter object. Source code: gameobjects/GameObjectCreator.js (Line 407)
graphics(x, y) → {Phaser.Graphics}
Creates a new Graphics object. Parameters Name Type Argument Default Description x number <optional> 0 X position of the new graphics object. y number <optional> 0 Y position of the new graphics object. Returns Phaser.Graphics - The newly created graphics object. Source code: gameobjects/GameObjectCreator.js (Line 236)
group(parent, name, addToStage, enableBody, physicsBodyType) → {Phaser.Group}
A Group is a container for display objects that allows for fast pooling, recycling and collision checks. Parameters Name Type Argument Default Description parent any The parent Group or DisplayObjectContainer that will hold this group, if any. name string <optional> 'group' A name for this Group. Not used internally but useful for debugging. addToStage boolean <optional> false If set to true this Group will be added directly to the Game.Stage instead of Game.World. enableBody boolean <optional> false If true all Sprites created with Group.create or Group.createMulitple will have a physics body created on them. Change the body type with physicsBodyType. physicsBodyType number <optional> 0 If enableBody is true this is the type of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2, Phaser.Physics.NINJA, etc. Returns Phaser.Group - The newly created Group. Source code: gameobjects/GameObjectCreator.js (Line 83)
image(x, y, key, frame) → {Phaser.Image}
Create a new Image object. An Image is a light-weight object you can use to display anything that doesn't need physics or animation.It can still rotate, scale, crop and receive input events. This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics. Parameters Name Type Argument Description x number X position of the image. y number Y position of the image. key string | Phaser.RenderTexture | PIXI.Texture This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture. frame string | number <optional> If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name. Returns Phaser.Image - the newly created sprite object. Source code: gameobjects/GameObjectCreator.js (Line 33)
renderTexture(width, height, key, addToCache) → {Phaser.RenderTexture}
A dynamic initially blank canvas to which images can be drawn. Parameters Name Type Argument Default Description width number <optional> 100 the width of the RenderTexture. height number <optional> 100 the height of the RenderTexture. key string <optional> '' Asset key for the RenderTexture when stored in the Cache (see addToCache parameter). addToCache boolean <optional> false Should this RenderTexture be added to the Game.Cache? If so you can retrieve it with Cache.getTexture(key) Returns Phaser.RenderTexture - The newly created RenderTexture object. Source code: gameobjects/GameObjectCreator.js (Line 353)
retroFont(font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset) → {Phaser.RetroFont}
Create a new RetroFont object. A RetroFont can be used as a texture for an Image or Sprite and optionally add it to the Cache.A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set.If you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapTextis that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text.The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all,i.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects. Parameters Name Type Argument Default Description font string The key of the image in the Game.Cache that the RetroFont will use. characterWidth number The width of each character in the font set. characterHeight number The height of each character in the font set. chars string The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements. charsPerRow number The number of characters per row in the font set. xSpacing number <optional> 0 If the characters in the font set have horizontal spacing between them set the required amount here. ySpacing number <optional> 0 If the characters in the font set have vertical spacing between them set the required amount here. xOffset number <optional> 0 If the font set doesn't start at the top left of the given image, specify the X coordinate offset here. yOffset number <optional> 0 If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here. Returns Phaser.RetroFont - The newly created RetroFont texture which can be applied to an Image or Sprite. Source code: gameobjects/GameObjectCreator.js (Line 269)
rope(x, y, width, height, key, frame) → {Phaser.Rope}
Creates a new Rope object. Parameters Name Type Description x number The x coordinate (in world space) to position the Rope at. y number The y coordinate (in world space) to position the Rope at. width number The width of the Rope. height number The height of the Rope. key string | Phaser.RenderTexture | Phaser.BitmapData | PIXI.Texture This is the image or texture used by the TileSprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture. frame string | number If this Rope is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index. Returns Phaser.Rope - The newly created rope object. Source code: gameobjects/GameObjectCreator.js (Line 181)
sound(key, volume, loop, connect) → {Phaser.Sound}
Creates a new Sound object. Parameters Name Type Argument Default Description key string The Game.cache key of the sound that this object will use. volume number <optional> 1 The volume at which the sound will be played. loop boolean <optional> false Whether or not the sound will loop. connect boolean <optional> true Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio. Returns Phaser.Sound - The newly created text object. Source code: gameobjects/GameObjectCreator.js (Line 147)
sprite(x, y, key, frame) → {Phaser.Sprite}
Create a new Sprite with specific position and sprite sheet key. Parameters Name Type Argument Description x number X position of the new sprite. y number Y position of the new sprite. key string | Phaser.RenderTexture | PIXI.Texture This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture. frame string | number <optional> If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name. Returns Phaser.Sprite - the newly created sprite object. Source code: gameobjects/GameObjectCreator.js (Line 52)
spriteBatch(parent, name, addToStage) → {Phaser.SpriteBatch}
Create a new SpriteBatch. Parameters Name Type Argument Default Description parent any The parent Group or DisplayObjectContainer that will hold this group, if any. name string <optional> 'group' A name for this Group. Not used internally but useful for debugging. addToStage boolean <optional> false If set to true this Group will be added directly to the Game.Stage instead of Game.World. Returns Phaser.SpriteBatch - The newly created group. Source code: gameobjects/GameObjectCreator.js (Line 100)
text(x, y, text, style) → {Phaser.Text}
Creates a new Text object. Parameters Name Type Description x number X position of the new text object. y number Y position of the new text object. text string The actual text that will be written. style object The style object containing style attributes like font, font size , etc. Returns Phaser.Text - The newly created text object. Source code: gameobjects/GameObjectCreator.js (Line 199)
tilemap(key, tileWidth, tileHeight, width, height)
Creates a new Phaser.Tilemap object. The map can either be populated with data from a Tiled JSON file or from a CSV file.To do this pass the Cache key as the first parameter. When using Tiled data you need only provide the key.When using CSV data you must provide the key and the tileWidth and tileHeight parameters.If creating a blank tilemap to be populated later, you can either specify no parameters at all and then use Tilemap.create or pass the map and tile dimensions here.Note that all Tilemaps use a base tile size to calculate dimensions from, but that a TilemapLayer may have its own unique tile size that overrides it. Parameters Name Type Argument Default Description key string <optional> The key of the tilemap data as stored in the Cache. If you're creating a blank map either leave this parameter out or pass null. tileWidth number <optional> 32 The pixel width of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data. tileHeight number <optional> 32 The pixel height of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data. width number <optional> 10 The width of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this. height number <optional> 10 The height of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this. Source code: gameobjects/GameObjectCreator.js (Line 331)
tileSprite(x, y, width, height, key, frame) → {Phaser.TileSprite}
Creates a new TileSprite object. Parameters Name Type Description x number The x coordinate (in world space) to position the TileSprite at. y number The y coordinate (in world space) to position the TileSprite at. width number The width of the TileSprite. height number The height of the TileSprite. key string | Phaser.BitmapData | PIXI.Texture This is the image or texture used by the TileSprite during rendering. It can be a string which is a reference to the Phaser Image Cache entry, or an instance of a PIXI.Texture or BitmapData. frame string | number If this TileSprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index. Returns Phaser.TileSprite - The newly created tileSprite object. Source code: gameobjects/GameObjectCreator.js (Line 163)
tween(obj) → {Phaser.Tween}
Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. Parameters Name Type Description obj object Object the tween will be run on. Returns Phaser.Tween - The Tween object. Source code: gameobjects/GameObjectCreator.js (Line 68)
|
dart:html CssRect constructor CssRect(
Element _element ) Implementation CssRect(this._element);
|
WebSocket.url
The WebSocket.url read-only property returns the absolute URL of the WebSocket as resolved by the constructor.
Value
A DOMString.
Specifications
Specification
WebSockets Standard # ref-for-dom-websocket-url①
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
url
18
12
7
No
12.1
6
4.4
18
7
12.1
6
1.0
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 2, 2022, by MDN contributors
|
WP_REST_Respons8b7c:f320:99b9:690f:4595:cd17:293a:c069set_matched_handler( array $handler ) Sets the handler that was responsible for generating the response. Parameters $handler array Required The matched handler. Source File: wp-includes/rest-api/class-wp-rest-response.php. View all references public function set_matched_handler( $handler ) {
$this->matched_handler = $handler;
}
Changelog Version Description 4.4.0 Introduced.
|
DirectoryIterator8b7c:f320:99b9:690f:4595:cd17:293a:c069seek (PHP 5 >= 5.3.0, PHP 7, PHP 8)
DirectoryIterator8b7c:f320:99b9:690f:4595:cd17:293a:c069seek — Seek to a DirectoryIterator item Description public DirectoryIterator8b7c:f320:99b9:690f:4595:cd17:293a:c069seek(int $offset): void Seek to a given position in the DirectoryIterator. Parameters
offset
The zero-based numeric position to seek to. Return Values No value is returned. Examples
Example #1 DirectoryIterator8b7c:f320:99b9:690f:4595:cd17:293a:c069seek() example Seek to the fourth item in the directory containing the script. The first two are usually . and .. <?php
$iterator = new DirectoryIterator(dirname(__FILE__));
$iterator->seek(3);
if ($iterator->valid()) {
echo $iterator->getFilename();
} else {
echo 'No file at position 3';
}
?> See Also
DirectoryIterator8b7c:f320:99b9:690f:4595:cd17:293a:c069rewind() - Rewind the DirectoryIterator back to the start DirectoryIterator8b7c:f320:99b9:690f:4595:cd17:293a:c069next() - Move forward to next DirectoryIterator item SeekableIterator8b7c:f320:99b9:690f:4595:cd17:293a:c069seek() - Seeks to a position
|
tf.math.subtract View source on GitHub Returns x - y element-wise. View aliases Main aliases
tf.subtract Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.subtract, tf.compat.v1.subtract
tf.math.subtract(
x, y, name=None
)
Note: Subtract supports broadcasting. More about broadcasting here
Args
x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int8, uint16, int16, int32, int64, complex64, complex128, uint32.
y A Tensor. Must have the same type as x.
name A name for the operation (optional).
Returns A Tensor. Has the same type as x.
|
Function st8b7c:f320:99b9:690f:4595:cd17:293a:c069intrinsics8b7c:f320:99b9:690f:4595:cd17:293a:c069size_of
pub const extern "rust-intrinsic" fn size_of<T>() -> usize
🔬This is a nightly-only experimental API. (core_intrinsics)
The size of a type in bytes. Note that, unlike most intrinsics, this is safe to call; it does not require an unsafe block. Therefore, implementations must not require the user to uphold any safety invariants. More specifically, this is the offset in bytes between successive items of the same type, including alignment padding. The stabilized version of this intrinsic is cor8b7c:f320:99b9:690f:4595:cd17:293a:c069mem8b7c:f320:99b9:690f:4595:cd17:293a:c069size_of.
|
pandas.Series.is_copy
Series.is_copy
|
Pkg
Pkg is Julia's builtin package manager, and handles operations such as installing, updating and removing packages.
Note
What follows is a very brief introduction to Pkg. It is highly recommended to read the full manual, which is available here: https://julialang.github.io/Pkg.jl/v1/.
What follows is a quick overview of Pkg, Julia's package manager. It should help new users become familiar with basic Pkg features.
Pkg comes with a REPL. Enter the Pkg REPL by pressing ] from the Julia REPL. To get back to the Julia REPL, press backspace or ^C.
Note
This guide relies on the Pkg REPL to execute Pkg commands. For non-interactive use, we recommend the Pkg API. The Pkg API is fully documented in the API Reference section of the Pkg documentation.
Upon entering the Pkg REPL, you should see a similar prompt:
(v1.1) pkg>
To add a package, use add:
(v1.1) pkg> add Example
Note
Some Pkg output has been omitted in order to keep this guide focused. This will help maintain a good pace and not get bogged down in details. If you require more details, refer to subsequent sections of the Pkg manual.
We can also specify multiple packages at once:
(v1.1) pkg> add JSON StaticArrays
To remove packages, use rm:
(v1.1) pkg> rm JSON StaticArrays
So far, we have referred only to registered packages. Pkg also supports working with unregistered packages. To add an unregistered package, specify a URL:
(v1.1) pkg> add https://github.com/JuliaLang/Example.jl
Use rm to remove this package by name:
(v1.1) pkg> rm Example
Use update to update an installed package:
(v1.1) pkg> update Example
To update all installed packages, use update without any arguments:
(v1.1) pkg> update
Up to this point, we have covered basic package management: adding, updating and removing packages. This will be familiar if you have used other package managers. Pkg offers significant advantages over traditional package managers by organizing dependencies into environments.
You may have noticed the (v1.1) in the REPL prompt. This lets us know v1.1 is the active environment. The active environment is the environment that will be modified by Pkg commands such as add, rm and update.
Let's set up a new environment so we may experiment. To set the active environment, use activate:
(v1.1) pkg> activate tutorial
[ Info: activating new environment at `/tmp/tutorial/Project.toml`.
Pkg lets us know we are creating a new environment and that this environment will be stored in the /tmp/tutorial directory.
Pkg has also updated the REPL prompt in order to reflect the new active environment:
(tutorial) pkg>
We can ask for information about the active environment by using status:
(tutorial) pkg> status
Status `/tmp/tutorial/Project.toml`
(empty environment)
/tmp/tutorial/Project.toml is the location of the active environment's project file. A project file is where Pkg stores metadata for an environment. Notice this new environment is empty. Let us add a package and observe:
(tutorial) pkg> add Example
...
(tutorial) pkg> status
Status `/tmp/tutorial/Project.toml`
[7876af07] Example v0.5.1
We can see tutorial now contains Example as a dependency.
Say we are working on Example and feel it needs new functionality. How can we modify the source code? We can use develop to set up a git clone of the Example package.
(tutorial) pkg> develop --local Example
...
(tutorial) pkg> status
Status `/tmp/tutorial/Project.toml`
[7876af07] Example v0.5.1+ [`dev/Example`]
Notice the feedback has changed. dev/Example refers to the location of the newly created clone. If we look inside the /tmp/tutorial directory, we will notice the following files:
tutorial
├── dev
│ └── Example
├── Manifest.toml
└── Project.toml
Instead of loading a registered version of Example, Julia will load the source code contained in tutorial/dev/Example.
Let's try it out. First we modify the file at tutorial/dev/Example/src/Example.jl and add a simple function:
plusone(x8b7c:f320:99b9:690f:4595:cd17:293a:c069Int) = x + 1
Now we can go back to the Julia REPL and load the package:
julia> import Example
Warn
A package can only be loaded once per Julia session. If you have run import Example in the current Julia session, you will have to restart Julia and rerun activate tutorial in the Pkg REPL. Revise.jl can make this process significantly more pleasant, but setting it up is beyond the scope of this guide.
Julia should load our new code. Let's test it:
julia> Example.plusone(1)
2
Say we have a change of heart and decide the world is not ready for such elegant code. We can tell Pkg to stop using the local clone and use a registered version instead. We do this with free:
(tutorial) pkg> free Example
When you are done experimenting with tutorial, you can return to the default environment by running activate with no arguments:
(tutorial) pkg> activate
(v1.1) pkg>
If you are ever stuck, you can ask Pkg for help:
(v1.1) pkg> ?
You should see a list of available commands along with short descriptions. You can ask for more detailed help by specifying a command:
(v1.1) pkg> ?develop
This guide should help you get started with Pkg. Pkg has much more to offer in terms of powerful package management, read the full manual to learn more!
|
QSharedGLTexture Class (Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QSharedGLTexture) Allows to use a textureId from a separate OpenGL context in a Qt 3D scene. More...
Header:
#include <QSharedGLTexture>
Since:
Qt 5.13
Inherits:
Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QAbstractTexture
This class was introduced in Qt 5.13. List of all members, including inherited members Properties
textureId : int Public Functions
int
textureId() const
Public Slots
void
setTextureId(int id)
Signals
void
textureIdChanged(int textureId)
Detailed Description
Depending on the rendering mode used by Qt 3D, the shared context will either be: qt_gl_global_share_context when letting Qt 3D drive the rendering. When setting the attribute Qt8b7c:f320:99b9:690f:4595:cd17:293a:c069_ShareOpenGLContexts on the QApplication class, this will automatically make QOpenGLWidget instances have their context shared with qt_gl_global_share_context. the shared context from the QtQuick scene. You might have to subclass QWindow or use QtQuickRenderControl to have control over what that shared context is though as of 5.13 it is qt_gl_global_share_context. Any 3rd party engine that shares its context with the Qt 3D renderer can now provide texture ids that will be referenced by the Qt 3D texture. You can omit specifying the texture properties, Qt 3D will try at runtime to determine what they are. If you know them, you can of course provide them, avoid additional work for Qt 3D. Keep in mind that if you are using custom materials and shaders, you need to specify the correct sampler type to be used. Property Documentation
textureId : int
The OpenGL texture id value that you want Qt3D to gain access to. Access functions:
int
textureId() const
void
setTextureId(int id)
Notifier signal:
void
textureIdChanged(int textureId)
|
Interface NewArrayTree All Superinterfaces:
CaseLabelTreePREVIEW, ExpressionTree, Tree
public interface NewArrayTree extends ExpressionTree A tree node for an expression to create a new instance of an array. For example:
new type dimensions initializers
new type dimensions [ ] initializers
See Java Language Specification: 15.10.1 Array Creation Expressions
Since: 1.6 Nested Class Summary Nested classes/interfaces declared in interface com.sun.source.tree.Tree
Tree.Kind
Method Summary
Modifier and Type
Method
Description
List<? extends AnnotationTree>
getAnnotations()
Returns the annotations on the base type.
List<? extends List<? extends AnnotationTree>>
getDimAnnotations()
Returns the annotations on each of the dimension expressions.
List<? extends ExpressionTree>
getDimensions()
Returns the dimension expressions for the type.
List<? extends ExpressionTree>
getInitializers()
Returns the initializer expressions.
Tree
getType()
Returns the base type of the expression.
Methods declared in interface com.sun.source.tree.Tree
accept, getKind
Method Details getType Tree getType() Returns the base type of the expression. May be null for an array initializer expression. Returns: the base type getDimensions List<? extends ExpressionTree> getDimensions() Returns the dimension expressions for the type. Returns: the dimension expressions getInitializers List<? extends ExpressionTree> getInitializers() Returns the initializer expressions. Returns: the initializer expressions getAnnotations List<? extends AnnotationTree> getAnnotations() Returns the annotations on the base type. Returns: the annotations getDimAnnotations List<? extends List<? extends AnnotationTree>> getDimAnnotations() Returns the annotations on each of the dimension expressions. Returns: the annotations on the dimensions expressions
|
community.network.ce_evpn_bd_vni – Manages EVPN VXLAN Network Identifier (VNI) on HUAWEI CloudEngine switches. Note This plugin is part of the community.network collection (version 1.3.0). To install it use: ansible-galaxy collection install community.network. To use it in a playbook, specify: community.network.ce_evpn_bd_vni. Synopsis Parameters Notes Examples Return Values Synopsis Manages Ethernet Virtual Private Network (EVPN) VXLAN Network Identifier (VNI) configurations on HUAWEI CloudEngine switches. Parameters Parameter Choices/Defaults Comments bridge_domain_id string / required Specify an existed bridge domain (BD).The value is an integer ranging from 1 to 16777215. evpn string
Choices:
enable ← disable Create or delete an EVPN instance for a VXLAN in BD view. route_distinguisher string Configures a route distinguisher (RD) for a BD EVPN instance. The format of an RD can be as follows 1) 2-byte AS number:4-byte user-defined number, for example, 1:3. An AS number is an integer ranging from 0 to 65535, and a user-defined number is an integer ranging from 0 to 4294967295. The AS and user-defined numbers cannot be both 0s. This means that an RD cannot be 0:0. 2) Integral 4-byte AS number:2-byte user-defined number, for example, 65537:3. An AS number is an integer ranging from 65536 to 4294967295, and a user-defined number is an integer ranging from 0 to 65535. 3) 4-byte AS number in dotted notation:2-byte user-defined number, for example, 0.0:3 or 0.1:0. A 4-byte AS number in dotted notation is in the format of x.y, where x and y are integers ranging from 0 to 65535. 4) A user-defined number is an integer ranging from 0 to 65535. The AS and user-defined numbers cannot be both 0s. This means that an RD cannot be 0.0:0. 5) 32-bit IP address:2-byte user-defined number. For example, 2256225045:1. An IP address ranges from 2256225045 to 2256225045, and a user-defined number is an integer ranging from 0 to 65535. 6) 'auto' specifies the RD that is automatically generated. state string
Choices:
present ← absent Manage the state of the resource. vpn_target_both string Add VPN targets to both the import and export VPN target lists of a BD EVPN instance. The format is the same as route_distinguisher. vpn_target_export string Add VPN targets to the export VPN target list of a BD EVPN instance. The format is the same as route_distinguisher. vpn_target_import string / required Add VPN targets to the import VPN target list of a BD EVPN instance. The format is the same as route_distinguisher. Notes Note Ensure that EVPN has been configured to serve as the VXLAN control plane when state is present. Ensure that a bridge domain (BD) has existed when state is present. Ensure that a VNI has been created and associated with a broadcast domain (BD) when state is present. If you configure evpn:false to delete an EVPN instance, all configurations in the EVPN instance are deleted. After an EVPN instance has been created in the BD view, you can configure an RD using route_distinguisher parameter in BD-EVPN instance view. Before configuring VPN targets for a BD EVPN instance, ensure that an RD has been configured for the BD EVPN instance If you unconfigure route_distinguisher, all VPN target attributes for the BD EVPN instance will be removed at the same time. When using state:absent, evpn is not supported and it will be ignored. When using state:absent to delete VPN target attributes, ensure the configuration of VPN target attributes has existed and otherwise it will report an error. This module requires the netconf system service be enabled on the remote device being managed. Recommended connection is netconf. This module also works with local connections for legacy playbooks. Examples - name: EVPN BD VNI test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Configure an EVPN instance for a VXLAN in BD view"
community.network.ce_evpn_bd_vni:
bridge_domain_id: 20
evpn: enable
provider: "{{ cli }}"
- name: "Configure a route distinguisher (RD) for a BD EVPN instance"
community.network.ce_evpn_bd_vni:
bridge_domain_id: 20
route_distinguisher: '22:22'
provider: "{{ cli }}"
- name: "Configure VPN targets to both the import and export VPN target lists of a BD EVPN instance"
community.network.ce_evpn_bd_vni:
bridge_domain_id: 20
vpn_target_both: 22:100,22:101
provider: "{{ cli }}"
- name: "Configure VPN targets to the import VPN target list of a BD EVPN instance"
community.network.ce_evpn_bd_vni:
bridge_domain_id: 20
vpn_target_import: 22:22,22:23
provider: "{{ cli }}"
- name: "Configure VPN targets to the export VPN target list of a BD EVPN instance"
community.network.ce_evpn_bd_vni:
bridge_domain_id: 20
vpn_target_export: 22:38,22:39
provider: "{{ cli }}"
- name: "Unconfigure VPN targets to both the import and export VPN target lists of a BD EVPN instance"
community.network.ce_evpn_bd_vni:
bridge_domain_id: 20
vpn_target_both: '22:100'
state: absent
provider: "{{ cli }}"
- name: "Unconfigure VPN targets to the import VPN target list of a BD EVPN instance"
community.network.ce_evpn_bd_vni:
bridge_domain_id: 20
vpn_target_import: '22:22'
state: absent
provider: "{{ cli }}"
- name: "Unconfigure VPN targets to the export VPN target list of a BD EVPN instance"
community.network.ce_evpn_bd_vni:
bridge_domain_id: 20
vpn_target_export: '22:38'
state: absent
provider: "{{ cli }}"
- name: "Unconfigure a route distinguisher (RD) of a BD EVPN instance"
community.network.ce_evpn_bd_vni:
bridge_domain_id: 20
route_distinguisher: '22:22'
state: absent
provider: "{{ cli }}"
- name: "Unconfigure an EVPN instance for a VXLAN in BD view"
community.network.ce_evpn_bd_vni:
bridge_domain_id: 20
evpn: disable
provider: "{{ cli }}"
Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description changed boolean always check to see if a change was made on the device Sample: True end_state dictionary always k/v pairs of end attributes on the device Sample: {'bridge_domain_id': '2', 'evpn': 'enable', 'route_distinguisher': '22:22', 'vpn_target_both': ['22:100', '22:101'], 'vpn_target_export': ['22:38', '22:39'], 'vpn_target_import': ['22:22', '22:23']} existing dictionary always k/v pairs of existing attributes on the device Sample: {'bridge_domain_id': '2', 'evpn': 'disable', 'route_distinguisher': None, 'vpn_target_both': [], 'vpn_target_export': [], 'vpn_target_import': []} proposed dictionary always k/v pairs of parameters passed into module Sample: {'bridge_domain_id': '2', 'evpn': 'enable', 'route_distinguisher': '22:22', 'state': 'present', 'vpn_target_both': ['22:100', '22:101'], 'vpn_target_export': ['22:38', '22:39'], 'vpn_target_import': ['22:22', '22:23']} updates list / elements=string always command list sent to the device Sample: ['bridge-domain 2', ' evpn', ' route-distinguisher 22:22', ' vpn-target 22:38 export-extcommunity', ' vpn-target 22:39 export-extcommunity', ' vpn-target 22:100 export-extcommunity', ' vpn-target 22:101 export-extcommunity', ' vpn-target 22:22 import-extcommunity', ' vpn-target 22:23 import-extcommunity', ' vpn-target 22:100 import-extcommunity', ' vpn-target 22:101 import-extcommunity'] Authors Zhijin Zhou (@QijunPan)
© 2012–2018 Michael DeHaan |
dart:async
distinct method Stream<T> distinct([bool equals(T previous, T next) ]) Skips data events if they are equal to the previous data event. The returned stream provides the same events as this stream, except that it never provides two consecutive data events that are equal. That is, errors are passed through to the returned stream, and data events are passed through if they are distinct from the most recently emitted data event. Equality is determined by the provided equals method. If that is omitted, the '==' operator on the last provided data element is used. If equals throws, the data event is replaced by an error event containing the thrown error. The behavior is equivalent to the original stream emitting the error event. The returned stream is a broadcast stream if this stream is. If a broadcast stream is listened to more than once, each subscription will individually perform the equals test. Source Stream<T> distinct([bool equals(T previous, T next)]) {
return new _DistinctStream<T>(this, equals);
}
|
megaco_codec_meas Module megaco_codec_meas Module Summary This module implements a simple megaco codec measurement tool. Description
This module implements a simple megaco codec measurement tool. Results are written to file (excel compatible text files) and on stdout. Note that this module is not included in the runtime part of the application. Exports
start() -> void()start(MessagePackage) -> void()
Types
This function runs the measurement on all the official codecs; pretty, compact, ber, per and erlang.
|
love.keyboard.setTextInput
Available since LÖVE 0.9.0 This function is not supported in earlier versions. Enables or disables text input events. It is enabled by default on Windows, Mac, and Linux, and disabled by default on iOS and Android.
On touch devices, this shows the system's native on-screen keyboard when it's enabled. Function Synopsis love.keyboard.setTextInput( enable ) Arguments
boolean enable Whether text input events should be enabled.
Returns Nothing. Function Available since LÖVE 0.10.0 This variant is not supported in earlier versions. On iOS and Android this variant tells the OS that the specified rectangle is where text will show up in the game, which prevents the system on-screen keyboard from covering the text. Synopsis love.keyboard.setTextInput( enable, x, y, w, h ) Arguments
boolean enable Whether text input events should be enabled. number x Text rectangle x position. number y Text rectangle y position. number w Text rectangle width. number h Text rectangle height.
Returns Nothing. See Also
love.keyboard
love.keyboard.hasTextInput
love.textinput
|
community.network.avi_healthmonitor – Module for setup of HealthMonitor Avi RESTful Object Note This plugin is part of the community.network collection (version 1.3.0). To install it use: ansible-galaxy collection install community.network. To use it in a playbook, specify: community.network.avi_healthmonitor. Synopsis Requirements Parameters Notes Examples Return Values Synopsis This module is used to configure HealthMonitor 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 dictionary 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 string Default:"16.4.4" Avi API version of to use for Avi API and objects. avi_api_patch_op string
Choices: add replace delete Patch operation to use when using avi_api_update_method as patch. avi_api_update_method string
Choices:
put ← patch Default method for object update is HTTP PUT. Setting to patch will override that behavior to use HTTP PATCH. avi_credentials dictionary Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. api_version string Default:"16.4.4" Avi controller version controller string Avi controller IP or SQDN csrftoken string Avi controller API csrftoken to reuse existing session with session id password string Avi controller password port string Avi controller port session_id string Avi controller API session id to reuse existing session with csrftoken tenant string Default:"admin" Avi controller tenant tenant_uuid string Avi controller tenant UUID timeout string Default:300 Avi controller request timeout token string Avi controller API token username string Avi controller username avi_disable_session_cache_as_fact boolean
Choices:
no ← yes It disables avi session information to be cached as a fact. controller string Default:"" IP address or hostname of the controller. The default value is the environment variable AVI_CONTROLLER. description string User defined description for the object. dns_monitor string Healthmonitordns settings for healthmonitor. external_monitor string Healthmonitorexternal settings for healthmonitor. failed_checks string Number of continuous failed health checks before the server is marked down. Allowed values are 1-50. Default value when not specified in API or module is interpreted by Avi Controller as 2. http_monitor string Healthmonitorhttp settings for healthmonitor. https_monitor string Healthmonitorhttp settings for healthmonitor. is_federated boolean
Choices: no yes This field describes the object's replication scope. If the field is set to false, then the object is visible within the controller-cluster and its associated service-engines. If the field is set to true, then the object is replicated across the federation. Field introduced in 17.1.3. Default value when not specified in API or module is interpreted by Avi Controller as False. monitor_port string Use this port instead of the port defined for the server in the pool. If the monitor succeeds to this port, the load balanced traffic will still be sent to the port of the server defined within the pool. Allowed values are 1-65535. Special values are 0 - 'use server port'. name string / required A user friendly name for this health monitor. password string Default:"" Password of Avi user in Avi controller. The default value is the environment variable AVI_PASSWORD. radius_monitor string Health monitor for radius. Field introduced in 18.2.3. receive_timeout string A valid response from the server is expected within the receive timeout window. This timeout must be less than the send interval. If server status is regularly flapping up and down, consider increasing this value. Allowed values are 1-2400. Default value when not specified in API or module is interpreted by Avi Controller as 4. send_interval string Frequency, in seconds, that monitors are sent to a server. Allowed values are 1-3600. Default value when not specified in API or module is interpreted by Avi Controller as 10. sip_monitor string Health monitor for sip. Field introduced in 17.2.8, 18.1.3, 18.2.1. state string
Choices: absent
present ← The state that should be applied on the entity. successful_checks string Number of continuous successful health checks before server is marked up. Allowed values are 1-50. Default value when not specified in API or module is interpreted by Avi Controller as 2. tcp_monitor string Healthmonitortcp settings for healthmonitor. tenant string Default:"admin" Name of tenant used for all Avi API calls and context of object. tenant_ref string It is a reference to an object of type tenant. tenant_uuid string Default:"" UUID of tenant used for all Avi API calls and context of object. type string / required Type of the health monitor. Enum options - HEALTH_MONITOR_PING, HEALTH_MONITOR_TCP, HEALTH_MONITOR_HTTP, HEALTH_MONITOR_HTTPS, HEALTH_MONITOR_EXTERNAL, HEALTH_MONITOR_UDP, HEALTH_MONITOR_DNS, HEALTH_MONITOR_GSLB, HEALTH_MONITOR_SIP, HEALTH_MONITOR_RADIUS. udp_monitor string Healthmonitorudp settings for healthmonitor. url string Avi controller URL of the object. username string Default:"" Username used for accessing Avi controller. The default value is the environment variable AVI_USERNAME. uuid string Uuid of the health monitor. Notes Note For more information on using Ansible to manage Avi Network devices see https://www.ansible.com/ansible-avi-networks. Examples - name: Create a HTTPS health monitor
community.network.avi_healthmonitor:
controller: 207.955.0837
username: admin
password: AviNetworks123!
https_monitor:
http_request: HEAD / HTTP/1.0
http_response_code:
- HTTP_2XX
- HTTP_3XX
receive_timeout: 4
failed_checks: 3
send_interval: 10
successful_checks: 3
type: HEALTH_MONITOR_HTTPS
name: MyWebsite-HTTPS
Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description obj dictionary success, changed HealthMonitor (api/healthmonitor) object Authors Gaurav Rastogi (@grastogi23) <[email protected]>
© 2012–2018 Michael DeHaan |
reflect
kotlin-stdlib / kotlin.reflect.jvm / reflect
Platform and version requirements: JVM (1.0)
@ExperimentalReflectionOnLambdas fun <R> Function<R>.reflect(): KFunction<R>?
This is an experimental API. Given a class for a compiled Kotlin lambda or a function expression, returns a KFunction instance providing introspection capabilities for that lambda or function expression and its parameters. Not all features are currently supported, in particular KCallable.call and KCallable.callBy will fail at the moment.
|
browsingData.removeHistory()
Clears the record of web pages that the user has visited (browsing history). You can use the removalOptions parameter, which is a browsingData.RemovalOptions object, to: clear only records of web pages visited after a given time control whether to clear only records of normal web pages or to clear records of hosted apps and extensions as well. This is an asynchronous function that returns a Promise.
Syntax
let removing = browser.browsingData.removeHistory(
removalOptions // RemovalOptions object
)
Parameters
removalOptions object. A browsingData.RemovalOptions object, which may be used to clear only records of web pages visited after a given time, and whether to clear only records of normal web pages or to clear records of hosted apps and extensions as well. Return value
A Promise that will be fulfilled with no arguments when the removal has finished. If any error occurs, the promise will be rejected with an error message.Examples
Remove records of pages visited in the last week: function onRemoved() {
console.log("removed");
}
function onError(error) {
console.error(error);
}
function weekInMilliseconds() {
return 1000 * 60 * 60 * 24 * 7;
}
let oneWeekAgo = (new Date()).getTime() - weekInMilliseconds();
browser.browsingData.removeHistory(
{since: oneWeekAgo}).
then(onRemoved, onError);
Remove all records of visited pages: function onRemoved() {
console.log("removed");
}
function onError(error) {
console.error(error);
}
browser.browsingData.removeHistory({}).
then(onRemoved, onError);
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
removeHistory
Yes
79
53
This function also removes download history and service workers.
?
Yes
No
?
?
No
See bug 1363010. Before Firefox for Android 79, browser.history.remove(options, {history:true}) can be used instead.
?
No
?
Note: This API is based on Chromium's chrome.browsingData API. Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
|
RouterTestingModule ngmodule Sets up the router to be used for testing. See more... class RouterTestingModule {
static withRoutes(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterTestingModule>
} Description The modules sets up the router to be used for testing. It provides spy implementations of Location, LocationStrategy, and NgModuleFactoryLoader. Static methods withRoutes() static withRoutes(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterTestingModule> Parameters routes Routes config ExtraOptions Optional. Default is undefined. Returns ModuleWithProviders<RouterTestingModule> Providers Provider ROUTER_PROVIDERS { provide: Location, useClass: SpyLocation } { provide: LocationStrategy, useClass: MockLocationStrategy } { provide: NgModuleFactoryLoader, useClass: SpyNgModuleFactoryLoader } {
provide: Router,
useFactory: setupTestingRouter,
deps: [
UrlSerializer, ChildrenOutletContexts, Location, NgModuleFactoryLoader, Compiler, Injector,
ROUTES, ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()]
]
} { provide: PreloadingStrategy, useExisting: NoPreloading } provideRoutes([]) Usage notes Example beforeEach(() => {
TestBed.configureTestModule({
imports: [
RouterTestingModule.withRoutes(
[{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]
)
]
});
});
|
onPostVisitDirectory
kotlin-stdlib / kotlin.io.path / FileVisitorBuilder / onPostVisitDirectory
Platform and version requirements: JVM (1.0), JRE7 (1.0)
abstract fun onPostVisitDirectory(
function: (directory: Path, exception: IOException?) -> FileVisitResult)
Overrides the corresponding function of the built file visitor with the provided function. By default, if the directory iteration completes without an I/O exception, FileVisitor.postVisitDirectory of the built file visitor returns FileVisitResult.CONTINUE; otherwise it re-throws the I/O exception that caused the iteration of the directory to terminate prematurely.
|
CompilerFactory class deprecated A factory for creating a Compiler Deprecated: Ivy JIT mode doesn't require accessing this symbol. See JIT API changes due to ViewEngine deprecation for additional context. abstract class CompilerFactory {
abstract createCompiler(options?: CompilerOptions[]): Compiler
} Subclasses JitCompilerFactory Methods createCompiler() abstract createCompiler(options?: CompilerOptions[]): Compiler Parameters options CompilerOptions[] Optional. Default is undefined. Returns Compiler
|
pandas.Series.argmin
Series.argmin(axis=None, skipna=True, *args, **kwargs)
Index of first occurrence of minimum of values.
Parameters:
skipna : boolean, default True Exclude NA/null values
Returns:
idxmin : Index of minimum of values See also DataFrame.idxmin, numpy.ndarray.argmin Notes This method is the Series version of ndarray.argmin.
|
dart:html
createPatternFromImage method @DomName('CanvasRenderingContext2D.createPatternFromImage') CanvasPattern createPatternFromImage(ImageElement image, String repetitionType) Source @DomName('CanvasRenderingContext2D.createPatternFromImage')
CanvasPattern createPatternFromImage(
ImageElement image, String repetitionType) =>
createPattern(image, repetitionType);
|
Database Forge Class The Database Forge Class contains methods that help you manage your database. Initializing the Forge Class
Creating and Dropping Databases Creating Databases in the Command Line
Creating and Dropping Tables Adding fields Adding Keys Adding Foreign Keys Creating a table Dropping a table Dropping a Foreign Key Dropping a Key Renaming a table
Modifying Tables Adding a Column to a Table Dropping Columns From a Table Modifying a Column in a Table Class Reference Initializing the Forge Class Important In order to initialize the Forge class, your database driver must already be running, since the forge class relies on it. Load the Forge Class as follows: $forge = \Config\Databas8b7c:f320:99b9:690f:4595:cd17:293a:c069forge();
You can also pass another database group name to the DB Forge loader, in case the database you want to manage isn’t the default one: $this->myforge = \Config\Databas8b7c:f320:99b9:690f:4595:cd17:293a:c069forge('other_db');
In the above example, we’re passing the name of a different database group to connect to as the first parameter. Creating and Dropping Databases $forge->createDatabase(‘db_name’) Permits you to create the database specified in the first parameter. Returns true/false based on success or failure: if ($forge->createDatabase('my_db')) {
echo 'Database created!';
}
An optional second parameter set to true will add IF EXISTS statement or will check if a database exists before create it (depending on DBMS). $forge->createDatabase('my_db', true);
// gives CREATE DATABASE IF NOT EXISTS `my_db`
// or will check if a database exists
$forge->dropDatabase(‘db_name’) Permits you to drop the database specified in the first parameter. Returns true/false based on success or failure: if ($forge->dropDatabase('my_db')) {
echo 'Database deleted!';
}
Creating Databases in the Command Line CodeIgniter supports creating databases straight from your favorite terminal using the dedicated db:create command. By using this command it is assumed that the database is not yet existing. Otherwise, CodeIgniter will complain that the database creation has failed. To start, just type the command and the name of the database (e.g., foo): php spark db:create foo
If everything went fine, you should expect the Database "foo" successfully created. message displayed. If you are on a testing environment or you are using the SQLite3 driver, you may pass in the file extension for the file where the database will be created using the --ext option. Valid values are db and sqlite and defaults to db. Remember that these should not be preceded by a period. php spark db:create foo --ext sqlite
// will create the db file in WRITEPATH/foo.sqlite
Note When using the special SQLite3 database name :memory:, expect that the command will still produce a success message but no database file is created. This is because SQLite3 will just use an in-memory database. Creating and Dropping Tables There are several things you may wish to do when creating tables. Add fields, add keys to the table, alter columns. CodeIgniter provides a mechanism for this. Adding fields Fields are normally created via an associative array. Within the array, you must include a ‘type’ key that relates to the datatype of the field. For example, INT, VARCHAR, TEXT, etc. Many datatypes (for example VARCHAR) also require a ‘constraint’ key. $fields = [
'users' => [
'type' => 'VARCHAR',
'constraint' => 100,
],
];
// will translate to "users VARCHAR(100)" when the field is added.
Additionally, the following key/values can be used: unsigned/true : to generate “UNSIGNED” in the field definition. default/value : to generate a default value in the field definition. null/true : to generate “null” in the field definition. Without this, the field will default to “NOT null”. auto_increment/true : generates an auto_increment flag on the field. Note that the field type must be a type that supports this, such as integer. unique/true : to generate a unique key for the field definition. $fields = [
'id' => [
'type' => 'INT',
'constraint' => 5,
'unsigned' => true,
'auto_increment' => true
],
'title' => [
'type' => 'VARCHAR',
'constraint' => '100',
'unique' => true,
],
'author' => [
'type' =>'VARCHAR',
'constraint' => 100,
'default' => 'King of Town',
],
'description' => [
'type' => 'TEXT',
'null' => true,
],
'status' => [
'type' => 'ENUM',
'constraint' => ['publish', 'pending', 'draft'],
'default' => 'pending',
],
];
After the fields have been defined, they can be added using $forge->addField($fields); followed by a call to the createTable() method. $forge->addField() The add fields method will accept the above array. Passing strings as fields If you know exactly how you want a field to be created, you can pass the string into the field definitions with addField() $forge->addField("label varchar(100) NOT NULL DEFAULT 'default label'");
Note Passing raw strings as fields cannot be followed by addKey() calls on those fields. Note Multiple calls to addField() are cumulative. Creating an id field There is a special exception for creating id fields. A field with type id will automatically be assigned as an INT(9) auto_incrementing Primary Key. $forge->addField('id');
// gives `id` INT(9) NOT NULL AUTO_INCREMENT
Adding Keys Generally speaking, you’ll want your table to have Keys. This is accomplished with $forge->addKey(‘field’). The optional second parameter set to true will make it a primary key and the third parameter set to true will make it a unique key. Note that addKey() must be followed by a call to createTable(). Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL. $forge->addKey('blog_id', true);
// gives PRIMARY KEY `blog_id` (`blog_id`)
$forge->addKey('blog_id', true);
$forge->addKey('site_id', true);
// gives PRIMARY KEY `blog_id_site_id` (`blog_id`, `site_id`)
$forge->addKey('blog_name');
// gives KEY `blog_name` (`blog_name`)
$forge->addKey(['blog_name', 'blog_label']);
// gives KEY `blog_name_blog_label` (`blog_name`, `blog_label`)
$forge->addKey(['blog_id', 'uri'], false, true);
// gives UNIQUE KEY `blog_id_uri` (`blog_id`, `uri`)
To make code reading more objective it is also possible to add primary and unique keys with specific methods: $forge->addPrimaryKey('blog_id');
// gives PRIMARY KEY `blog_id` (`blog_id`)
$forge->addUniqueKey(['blog_id', 'uri']);
// gives UNIQUE KEY `blog_id_uri` (`blog_id`, `uri`)
Adding Foreign Keys Foreign Keys help to enforce relationships and actions across your tables. For tables that support Foreign Keys, you may add them directly in forge: $forge->addForeignKey('users_id','users','id');
// gives CONSTRAINT `TABLENAME_users_foreign` FOREIGN KEY(`users_id`) REFERENCES `users`(`id`)
$forge->addForeignKey(['users_id', 'users_name'],'users',['id', 'name']);
// gives CONSTRAINT `TABLENAME_users_foreign` FOREIGN KEY(`users_id`, `users_name`) REFERENCES `users`(`id`, `name`)
You can specify the desired action for the “on delete” and “on update” properties of the constraint: $forge->addForeignKey('users_id','users','id','CASCADE','CASCADE');
// gives CONSTRAINT `TABLENAME_users_foreign` FOREIGN KEY(`users_id`) REFERENCES `users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
$forge->addForeignKey(['users_id', 'users_name'],'users',['id', 'name'],'CASCADE','CASCADE');
// gives CONSTRAINT `TABLENAME_users_foreign` FOREIGN KEY(`users_id`, `users_name`) REFERENCES `users`(`id`, `name`) ON DELETE CASCADE ON UPDATE CASCADE
Creating a table After fields and keys have been declared, you can create a new table with $forge->createTable('table_name');
// gives CREATE TABLE table_name
An optional second parameter set to true adds an “IF NOT EXISTS” clause into the definition $forge->createTable('table_name', true);
// gives CREATE TABLE IF NOT EXISTS table_name
You could also pass optional table attributes, such as MySQL’s ENGINE: $attributes = ['ENGINE' => 'InnoDB'];
$forge->createTable('table_name', false, $attributes);
// produces: CREATE TABLE `table_name` (...) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
Note Unless you specify the CHARACTER SET and/or COLLATE attributes, createTable() will always add them with your configured charset and DBCollat values, as long as they are not empty (MySQL only). Dropping a table Execute a DROP TABLE statement and optionally add an IF EXISTS clause. // Produces: DROP TABLE `table_name`
$forge->dropTable('table_name');
// Produces: DROP TABLE IF EXISTS `table_name`
$forge->dropTable('table_name', true);
A third parameter can be passed to add a “CASCADE” option, which might be required for some drivers to handle removal of tables with foreign keys. // Produces: DROP TABLE `table_name` CASCADE
$forge->dropTable('table_name', false, true);
Dropping a Foreign Key Execute a DROP FOREIGN KEY. // Produces: ALTER TABLE `tablename` DROP FOREIGN KEY `users_foreign`
$forge->dropForeignKey('tablename','users_foreign');
Dropping a Key Execute a DROP KEY. // Produces: DROP INDEX `users_index` ON `tablename`
$forge->dropKey('tablename','users_index');
Renaming a table Executes a TABLE rename $forge->renameTable('old_table_name', 'new_table_name');
// gives ALTER TABLE `old_table_name` RENAME TO `new_table_name`
Modifying Tables Adding a Column to a Table $forge->addColumn() The addColumn() method is used to modify an existing table. It accepts the same field array as above, and can be used for an unlimited number of additional fields. $fields = [
'preferences' => ['type' => 'TEXT']
];
$forge->addColumn('table_name', $fields);
// Executes: ALTER TABLE `table_name` ADD `preferences` TEXT
If you are using MySQL or CUBIRD, then you can take advantage of their AFTER and FIRST clauses to position the new column. Examples: // Will place the new column after the `another_field` column:
$fields = [
'preferences' => ['type' => 'TEXT', 'after' => 'another_field']
];
// Will place the new column at the start of the table definition:
$fields = [
'preferences' => ['type' => 'TEXT', 'first' => true]
];
Dropping Columns From a Table $forge->dropColumn() Used to remove a column from a table. $forge->dropColumn('table_name', 'column_to_drop'); // to drop one single column
Used to remove multiple columns from a table. $forge->dropColumn('table_name', 'column_1,column_2'); // by proving comma separated column names
$forge->dropColumn('table_name', ['column_1', 'column_2']); // by proving array of column names
Modifying a Column in a Table $forge->modifyColumn() The usage of this method is identical to addColumn(), except it alters an existing column rather than adding a new one. In order to change the name, you can add a “name” key into the field defining array. $fields = [
'old_name' => [
'name' => 'new_name',
'type' => 'TEXT',
],
];
$forge->modifyColumn('table_name', $fields);
// gives ALTER TABLE `table_name` CHANGE `old_name` `new_name` TEXT
Class Reference
CodeIgniter\Database\Forge
addColumn($table[, $field = []])
Parameters:
$table (string) – Table name to add the column to
$field (array) – Column definition(s)
Returns:
true on success, false on failure
Return type:
bool Adds a column to a table. Usage: See Adding a Column to a Table.
addField($field)
Parameters:
$field (array) – Field definition to add
Returns:
CodeIgniterDatabaseForge instance (method chaining)
Return type:
CodeIgniterDatabaseForge Adds a field to the set that will be used to create a table. Usage: See Adding fields.
addForeignKey($fieldName, $tableName, $tableField[, $onUpdate = '', $onDelete = ''])
Parameters:
$fieldName (string|string[]) – Name of a key field or an array of fields
$tableName (string) – Name of a parent table
$tableField (string|string[]) – Name of a parent table field or an array of fields
$onUpdate (string) – Desired action for the “on update”
$onDelete (string) – Desired action for the “on delete”
Returns:
CodeIgniterDatabaseForge instance (method chaining)
Return type:
CodeIgniterDatabaseForge Adds a foreign key to the set that will be used to create a table. Usage: See Adding Foreign Keys.
addKey($key[, $primary = false[, $unique = false]])
Parameters:
$key (mixed) – Name of a key field or an array of fields
$primary (bool) – Set to true if it should be a primary key or a regular one
$unique (bool) – Set to true if it should be a unique key or a regular one
Returns:
CodeIgniterDatabaseForge instance (method chaining)
Return type:
CodeIgniterDatabaseForge Adds a key to the set that will be used to create a table. Usage: See Adding Keys.
addPrimaryKey($key)
Parameters:
$key (mixed) – Name of a key field or an array of fields
Returns:
CodeIgniterDatabaseForge instance (method chaining)
Return type:
CodeIgniterDatabaseForge Adds a primary key to the set that will be used to create a table. Usage: See Adding Keys.
addUniqueKey($key)
Parameters:
$key (mixed) – Name of a key field or an array of fields
Returns:
CodeIgniterDatabaseForge instance (method chaining)
Return type:
CodeIgniterDatabaseForge Adds a unique key to the set that will be used to create a table. Usage: See Adding Keys.
createDatabase($dbName[, $ifNotExists = false])
Parameters:
$db_name (string) – Name of the database to create
$ifNotExists (string) – Set to true to add an ‘IF NOT EXISTS’ clause or check if database exists
Returns:
true on success, false on failure
Return type:
bool Creates a new database. Usage: See Creating and Dropping Databases.
createTable($table[, $if_not_exists = false[, array $attributes = []]])
Parameters:
$table (string) – Name of the table to create
$if_not_exists (string) – Set to true to add an ‘IF NOT EXISTS’ clause
$attributes (string) – An associative array of table attributes
Returns:
Query object on success, false on failure
Return type:
mixed Creates a new table. Usage: See Creating a table.
dropColumn($table, $column_name)
Parameters:
$table (string) – Table name
$column_names (mixed) – Comma-delimited string or an array of column names
Returns:
true on success, false on failure
Return type:
bool Drops single or multiple columns from a table. Usage: See Dropping Columns From a Table.
dropDatabase($dbName)
Parameters:
$dbName (string) – Name of the database to drop
Returns:
true on success, false on failure
Return type:
bool Drops a database. Usage: See Creating and Dropping Databases.
dropTable($table_name[, $if_exists = false])
Parameters:
$table (string) – Name of the table to drop
$if_exists (string) – Set to true to add an ‘IF EXISTS’ clause
Returns:
true on success, false on failure
Return type:
bool Drops a table. Usage: See Dropping a table.
modifyColumn($table, $field)
Parameters:
$table (string) – Table name
$field (array) – Column definition(s)
Returns:
true on success, false on failure
Return type:
bool Modifies a table column. Usage: See Modifying a Column in a Table.
renameTable($table_name, $new_table_name)
Parameters:
$table (string) – Current of the table
$new_table_name (string) – New name of the table
Returns:
Query object on success, false on failure
Return type:
mixed Renames a table. Usage: See Renaming a table.
|
LOAD Name LOAD -- load a shared library file Synopsis LOAD 'filename' Description This command loads a shared library file into the PostgreSQL server's address space. If the file has been loaded already, the command does nothing. Shared library files that contain C functions are automatically loaded whenever one of their functions is called. Therefore, an explicit LOAD is usually only needed to load a library that modifies the server's behavior through "hooks" rather than providing a set of functions. The file name is specified in the same way as for shared library names in CREATE FUNCTION; in particular, one can rely on a search path and automatic addition of the system's standard shared library file name extension. See Section 35.9 for more information on this topic. Non-superusers can only apply LOAD to library files located in $libdir/plugins/ — the specified filename must begin with exactly that string. (It is the database administrator's responsibility to ensure that only "safe" libraries are installed there.) Compatibility LOAD is a PostgreSQL extension. See Also CREATE FUNCTION Prev Next LISTEN Up LOCK
|
Interface DynValueCommon All Superinterfaces:
DynAny, DynAnyOperations, DynValueCommonOperations, IDLEntity, Object, Serializable
All Known Subinterfaces:
DynValue, DynValueBox
All Known Implementing Classes: _DynValueStub public interface DynValueCommon
extends DynValueCommonOperations, DynAny, IDLEntity DynValueCommon provides operations supported by both the DynValue and DynValueBox interfaces. Methods Methods inherited from interface org.omg.DynamicAny.DynValueCommonOperations
is_null, set_to_null, set_to_value Methods inherited from interface org.omg.DynamicAny.DynAnyOperations
assign, component_count, copy, current_component, destroy, equal, from_any, get_any, get_boolean, get_char, get_double, get_dyn_any, get_float, get_long, get_longlong, get_octet, get_reference, get_short, get_string, get_typecode, get_ulong, get_ulonglong, get_ushort, get_val, get_wchar, get_wstring, insert_any, insert_boolean, insert_char, insert_double, insert_dyn_any, insert_float, insert_long, insert_longlong, insert_octet, insert_reference, insert_short, insert_string, insert_typecode, insert_ulong, insert_ulonglong, insert_ushort, insert_val, insert_wchar, insert_wstring, next, rewind, seek, to_any, type Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
|
matplotlib.animation.MovieWriter.saving
MovieWriter.saving(*args, **kw)
Context manager to facilitate writing the movie file. *args, **kw are any parameters that should be passed to setup.
|
AbsoluteOrientationSensor()
The AbsoluteOrientationSensor() constructor creates a new AbsoluteOrientationSensor object which describes the device's physical orientation in relation to the Earth's reference coordinate system. If a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. This is not something that would ever be shown to a user. The Feature-Policy HTTP header article contains implementation instructions.
Syntax
new AbsoluteOrientationSensor()
new AbsoluteOrientationSensor(options)
Parameters
options Optional
Options are as follows:
frequency: The desired number of times per second a sample should be taken, meaning the number of times per second that the reading event will be called. A whole number or decimal may be used, the latter for frequencies less than a second. The actual reading frequency depends on the device hardware and consequently may be less than requested.
referenceFrame: Either 'device' or 'screen'. The default is 'device'.
Specifications
Specification
Orientation Sensor # dom-absoluteorientationsensor-absoluteorientationsensor
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
AbsoluteOrientationSensor
67
79
No
No
54
No
67
67
No
48
No
9.0
See also
reading event
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: Feb 2, 2022, by MDN contributors
|
Class PipedInputStream
java.lang.Object
java.io.InputStream java.io.PipedInputStream All Implemented Interfaces:
Closeable, AutoCloseable
public class PipedInputStream extends InputStream A piped input stream should be connected to a piped output stream; the piped input stream then provides whatever data bytes are written to the piped output stream. Typically, data is read from a PipedInputStream object by one thread and data is written to the corresponding PipedOutputStream by some other thread. Attempting to use both objects from a single thread is not recommended, as it may deadlock the thread. The piped input stream contains a buffer, decoupling read operations from write operations, within limits. A pipe is said to be broken if a thread that was providing data bytes to the connected piped output stream is no longer alive. Since: 1.0 See Also: PipedOutputStream Field Summary
Modifier and Type
Field
Description
protected byte[]
buffer
The circular buffer into which incoming data is placed.
protected int
in
The index of the position in the circular buffer at which the next byte of data will be stored when received from the connected piped output stream.
protected int
out
The index of the position in the circular buffer at which the next byte of data will be read by this piped input stream.
protected static final int
PIPE_SIZE
The default size of the pipe's circular input buffer.
Constructor Summary
Constructor
Description
PipedInputStream()
Creates a PipedInputStream so that it is not yet connected.
PipedInputStream(int pipeSize)
Creates a PipedInputStream so that it is not yet connected and uses the specified pipe size for the pipe's buffer.
PipedInputStream(PipedOutputStream src)
Creates a PipedInputStream so that it is connected to the piped output stream src.
PipedInputStream(PipedOutputStream src,
int pipeSize)
Creates a PipedInputStream so that it is connected to the piped output stream src and uses the specified pipe size for the pipe's buffer.
Method Summary
Modifier and Type
Method
Description
int
available()
Returns the number of bytes that can be read from this input stream without blocking.
void
close()
Closes this piped input stream and releases any system resources associated with the stream.
void
connect(PipedOutputStream src)
Causes this piped input stream to be connected to the piped output stream src.
int
read()
Reads the next byte of data from this piped input stream.
int
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from this piped input stream into an array of bytes.
protected void
receive(int b)
Receives a byte of data.
Methods declared in class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Details PIPE_SIZE protected static final int PIPE_SIZE The default size of the pipe's circular input buffer. Since: 1.1 See Also: Constant Field Values buffer protected byte[] buffer The circular buffer into which incoming data is placed. Since: 1.1 in protected int in The index of the position in the circular buffer at which the next byte of data will be stored when received from the connected piped output stream. in < 0 implies the buffer is empty, in == out implies the buffer is full Since: 1.1 out protected int out The index of the position in the circular buffer at which the next byte of data will be read by this piped input stream. Since: 1.1 Constructor Details PipedInputStream public PipedInputStream(PipedOutputStream src) throws IOException Creates a PipedInputStream so that it is connected to the piped output stream src. Data bytes written to src will then be available as input from this stream. Parameters:
src - the stream to connect to. Throws:
IOException - if an I/O error occurs. PipedInputStream public PipedInputStream(PipedOutputStream src, int pipeSize) throws IOException Creates a PipedInputStream so that it is connected to the piped output stream src and uses the specified pipe size for the pipe's buffer. Data bytes written to src will then be available as input from this stream. Parameters:
src - the stream to connect to.
pipeSize - the size of the pipe's buffer. Throws:
IOException - if an I/O error occurs.
IllegalArgumentException - if pipeSize <= 0. Since: 1.6 PipedInputStream public PipedInputStream() Creates a PipedInputStream so that it is not yet connected. It must be connected to a PipedOutputStream before being used. PipedInputStream public PipedInputStream(int pipeSize) Creates a PipedInputStream so that it is not yet connected and uses the specified pipe size for the pipe's buffer. It must be connected to a PipedOutputStream before being used. Parameters:
pipeSize - the size of the pipe's buffer. Throws:
IllegalArgumentException - if pipeSize <= 0. Since: 1.6 Method Details connect public void connect(PipedOutputStream src) throws IOException Causes this piped input stream to be connected to the piped output stream src. If this object is already connected to some other piped output stream, an IOException is thrown. If src is an unconnected piped output stream and snk is an unconnected piped input stream, they may be connected by either the call:
snk.connect(src) or the call:
src.connect(snk) The two calls have the same effect.
Parameters:
src - The piped output stream to connect to. Throws:
IOException - if an I/O error occurs. receive protected void receive(int b) throws IOException Receives a byte of data. This method will block if no input is available. Parameters:
b - the byte being received Throws:
IOException - If the pipe is broken, unconnected, closed, or if an I/O error occurs. Since: 1.1 read public int read() throws IOException Reads the next byte of data from this piped input stream. The value byte is returned as an int in the range 0 to 255. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown. Specified by:
read in class InputStream
Returns: the next byte of data, or -1 if the end of the stream is reached. Throws:
IOException - if the pipe is unconnected, broken, closed, or if an I/O error occurs. read public int read(byte[] b, int off, int len) throws IOException Reads up to len bytes of data from this piped input stream into an array of bytes. Less than len bytes will be read if the end of the data stream is reached or if len exceeds the pipe's buffer size. If len is zero, then no bytes are read and 0 is returned; otherwise, the method blocks until at least 1 byte of input is available, end of the stream has been detected, or an exception is thrown. Overrides:
read in class InputStream
Parameters:
b - the buffer into which the data is read.
off - the start offset in the destination array b
len - the maximum number of bytes read. Returns: the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached. Throws:
NullPointerException - If b is null.
IndexOutOfBoundsException - If off is negative, len is negative, or len is greater than b.length - off
IOException - if the pipe is broken, unconnected, closed, or if an I/O error occurs. See Also: InputStream.read() available public int available() throws IOException Returns the number of bytes that can be read from this input stream without blocking. Overrides:
available in class InputStream
Returns: the number of bytes that can be read from this input stream without blocking, or 0 if this input stream has been closed by invoking its close() method, or if the pipe is unconnected, or broken. Throws:
IOException - if an I/O error occurs. Since: 1.0.2 close public void close() throws IOException Closes this piped input stream and releases any system resources associated with the stream. Specified by:
close in interface AutoCloseable
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException - if an I/O error occurs.
|
Create a new project You begin by creating an initial application using the Angular CLI. Throughout this tutorial, you’ll modify and extend that starter application to create the Tour of Heroes app. In this part of the tutorial, you'll do the following: Set up your environment. Create a new workspace and initial app project. Serve the application. Make changes to the application. Set up your environment To set up your development environment, follow the instructions in Local Environment Setup. Create a new workspace and an initial application You develop apps in the context of an Angular workspace. A workspace contains the files for one or more projects. A project is the set of files that comprise an app, a library, or end-to-end (e2e) tests. For this tutorial, you will create a new workspace. To create a new workspace and an initial app project: Ensure that you are not already in an Angular workspace folder. For example, if you have previously created the Getting Started workspace, change to the parent of that folder. Run the CLI command ng new and provide the name angular-tour-of-heroes, as shown here: ng new angular-tour-of-heroes The ng new command prompts you for information about features to include in the initial app project. Accept the defaults by pressing the Enter or Return key. The Angular CLI installs the necessary Angular npm packages and other dependencies. This can take a few minutes. It also creates the following workspace and starter project files: A new workspace, with a root folder named angular-tour-of-heroes. An initial skeleton app project, also called angular-tour-of-heroes (in the src subfolder). An end-to-end test project (in the e2e subfolder). Related configuration files. The initial app project contains a simple Welcome app, ready to run. Serve the application Go to the workspace directory and launch the application. cd angular-tour-of-heroes
ng serve --open The ng serve command builds the app, starts the development server, watches the source files, and rebuilds the app as you make changes to those files. The --open flag opens a browser to http://localhost:4200/. You should see the app running in your browser. Angular components The page you see is the application shell. The shell is controlled by an Angular component named AppComponent. Components are the fundamental building blocks of Angular applications. They display data on the screen, listen for user input, and take action based on that input. Make changes to the application Open the project in your favorite editor or IDE and navigate to the src/app folder to make some changes to the starter app. You'll find the implementation of the shell AppComponent distributed over three files:
app.component.ts— the component class code, written in TypeScript.
app.component.html— the component template, written in HTML.
app.component.css— the component's private CSS styles. Change the application title Open the component class file (app.component.ts) and change the value of the title property to 'Tour of Heroes'. title = 'Tour of Heroes'; Open the component template file (app.component.html) and delete the default template generated by the Angular CLI. Replace it with the following line of HTML. <h1>{{title}}</h1> The double curly braces are Angular's interpolation binding syntax. This interpolation binding presents the component's title property value inside the HTML header tag. The browser refreshes and displays the new application title. Add application styles Most apps strive for a consistent look across the application. The CLI generated an empty styles.css for this purpose. Put your application-wide styles there. Open src/styles.css and add the code below to the file. /* Application-wide Styles */
h1 {
color: #369;
font-family: Arial, Helvetica, sans-serif;
font-size: 250%;
}
h2, h3 {
color: #444;
font-family: Arial, Helvetica, sans-serif;
font-weight: lighter;
}
body {
margin: 2em;
}
body, input[type="text"], button {
color: #333;
font-family: Cambria, Georgia;
}
/* everywhere else */
* {
font-family: Arial, Helvetica, sans-serif;
} Final code review The source code for this tutorial and the complete Tour of Heroes global styles are available in the live example. Here are the code files discussed on this page. import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Tour of Heroes';
} <h1>{{title}}</h1> /* Application-wide Styles */
h1 {
color: #369;
font-family: Arial, Helvetica, sans-serif;
font-size: 250%;
}
h2, h3 {
color: #444;
font-family: Arial, Helvetica, sans-serif;
font-weight: lighter;
}
body {
margin: 2em;
}
body, input[type="text"], button {
color: #333;
font-family: Cambria, Georgia;
}
/* everywhere else */
* {
font-family: Arial, Helvetica, sans-serif;
} Summary You created the initial application structure using the Angular CLI. You learned that Angular components display data. You used the double curly braces of interpolation to display the app title.
|
Package java.lang.reflect package java.lang.reflect
Provides classes and interfaces for obtaining reflective information about classes and objects. Reflection allows programmatic access to information about the fields, methods, and constructors of loaded classes, and the use of reflected fields, methods, and constructors to operate on their underlying counterparts, within encapsulation and security restrictions. Classes in this package, along with java.lang.Class accommodate applications such as debuggers, interpreters, object inspectors, class browsers, and services such as Object Serialization and JavaBeans that need access to either the public members of a target object (based on its runtime class) or the members declared by a given class.
AccessibleObject allows suppression of access checks if the necessary ReflectPermission is available.
Array provides static methods to dynamically create and access arrays.
Java programming language and JVM modeling in core reflection The components of core reflection, which include types in this package as well as Class, Package, and Module, fundamentally present a JVM model of the entities in question rather than a Java programming language model. A Java compiler, such as javac, translates Java source code into executable output that can be run on a JVM, primarily class files. Compilers for source languages other than Java can and do target the JVM as well. The translation process, including from Java language sources, to executable output for the JVM is not a one-to-one mapping. Structures present in the source language may have no representation in the output and structures not present in the source language may be present in the output. The latter are called synthetic structures. Synthetic structures can include methods, fields, parameters, classes and interfaces. One particular kind of synthetic method is a bridge method. It is possible a synthetic structure may not be marked as such. In particular, not all class file versions support marking a parameter as synthetic. A source language compiler generally has multiple ways to translate a source program into a class file representation. The translation may also depend on the version of the class file format being targeted as different
class file versions have different capabilities and features. In some cases the modifiers present in the class file representation may differ from the modifiers on the originating element in the source language, including final on a parameter and protected, private, and static on classes and interfaces.
Besides differences in structural representation between the source language and the JVM representation, core reflection also exposes runtime specific information. For example, the class loaders and protection domains of a Class are runtime concepts without a direct analogue in source code.
See Java Language Specification: 13.1 The Form of a Binary
See Java Virtual Machine Specification: 1.2 The Java Virtual Machine4.7.8 The Synthetic Attribute5.3.1 Loading Using the Bootstrap Class Loader5.3.2 Loading Using a User-defined Class Loader
Since: 1.1
Package
Description
java.lang
Provides classes that are fundamental to the design of the Java programming language.
Class
Description
AccessibleObject
The AccessibleObject class is the base class for Field, Method, and Constructor objects (known as reflected objects).
AnnotatedArrayType
AnnotatedArrayType represents the potentially annotated use of an array type, whose component type may itself represent the annotated use of a type.
AnnotatedElement
Represents an annotated construct of the program currently running in this VM.
AnnotatedParameterizedType
AnnotatedParameterizedType represents the potentially annotated use of a parameterized type, whose type arguments may themselves represent annotated uses of types.
AnnotatedType
AnnotatedType represents the potentially annotated use of a type in the program currently running in this VM.
AnnotatedTypeVariable
AnnotatedTypeVariable represents the potentially annotated use of a type variable, whose declaration may have bounds which themselves represent annotated uses of types.
AnnotatedWildcardType
AnnotatedWildcardType represents the potentially annotated use of a wildcard type argument, whose upper or lower bounds may themselves represent annotated uses of types.
Array
The Array class provides static methods to dynamically create and access Java arrays.
Constructor<T>
Constructor provides information about, and access to, a single constructor for a class.
Executable
A shared superclass for the common functionality of Method and Constructor.
Field
A Field provides information about, and dynamic access to, a single field of a class or an interface.
GenericArrayType
GenericArrayType represents an array type whose component type is either a parameterized type or a type variable.
GenericDeclaration
A common interface for all entities that declare type variables.
GenericSignatureFormatError
Thrown when a syntactically malformed signature attribute is encountered by a reflective method that needs to interpret the generic signature information for a class or interface, method or constructor.
InaccessibleObjectException
Thrown when Java language access checks cannot be suppressed.
InvocationHandler
InvocationHandler is the interface implemented by the invocation handler of a proxy instance.
InvocationTargetException
InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor.
MalformedParameterizedTypeException
Thrown when a semantically malformed parameterized type is encountered by a reflective method that needs to instantiate it.
MalformedParametersException
Thrown when the
java.lang.reflect package attempts to read method parameters from a class file and determines that one or more parameters are malformed.
Member
Member is an interface that reflects identifying information about a single member (a field or a method) or a constructor.
Method
A Method provides information about, and access to, a single method on a class or interface.
Modifier
The Modifier class provides static methods and constants to decode class and member access modifiers.
Parameter
Information about method parameters.
ParameterizedType
ParameterizedType represents a parameterized type such as Collection<String>.
Proxy
Proxy provides static methods for creating objects that act like instances of interfaces but allow for customized method invocation.
RecordComponent
A RecordComponent provides information about, and dynamic access to, a component of a record class.
ReflectPermission
The Permission class for reflective operations.
Type
Type is the common superinterface for all types in the Java programming language.
TypeVariable<D extends GenericDeclaration>
TypeVariable is the common superinterface for type variables of kinds.
UndeclaredThrowableException
Thrown by a method invocation on a proxy instance if its invocation handler's invoke method throws a checked exception (a Throwable that is not assignable to RuntimeException or Error) that is not assignable to any of the exception types declared in the throws clause of the method that was invoked on the proxy instance and dispatched to the invocation handler.
WildcardType
WildcardType represents a wildcard type expression, such as ?, ? extends Number, or ? super Integer.
|
Command reference fish ships with a large number of builtin commands, shellscript functions and external commands. These are all described below. Almost all fish commands respond to the -h or --help options to display their relevant help, also accessible using the help and man commands, like so: echo -h echo --help # Prints help to the terminal window man echo # Displays the man page in the system pager # (normally 'less', 'more' or 'most'). help echo # Open a web browser to show the relevant documentation abbr - manage fish abbreviations Synopsis abbr --add word phrase... abbr --rename word new_word abbr --show abbr --list abbr --erase word Description abbr manipulates the list of abbreviations that fish will expand. Abbreviations are user-defined character sequences or words that are replaced with longer phrases after they are entered. For example, a frequently-run command such as git checkout can be abbreviated to gco. After entering gco and pressing Space or Enter, the full text git checkout will appear in the command line. Abbreviations are stored in a variable named fish_user_abbreviations. This is automatically created as a universal variable the first time an abbreviation is created. If you want your abbreviations to be private to a particular fish session you can put the following in your *~/.config/fish/config.fish* file before you define your first abbrevation: if status --is-interactive set -g fish_user_abbreviations abbr --add first 'echo my first abbreviation' abbr --add second 'echo my second abbreviation' # etcetera end You can create abbreviations directly on the command line and they will be saved automatically and made visible to other fish sessions if fish_user_abbreviations is a universal variable. If you keep the variable as universal, abbr --add statements in config.fish will do nothing but slow down startup slightly. Options The following parameters are available: -a WORD PHRASE or --add WORD PHRASE Adds a new abbreviation, causing WORD to be expanded to PHRASE. -r WORD NEW_WORD or --rename WORD NEW_WORD Renames an abbreviation, from WORD to NEW_WORD. -s or --show Show all abbreviated words and their expanded phrases in a manner suitable for export and import. -l or --list Lists all abbreviated words. -e WORD or --erase WORD Erase the abbreviation WORD. Note: fish version 2.1 supported -a WORD=PHRASE. This syntax is now deprecated but will still be converted. Examples abbr -a gco git checkout Add a new abbreviation where gco will be replaced with git checkout. abbr -r gco gch Renames an existing abbreviation from gco to gch. abbr -e gco Erase the gco abbreviation. ssh another_host abbr -s | source Import the abbreviations defined on another_host over SSH. Back to command index. alias - create a function Synopsis alias alias NAME DEFINITION alias NAME=DEFINITION Description alias is a simple wrapper for the function builtin, which creates a function wrapping a command. It has similar syntax to POSIX shell alias. For other uses, it is recommended to define a function. fish marks functions that have been created by alias by including the command used to create them in the function description. You can list alias-created functions by running alias without arguments. They must be erased using functions -e. NAME is the name of the alias DEFINITION is the actual command to execute. The string $argv will be appended. You cannot create an alias to a function with the same name. Note that spaces need to be escaped in the call to alias just like at the command line, even inside quoted parts. Example The following code will create rmi, which runs rm with additional arguments on every invocation. alias rmi="rm -i" # This is equivalent to entering the following function: function rmi --wraps rm --description 'alias rmi=rm -i' rm -i $argv end # This needs to have the spaces escaped or "Chrome.app..." will be seen as an argument to "/Applications/Google": alias chrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome banana' Back to command index. and - conditionally execute a command Synopsis COMMAND1; and COMMAND2 Description and is used to execute a command if the current exit status (as set by the previous command) is 0. and statements may be used as part of the condition in an if or while block. See the documentation for if and while for examples. and does not change the current exit status. The exit status of the last foreground command to exit can always be accessed using the $status variable. Example The following code runs the make command to build a program. If the build succeeds, make's exit status is 0, and the program is installed. If either step fails, the exit status is 1, and make clean is run, which removes the files created by the build process. make; and make install; or make clean Back to command index. begin - start a new block of code Synopsis begin; [COMMANDS...;] end Description begin is used to create a new block of code. The block is unconditionally executed. begin; ...; end is equivalent to if true; ...; end. begin is used to group a number of commands into a block. This allows the introduction of a new variable scope, redirection of the input or output of a set of commands as a group, or to specify precedence when using the conditional commands like and. begin does not change the current exit status. Example The following code sets a number of variables inside of a block scope. Since the variables are set inside the block and have local scope, they will be automatically deleted when the block ends. begin set -l PIRATE Yarrr ... end echo $PIRATE # This will not output anything, since the PIRATE variable # went out of scope at the end of the block In the following code, all output is redirected to the file out.html. begin echo $xml_header echo $html_header if test -e $file ... end ... end > out.html Back to command index. bg - send jobs to background Synopsis bg [PID...] Description bg sends jobs to the background, resuming them if they are stopped. A background job is executed simultaneously with fish, and does not have access to the keyboard. If no job is specified, the last job to be used is put in the background. If PID is specified, the jobs with the specified process group IDs are put in the background. The PID of the desired process is usually found by using process expansion. Example bg %1 will put the job with job ID 1 in the background. Back to command index. bind - handle fish key bindings Synopsis bind [(-M | --mode) MODE] [(-m | --sets-mode) NEW_MODE] [(-k | --key)] SEQUENCE COMMAND [COMMAND...] bind [(-M | --mode) MODE] [(-k | --key)] SEQUENCE bind (-K | --key-names) [(-a | --all)] bind (-f | --function-names) bind (-e | --erase) [(-M | --mode) MODE] (-a | --all | [(-k | --key)] SEQUENCE [SEQUENCE...]) Description bind adds a binding for the specified key sequence to the specified command. SEQUENCE is the character sequence to bind to. These should be written as fish escape sequences. For example, because pressing the Alt key and another character sends that character prefixed with an escape character, Alt-based key bindings can be written using the \e escape. For example, Alt-w can be written as \ew. The control character can be written in much the same way using the \c escape, for example Control-X (^X) can be written as \cx. Note that Alt-based key bindings are case sensitive and Control-based key bindings are not. This is a constraint of text-based terminals, not fish. The default key binding can be set by specifying a SEQUENCE of the empty string (that is, '' ). It will be used whenever no other binding matches. For most key bindings, it makes sense to use the self-insert function (i.e. bind '' self-insert) as the default keybinding. This will insert any keystrokes not specifically bound to into the editor. Non- printable characters are ignored by the editor, so this will not result in control sequences being printable. If the -k switch is used, the name of the key (such as 'down', 'up' or 'backspace') is used instead of a sequence. The names used are the same as the corresponding curses variables, but without the 'key_' prefix. (See terminfo(5) for more information, or use bind --key-names for a list of all available named keys.) COMMAND can be any fish command, but it can also be one of a set of special input functions. These include functions for moving the cursor, operating on the kill-ring, performing tab completion, etc. Use bind --function-names for a complete list of these input functions. When COMMAND is a shellscript command, it is a good practice to put the actual code into a function and simply bind to the function name. This way it becomes significantly easier to test the function while editing, and the result is usually more readable as well. If such a script produces output, the script needs to finish by calling commandline -f repaint in order to tell fish that a repaint is in order. When multiple COMMANDs are provided, they are all run in the specified order when the key is pressed. If no SEQUENCE is provided, all bindings (or just the bindings in the specified MODE) are printed. If SEQUENCE is provided without COMMAND, just the binding matching that sequence is printed. Key bindings are not saved between sessions by default. Bare bind statements in config.fish won't have any effect because it is sourced before the default keybindings are setup. To save custom keybindings, put the bind statements into a function called fish_user_key_bindings, which will be autoloaded. Key bindings may use "modes", which mimics Vi's modal input behavior. The default mode is "default", and every bind applies to a single mode. The mode can be viewed/changed with the $fish_bind_mode variable. The following parameters are available: -k or --key Specify a key name, such as 'left' or 'backspace' instead of a character sequence -K or --key-names Display a list of available key names. Specifying -a or --all includes keys that don't have a known mapping -f or --function-names Display a list of available input functions -M MODE or --mode MODE Specify a bind mode that the bind is used in. Defaults to "default" -m NEW_MODE or --sets-mode NEW_MODE Change the current mode to NEW_MODE after this binding is executed -e or --erase Erase the binding with the given sequence and mode instead of defining a new one. Multiple sequences can be specified with this flag. Specifying -a or --all with -M or --mode erases all binds in the given mode regardless of sequence. Specifying -a or --all without -M or --mode erases all binds in all modes regardless of sequence. -a or --all See --erase and --key-names The following special input functions are available: accept-autosuggestion, accept the current autosuggestion completely backward-char, moves one character to the left backward-bigword, move one whitespace-delimited word to the left backward-delete-char, deletes one character of input to the left of the cursor backward-kill-bigword, move the whitespace-delimited word to the left of the cursor to the killring backward-kill-line, move everything from the beginning of the line to the cursor to the killring backward-kill-path-component, move one path component to the left of the cursor (everything from the last "/" or whitespace exclusive) to the killring backward-kill-word, move the word to the left of the cursor to the killring backward-word, move one word to the left beginning-of-buffer, moves to the beginning of the buffer, i.e. the start of the first line beginning-of-history, move to the beginning of the history beginning-of-line, move to the beginning of the line begin-selection, start selecting text capitalize-word, make the current word begin with a capital letter complete, guess the remainder of the current token complete-and-search, invoke the searchable pager on completion options (for convenience, this also moves backwards in the completion pager) delete-char, delete one character to the right of the cursor downcase-word, make the current word lowercase end-of-buffer, moves to the end of the buffer, i.e. the end of the first line end-of-history, move to the end of the history end-of-line, move to the end of the line end-selection, end selecting text forward-bigword, move one whitespace-delimited word to the right forward-char, move one character to the right forward-word, move one word to the right history-search-backward, search the history for the previous match history-search-forward, search the history for the next match kill-bigword, move the next whitespace-delimited word to the killring kill-line, move everything from the cursor to the end of the line to the killring kill-selection, move the selected text to the killring kill-whole-line, move the line to the killring kill-word, move the next word to the killring suppress-autosuggestion, remove the current autosuggestion swap-selection-start-stop, go to the other end of the highlighted text without changing the selection transpose-chars, transpose two characters to the left of the cursor transpose-words, transpose two words to the left of the cursor upcase-word, make the current word uppercase yank, insert the latest entry of the killring into the buffer yank-pop, rotate to the previous entry of the killring Examples bind \cd 'exit' Causes fish to exit when Control-D is pressed. bind -k ppage history-search-backward Performs a history search when the Page Up key is pressed. set -g fish_key_bindings fish_vi_key_bindings bind -M insert \cc kill-whole-line force-repaint Turns on Vi key bindings and rebinds Control-C to clear the input line. Special Case: The escape Character The escape key can be used standalone, for example, to switch from insertion mode to normal mode when using Vi keybindings. Escape may also be used as a "meta" key, to indicate the start of an escape sequence, such as function or arrow keys. Custom bindings can also be defined that begin with an escape character. fish waits for a period after receiving the escape character, to determine whether it is standalone or part of an escape sequence. While waiting, additional key presses make the escape key behave as a meta key. If no other key presses come in, it is handled as a standalone escape. The waiting period is set to 300 milliseconds (0.3 seconds) in the default key bindings and 10 milliseconds in the vi key bindings. It can be configured by setting the fish_escape_delay_ms variable to a value between 10 and 5000 ms. It is recommended that this be a universal variable that you set once from an interactive session. Note: fish 2.2.0 and earlier used a default of 10 milliseconds, and provided no way to configure it. That effectively made it impossible to use escape as a meta key. Back to command index. block - temporarily block delivery of events Synopsis block [OPTIONS...] Description block prevents events triggered by fish or the emit command from being delivered and acted upon while the block is in place. In functions, block can be useful while performing work that should not be interrupted by the shell. The block can be removed. Any events which triggered while the block was in place will then be delivered. Event blocks should not be confused with code blocks, which are created with begin, if, while or for The following parameters are available: -l or --local Release the block automatically at the end of the current innermost code block scope -g or --global Never automatically release the lock -e or --erase Release global block Example # Create a function that listens for events function --on-event foo foo; echo 'foo fired'; end # Block the delivery of events block -g emit foo # No output will be produced block -e # 'foo fired' will now be printed Back to command index. break - stop the current inner loop Synopsis LOOP_CONSTRUCT; [COMMANDS...] break; [COMMANDS...] end Description break halts a currently running loop, such as a for loop or a while loop. It is usually added inside of a conditional block such as an if statement or a switch statement. There are no parameters for break. Example The following code searches all .c files for "smurf", and halts at the first occurrence. for i in *.c if grep smurf $i echo Smurfs are present in $i break end end Back to command index. breakpoint - Launch debug mode Synopsis breakpoint Description breakpoint is used to halt a running script and launch an interactive debugging prompt. For more details, see Debugging fish scripts in the fish manual. There are no parameters for breakpoint. Back to command index. builtin - run a builtin command Synopsis builtin BUILTINNAME [OPTIONS...] Description builtin forces the shell to use a builtin command, rather than a function or program. The following parameters are available: -n or --names List the names of all defined builtins Example builtin jobs # executes the jobs builtin, even if a function named jobs exists Back to command index. case - conditionally execute a block of commands Synopsis switch VALUE; [case [WILDCARD...]; [COMMANDS...]; ...] end Description switch performs one of several blocks of commands, depending on whether a specified value equals one of several wildcarded values. case is used together with the switch statement in order to determine which block should be executed. Each case command is given one or more parameters. The first case command with a parameter that matches the string specified in the switch command will be evaluated. case parameters may contain wildcards. These need to be escaped or quoted in order to avoid regular wildcard expansion using filenames. Note that fish does not fall through on case statements. Only the first matching case is executed. Note that command substitutions in a case statement will be evaluated even if its body is not taken. All substitutions, including command substitutions, must be performed before the value can be compared against the parameter. Example If the variable $animal contains the name of an animal, the following code would attempt to classify it: switch $animal case cat echo evil case wolf dog human moose dolphin whale echo mammal case duck goose albatross echo bird case shark trout stingray echo fish # Note that the next case has a wildcard which is quoted case '*' echo I have no idea what a $animal is end If the above code was run with $animal set to whale, the output would be mammal. Back to command index. cd - change directory Synopsis cd [DIRECTORY] Description cd changes the current working directory. If DIRECTORY is supplied, it will become the new directory. If no parameter is given, the contents of the HOME environment variable will be used. If DIRECTORY is a relative path, the paths found in the CDPATH environment variable array will be tried as prefixes for the specified path. Note that the shell will attempt to change directory without requiring cd if the name of a directory is provided (starting with ., / or ~, or ending with /). Fish also ships a wrapper function around the builtin cd that understands cd - as changing to the previous directory. See also prevd. This wrapper function maintains a history of the 25 most recently visited directories in the $dirprev and $dirnext global variables. Examples cd # changes the working directory to your home directory. cd /usr/src/fish-shell # changes the working directory to /usr/src/fish-shell Back to command index. command - run a program Synopsis command [OPTIONS] COMMANDNAME [ARGS...] Description command forces the shell to execute the program COMMANDNAME and ignore any functions or builtins with the same name. The following options are available: -s or --search returns the name of the disk file that would be executed, or nothing if no file with the specified name could be found in the $PATH. With the -s option, command treats every argument as a separate command to look up and sets the exit status to 0 if any of the specified commands were found, or 1 if no commands could be found. Additionally passing a -q or --quiet option prevents any paths from being printed, like the type -q, for testing only the exit status. For basic compatibility with POSIX command, the -v flag is recognized as an alias for -s. Examples command ls causes fish to execute the ls program, even if an ls function exists. command -s ls returns the path to the ls program. Back to command index. commandline - set or get the current command line buffer Synopsis commandline [OPTIONS] [CMD] Description commandline can be used to set or get the current contents of the command line buffer. With no parameters, commandline returns the current value of the command line. With CMD specified, the command line buffer is erased and replaced with the contents of CMD. The following options are available: -C or --cursor set or get the current cursor position, not the contents of the buffer. If no argument is given, the current cursor position is printed, otherwise the argument is interpreted as the new cursor position. -f or --function inject readline functions into the reader. This option cannot be combined with any other option. It will cause any additional arguments to be interpreted as readline functions, and these functions will be injected into the reader, so that they will be returned to the reader before any additional actual key presses are read. The following options change the way commandline updates the command line buffer: -a or --append do not remove the current commandline, append the specified string at the end of it -i or --insert do not remove the current commandline, insert the specified string at the current cursor position -r or --replace remove the current commandline and replace it with the specified string (default) The following options change what part of the commandline is printed or updated: -b or --current-buffer select the entire buffer (default) -j or --current-job select the current job -p or --current-process select the current process -t or --current-token select the current token. The following options change the way commandline prints the current commandline buffer: -c or --cut-at-cursor only print selection up until the current cursor position -o or --tokenize tokenize the selection and print one string-type token per line If commandline is called during a call to complete a given string using complete -C STRING, commandline will consider the specified string to be the current contents of the command line. The following options output metadata about the commandline state: -L or --line print the line that the cursor is on, with the topmost line starting at 1 -S or --search-mode evaluates to true if the commandline is performing a history search -P or --paging-mode evaluates to true if the commandline is showing pager contents, such as tab completions Example commandline -j $history[3] replaces the job under the cursor with the third item from the command line history. If the commandline contains > echo $flounder >&2 | less; and echo $catfish (with the cursor on the "o" of "flounder") Then the following invocations behave like this: > commandline -t $flounder > commandline -ct $fl > commandline -b ## or just commandline echo $flounder >&2 | less; and echo $catfish > commandline -p echo $flounder >&2 > commandline -j echo $flounder >&2 | less Back to command index. complete - edit command specific tab-completions Synopsis complete ( -c | --command | -p | --path ) COMMAND [( -c | --command | -p | --path ) COMMAND]... [( -e | --erase )] [( -s | --short-option ) SHORT_OPTION]... [( -l | --long-option | -o | --old-option ) LONG_OPTION]... [( -a | --arguments ) OPTION_ARGUMENTS] [( -f | --no-files )] [( -r | --require-parameter )] [( -x | --exclusive )] [( -w | --wraps ) WRAPPED_COMMAND]... [( -n | --condition ) CONDITION] [( -d | --description ) DESCRIPTION] complete ( -C[STRING] | --do-complete[=STRING] ) Description For an introduction to specifying completions, see Writing your own completions in the fish manual. COMMAND is the name of the command for which to add a completion. SHORT_OPTION is a one character option for the command. LONG_OPTION is a multi character option for the command. OPTION_ARGUMENTS is parameter containing a space-separated list of possible option-arguments, which may contain command substitutions. DESCRIPTION is a description of what the option and/or option arguments do. -c COMMAND or --command COMMAND specifies that COMMAND is the name of the command. -p COMMAND or --path COMMAND specifies that COMMAND is the absolute path of the program (optionally containing wildcards). -e or --erase deletes the specified completion. -s SHORT_OPTION or --short-option=SHORT_OPTION adds a short option to the completions list. -l LONG_OPTION or --long-option=LONG_OPTION adds a GNU style long option to the completions list. -o LONG_OPTION or --old-option=LONG_OPTION adds an old style long option to the completions list (See below for details). -a OPTION_ARGUMENTS or --arguments=OPTION_ARGUMENTS adds the specified option arguments to the completions list. -f or --no-files specifies that the options specified by this completion may not be followed by a filename. -r or --require-parameter specifies that the options specified by this completion always must have an option argument, i.e. may not be followed by another option. -x or --exclusive implies both -r and -f. -w WRAPPED_COMMAND or --wraps=WRAPPED_COMMAND causes the specified command to inherit completions from the wrapped command (See below for details). -n or --condition specifies a shell command that must return 0 if the completion is to be used. This makes it possible to specify completions that should only be used in some cases. -CSTRING or --do-complete=STRING makes complete try to find all possible completions for the specified string. -C or --do-complete with no argument makes complete try to find all possible completions for the current command line buffer. If the shell is not in interactive mode, an error is returned. -A and --authoritative no longer do anything and are silently ignored. -u and --unauthoritative no longer do anything and are silently ignored. Command specific tab-completions in fish are based on the notion of options and arguments. An option is a parameter which begins with a hyphen, such as '-h', '-help' or '--help'. Arguments are parameters that do not begin with a hyphen. Fish recognizes three styles of options, the same styles as the GNU version of the getopt library. These styles are: Short options, like '-a'. Short options are a single character long, are preceded by a single hyphen and may be grouped together (like '-la', which is equivalent to '-l -a'). Option arguments may be specified in the following parameter ('-w 32') or by appending the option with the value ('-w32'). Old style long options, like '-Wall'. Old style long options can be more than one character long, are preceded by a single hyphen and may not be grouped together. Option arguments are specified in the following parameter ('-ao null'). GNU style long options, like '--colors'. GNU style long options can be more than one character long, are preceded by two hyphens, and may not be grouped together. Option arguments may be specified in the following parameter ('--quoting-style shell') or by appending the option with a '=' and the value ('--quoting-style=shell'). GNU style long options may be abbreviated so long as the abbreviation is unique ('--h') is equivalent to '--help' if help is the only long option beginning with an 'h'). The options for specifying command name and command path may be used multiple times to define the same completions for multiple commands. The options for specifying command switches and wrapped commands may be used multiple times to define multiple completions for the command(s) in a single call. Invoking complete multiple times for the same command adds the new definitions on top of any existing completions defined for the command. When -a or --arguments is specified in conjunction with long, short, or old style options, the specified arguments are only used as completions when attempting to complete an argument for any of the specified options. If -a or --arguments is specified without any long, short, or old style options, the specified arguments are used when completing any argument to the command (except when completing an option argument that was specified with -r or --require-parameter). Command substitutions found in OPTION_ARGUMENTS are not expected to return a space-separated list of arguments. Instead they must return a newline-separated list of arguments, and each argument may optionally have a tab character followed by the argument description. Any description provided in this way overrides a description given with -d or --description. The -w or --wraps options causes the specified command to inherit completions from another command. The inheriting command is said to "wrap" the inherited command. The wrapping command may have its own completions in addition to inherited ones. A command may wrap multiple commands, and wrapping is transitive: if A wraps B, and B wraps C, then A automatically inherits all of C's completions. Wrapping can be removed using the -e or --erase options. Note that wrapping only works for completions specified with -c or --command and are ignored when specifying completions with -p or --path. When erasing completions, it is possible to either erase all completions for a specific command by specifying complete -c COMMAND -e, or by specifying a specific completion option to delete by specifying either a long, short or old style option. Example The short style option -o for the gcc command requires that a file follows it. This can be done using writing: complete -c gcc -s o -r The short style option -d for the grep command requires that one of the strings 'read', 'skip' or 'recurse' is used. This can be specified writing: complete -c grep -s d -x -a "read skip recurse" The su command takes any username as an argument. Usernames are given as the first colon-separated field in the file /etc/passwd. This can be specified as: complete -x -c su -d "Username" -a "(cat /etc/passwd | cut -d : -f 1)" The rpm command has several different modes. If the -e or --erase flag has been specified, rpm should delete one or more packages, in which case several switches related to deleting packages are valid, like the nodeps switch. This can be written as: complete -c rpm -n "__fish_contains_opt -s e erase" -d nodeps "Don't check dependencies" where __fish_contains_opt is a function that checks the command line buffer for the presence of a specified set of options. To implement an alias, use the -w or --wraps option: complete -c hub -w git Now hub inherits all of the completions from git. Note this can also be specified in a function declaration. Back to command index. contains - test if a word is present in a list Synopsis contains [OPTIONS] KEY [VALUES...] Description contains tests whether the set VALUES contains the string KEY. If so, contains exits with status 0; if not, it exits with status 1. The following options are available: -i or --index print the word index Note that, like GNU tools, contains interprets all arguments starting with a - as options to contains, until it reaches an argument that is -- (two dashes). See the examples below. Example for i in ~/bin /usr/local/bin if not contains $i $PATH set PATH $PATH $i end end The above code tests if ~/bin and /usr/local/bin are in the path and adds them if not. function hasargs if contains -- -q $argv echo '$argv contains a -q option' end end The above code checks for -q in the argument list, using the -- argument to demarcate options to contains from the key to search for. Back to command index. continue - skip the remainder of the current iteration of the current inner loop Synopsis LOOP_CONSTRUCT; [COMMANDS...;] continue; [COMMANDS...;] end Description continue skips the remainder of the current iteration of the current inner loop, such as a for loop or a while loop. It is usually added inside of a conditional block such as an if statement or a switch statement. Example The following code removes all tmp files that do not contain the word smurf. for i in *.tmp if grep smurf $i continue end rm $i end Back to command index. count - count the number of elements of an array Synopsis count $VARIABLE Description count prints the number of arguments that were passed to it. This is usually used to find out how many elements an environment variable array contains. count does not accept any options, including -h or --help. count exits with a non-zero exit status if no arguments were passed to it, and with zero if at least one argument was passed. Example count $PATH # Returns the number of directories in the users PATH variable. count *.txt # Returns the number of files in the current working directory ending with the suffix '.txt'. Back to command index. dirh - print directory history Synopsis dirh Description dirh prints the current directory history. The current position in the history is highlighted using the color defined in the fish_color_history_current environment variable. dirh does not accept any parameters. Note that the cd command limits directory history to the 25 most recently visited directories. The history is stored in the $dirprev and $dirnext variables. Back to command index. dirs - print directory stack Synopsis dirs dirs -c Description dirs prints the current directory stack, as created by the pushd command. With "-c", it clears the directory stack instead. dirs does not accept any parameters. Back to command index. echo - display a line of text Synopsis echo [OPTIONS] [STRING] Description echo displays a string of text. The following options are available: -n, Do not output a newline -s, Do not separate arguments with spaces -E, Disable interpretation of backslash escapes (default) -e, Enable interpretation of backslash escapes Escape Sequences If -e is used, the following sequences are recognized: \ backslash \a alert (BEL) \b backspace \c produce no further output \e escape \f form feed \n new line \r carriage return \t horizontal tab \v vertical tab \0NNN byte with octal value NNN (1 to 3 digits) \xHH byte with hexadecimal value HH (1 to 2 digits) Example echo 'Hello World' Print hello world to stdout echo -e 'Top\nBottom' Print Top and Bottom on separate lines, using an escape sequence Back to command index. else - execute command if a condition is not met Synopsis if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end Description if will execute the command CONDITION. If the condition's exit status is 0, the commands COMMANDS_TRUE will execute. If it is not 0 and else is given, COMMANDS_FALSE will be executed. Example The following code tests whether a file foo.txt exists as a regular file. if test -f foo.txt echo foo.txt exists else echo foo.txt does not exist end Back to command index. emit - Emit a generic event Synopsis emit EVENT_NAME [ARGUMENTS...] Description emit emits, or fires, an event. Events are delivered to, or caught by, special functions called event handlers. The arguments are passed to the event handlers as function arguments. Example The following code first defines an event handler for the generic event named 'test_event', and then emits an event of that type. function event_test --on-event test_event echo event test: $argv end emit test_event something Back to command index. end - end a block of commands. Synopsis begin; [COMMANDS...] end if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end while CONDITION; COMMANDS...; end for VARNAME in [VALUES...]; COMMANDS...; end switch VALUE; [case [WILDCARD...]; [COMMANDS...]; ...] end Description end ends a block of commands. For more information, read the documentation for the block constructs, such as if, for and while. The end command does not change the current exit status. Back to command index. eval - evaluate the specified commands Synopsis eval [COMMANDS...] Description eval evaluates the specified parameters as a command. If more than one parameter is specified, all parameters will be joined using a space character as a separator. Example The following code will call the ls command. Note that fish does not support the use of shell variables as direct commands; eval can be used to work around this. set cmd ls eval $cmd Back to command index. exec - execute command in current process Synopsis exec COMMAND [OPTIONS...] Description exec replaces the currently running shell with a new command. On successful completion, exec never returns. exec cannot be used inside a pipeline. Example exec emacs starts up the emacs text editor, and exits fish. When emacs exits, the session will terminate. Back to command index. exit - exit the shell Synopsis exit [STATUS] Description exit causes fish to exit. If STATUS is supplied, it will be converted to an integer and used as the exit code. Otherwise, the exit code will be that of the last command executed. If exit is called while sourcing a file (using the source builtin) the rest of the file will be skipped, but the shell itself will not exit. Back to command index. false - return an unsuccessful result Synopsis false Description false sets the exit status to 1. Back to command index. fg - bring job to foreground Synopsis fg [PID] Description fg brings the specified job to the foreground, resuming it if it is stopped. While a foreground job is executed, fish is suspended. If no job is specified, the last job to be used is put in the foreground. If PID is specified, the job with the specified group ID is put in the foreground. The PID of the desired process is usually found by using process expansion. Fish is capable of expanding far more than just the numeric PID, including referencing itself and finding PIDs by name. Example fg %1 will put the job with job ID 1 in the foreground. Back to command index. fish - the friendly interactive shell Synopsis fish [OPTIONS] [-c command] [FILE [ARGUMENTS...]] Description fish is a command-line shell written mainly with interactive use in mind. The full manual is available in HTML by using the help command from inside fish. The following options are available: -c or --command=COMMANDS evaluate the specified commands instead of reading from the commandline -d or --debug-level=DEBUG_LEVEL specify the verbosity level of fish. A higher number means higher verbosity. The default level is 1. -i or --interactive specify that fish is to run in interactive mode -l or --login specify that fish is to run as a login shell -n or --no-execute do not execute any commands, only perform syntax checking -p or --profile=PROFILE_FILE when fish exits, output timing information on all executed commands to the specified file -v or --version display version and exit -D or --debug-stack-frames=DEBUG_LEVEL specify how many stack frames to display when debug messages are written. The default is zero. A value of 3 or 4 is usually sufficient to gain insight into how a given debug call was reached but you can specify a value up to 128. The fish exit status is generally the exit status of the last foreground command. If fish is exiting because of a parse error, the exit status is 127. Back to command index. fish_config - start the web-based configuration interface Description fish_config starts the web-based configuration interface. The web interface allows you to view your functions, variables and history, and to make changes to your prompt and color configuration. fish_config starts a local web server and then opens a web browser window; when you have finished, close the browser window and then press the Enter key to terminate the configuration session. fish_config optionally accepts name of the initial configuration tab. For e.g. fish_config history will start configuration interface with history tab. If the BROWSER environment variable is set, it will be used as the name of the web browser to open instead of the system default. Example fish_config opens a new web browser window and allows you to configure certain fish settings. Back to command index. fish_indent - indenter and prettifier Synopsis fish_indent [OPTIONS] Description fish_indent is used to indent a piece of fish code. fish_indent reads commands from standard input and outputs them to standard output or a specified file. The following options are available: -w or --write indents a specified file and immediately writes to that file. -i or --no-indent do not indent commands; only reformat to one job per line. -v or --version displays the current fish version and then exits. --ansi colorizes the output using ANSI escape sequences, appropriate for the current $TERM, using the colors defined in the environment (such as $fish_color_command). --html outputs HTML, which supports syntax highlighting if the appropriate CSS is defined. The CSS class names are the same as the variable names, such as fish_color_command. -d or --debug-level=DEBUG_LEVEL enables debug output and specifies a verbosity level (like fish -d). Defaults to 0. -D or --debug-stack-frames=DEBUG_LEVEL specify how many stack frames to display when debug messages are written. The default is zero. A value of 3 or 4 is usually sufficient to gain insight into how a given debug call was reached but you can specify a value up to 128. --dump-parse-tree dumps information about the parsed statements to stderr. This is likely to be of interest only to people working on the fish source code. Back to command index. fish_key_reader - explore what characters keyboard keys send Synopsis fish_key_reader [OPTIONS] Description fish_key_reader is used to study input received from the terminal and can help with key binds. The program is interactive and works on standard input. Individual characters themselves and their hexadecimal values are displayed. The tool will write an example bind command matching the character sequence captured to stdout. If the character sequence matches a special key name (see bind --key-names), both bind CHARS ... and bind -k KEYNAME ... usage will be shown. Additional details about the characters received, such as the delay between chars, are written to stderr. The following options are available: -c or --continuous begins a session where multiple key sequences can be inspected. By default the program exits after capturing a single key sequence. -d or --debug-level=DEBUG_LEVEL enables debug output and specifies a verbosity level (like fish -d). Defaults to 0. -D or --debug-stack-frames=DEBUG_LEVEL specify how many stack frames to display when debug messages are written. The default is zero. A value of 3 or 4 is usually sufficient to gain insight into how a given debug call was reached but you can specify a value up to 128. -h or --help prints usage information. Usage Notes The delay in milliseconds since the previous character was received is included in the diagnostic information written to stderr. This information may be useful to determine the optimal fish_escape_delay_ms setting or learn the amount of lag introduced by tools like ssh, mosh or tmux. fish_key_reader intentionally disables handling of many signals. To terminate fish_key_reader in --continuous mode do: press Ctrl-C twice, or press Ctrl-D twice, or type exit, or type quit Back to command index. fish_mode_prompt - define the appearance of the mode indicator Synopsis fish_mode_prompt will output the mode indicator for use in vi-mode. Description The output of fish_mode_prompt will be displayed in the mode indicator position to the left of the regular prompt. Multiple lines are not supported in fish_mode_prompt. Back to command index. fish_prompt - define the appearance of the command line prompt Synopsis function fish_prompt ... end Description By defining the fish_prompt function, the user can choose a custom prompt. The fish_prompt function is executed when the prompt is to be shown, and the output is used as a prompt. The exit status of commands within fish_prompt will not modify the value of $status outside of the fish_prompt function. fish ships with a number of example prompts that can be chosen with the fish_config command. Example A simple prompt: function fish_prompt -d "Write out the prompt" printf '%s@%s%s%s%s> ' (whoami) (hostname | cut -d . -f 1) \ (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) end Back to command index. fish_right_prompt - define the appearance of the right-side command line prompt Synopsis function fish_right_prompt ... end Description fish_right_prompt is similar to fish_prompt, except that it appears on the right side of the terminal window. Multiple lines are not supported in fish_right_prompt. Example A simple right prompt: function fish_right_prompt -d "Write out the right prompt" date '+%m/%d/%y' end Back to command index. fish_update_completions - Update completions using manual pages Description fish_update_completions parses manual pages installed on the system, and attempts to create completion files in the fish configuration directory. This does not overwrite custom completions. There are no parameters for fish_update_completions. Back to command index. fish_vi_mode - Enable vi mode Synopsis fish_vi_mode Description This function is deprecated. Please call fish_vi_key_bindings directly fish_vi_mode enters a vi-like command editing mode. To always start in vi mode, add fish_vi_mode to your config.fish file. Back to command index. for - perform a set of commands multiple times. Synopsis for VARNAME in [VALUES...]; COMMANDS...; end Description for is a loop construct. It will perform the commands specified by COMMANDS multiple times. On each iteration, the local variable specified by VARNAME is assigned a new value from VALUES. If VALUES is empty, COMMANDS will not be [email protected]. Example for i in foo bar baz; echo $i; end # would output: foo bar baz Back to command index. funced - edit a function interactively Synopsis funced [OPTIONS] NAME Description funced provides an interface to edit the definition of the function NAME. If the $VISUAL environment variable is set, it will be used as the program to edit the function. If $VISUAL is unset but $EDITOR is set, that will be used. Otherwise, a built-in editor will be used. If there is no function called NAME a new function will be created with the specified name -e command or --editor command Open the function body inside the text editor given by the command (for example, "vi"). The command 'fish' will use the built-in editor. -i or --interactive Open function body in the built-in editor. Back to command index. funcsave - save the definition of a function to the user's autoload directory Synopsis funcsave FUNCTION_NAME Description funcsave saves the current definition of a function to a file in the fish configuration directory. This function will be automatically loaded by current and future fish sessions. This can be useful if you have interactively created a new function and wish to save it for later use. Note that because fish loads functions on-demand, saved functions will not function as event handlers until they are run or sourced otherwise. To activate an event handler for every new shell, add the function to your shell initialization file instead of using funcsave. Back to command index. function - create a function Synopsis function NAME [OPTIONS]; BODY; end Description function creates a new function NAME with the body BODY. A function is a list of commands that will be executed when the name of the function is given as a command. The following options are available: -a NAMES or --argument-names NAMES assigns the value of successive command-line arguments to the names given in NAMES. -d DESCRIPTION or --description=DESCRIPTION is a description of what the function does, suitable as a completion description. -w WRAPPED_COMMAND or --wraps=WRAPPED_COMMAND causes the function to inherit completions from the given wrapped command. See the documentation for complete for more information. -e or --on-event EVENT_NAME tells fish to run this function when the specified named event is emitted. Fish internally generates named events e.g. when showing the prompt. -v or --on-variable VARIABLE_NAME tells fish to run this function when the variable VARIABLE_NAME changes value. -j PGID or --on-job-exit PGID tells fish to run this function when the job with group ID PGID exits. Instead of PGID, the string 'caller' can be specified. This is only legal when in a command substitution, and will result in the handler being triggered by the exit of the job which created this command substitution. -p PID or --on-process-exit PID tells fish to run this function when the fish child process with process ID PID exits. -s or --on-signal SIGSPEC tells fish to run this function when the signal SIGSPEC is delivered. SIGSPEC can be a signal number, or the signal name, such as SIGHUP (or just HUP). -S or --no-scope-shadowing allows the function to access the variables of calling functions. Normally, any variables inside the function that have the same name as variables from the calling function are "shadowed", and their contents is independent of the calling function. -V or --inherit-variable NAME snapshots the value of the variable NAME and defines a local variable with that same name and value when the function is defined. This is similar to a closure in other languages like Python but a bit different. Note the word "snapshot" in the first sentence. If you change the value of the variable after defining the function, even if you do so in the same scope (typically another function) the new value will not be used by the function you just created using this option. See the function notify example below for how this might be used. If the user enters any additional arguments after the function, they are inserted into the environment variable array $argv. If the --argument-names option is provided, the arguments are also assigned to names specified in that option. By using one of the event handler switches, a function can be made to run automatically at specific events. The user may generate new events using the emit builtin. Fish generates the following named events: fish_prompt, which is emitted whenever a new fish prompt is about to be displayed. fish_command_not_found, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.