text
stringlengths
0
13M
Views Views are stored queries that act as a virtual table. Title Description Creating & Using Views A tutorial on creating and using views. CREATE VIEW Create or replace a view. ALTER VIEW Change a view definition. DROP VIEW Removes one or more views. SHOW CREATE VIEW Show the CREATE VIEW statement that created a view. Inserting and Updating with Views Views can be used for inserting or updating with certain limitations. RENAME TABLE Change a table's name. View Algorithms Optional ALGORITHM clause when creating views Information Schema VIEWS Table Information about views. SHOW TABLES List of non-temporary tables, views or sequences. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
Package scala.collection package collection Source package.scala Linear Supertypes AnyRef, Any Package Members package concurrent package convert package generic package immutable package mutable Type Members abstract class AbstractIndexedSeqView[+A] extends AbstractSeqView[A] with IndexedSeqView[A] Explicit instantiation of the IndexedSeqView trait to reduce class file size in subclasses. Annotations @SerialVersionUID() abstract class AbstractIterable[+A] extends Iterable[A] abstract class AbstractIterator[+A] extends Iterator[A] abstract class AbstractMap[K, +V] extends AbstractIterable[(K, V)] with Map[K, V] Explicit instantiation of the Map trait to reduce class file size in subclasses. Annotations @SerialVersionUID() abstract class AbstractMapView[K, +V] extends AbstractView[(K, V)] with MapView[K, V] Explicit instantiation of the MapView trait to reduce class file size in subclasses. Annotations @SerialVersionUID() abstract class AbstractSeq[+A] extends AbstractIterable[A] with Seq[A] Explicit instantiation of the Seq trait to reduce class file size in subclasses. Annotations @SerialVersionUID() abstract class AbstractSeqView[+A] extends AbstractView[A] with SeqView[A] Explicit instantiation of the SeqView trait to reduce class file size in subclasses. Annotations @SerialVersionUID() abstract class AbstractSet[A] extends AbstractIterable[A] with Set[A] Explicit instantiation of the Set trait to reduce class file size in subclasses. Annotations @SerialVersionUID() abstract class AbstractView[+A] extends AbstractIterable[A] with View[A] Explicit instantiation of the View trait to reduce class file size in subclasses. Annotations @SerialVersionUID() trait AnyStepper[+A] extends Stepper[A] A Stepper for arbitrary element types. See Stepper. final class ArrayOps[A] extends AnyVal This class serves as a wrapper for Arrays with many of the operations found in indexed sequences. Where needed, instances of arrays are implicitly converted into this class. There is generally no reason to create an instance explicitly or use an ArrayOps type. It is better to work with plain Array types instead and rely on the implicit conversion to ArrayOps when calling a method (which does not actually allocate an instance of ArrayOps because it is a value class). Neither Array nor ArrayOps are proper collection types (i.e. they do not extend Iterable or even IterableOnce). mutable.ArraySeq and immutable.ArraySeq serve this purpose. The difference between this class and ArraySeqs is that calling transformer methods such as filter and map will yield an array, whereas an ArraySeq will remain an ArraySeq. A type of the elements contained in this array. Since 2.8 trait BitSet extends SortedSet[Int] with BitSetOps[BitSet] Base type of bitsets. This trait provides most of the operations of a BitSet independently of its representation. It is inherited by all concrete implementations of bitsets. trait BitSetOps[+C <: BitSet with BitSetOps[C]] extends SortedSetOps[Int, SortedSet, C] trait BufferedIterator[+A] extends Iterator[A] Buffered iterators are iterators which provide a method head that inspects the next element without discarding it. Since 2.8 trait BuildFrom[-From, -A, +C] extends Any Builds a collection of type C from elements of type A when a source collection of type From is available. Implicit instances of BuildFrom are available for all collection types. From Type of source collection A Type of elements (e.g. Int, Boolean, etc.) C Type of collection (e.g. List[Int], TreeMap[Int, String], etc.) Annotations @implicitNotFound("Cannot construct a collection of type ${C} with elements of type ${A} based on a collection of type ${From}.") trait BuildFromLowPriority1 extends BuildFromLowPriority2 trait BuildFromLowPriority2 extends AnyRef trait ClassTagIterableFactory[+CC[_]] extends EvidenceIterableFactory[CC, ClassTag] Base trait for companion objects of collections that require an implicit ClassTag. CC Collection type constructor (e.g. ArraySeq) trait ClassTagSeqFactory[+CC[A] <: SeqOps[A, Seq, Seq[A]]] extends ClassTagIterableFactory[CC] CC Collection type constructor (e.g. ArraySeq) trait DoubleStepper extends Stepper[Double] A Stepper for Doubles. See Stepper. trait EvidenceIterableFactory[+CC[_], Ev[_]] extends Serializable Base trait for companion objects of collections that require an implicit evidence. CC Collection type constructor (e.g. ArraySeq) Ev Unary type constructor for the implicit evidence required for an element type (typically Ordering or ClassTag) trait EvidenceIterableFactoryDefaults[+A, +CC[x] <: IterableOps[x, CC, CC[x]], Ev[_]] extends IterableOps[A, CC, CC[A]] This trait provides default implementations for the factory methods fromSpecific and newSpecificBuilder that need to be refined when implementing a collection type that refines the CC and C type parameters. It is used for collections that have an additional constraint, expressed by the evidenceIterableFactory method. The default implementations in this trait can be used in the common case when CC[A] is the same as C. trait Factory[-A, +C] extends Any A factory that builds a collection of type C with elements of type A. This is a general form of any factory (IterableFactory, SortedIterableFactory, MapFactory and SortedMapFactory) whose element type is fixed. A Type of elements (e.g. Int, Boolean, etc.) C Type of collection (e.g. List[Int], TreeMap[Int, String], etc.) trait IndexedSeq[+A] extends Seq[A] with IndexedSeqOps[A, IndexedSeq, IndexedSeq[A]] with IterableFactoryDefaults[A, IndexedSeq] trait IndexedSeqOps[+A, +CC[_], +C] extends SeqOps[A, CC, C] trait IndexedSeqView[+A] extends IndexedSeqOps[A, View, View[A]] with SeqView[A] trait IntStepper extends Stepper[Int] A Stepper for Ints. See Stepper. trait Iterable[+A] extends IterableOnce[A] with IterableOps[A, Iterable, Iterable[A]] with IterableFactoryDefaults[A, Iterable] Base trait for generic collections. A the element type of the collection trait IterableFactory[+CC[_]] extends Serializable Base trait for companion objects of unconstrained collection types that may require multiple traversals of a source collection to build a target collection CC. CC Collection type constructor (e.g. List) trait IterableFactoryDefaults[+A, +CC[x] <: IterableOps[x, CC, CC[x]]] extends IterableOps[A, CC, CC[A]] This trait provides default implementations for the factory methods fromSpecific and newSpecificBuilder that need to be refined when implementing a collection type that refines the CC and C type parameters. The default implementations in this trait can be used in the common case when CC[A] is the same as C. trait IterableOnce[+A] extends Any A template trait for collections which can be traversed either once only or one or more times. Note: IterableOnce does not extend IterableOnceOps. This is different than the general design of the collections library, which uses the following pattern: trait Seq extends Iterable with SeqOps trait SeqOps extends IterableOps trait IndexedSeq extends Seq with IndexedSeqOps trait IndexedSeqOps extends SeqOps The goal is to provide a minimal interface without any sequential operations. This allows third-party extension like Scala parallel collections to integrate at the level of IterableOnce without inheriting unwanted implementations. final class IterableOnceExtensionMethods[A] extends AnyVal trait IterableOnceOps[+A, +CC[_], +C] extends Any This implementation trait can be mixed into an IterableOnce to get the basic methods that are shared between Iterator and Iterable. The IterableOnce must support multiple calls to iterator but may or may not return the same Iterator every time. trait IterableOps[+A, +CC[_], +C] extends IterableOnce[A] with IterableOnceOps[A, CC, C] Base trait for Iterable operations VarianceNote We require that for all child classes of Iterable the variance of the child class and the variance of the C parameter passed to IterableOps are the same. We cannot express this since we lack variance polymorphism. That's why we have to resort at some places to write C[A @uncheckedVariance]. CC type constructor of the collection (e.g. List, Set). Operations returning a collection with a different type of element B (e.g. map) return a CC[B]. C type of the collection (e.g. List[Int], String, BitSet). Operations returning a collection with the same type of element (e.g. drop, filter) return a C. trait Iterator[+A] extends IterableOnce[A] with IterableOnceOps[A, Iterator, Iterator[A]] Iterators are data structures that allow to iterate over a sequence of elements. They have a hasNext method for checking if there is a next element available, and a next method which returns the next element and advances the iterator. An iterator is mutable: most operations on it change its state. While it is often used to iterate through the elements of a collection, it can also be used without being backed by any collection (see constructors on the companion object). It is of particular importance to note that, unless stated otherwise, one should never use an iterator after calling a method on it. The two most important exceptions are also the sole abstract methods: next and hasNext. Both these methods can be called any number of times without having to discard the iterator. Note that even hasNext may cause mutation -- such as when iterating from an input stream, where it will block until the stream is closed or some input becomes available. Consider this example for safe and unsafe use: def f[A](it: Iterator[A]) = { if (it.hasNext) { // Safe to reuse "it" after "hasNext" it.next // Safe to reuse "it" after "next" val remainder = it.drop(2) // it is *not* safe to use "it" again after this line! remainder.take(2) // it is *not* safe to use "remainder" after this line! } else it } final class LazyZip2[+El1, +El2, C1] extends AnyRef final class LazyZip3[+El1, +El2, +El3, C1] extends AnyRef final class LazyZip4[+El1, +El2, +El3, +El4, C1] extends AnyRef trait LinearSeq[+A] extends Seq[A] with LinearSeqOps[A, LinearSeq, LinearSeq[A]] with IterableFactoryDefaults[A, LinearSeq] Base trait for linearly accessed sequences that have efficient head and tail operations. Known subclasses: List, LazyList trait LinearSeqOps[+A, +CC[X] <: LinearSeq[X], +C <: LinearSeq[A] with LinearSeqOps[A, CC, C]] extends SeqOps[A, CC, C] trait LongStepper extends Stepper[Long] A Stepper for Longs. See Stepper. trait Map[K, +V] extends Iterable[(K, V)] with MapOps[K, V, Map, Map[K, V]] with MapFactoryDefaults[K, V, Map, Iterable] with Equals trait MapFactory[+CC[_, _]] extends Serializable trait MapFactoryDefaults[K, +V, +CC[x, y] <: IterableOps[(x, y), Iterable, Iterable[(x, y)]], +WithFilterCC[x] <: IterableOps[x, WithFilterCC, WithFilterCC[x]] with Iterable[x]] extends MapOps[K, V, CC, CC[K, V]] with IterableOps[(K, V), WithFilterCC, CC[K, V]] This trait provides default implementations for the factory methods fromSpecific and newSpecificBuilder that need to be refined when implementing a collection type that refines the CC and C type parameters. It is used for maps. Note that in maps, the CC type of the map is not the same as the CC type for the underlying iterable (which is fixed to Map in MapOps). This trait has therefore two type parameters CC and WithFilterCC. The withFilter method inherited from IterableOps is overridden with a compatible default implementation. The default implementations in this trait can be used in the common case when CC[A] is the same as C. trait MapOps[K, +V, +CC[_, _] <: IterableOps[_, collection.AnyConstr, _], +C] extends IterableOps[(K, V), Iterable, C] with PartialFunction[K, V] Base Map implementation type K Type of keys V Type of values CC type constructor of the map (e.g. HashMap). Operations returning a collection with a different type of entries (L, W) (e.g. map) return a CC[L, W]. C type of the map (e.g. HashMap[Int, String]). Operations returning a collection with the same type of element (e.g. drop, filter) return a C. trait MapView[K, +V] extends MapOps[K, V, [X, Y]View[(X, Y)], View[(K, V)]] with View[(K, V)] trait MapViewFactory extends MapFactory[[X, Y]View[(X, Y)]] trait Seq[+A] extends Iterable[A] with PartialFunction[Int, A] with SeqOps[A, Seq, Seq[A]] with IterableFactoryDefaults[A, Seq] with Equals Base trait for sequence collections A the element type of the collection trait SeqFactory[+CC[A] <: SeqOps[A, Seq, Seq[A]]] extends IterableFactory[CC] CC Collection type constructor (e.g. List) trait SeqMap[K, +V] extends Map[K, V] with MapOps[K, V, SeqMap, SeqMap[K, V]] with MapFactoryDefaults[K, V, SeqMap, Iterable] A generic trait for ordered maps. Concrete classes have to provide functionality for the abstract methods in SeqMap. Note that when checking for equality SeqMap does not take into account ordering. K the type of the keys contained in this linked map. V the type of the values associated with the keys in this linked map. Version 2.13 Since 2.13 trait SeqOps[+A, +CC[_], +C] extends IterableOps[A, CC, C] Base trait for Seq operations A the element type of the collection CC type constructor of the collection (e.g. List, Set). Operations returning a collection with a different type of element B (e.g. map) return a CC[B]. C type of the collection (e.g. List[Int], String, BitSet). Operations returning a collection with the same type of element (e.g. drop, filter) return a C. trait SeqView[+A] extends SeqOps[A, View, View[A]] with View[A] trait Set[A] extends Iterable[A] with SetOps[A, Set, Set[A]] with Equals with IterableFactoryDefaults[A, Set] trait SetOps[A, +CC[_], +C <: SetOps[A, CC, C]] extends IterableOps[A, CC, C] with (A) => Boolean trait SortedIterableFactory[+CC[_]] extends EvidenceIterableFactory[CC, Ordering] Base trait for companion objects of collections that require an implicit Ordering. CC Collection type constructor (e.g. SortedSet) trait SortedMap[K, +V] extends Map[K, V] with SortedMapOps[K, V, SortedMap, SortedMap[K, V]] with SortedMapFactoryDefaults[K, V, SortedMap, Iterable, Map] trait SortedMapFactory[+CC[_, _]] extends Serializable trait SortedMapFactoryDefaults[K, +V, +CC[x, y] <: Map[x, y] with SortedMapOps[x, y, CC, CC[x, y]] with UnsortedCC[x, y], +WithFilterCC[x] <: IterableOps[x, WithFilterCC, WithFilterCC[x]] with Iterable[x], +UnsortedCC[x, y] <: Map[x, y]] extends SortedMapOps[K, V, CC, CC[K, V]] with MapOps[K, V, UnsortedCC, CC[K, V]] This trait provides default implementations for the factory methods fromSpecific and newSpecificBuilder that need to be refined when implementing a collection type that refines the CC and C type parameters. It is used for sorted maps. Note that in sorted maps, the CC type of the map is not the same as the CC type for the underlying map (which is fixed to Map in SortedMapOps). This trait has therefore three type parameters CC, WithFilterCC and UnsortedCC. The withFilter method inherited from IterableOps is overridden with a compatible default implementation. The default implementations in this trait can be used in the common case when CC[A] is the same as C. trait SortedMapOps[K, +V, +CC[X, Y] <: Map[X, Y] with SortedMapOps[X, Y, CC, _], +C <: SortedMapOps[K, V, CC, C]] extends MapOps[K, V, Map, C] with SortedOps[K, C] trait SortedOps[A, +C] extends AnyRef trait SortedSet[A] extends Set[A] with SortedSetOps[A, SortedSet, SortedSet[A]] with SortedSetFactoryDefaults[A, SortedSet, Set] trait SortedSetFactoryDefaults[+A, +CC[X] <: SortedSet[X] with SortedSetOps[X, CC, CC[X]], +WithFilterCC[x] <: IterableOps[x, WithFilterCC, WithFilterCC[x]] with Set[x]] extends SortedSetOps[A, CC, CC[A]] This trait provides default implementations for the factory methods fromSpecific and newSpecificBuilder that need to be refined when implementing a collection type that refines the CC and C type parameters. It is used for sorted sets. Note that in sorted sets, the CC type of the set is not the same as the CC type for the underlying iterable (which is fixed to Set in SortedSetOps). This trait has therefore two type parameters CC and WithFilterCC. The withFilter method inherited from IterableOps is overridden with a compatible default implementation. The default implementations in this trait can be used in the common case when CC[A] is the same as C. trait SortedSetOps[A, +CC[X] <: SortedSet[X], +C <: SortedSetOps[A, CC, C]] extends SetOps[A, Set, C] with SortedOps[A, C] trait SpecificIterableFactory[-A, +C] extends Factory[A, C] A Type of elements (e.g. Int, Boolean, etc.) C Type of collection (e.g. List[Int], TreeMap[Int, String], etc.) trait Stepper[+A] extends AnyRef Steppers exist to enable creating Java streams over Scala collections, see scala.jdk.StreamConverters. Besides that use case, they allow iterating over collections holding unboxed primitives (e.g., Array[Int]) without boxing the elements. Steppers have an iterator-like interface with methods hasStep and nextStep(). The difference to iterators - and the reason Stepper is not a subtype of Iterator - is that there are hand-specialized variants of Stepper for Int, Long and Double (IntStepper, etc.). These enable iterating over collections holding unboxed primitives (e.g., Arrays, scala.jdk.Accumulators) without boxing the elements. The selection of primitive types (Int, Long and Double) matches the hand-specialized variants of Java Streams (java.util.stream.Stream, java.util.stream.IntStream, etc.) and the corresponding Java Spliterators (Spliterator, Spliterator.OfInt, etc.). Steppers can be converted to Scala Iterators, Java Iterators and Java Spliterators. Primitive Steppers are converted to the corresponding primitive Java Iterators and Spliterators. A the element type of the Stepper sealed trait StepperShape[-T, S <: Stepper[_]] extends AnyRef trait StepperShapeLowPriority1 extends StepperShapeLowPriority2 trait StepperShapeLowPriority2 extends AnyRef trait StrictOptimizedClassTagSeqFactory[+CC[A] <: SeqOps[A, Seq, Seq[A]]] extends ClassTagSeqFactory[CC] trait StrictOptimizedIterableOps[+A, +CC[_], +C] extends IterableOps[A, CC, C] Trait that overrides iterable operations to take advantage of strict builders. A Elements type CC Collection type constructor C Collection type trait StrictOptimizedLinearSeqOps[+A, +CC[X] <: LinearSeq[X], +C <: LinearSeq[A] with StrictOptimizedLinearSeqOps[A, CC, C]] extends LinearSeqOps[A, CC, C] with StrictOptimizedSeqOps[A, CC, C] trait StrictOptimizedMapOps[K, +V, +CC[_, _] <: IterableOps[_, collection.AnyConstr, _], +C] extends MapOps[K, V, CC, C] with StrictOptimizedIterableOps[(K, V), Iterable, C] Trait that overrides map operations to take advantage of strict builders. K Type of keys V Type of values CC Collection type constructor C Collection type trait StrictOptimizedSeqFactory[+CC[A] <: SeqOps[A, Seq, Seq[A]]] extends SeqFactory[CC] trait StrictOptimizedSeqOps[+A, +CC[_], +C] extends SeqOps[A, CC, C] with StrictOptimizedIterableOps[A, CC, C] trait StrictOptimizedSetOps[A, +CC[_], +C <: SetOps[A, CC, C]] extends SetOps[A, CC, C] with StrictOptimizedIterableOps[A, CC, C] Trait that overrides set operations to take advantage of strict builders. A Elements type CC Collection type constructor C Collection type trait StrictOptimizedSortedMapOps[K, +V, +CC[X, Y] <: Map[X, Y] with SortedMapOps[X, Y, CC, _], +C <: SortedMapOps[K, V, CC, C]] extends SortedMapOps[K, V, CC, C] with StrictOptimizedMapOps[K, V, Map, C] Trait that overrides sorted map operations to take advantage of strict builders. K Type of keys V Type of values CC Collection type constructor C Collection type trait StrictOptimizedSortedSetOps[A, +CC[X] <: SortedSet[X], +C <: SortedSetOps[A, CC, C]] extends SortedSetOps[A, CC, C] with StrictOptimizedSetOps[A, Set, C] Trait that overrides sorted set operations to take advantage of strict builders. A Elements type CC Collection type constructor C Collection type final class StringOps extends AnyVal final case class StringView(s: String) extends AbstractIndexedSeqView[Char] with Product with Serializable trait View[+A] extends Iterable[A] with IterableOps[A, View, View[A]] with IterableFactoryDefaults[A, View] with Serializable Views are collections whose transformation operations are non strict: the resulting elements are evaluated only when the view is effectively traversed (e.g. using foreach or foldLeft), or when the view is converted to a strict collection type (using the to operation). abstract class WithFilter[+A, +CC[_]] extends Serializable A template trait that contains just the map, flatMap, foreach and withFilter methods of trait Iterable. A Element type (e.g. Int) CC Collection type constructor (e.g. List) Annotations @SerialVersionUID() Value Members object +: object :+ object AnyStepper object ArrayOps object BitSet extends SpecificIterableFactory[Int, BitSet] Annotations @SerialVersionUID() object BitSetOps object BuildFrom extends BuildFromLowPriority1 object ClassTagIterableFactory extends java.io.Serializable object ClassTagSeqFactory extends java.io.Serializable object DoubleStepper object EvidenceIterableFactory extends java.io.Serializable object Factory object Hashing Attributes protected object IndexedSeq extends Delegate[IndexedSeq] Annotations @SerialVersionUID() object IndexedSeqView extends java.io.Serializable object IntStepper object Iterable extends Delegate[Iterable] Annotations @SerialVersionUID() object IterableFactory extends java.io.Serializable object IterableOnce object IterableOps object Iterator extends IterableFactory[Iterator] Annotations @SerialVersionUID() object LazyZip2 object LazyZip3 object LazyZip4 object LinearSeq extends Delegate[LinearSeq] Annotations @SerialVersionUID() object LongStepper object Map extends Delegate[Map] This object provides a set of operations to create Map values. Annotations @SerialVersionUID() object MapFactory extends java.io.Serializable object MapOps object MapView extends MapViewFactory object Searching object Seq extends Delegate[Seq] This object provides a set of operations to create Seq values. Annotations @SerialVersionUID() object SeqFactory extends java.io.Serializable object SeqMap extends Delegate[collection.immutable.SeqMap] object SeqOps object SeqView extends java.io.Serializable object Set extends Delegate[Set] This object provides a set of operations to create Set values. Annotations @SerialVersionUID() object SortedIterableFactory extends java.io.Serializable object SortedMap extends Delegate[SortedMap] Annotations @SerialVersionUID() object SortedMapFactory extends java.io.Serializable object SortedMapOps object SortedSet extends Delegate[SortedSet] Annotations @SerialVersionUID() object SortedSetOps object Stepper object StepperShape extends StepperShapeLowPriority1 object StringOps object View extends IterableFactory[View] This object reifies operations on views as case classes Annotations @SerialVersionUID()
RouteQuery QML Type The RouteQuery type is used to provide query parameters to a RouteModel. More... Import Statement: import QtLocation 5.14 Since: QtLocation 5.5 List of all members, including inherited members Properties departureTime : date excludedAreas : list<georectangle> extraParameters : VariantMap featureTypes : QList<FeatureType> maneuverDetail : enumeration numberAlternativeRoutes : int routeOptimizations : enumeration segmentDetail : enumeration travelModes : enumeration waypoints : list<coordinate> Methods void addExcludedArea(area) void addWaypoint(coordinate) void clearExcludedAreas() void clearWaypoints() FeatureWeight featureWeight(featureType) void removeExcludedArea(area) void removeWaypoint(coordinate) void resetFeatureWeights() void setFeatureWeight(feature, FeatureWeight weight) list<Waypoint> waypointObjects() Detailed Description A RouteQuery is used to pack all the parameters necessary to make a request to a routing service, which can then populate the contents of a RouteModel. These parameters describe key details of the route, such as waypoints to pass through, excludedAreas to avoid, the travelModes in use, as well as detailed preferences on how to optimize the route and what features to prefer or avoid along the path (such as toll roads, highways, etc). RouteQuery objects are used exclusively to fill out the value of a RouteModel's query property, which can then begin the retrieval process to populate the model. Some plugins might allow or require specific parameters to operate. In order to specify these plugin-specific parameters, MapParameter elements can be nested inside a RouteQuery. Example Usage The following snipped shows an incomplete example of creating a RouteQuery object and setting it as the value of a RouteModel's query property. RouteQuery { id: aQuery } RouteModel { query: aQuery autoUpdate: false } For a more complete example, see the documentation for the RouteModel type, and the Mapviewer example. See also RouteModel. Property Documentation departureTime : date The departure time to be used when querying for the route. The default value is an invalid date, meaning no departure time will be used in the query. This property was introduced in Qt 5.13. excludedAreas : list<georectangle> Areas that the route must not cross. Excluded areas can be set as part of the RouteQuery type declaration or dynamically with the functions provided. See also addExcludedArea, removeExcludedArea, and clearExcludedAreas. [read-only] extraParameters : VariantMap The route query extra parameters. This property is read only. If the query is defined by the user, these can be set by using MapParameters. If the route query comes from the engine via signals, the query is intended to be read-only. This property was introduced in Qt 5.11. featureTypes : QList<FeatureType> List of features that will be considered when planning the route. Features with a weight of NeutralFeatureWeight will not be returned. RouteQuery.NoFeature - No features will be taken into account when planning the route RouteQuery.TollFeature - Consider tollways when planning the route RouteQuery.HighwayFeature - Consider highways when planning the route RouteQuery.PublicTransitFeature - Consider public transit when planning the route RouteQuery.FerryFeature - Consider ferries when planning the route RouteQuery.TunnelFeature - Consider tunnels when planning the route RouteQuery.DirtRoadFeature - Consider dirt roads when planning the route RouteQuery.ParksFeature - Consider parks when planning the route RouteQuery.MotorPoolLaneFeature - Consider motor pool lanes when planning the route RouteQuery.TrafficFeature - Consider traffic when planning the route See also setFeatureWeight and featureWeight. maneuverDetail : enumeration The level of detail which will be used in the representation of routing maneuvers. Constant Description RouteQuery.NoManeuvers No maneuvers should be included with the route RouteQuery.BasicManeuvers Basic maneuvers will be included with the route The default value is RouteQuery.BasicManeuvers. numberAlternativeRoutes : int The number of alternative routes requested when requesting routes. The default value is 0. routeOptimizations : enumeration The route optimizations which should be considered during the planning of the route. Values can be combined with OR ('|') -operator. Constant Description RouteQuery.ShortestRoute Minimize the length of the journey RouteQuery.FastestRoute Minimize the traveling time for the journey RouteQuery.MostEconomicRoute Minimize the cost of the journey RouteQuery.MostScenicRoute Maximize the scenic potential of the journey The default value is RouteQuery.FastestRoute. segmentDetail : enumeration The level of detail which will be used in the representation of routing segments. Constant Description RouteQuery.NoSegmentData No segment data should be included with the route RouteQuery.BasicSegmentData Basic segment data will be included with the route The default value is RouteQuery.BasicSegmentData. travelModes : enumeration The travel modes which should be considered during the planning of the route. Values can be combined with OR ('|') -operator. Constant Description RouteQuery.CarTravel The route will be optimized for someone who is driving a car RouteQuery.PedestrianTravel The route will be optimized for someone who is walking RouteQuery.BicycleTravel The route will be optimized for someone who is riding a bicycle RouteQuery.PublicTransit Travel The route will be optimized for someone who is making use of public transit RouteQuery.TruckTravel The route will be optimized for someone who is driving a truck The default value is RouteQuery.CarTravel. waypoints : list<coordinate> The coordinates of the waypoints for the desired route. The waypoints should be given in order from origin to destination. Two or more coordinates are needed. Waypoints can be set as part of the RouteQuery type declaration or dynamically with the functions provided. When setting this property to a list of waypoints, each waypoint can be either a coordinate or a Waypoint, interchangeably. If a coordinate is passed, it will be internally converted to a Waypoint. This property, however, always contains a list of coordinates. See also waypointObjects, addWaypoint, removeWaypoint, and clearWaypoints. Method Documentation void addExcludedArea(area) Adds the specified georectangle area to the excluded areas (areas that the route must not cross). The same area can only be added once. See also removeExcludedArea and clearExcludedAreas. void addWaypoint(coordinate) Appends a coordinate to the list of waypoints. Same coordinate can be set multiple times. The coordinate argument can be a coordinate or a Waypoint. If a coordinate is used, it will be internally converted to a Waypoint. See also removeWaypoint and clearWaypoints. void clearExcludedAreas() Clears all excluded areas (areas that the route must not cross). See also addExcludedArea and removeExcludedArea. void clearWaypoints() Clears all waypoints. See also removeWaypoint and addWaypoint. FeatureWeight featureWeight(featureType) Gets the weight for the featureType. See also featureTypes, setFeatureWeight, and resetFeatureWeights. void removeExcludedArea(area) Removes the given area from excluded areas (areas that the route must not cross). See also addExcludedArea and clearExcludedAreas. void removeWaypoint(coordinate) Removes the given coordinate from the list of waypoints. If the same coordinate appears multiple times, the most recently added coordinate instance is removed. See also addWaypoint and clearWaypoints. void resetFeatureWeights() Resets all feature weights to their default state (NeutralFeatureWeight). See also featureTypes, setFeatureWeight, and featureWeight. void setFeatureWeight(feature, FeatureWeight weight) Defines the weight to associate with a feature during the planning of a route. Following lists the possible feature weights: Constant Description RouteQuery.NeutralFeatureWeight The presence or absence of the feature does not affect the planning of the route RouteQuery.PreferFeatureWeight Routes which contain the feature are preferred over those that do not RouteQuery.RequireFeatureWeight Only routes which contain the feature are considered, otherwise no route will be returned RouteQuery.AvoidFeatureWeight Routes which do not contain the feature are preferred over those that do RouteQuery.DisallowFeatureWeight Only routes which do not contain the feature are considered, otherwise no route will be returned See also featureTypes, resetFeatureWeights, and featureWeight. list<Waypoint> waypointObjects() This method can be used to retrieve the list of Waypoint objects relative to RouteQuery8b7c:f320:99b9:690f:4595:cd17:293a:c069waypoints. See also waypointObjects, addWaypoint, removeWaypoint, and clearWaypoints.
public function SelectExtender8b7c:f320:99b9:690f:4595:cd17:293a:c069__clone public SelectExtender8b7c:f320:99b9:690f:4595:cd17:293a:c069__clone() Clone magic method. Select queries have dependent objects that must be deep-cloned. The connection object itself, however, should not be cloned as that would duplicate the connection itself. Overrides SelectInter8b7c:f320:99b9:690f:4595:cd17:293a:c069__clone File core/lib/Drupal/Core/Database/Query/SelectExtender.php, line 482 Class SelectExtender The base extender class for Select queries. Namespace Drupal\Core\Database\Query Code public function __clone() { $this->uniqueIdentifier = uniqid('', TRUE); // We need to deep-clone the query we're wrapping, which in turn may // deep-clone other objects. Exciting! $this->query = clone($this->query); }
ImagickPixelIterator8b7c:f320:99b9:690f:4595:cd17:293a:c069setIteratorRow (PECL imagick 2, PECL imagick 3) ImagickPixelIterator8b7c:f320:99b9:690f:4595:cd17:293a:c069setIteratorRow — Set the pixel iterator row Description public ImagickPixelIterator8b7c:f320:99b9:690f:4595:cd17:293a:c069setIteratorRow(int $row): bool WarningThis function is currently not documented; only its argument list is available. Set the pixel iterator row. Parameters row Return Values Returns true on success. Examples Example #1 ImagickPixelIterator8b7c:f320:99b9:690f:4595:cd17:293a:c069setIteratorRow() <?php function setIteratorRow($imagePath) {     $imagick = new \Imagick(realpath($imagePath));     $imageIterator = $imagick->getPixelRegionIterator(200, 100, 200, 200);     for ($x = 0; $x < 20; $x++) {                 $imageIterator->setIteratorRow($x * 5);         $pixels = $imageIterator->getCurrentIteratorRow();         /* Loop through the pixels in the row (columns) */         foreach ($pixels as $pixel) {             /** @var $pixel \ImagickPixel */             /* Paint every second pixel black*/             $pixel->setColor("rgba(0, 0, 0, 0)");          }         /* Sync the iterator, this is important to do on each iteration */         $imageIterator->syncIterator();     }     header("Content-Type: image/jpg");     echo $imagick; } ?>
torch.sin torch.sin(input, *, out=None) → Tensor Returns a new tensor with the sine of the elements of input. outi=sin⁡(inputi)\text{out}_{i} = \sin(\text{input}_{i}) Parameters input (Tensor) – the input tensor. Keyword Arguments out (Tensor, optional) – the output tensor. Example: >>> a = torch.randn(4) >>> a tensor([-0.5461, 0.1347, -2.7266, -0.2746]) >>> torch.sin(a) tensor([-0.5194, 0.1343, -0.4032, -0.2711])
sklearn.model_selection.LeaveOneOut classsklearn.model_selection.LeaveOneOut[source] Leave-One-Out cross-validator Provides train/test indices to split data in train/test sets. Each sample is used once as a test set (singleton) while the remaining samples form the training set. Note: LeaveOneOut() is equivalent to KFold(n_splits=n) and LeavePOut(p=1) where n is the number of samples. Due to the high number of test sets (which is the same as the number of samples) this cross-validation method can be very costly. For large datasets one should favor KFold, ShuffleSplit or StratifiedKFold. Read more in the User Guide. See also LeaveOneGroupOut For splitting the data according to explicit, domain-specific stratification of the dataset. GroupKFold K-fold iterator variant with non-overlapping groups. Examples >>> import numpy as np >>> from sklearn.model_selection import LeaveOneOut >>> X = np.array([[1, 2], [3, 4]]) >>> y = np.array([1, 2]) >>> loo = LeaveOneOut() >>> loo.get_n_splits(X) 2 >>> print(loo) LeaveOneOut() >>> for train_index, test_index in loo.split(X): ... print("TRAIN:", train_index, "TEST:", test_index) ... X_train, X_test = X[train_index], X[test_index] ... y_train, y_test = y[train_index], y[test_index] ... print(X_train, X_test, y_train, y_test) TRAIN: [1] TEST: [0] [[3 4]] [[1 2]] [2] [1] TRAIN: [0] TEST: [1] [[1 2]] [[3 4]] [1] [2] Methods get_n_splits(X[, y, groups]) Returns the number of splitting iterations in the cross-validator split(X[, y, groups]) Generate indices to split data into training and test set. get_n_splits(X, y=None, groups=None)[source] Returns the number of splitting iterations in the cross-validator Parameters: Xarray-like of shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the number of features. yobject Always ignored, exists for compatibility. groupsobject Always ignored, exists for compatibility. Returns: n_splitsint Returns the number of splitting iterations in the cross-validator. split(X, y=None, groups=None)[source] Generate indices to split data into training and test set. Parameters: Xarray-like of shape (n_samples, n_features) Training data, where n_samples is the number of samples and n_features is the number of features. yarray-like of shape (n_samples,) The target variable for supervised learning problems. groupsarray-like of shape (n_samples,), default=None Group labels for the samples used while splitting the dataset into train/test set. Yields: trainndarray The training set indices for that split. testndarray The testing set indices for that split.
GlobalDescriptor package js.lib.webassembly import js.lib.webassembly.Global Available on js Fields value:ValueType optionalmutable:Null<Bool> By default, this is false.
std.container.slist This module implements a singly-linked list container. It can be used as a stack. This module is a submodule of std.container. Source std/container/slist.d License: Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or [email protected]/LICENSE_1_0.txt). Authors: Andrei Alexandrescu Examples: import std.algorithm.comparison : equal; import std.container : SList; auto s = SList!int(1, 2, 3); assert(equal(s[], [1, 2, 3])); s.removeFront(); assert(equal(s[], [2, 3])); s.insertFront([5, 6]); assert(equal(s[], [5, 6, 2, 3])); // If you want to apply range operations, simply slice it. import std.algorithm.searching : countUntil; import std.range : popFrontN, walkLength; auto sl = SList!int(1, 2, 3, 4, 5); writeln(countUntil(sl[], 2)); // 1 auto r = sl[]; popFrontN(r, 2); writeln(walkLength(r)); // 3 struct SList(T) if (!is(T == shared)); Implements a simple and fast singly-linked list. It can be used as a stack. SList uses reference semantics. this(U)(U[] values...) Constraints: if (isImplicitlyConvertible!(U, T)); Constructor taking a number of nodes this(Stuff)(Stuff stuff) Constraints: if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, T) && !is(Stuff == T[])); Constructor taking an input range const bool opEquals(const SList rhs); const bool opEquals(ref const SList rhs); Comparison for equality. Complexity Ο(min(n, n1)) where n1 is the number of elements in rhs. struct Range; Defines the container's primary range, which embodies a forward range. const @property bool empty(); @property ref T front(); void popFront(); Input range primitives. @property Range save(); Forward range primitive. const @property bool empty(); Property returning true if and only if the container has no elements. Complexity Ο(1) @property SList dup(); Duplicates the container. The elements themselves are not transitively duplicated. Complexity Ο(n). Range opSlice(); Returns a range that iterates over all elements of the container, in forward order. Complexity Ο(1) @property ref T front(); Forward to opSlice().front. Complexity Ο(1) SList opBinary(string op, Stuff)(Stuff rhs) Constraints: if (op == "~" && is(typeof(SList(rhs)))); SList opBinaryRight(string op, Stuff)(Stuff lhs) Constraints: if (op == "~" && !is(typeof(lhs.opBinary!"~"(this))) && is(typeof(SList(lhs)))); Returns a new SList that's the concatenation of this and its argument. opBinaryRight is only defined if Stuff does not define opBinary. void clear(); Removes all contents from the SList. Postcondition empty Complexity Ο(1) void reverse(); Reverses SList in-place. Performs no memory allocation. Complexity Ο(n) size_t insertFront(Stuff)(Stuff stuff) Constraints: if (isInputRange!Stuff || isImplicitlyConvertible!(Stuff, T)); alias insert = insertFront; alias stableInsert = insert; alias stableInsertFront = insertFront; Inserts stuff to the front of the container. stuff can be a value convertible to T or a range of objects convertible to T. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of elements inserted Complexity Ο(m), where m is the length of stuff T removeAny(); alias stableRemoveAny = removeAny; Picks one value in an unspecified position in the container, removes it from the container, and returns it. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Precondition !empty Returns: The element removed. Complexity Ο(1). void removeFront(); alias stableRemoveFront = removeFront; Removes the value at the front of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Precondition !empty Complexity Ο(1). size_t removeFront(size_t howMany); alias stableRemoveFront = removeFront; Removes howMany values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove howMany elements. Instead, if howMany > n, all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of elements removed Complexity Ο(howMany * log(n)). size_t insertAfter(Stuff)(Range r, Stuff stuff) Constraints: if (isInputRange!Stuff || isImplicitlyConvertible!(Stuff, T)); Inserts stuff after range r, which must be a range previously extracted from this container. Given that all ranges for a list end at the end of the list, this function essentially appends to the list and uses r as a potentially fast way to reach the last node in the list. Ideally r is positioned near or at the last element of the list. stuff can be a value convertible to T or a range of objects convertible to T. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of values inserted. Complexity Ο(k + m), where k is the number of elements in r and m is the length of stuff. Example auto sl = SList!string(["a", "b", "d"]); sl.insertAfter(sl[], "e"); // insert at the end (slowest) assert(std.algorithm.equal(sl[], ["a", "b", "d", "e"])); sl.insertAfter(std.range.take(sl[], 2), "c"); // insert after "b" assert(std.algorithm.equal(sl[], ["a", "b", "c", "d", "e"])); size_t insertAfter(Stuff)(Take!Range r, Stuff stuff) Constraints: if (isInputRange!Stuff || isImplicitlyConvertible!(Stuff, T)); alias stableInsertAfter = insertAfter; Similar to insertAfter above, but accepts a range bounded in count. This is important for ensuring fast insertions in the middle of the list. For fast insertions after a specified position r, use insertAfter(take(r, 1), stuff). The complexity of that operation only depends on the number of elements in stuff. Precondition r.original.empty || r.maxLength > 0 Returns: The number of values inserted. Complexity Ο(k + m), where k is the number of elements in r and m is the length of stuff. Range linearRemove(Range r); Removes a range from the list in linear time. Returns: An empty range. Complexity Ο(n) Range linearRemove(Take!Range r); alias stableLinearRemove = linearRemove; Removes a Take!Range from the list in linear time. Returns: A range comprehending the elements after the removed range. Complexity Ο(n) bool linearRemoveElement(T value); Removes the first occurence of an element from the list in linear time. Returns: True if the element existed and was successfully removed, false otherwise. Parameters: T value value of the node to be removed Complexity Ο(n)
tf.argsort View source on GitHub Returns the indices of a tensor that give its sorted order along an axis. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.argsort tf.argsort( values, axis=-1, direction='ASCENDING', stable=False, name=None ) values = [1, 10, 26.9, 2.8, 166.32, 62.3] sort_order = tf.argsort(values) sort_order.numpy() array([0, 3, 1, 2, 5, 4], dtype=int32) For a 1D tensor: sorted = tf.gather(values, sort_order) assert tf.reduce_all(sorted == tf.sort(values)) For higher dimensions, the output has the same shape as values, but along the given axis, values represent the index of the sorted element in that slice of the tensor at the given position. mat = [[30,20,10], [20,10,30], [10,30,20]] indices = tf.argsort(mat) indices.numpy() array([[2, 1, 0], [1, 0, 2], [0, 2, 1]], dtype=int32) If axis=-1 these indices can be used to apply a sort using tf.gather: tf.gather(mat, indices, batch_dims=-1).numpy() array([[10, 20, 30], [10, 20, 30], [10, 20, 30]], dtype=int32) See also: tf.sort: Sort along an axis. tf.math.top_k: A partial sort that returns a fixed number of top values and corresponding indices. Args values 1-D or higher numeric Tensor. axis The axis along which to sort. The default is -1, which sorts the last axis. direction The direction in which to sort the values ('ASCENDING' or 'DESCENDING'). stable If True, equal elements in the original tensor will not be re-ordered in the returned order. Unstable sort is not yet implemented, but will eventually be the default for performance reasons. If you require a stable order, pass stable=True for forwards compatibility. name Optional name for the operation. Returns An int32 Tensor with the same shape as values. The indices that would sort each slice of the given values along the given axis. Raises ValueError If axis is not a constant scalar, or the direction is invalid. tf.errors.InvalidArgumentError If the values.dtype is not a float or int type.
Box Versioning Since Vagrant 1.5, boxes support versioning. This allows the people who make boxes to push updates to the box, and the people who use the box have a simple workflow for checking for updates, updating their boxes, and seeing what has changed. If you are just getting started with Vagrant, box versioning is not too important, and we recommend learning about some other topics first. But if you are using Vagrant on a team or plan on creating your own boxes, versioning is very important. Luckily, having versioning built right in to Vagrant makes it easy to use and fit nicely into the Vagrant workflow. This page will cover how to use versioned boxes. It does not cover how to update your own custom boxes with versions. That is covered in creating a base box. Viewing Versions and Updating vagrant box list only shows installed versions of boxes. If you want to see all available versions of a box, you will have to find the box on HashiCorp's Vagrant Cloud. An easy way to find a box is to use the url https://vagrantcloud.com/$USER/$BOX. For example, for the hashicorp/precise64 box, you can find information about it at https://vagrantcloud.com/hashicorp/precise64. You can check if the box you are using is outdated with vagrant box outdated. This can check if the box in your current Vagrant environment is outdated as well as any other box installed on the system. Finally, you can update boxes with vagrant box update. This will download and install the new box. This will not magically update running Vagrant environments. If a Vagrant environment is already running, you will have to destroy and recreate it to acquire the new updates in the box. The update command just downloads these updates locally. Version Constraints You can constrain a Vagrant environment to a specific version or versions of a box using the Vagrantfile by specifying the config.vm.box_version option. If this option is not specified, the latest version is always used. This is equivalent to specifying a constraint of ">= 0". The box version configuration can be a specific version or a constraint of versions. Constraints can be any combination of the following: = X, > X, < X, >= X, <= X, ~> X. You can combine multiple constraints by separating them with commas. All the constraints should be self explanatory except perhaps for ~>, known as the "pessimistic constraint". Examples explain it best: ~> 1.0 is equivalent to >= 1.0, < 2.0. And ~> 1.1.5 is equivalent to >= 1.1.5, < 1.2.0. You can choose to handle versions however you see fit. However, many boxes in the public catalog follow semantic versioning. Basically, only the first number (the "major version") breaks backwards compatibility. In terms of Vagrant boxes, this means that any software that runs in version "1.1.5" of a box should work in "1.2" and "1.4.5" and so on, but "2.0" might introduce big changes that break your software. By following this convention, the best constraint is ~> 1.0 because you know it is safe no matter what version is in that range. Please note that, while the semantic versioning specification allows for more than three points and pre-release or beta versions, Vagrant boxes must be of the format X.Y.Z where X, Y, and Z are all positive integers. Automatic Update Checking Using the Vagrantfile, you can also configure Vagrant to automatically check for updates during any vagrant up. This is enabled by default, but can easily be disabled with config.vm.box_check_update = false in your Vagrantfile. When this is enabled, Vagrant will check for updates on every vagrant up, not just when the machine is being created from scratch, but also when it is resuming, starting after being halted, etc. If an update is found, Vagrant will output a warning to the user letting them know an update is available. That user can choose to ignore the warning for now, or can update the box by running vagrant box update. Vagrant can not and does not automatically download the updated box and update the machine because boxes can be relatively large and updating the machine requires destroying it and recreating it, which can cause important data to be lost. Therefore, this process is manual to the extent that the user has to manually enter a command to do it. Pruning Old Versions Vagrant does not automatically prune old versions because it does not know if they might be in use by other Vagrant environments. Because boxes can be large, you may want to actively prune them once in a while using vagrant box remove. You can see all the boxes that are installed using vagrant box list. Another option is to use vagrant box prune command to remove all installed boxes that are outdated and not currently in use.
tf.lite.TargetSpec View source on GitHub Specification of target device. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.lite.TargetSpec tf.lite.TargetSpec( supported_ops=None, supported_types=None ) Details about target device. Converter optimizes the generated model for specific device. Attributes supported_ops Experimental flag, subject to change. Set of OpsSet options supported by the device. (default set([OpsSet.TFLITE_BUILTINS])) supported_types List of types for constant values on the target device. Supported values are types exported by lite.constants. Frequently, an optimization choice is driven by the most compact (i.e. smallest) type in this list (default [constants.FLOAT])
pandas.api.types.is_integer pandas.api.types.is_integer()
Getting Started with Telegraf Getting Started with Telegraf Telegraf is an agent written in Go for collecting metrics and writing them into InfluxDB or other possible outputs. This guide will get you up and running with Telegraf. It walks you through the download, installation, and configuration processes, and it shows how to use Telegraf to get data into InfluxDB. Download and Install Telegraf Follow the instructions in the Telegraf section on the Downloads page. Note: Telegraf will start automatically using the default configuration when installed from a deb package. Configuration Configuration file location by installation type OS X Homebrew: /usr/local/etc/telegraf.conf Linux debian and RPM packages: /etc/telegraf/telegraf.conf Standalone Binary: see the next section for how to create a configuration file Creating and Editing the Configuration File Before starting the Telegraf server you need to edit and/or create an initial configuration that specifies your desired inputs (where the metrics come from) and outputs (where the metrics go). There are several ways to create and edit the configuration file. Here, we’ll generate a configuration file and simultaneously specify the desired inputs with the -input-filter flag and the desired output with the -output-filter flag. In the example below, we create a configuration file called telegraf.conf with two inputs: one that reads metrics about the system’s cpu usage (cpu) and one that reads metrics about the system’s memory usage (mem). We specify InfluxDB as the desired output. telegraf -sample-config -input-filter cpu:mem -output-filter influxdb > telegraf.conf Start the Telegraf Server Start the Telegraf server and direct it to the relevant configuration file: OS X Homebrew telegraf -config telegraf.conf Linux (sysvinit and upstart installations) sudo service telegraf start Linux (systemd installations) systemctl start telegraf Results Once Telegraf is up and running it will start collecting data and writing them to the desired output. Returning to our sample configuration, we show what the cpu and mem data look like in InfluxDB below. Note that we used the default input and output configuration settings to get these data. List all measurements in the telegraf database: > SHOW MEASUREMENTS name: measurements ------------------ name cpu mem List all field keys by measurement: > SHOW FIELD KEYS name: cpu --------- fieldKey fieldType usage_guest float usage_guest_nice float usage_idle float usage_iowait float usage_irq float usage_nice float usage_softirq float usage_steal float usage_system float usage_user float name: mem --------- fieldKey fieldType active integer available integer available_percent float buffered integer cached integer free integer inactive integer total integer used integer used_percent float Select a sample of the data in the field usage_idle in the measurement cpu_usage_idle: > SELECT usage_idle FROM cpu WHERE cpu = 'cpu-total' LIMIT 5 name: cpu --------- time usage_idle 2016-01-16T00:03:00Z 97.56189047261816 2016-01-16T00:03:10Z 97.76305923519121 2016-01-16T00:03:20Z 97.32533433320835 2016-01-16T00:03:30Z 95.68857785553611 2016-01-16T00:03:40Z 98.63715928982245 Notice that the timestamps occur at rounded ten second intervals (that is, :00, :10, :20, and so on) - this is a configurable setting. That’s it! You now have the foundation for using Telegraf to collect metrics and write them to your output of choice.
tf.contrib.layers.summarize_tensor Summarize a tensor using a suitable summary type. tf.contrib.layers.summarize_tensor( tensor, tag=None ) This function adds a summary op for tensor. The type of summary depends on the shape of tensor. For scalars, a scalar_summary is created, for all other tensors, histogram_summary is used. Args tensor The tensor to summarize tag The tag to use, if None then use tensor's op's name. Returns The summary op created or None for string tensors.
statsmodels.sandbox.stats.runs.median_test_ksample statsmodels.sandbox.stats.runs.median_test_ksample(x, groups) [source] chisquare test for equality of median/location This tests whether all groups have the same fraction of observations above the median. Parameters: x (array_like) – data values stacked for all groups groups (array_like) – group labels or indicator Returns: stat (float) – test statistic pvalue (float) – pvalue from the chisquare distribution others ???? – currently some test output, table and expected © 2009–2012 Statsmodels Developers© 2006–2008 Scipy Developers
tf.raw_ops.StatelessRandomGetAlg Picks the best counter-based RNG algorithm based on device. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.raw_ops.StatelessRandomGetAlg tf.raw_ops.StatelessRandomGetAlg( name=None ) This op picks the best counter-based RNG algorithm based on device. Args name A name for the operation (optional). Returns A Tensor of type int32.
protected function FieldConfigStorageBas8b7c:f320:99b9:690f:4595:cd17:293a:c069mapToStorageRecord protected FieldConfigStorageBas8b7c:f320:99b9:690f:4595:cd17:293a:c069mapToStorageRecord(EntityInterface $entity) Maps from an entity object to the storage record. Parameters \Drupal\Core\Entity\EntityInterface $entity: The entity object. Return value array The record to store. Overrides ConfigEntityStorag8b7c:f320:99b9:690f:4595:cd17:293a:c069mapToStorageRecord File core/lib/Drupal/Core/Field/FieldConfigStorageBase.php, line 34 Class FieldConfigStorageBase Base storage class for field config entities. Namespace Drupal\Core\Field Code protected function mapToStorageRecord(EntityInterface $entity) { $record = parent8b7c:f320:99b9:690f:4595:cd17:293a:c069mapToStorageRecord($entity); $class = $this->fieldTypeManager->getPluginClass($record['field_type']); $record['settings'] = $class8b7c:f320:99b9:690f:4595:cd17:293a:c069ieldSettingsToConfigData($record['settings']); return $record; }
Class MessagesFileLoader A generic translations package factory that will load translations files based on the file extension and the package name. This class is a callable, so it can be used as a package loader argument. Namespace: Cake\I18n Location: I18n/MessagesFileLoader.php Properties summary $_extension protected string The extension name. $_locale protected string The locale to load for the given package. $_name protected string The package (domain) name. Method Summary __construct() public Creates a translation file loader. The file to be loaded corresponds to the following rules: __invoke() public Loads the translation file and parses it. Returns an instance of a translations package containing the messages loaded from the file. translationsFolders() public Returns the folders where the file should be looked for according to the locale and package name. Method Detail __construct()source public __construct( string $name , string $locale , string $extension = 'po' ) Creates a translation file loader. The file to be loaded corresponds to the following rules: The locale is a folder under the Locale directory, a fallback will be used if the folder is not found. The $name corresponds to the file name to load If there is a loaded plugin with the underscored version of $name, the translation file will be loaded from such plugin. Examples: Load and parse src/Locale/fr/validation.po $loader = new MessagesFileLoader('validation', 'fr_FR', 'po'); $package = $loader(); Load and parse src/Locale/fr_FR/validation.mo $loader = new MessagesFileLoader('validation', 'fr_FR', 'mo'); $package = $loader(); Load the plugins/MyPlugin/src/Locale/fr/my_plugin.po file: $loader = new MessagesFileLoader('my_plugin', 'fr_FR', 'mo'); $package = $loader(); Parameters string $name The name (domain) of the translations package. string $locale The locale to load, this will be mapped to a folder in the system. string $extension optional 'po' The file extension to use. This will also be mapped to a messages parser class. __invoke()source public __invoke( ) Loads the translation file and parses it. Returns an instance of a translations package containing the messages loaded from the file. Returns Aura\Intl\Package|false Throws RuntimeExceptionif no file parser class could be found for the specified file extension. translationsFolders()source public translationsFolders( ) Returns the folders where the file should be looked for according to the locale and package name. Returns arrayThe list of folders where the translation file should be looked for Properties detail $_extensionsource protected string The extension name. $_localesource protected string The locale to load for the given package. $_namesource protected string The package (domain) name.
Range.startContainer The Range.startContainer read-only property returns the Node within which the Range starts. To change the start position of a node, use one of the Range.setStart() methods. Value A Node object. Examples range = document.createRange(); range.setStart(startNode,startOffset); range.setEnd(endNode,endOffset); startRangeNode = range.startContainer; Specifications Specification DOM Standard # ref-for-dom-range-startcontainer① 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 startContainer 1 12 1 9 9 1 1 18 4 10.1 1 1.0 See also The DOM interfaces index 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 5, 2022, by MDN contributors
Unescaper class Unescaper Unescaper encapsulates unescaping rules for single and double-quoted YAML strings. Constants ENCODING Parser and Inline assume UTF-8 encoding, so escaped Unicode characters must be converted to that encoding. REGEX_ESCAPED_CHARACTER Regex fragment that matches an escaped character in a double quoted string. Methods string unescapeSingleQuotedString(string $value) Unescapes a single quoted string. string unescapeDoubleQuotedString(string $value) Unescapes a double quoted string. string unescapeCharacter(string $value) Unescapes a character that was found in a double-quoted string. Details string unescapeSingleQuotedString(string $value) Unescapes a single quoted string. Parameters string $value A single quoted string Return Value string The unescaped string string unescapeDoubleQuotedString(string $value) Unescapes a double quoted string. Parameters string $value A double quoted string Return Value string The unescaped string string unescapeCharacter(string $value) Unescapes a character that was found in a double-quoted string. Parameters string $value An escaped character Return Value string The unescaped character
community.aws.sns_topic – Manages AWS SNS topics and subscriptions Note This plugin is part of the community.aws collection (version 1.3.0). To install it use: ansible-galaxy collection install community.aws. To use it in a playbook, specify: community.aws.sns_topic. New in version 1.0.0: of community.aws Synopsis Requirements Parameters Notes Examples Return Values Synopsis The community.aws.sns_topic module allows you to create, delete, and manage subscriptions for AWS SNS topics. As of 2.6, this module can be use to subscribe and unsubscribe to topics outside of your AWS account. Requirements The below requirements are needed on the host that executes this module. boto python >= 2.6 Parameters Parameter Choices/Defaults Comments aws_access_key string AWS access key. If not set then the value of the AWS_ACCESS_KEY_ID, AWS_ACCESS_KEY or EC2_ACCESS_KEY environment variable is used. If profile is set this parameter is ignored. Passing the aws_access_key and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01. aliases: ec2_access_key, access_key aws_ca_bundle path The location of a CA Bundle to use when validating SSL certificates. Only used for boto3 based modules. Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally. aws_config dictionary A dictionary to modify the botocore configuration. Parameters can be found at https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config. Only the 'user_agent' key is used for boto modules. See http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto for more boto configuration. aws_secret_key string AWS secret key. If not set then the value of the AWS_SECRET_ACCESS_KEY, AWS_SECRET_KEY, or EC2_SECRET_KEY environment variable is used. If profile is set this parameter is ignored. Passing the aws_secret_key and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01. aliases: ec2_secret_key, secret_key debug_botocore_endpoint_logs boolean Choices: no ← yes Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource_actions key in the task results. Use the aws_resource_action callback to output to total list made during a playbook. The ANSIBLE_DEBUG_BOTOCORE_LOGS environment variable may also be used. delivery_policy dictionary Delivery policy to apply to the SNS topic. display_name string Display name of the topic. ec2_url string Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used. aliases: aws_endpoint_url, endpoint_url name string / required The name or ARN of the SNS topic to manage. policy dictionary Policy to apply to the SNS topic. profile string Uses a boto profile. Only works with boto >= 2.24.0. Using profile will override aws_access_key, aws_secret_key and security_token and support for passing them at the same time as profile has been deprecated. aws_access_key, aws_secret_key and security_token will be made mutually exclusive with profile after 2022-06-01. aliases: aws_profile purge_subscriptions boolean Choices: no yes ← Whether to purge any subscriptions not listed here. NOTE: AWS does not allow you to purge any PendingConfirmation subscriptions, so if any exist and would be purged, they are silently skipped. This means that somebody could come back later and confirm the subscription. Sorry. Blame Amazon. region string The AWS region to use. If not specified then the value of the AWS_REGION or EC2_REGION environment variable, if any, is used. See http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region aliases: aws_region, ec2_region security_token string AWS STS security token. If not set then the value of the AWS_SECURITY_TOKEN or EC2_SECURITY_TOKEN environment variable is used. If profile is set this parameter is ignored. Passing the security_token and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01. aliases: aws_security_token, access_token state string Choices: absent present ← Whether to create or destroy an SNS topic. subscriptions list / elements=dictionary Default:[] List of subscriptions to apply to the topic. Note that AWS requires subscriptions to be confirmed, so you will need to confirm any new subscriptions. endpoint string / required Endpoint of subscription. protocol string / required Protocol of subscription. validate_certs boolean Choices: no yes ← When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. Notes Note If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence AWS_URL or EC2_URL, AWS_PROFILE or AWS_DEFAULT_PROFILE, AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY or EC2_ACCESS_KEY, AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY or EC2_SECRET_KEY, AWS_SECURITY_TOKEN or EC2_SECURITY_TOKEN, AWS_REGION or EC2_REGION, AWS_CA_BUNDLE Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See https://boto.readthedocs.io/en/latest/boto_config_tut.html AWS_REGION or EC2_REGION can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file Examples - name: Create alarm SNS topic community.aws.sns_topic: name: "alarms" state: present display_name: "alarm SNS topic" delivery_policy: http: defaultHealthyRetryPolicy: minDelayTarget: 2 maxDelayTarget: 4 numRetries: 3 numMaxDelayRetries: 5 backoffFunction: "<linear|arithmetic|geometric|exponential>" disableSubscriptionOverrides: True defaultThrottlePolicy: maxReceivesPerSecond: 10 subscriptions: - endpoint: "[email protected]" protocol: "email" - endpoint: "my_mobile_number" protocol: "sms" Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description community.aws.sns_topic complex always Dict of sns topic details attributes_set list / elements=string always list of attributes set during this run check_mode boolean always whether check mode was on delivery_policy string when topic is owned by this AWS account Delivery policy for the SNS topic Sample: {"http":{"defaultHealthyRetryPolicy":{"minDelayTarget":20,"maxDelayTarget":20,"numRetries":3,"numMaxDelayRetries":0, "numNoDelayRetries":0,"numMinDelayRetries":0,"backoffFunction":"linear"},"disableSubscriptionOverrides":false}} display_name string when topic is owned by this AWS account Display name for SNS topic Sample: My topic name name string always Topic name Sample: ansible-test-dummy-topic owner string when topic is owned by this AWS account AWS account that owns the topic Sample: 111111111111 policy string when topic is owned by this AWS account Policy for the SNS topic Sample: {"Version":"2012-10-17","Id":"SomePolicyId","Statement":[{"Sid":"ANewSid","Effect":"Allow","Principal":{"AWS":"arn:aws:iam8b7c:f320:99b9:690f:4595:cd17:293a:c06911111111:root"}, "Action":"sns:Subscribe","Resource":"arn:aws:sns:us-east-2:111111111111:ansible-test-dummy-topic","Condition":{"StringEquals":{"sns:Protocol":"email"}}}]} state string always whether the topic is present or absent Sample: present subscriptions list / elements=string always List of subscribers to the topic in this AWS account subscriptions_added list / elements=string always List of subscribers added in this run subscriptions_confirmed string when topic is owned by this AWS account Count of confirmed subscriptions Sample: 0 subscriptions_deleted string when topic is owned by this AWS account Count of deleted subscriptions Sample: 0 subscriptions_existing list / elements=string always List of existing subscriptions subscriptions_new list / elements=string always List of new subscriptions subscriptions_pending string when topic is owned by this AWS account Count of pending subscriptions Sample: 0 subscriptions_purge boolean always Whether or not purge_subscriptions was set Sample: True topic_arn string when topic is owned by this AWS account ARN of the SNS topic (equivalent to sns_arn) Sample: arn:aws:sns:us-east-2:111111111111:ansible-test-dummy-topic topic_created boolean always Whether the topic was created topic_deleted boolean always Whether the topic was deleted sns_arn string always The ARN of the topic you are modifying Sample: arn:aws:sns:us-east-2:111111111111:my_topic_name Authors Joel Thompson (@joelthompson) Fernando Jose Pando (@nand0p) Will Thames (@willthames) © 2012–2018 Michael DeHaan
FormRenderer class FormRenderer implements FormRendererInterface Renders a form into HTML using a rendering engine. Constants CACHE_KEY_VAR Methods __construct(FormRendererEngineInterface $engine, CsrfTokenManagerInterface $csrfTokenManager = null) FormRendererEngineInterface getEngine() Returns the engine used by this renderer. setTheme(FormView $view, $themes) Sets the theme(s) to be used for rendering a view and its children. string renderCsrfToken(string $tokenId) Renders a CSRF token. string renderBlock(FormView $view, string $blockName, array $variables = array()) Renders a named block of the form theme. string searchAndRenderBlock(FormView $view, string $blockNameSuffix, array $variables = array()) Searches and renders a block for a given name suffix. string humanize(string $text) Makes a technical name human readable. Details __construct(FormRendererEngineInterface $engine, CsrfTokenManagerInterface $csrfTokenManager = null) Parameters FormRendererEngineInterface $engine CsrfTokenManagerInterface $csrfTokenManager FormRendererEngineInterface getEngine() Returns the engine used by this renderer. Return Value FormRendererEngineInterface The renderer engine setTheme(FormView $view, $themes) Sets the theme(s) to be used for rendering a view and its children. Parameters FormView $view $themes string renderCsrfToken(string $tokenId) Renders a CSRF token. Use this helper for CSRF protection without the overhead of creating a form. Check the token in your action using the same token ID. // $csrfProvider being an instance of Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface if (!$csrfProvider->isCsrfTokenValid('rmuser'.$user->getId(), $token)) { throw new \RuntimeException('CSRF attack detected.'); } Parameters string $tokenId The ID of the CSRF token Return Value string A CSRF token string renderBlock(FormView $view, string $blockName, array $variables = array()) Renders a named block of the form theme. Parameters FormView $view The view for which to render the block string $blockName The name of the block array $variables The variables to pass to the template Return Value string The HTML markup string searchAndRenderBlock(FormView $view, string $blockNameSuffix, array $variables = array()) Searches and renders a block for a given name suffix. The block is searched by combining the block names stored in the form view with the given suffix. If a block name is found, that block is rendered. If this method is called recursively, the block search is continued where a block was found before. Parameters FormView $view The view for which to render the block string $blockNameSuffix The suffix of the block name array $variables The variables to pass to the template Return Value string The HTML markup string humanize(string $text) Makes a technical name human readable. Sequences of underscores are replaced by single spaces. The first letter of the resulting string is capitalized, while all other letters are turned to lowercase. Parameters string $text The text to humanize Return Value string The humanized text
State and Lifecycle This page introduces the concept of state and lifecycle in a React component. You can find a detailed component API reference here. Consider the ticking clock example from one of the previous sections. In Rendering Elements, we have only learned one way to update the UI. We call root.render() to change the rendered output: const root = ReactDOM.createRoot(document.getElementById('root')); function tick() { const element = ( <div> <h1>Hello, world!</h1> <h2>It is {new Date().toLocaleTimeString()}.</h2> </div> ); root.render(element); } setInterval(tick, 1000); Try it on CodePen In this section, we will learn how to make the Clock component truly reusable and encapsulated. It will set up its own timer and update itself every second. We can start by encapsulating how the clock looks: const root = ReactDOM.createRoot(document.getElementById('root')); function Clock(props) { return ( <div> <h1>Hello, world!</h1> <h2>It is {props.date.toLocaleTimeString()}.</h2> </div> ); } function tick() { root.render(<Clock date={new Date()} />); } setInterval(tick, 1000); Try it on CodePen However, it misses a crucial requirement: the fact that the Clock sets up a timer and updates the UI every second should be an implementation detail of the Clock. Ideally we want to write this once and have the Clock update itself: root.render(<Clock />); To implement this, we need to add “state” to the Clock component. State is similar to props, but it is private and fully controlled by the component. Converting a Function to a Class You can convert a function component like Clock to a class in five steps: Create an ES6 class, with the same name, that extends React.Component. Add a single empty method to it called render(). Move the body of the function into the render() method. Replace props with this.props in the render() body. Delete the remaining empty function declaration. class Clock extends React.Component { render() { return ( <div> <h1>Hello, world!</h1> <h2>It is {this.props.date.toLocaleTimeString()}.</h2> </div> ); } } Try it on CodePen Clock is now defined as a class rather than a function. The render method will be called each time an update happens, but as long as we render <Clock /> into the same DOM node, only a single instance of the Clock class will be used. This lets us use additional features such as local state and lifecycle methods. Adding Local State to a Class We will move the date from props to state in three steps: Replace this.props.date with this.state.date in the render() method: class Clock extends React.Component { render() { return ( <div> <h1>Hello, world!</h1> <h2>It is {this.state.date.toLocaleTimeString()}.</h2> </div> ); } } Add a class constructor that assigns the initial this.state: class Clock extends React.Component { constructor(props) { super(props); this.state = {date: new Date()}; } render() { return ( <div> <h1>Hello, world!</h1> <h2>It is {this.state.date.toLocaleTimeString()}.</h2> </div> ); } } Note how we pass props to the base constructor: constructor(props) { super(props); this.state = {date: new Date()}; } Class components should always call the base constructor with props. Remove the date prop from the <Clock /> element: root.render(<Clock />); We will later add the timer code back to the component itself. The result looks like this: class Clock extends React.Component { constructor(props) { super(props); this.state = {date: new Date()}; } render() { return ( <div> <h1>Hello, world!</h1> <h2>It is {this.state.date.toLocaleTimeString()}.</h2> </div> ); } } const root = ReactDOM.createRoot(document.getElementById('root')); root.render(<Clock />); Try it on CodePen Next, we’ll make the Clock set up its own timer and update itself every second. Adding Lifecycle Methods to a Class In applications with many components, it’s very important to free up resources taken by the components when they are destroyed. We want to set up a timer whenever the Clock is rendered to the DOM for the first time. This is called “mounting” in React. We also want to clear that timer whenever the DOM produced by the Clock is removed. This is called “unmounting” in React. We can declare special methods on the component class to run some code when a component mounts and unmounts: class Clock extends React.Component { constructor(props) { super(props); this.state = {date: new Date()}; } componentDidMount() { } componentWillUnmount() { } render() { return ( <div> <h1>Hello, world!</h1> <h2>It is {this.state.date.toLocaleTimeString()}.</h2> </div> ); } } These methods are called “lifecycle methods”. The componentDidMount() method runs after the component output has been rendered to the DOM. This is a good place to set up a timer: componentDidMount() { this.timerID = setInterval( () => this.tick(), 1000 ); } Note how we save the timer ID right on this (this.timerID). While this.props is set up by React itself and this.state has a special meaning, you are free to add additional fields to the class manually if you need to store something that doesn’t participate in the data flow (like a timer ID). We will tear down the timer in the componentWillUnmount() lifecycle method: componentWillUnmount() { clearInterval(this.timerID); } Finally, we will implement a method called tick() that the Clock component will run every second. It will use this.setState() to schedule updates to the component local state: class Clock extends React.Component { constructor(props) { super(props); this.state = {date: new Date()}; } componentDidMount() { this.timerID = setInterval( () => this.tick(), 1000 ); } componentWillUnmount() { clearInterval(this.timerID); } tick() { this.setState({ date: new Date() }); } render() { return ( <div> <h1>Hello, world!</h1> <h2>It is {this.state.date.toLocaleTimeString()}.</h2> </div> ); } } const root = ReactDOM.createRoot(document.getElementById('root')); root.render(<Clock />); Try it on CodePen Now the clock ticks every second. Let’s quickly recap what’s going on and the order in which the methods are called: When <Clock /> is passed to root.render(), React calls the constructor of the Clock component. Since Clock needs to display the current time, it initializes this.state with an object including the current time. We will later update this state. React then calls the Clock component’s render() method. This is how React learns what should be displayed on the screen. React then updates the DOM to match the Clock’s render output. When the Clock output is inserted in the DOM, React calls the componentDidMount() lifecycle method. Inside it, the Clock component asks the browser to set up a timer to call the component’s tick() method once a second. Every second the browser calls the tick() method. Inside it, the Clock component schedules a UI update by calling setState() with an object containing the current time. Thanks to the setState() call, React knows the state has changed, and calls the render() method again to learn what should be on the screen. This time, this.state.date in the render() method will be different, and so the render output will include the updated time. React updates the DOM accordingly. If the Clock component is ever removed from the DOM, React calls the componentWillUnmount() lifecycle method so the timer is stopped. Using State Correctly There are three things you should know about setState(). Do Not Modify State Directly For example, this will not re-render a component: // Wrong this.state.comment = 'Hello'; Instead, use setState(): // Correct this.setState({comment: 'Hello'}); The only place where you can assign this.state is the constructor. State Updates May Be Asynchronous React may batch multiple setState() calls into a single update for performance. Because this.props and this.state may be updated asynchronously, you should not rely on their values for calculating the next state. For example, this code may fail to update the counter: // Wrong this.setState({ counter: this.state.counter + this.props.increment, }); To fix it, use a second form of setState() that accepts a function rather than an object. That function will receive the previous state as the first argument, and the props at the time the update is applied as the second argument: // Correct this.setState((state, props) => ({ counter: state.counter + props.increment })); We used an arrow function above, but it also works with regular functions: // Correct this.setState(function(state, props) { return { counter: state.counter + props.increment }; }); State Updates are Merged When you call setState(), React merges the object you provide into the current state. For example, your state may contain several independent variables: constructor(props) { super(props); this.state = { posts: [], comments: [] }; } Then you can update them independently with separate setState() calls: componentDidMount() { fetchPosts().then(response => { this.setState({ posts: response.posts }); }); fetchComments().then(response => { this.setState({ comments: response.comments }); }); } The merging is shallow, so this.setState({comments}) leaves this.state.posts intact, but completely replaces this.state.comments. The Data Flows Down Neither parent nor child components can know if a certain component is stateful or stateless, and they shouldn’t care whether it is defined as a function or a class. This is why state is often called local or encapsulated. It is not accessible to any component other than the one that owns and sets it. A component may choose to pass its state down as props to its child components: <FormattedDate date={this.state.date} /> The FormattedDate component would receive the date in its props and wouldn’t know whether it came from the Clock’s state, from the Clock’s props, or was typed by hand: function FormattedDate(props) { return <h2>It is {props.date.toLocaleTimeString()}.</h2>; } Try it on CodePen This is commonly called a “top-down” or “unidirectional” data flow. Any state is always owned by some specific component, and any data or UI derived from that state can only affect components “below” them in the tree. If you imagine a component tree as a waterfall of props, each component’s state is like an additional water source that joins it at an arbitrary point but also flows down. To show that all components are truly isolated, we can create an App component that renders three <Clock>s: function App() { return ( <div> <Clock /> <Clock /> <Clock /> </div> ); } Try it on CodePen Each Clock sets up its own timer and updates independently. In React apps, whether a component is stateful or stateless is considered an implementation detail of the component that may change over time. You can use stateless components inside stateful components, and vice versa. Is this page useful?
bundle-visualizer Documentation of Meteor's `bundle-visualizer` package. The bundle-visualizer package is an analysis tool which provides a visual representation within the web browser showing what is included in the initial client bundle. The initial client bundle is the primary package of code downloaded and executed by the browser to run a Meteor application and includes packages which have been added via meteor add <package> or Node modules included in the node_modules directory and used in an application. This visualization can uncover details about which files or packages are occupying space within the initial client bundle. This can be useful in determining which imports might be candidates for being converted to dynamic import() statements (which are excluded from the initial client bundle), or for identifying packages which have been inadvertently included in a project. How it works This package utilizes the <hash>.stats.json files which are written alongside file bundles when the application is ran with the --production flag. The specific details for the minified file sizes is added by the minifier package and therefore it’s important to review the minifier requirements below. Requirements This package requires data provided by the project’s minifier. For this reason, it is necessary to use the official standard-minifier-js package or a minifier which includes file-size details obtained during minification. Usage Since bundle analysis is only truly accurate on a minified bundle and minification does not take place during development (as it is a complex and CPU-intensive process which would substantially slow down normal development) this package must be used in conjunction with the --production flag to the meteor tool to simulate production bundling and enable minification. IMPORTANT: Since this package is active in production mode, it is critical to only add this package temporarily. This can be easily accomplished using the --extra-packages option to meteor. Enabling $ cd app/ $ meteor --extra-packages bundle-visualizer --production Viewing Once enabled, view the application in a web-browser as usual (e.g. http://localhost:3000/) and the chart will be displayed on top of the application. Disabling If you used --extra-packages, simply remove bundle-visualizer from the list of included packages and run meteor as normal. If you’ve added bundle-visualizer permanently with meteor add, it is important to remove this package prior to bundling or deploying to production with meteor remove bundle-visualizer.
public function AccessAwareRouter8b7c:f320:99b9:690f:4595:cd17:293a:c069matchRequest public AccessAwareRouter8b7c:f320:99b9:690f:4595:cd17:293a:c069matchRequest(Request $request) Throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException Thrown when access checking failed. Overrides AccessAwareRouterInter8b7c:f320:99b9:690f:4595:cd17:293a:c069matchRequest File core/lib/Drupal/Core/Routing/AccessAwareRouter.php, line 83 Class AccessAwareRouter A router class for Drupal with access check and upcasting. Namespace Drupal\Core\Routing Code public function matchRequest(Request $request) { $parameters = $this->chainRouter->matchRequest($request); $request->attributes->add($parameters); $this->checkAccess($request); // We can not return $parameters because the access check can change the // request attributes. return $request->attributes->all(); }
community.general.jabber – post task events to a jabber server Note This plugin is part of the community.general collection (version 1.3.2). To install it use: ansible-galaxy collection install community.general. To use it in a playbook, specify: community.general.jabber. Synopsis Requirements Parameters Synopsis The chatty part of ChatOps with a Hipchat server as a target This callback plugin sends status updates to a HipChat channel during playbook execution. Requirements The below requirements are needed on the local controller node that executes this callback. xmpp (python lib https://github.com/ArchipelProject/xmpppy) Parameters Parameter Choices/Defaults Configuration Comments password string / required env:JABBER_PASS Password for the user to the jabber server server string / required env:JABBER_SERV connection info to jabber server to string / required env:JABBER_TO chat identifier that will receive the message user string / required env:JABBER_USER Jabber user to authenticate as Authors Unknown (!UNKNOWN) © 2012–2018 Michael DeHaan
CPACK_NEVER_OVERWRITE New in version 3.1. Request that this file not be overwritten on install or reinstall. The property is currently only supported by the CPack WIX Generator.
dart:html HttpRequest factory constructor HttpRequest() General constructor for any type of request (GET, POST, etc). This call is used in conjunction with open: var request = new HttpRequest(); request.open('GET', 'http://dartlang.org'); request.onLoad.listen((event) => print( 'Request complete ${event.target.reponseText}')); request.send(); is the (more verbose) equivalent of HttpRequest.getString('http://dartlang.org').then( (result) => print('Request complete: $result')); Source @DomName('XMLHttpRequest.XMLHttpRequest') @DocsEditable() factory HttpRequest() { return _blink.BlinkXMLHttpRequest.instance.constructorCallback_0_(); }
operator<<,>>(st8b7c:f320:99b9:690f:4595:cd17:293a:c069discard_block_engine) template< class CharT, class Traits > friend st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_ostream<CharT,Traits>& operator<<( st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_ostream<CharT,Traits>& ost, discard_block_engine<>& e ); (1) (since C++11) template< class CharT, class Traits > friend st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_istream<CharT,Traits>& operator>>( st8b7c:f320:99b9:690f:4595:cd17:293a:c069basic_istream<CharT,Traits>& ist, discard_block_engine& e ); (2) (since C++11) 1) Serializes the internal state of the pseudo-random number engine adaptor as a sequence of decimal numbers separated by one or more spaces, and inserts it to the stream ost. The fill character and the formatting flags of the stream are ignored and unaffected. 2) Restores the internal state of the pseudo-random number engine adaptor e from the serialized representation, which was created by an earlier call to operator<< using a stream with the same imbued locale and the same CharT and Traits. If the input cannot be deserialized, e is left unchanged and failbit is raised on ist. These function templates are not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when st8b7c:f320:99b9:690f:4595:cd17:293a:c069discard_block_engine<Engine,p,r> is an associated class of the arguments. If a textual representation is written using os << x and that representation is restored into the same or a different object y of the same type using is >> y, then x==y. Parameters ost - output stream to insert the data to ist - input stream to extract the data from e - engine adaptor to serialize or restore Return value 1) ost 2) ist Complexity Exceptions 1) May throw implementation-defined exceptions. 2) May throw st8b7c:f320:99b9:690f:4595:cd17:293a:c069ios_bas8b7c:f320:99b9:690f:4595:cd17:293a:c069failure when setting failbit. Defect reports The following behavior-changing defect reports were applied retroactively to previously published C++ standards. DR Applied to Behavior as published Correct behavior LWG 3519 C++11 the form of insertion and extraction operators were unspecified specified to be hidden friends
tf.compat.v1.flags.DEFINE Registers a generic Flag object. tf.compat.v1.flags.DEFINE( parser, name, default, help, flag_values=_flagvalues.FLAGS, serializer=None, module_name=None, required=False, **args ) Note: in the docstrings of all DEFINE* functions, "registers" is short for "creates a new flag and registers it". Auxiliary function: clients should use the specialized DEFINE_ function instead. Args parser ArgumentParser, used to parse the flag arguments. name str, the flag name. default The default value of the flag. help str, the help message. flag_values FlagValues, the FlagValues instance with which the flag will be registered. This should almost never need to be overridden. serializer ArgumentSerializer, the flag serializer instance. module_name str, the name of the Python module declaring this flag. If not provided, it will be computed using the stack trace of this call. required bool, is this a required flag. This must be used as a keyword argument. **args dict, the extra keyword args that are passed to Flag init. Returns a handle to defined flag.
public function ContentEntityStorageBas8b7c:f320:99b9:690f:4595:cd17:293a:c069onFieldDefinitionDelete public ContentEntityStorageBas8b7c:f320:99b9:690f:4595:cd17:293a:c069onFieldDefinitionDelete(FieldDefinitionInterface $field_definition) Reacts to the deletion of a field. Stored values should not be wiped at once, but marked as 'deleted' so that they can go through a proper purge process later on. Parameters \Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition being deleted. Overrides FieldDefinitionListenerInter8b7c:f320:99b9:690f:4595:cd17:293a:c069onFieldDefinitionDelete File core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php, line 169 Class ContentEntityStorageBase Base class for content entity storage handlers. Namespace Drupal\Core\Entity Code public function onFieldDefinitionDelete(FieldDefinitionInterface $field_definition) { }
Class SynthProgressBarUI java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.ProgressBarUI javax.swing.plaf.basic.BasicProgressBarUI javax.swing.plaf.synth.SynthProgressBarUI All Implemented Interfaces: PropertyChangeListener, EventListener, SynthConstants, SynthUI public class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, PropertyChangeListener Provides the Synth L&F UI delegate for JProgressBar. Since: 1.7 Nested Classes Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicProgressBarUI BasicProgressBarUI.ChangeHandler Fields Fields inherited from class javax.swing.plaf.basic.BasicProgressBarUI boxRect, changeListener, progressBar Fields inherited from interface javax.swing.plaf.synth.SynthConstants DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED Constructors Constructor and Description SynthProgressBarUI() Methods Modifier and Type Method and Description static ComponentUI createUI(JComponent x) Creates a new UI object for the given component. int getBaseline(JComponent c, int width, int height) Returns the baseline. protected Rectangle getBox(Rectangle r) Stores the position and size of the bouncing box that would be painted for the current animation index in r and returns r. SynthContext getContext(JComponent c) Returns the Context for the specified component. Dimension getPreferredSize(JComponent c) Returns the specified component's preferred size appropriate for the look and feel. protected void installDefaults() protected void installListeners() void paint(Graphics g, JComponent c) Paints the specified component according to the Look and Feel. protected void paint(SynthContext context, Graphics g) Paints the specified component. void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) Paints the border. protected void paintText(SynthContext context, Graphics g, String title) Paints the component's text. void propertyChange(PropertyChangeEvent e) This method gets called when a bound property is changed. protected void setAnimationIndex(int newValue) Sets the index of the current animation frame to the specified value and requests that the progress bar be repainted. protected void uninstallDefaults() protected void uninstallListeners() Removes all listeners installed by this object. void update(Graphics g, JComponent c) Notifies this UI delegate to repaint the specified component. Methods inherited from class javax.swing.plaf.basic.BasicProgressBarUI getAmountFull, getAnimationIndex, getBaselineResizeBehavior, getBoxLength, getCellLength, getCellSpacing, getFrameCount, getMaximumSize, getMinimumSize, getPreferredInnerHorizontal, getPreferredInnerVertical, getSelectionBackground, getSelectionForeground, getStringPlacement, incrementAnimationIndex, installUI, paintDeterminate, paintIndeterminate, paintString, setCellLength, setCellSpacing, startAnimationTimer, stopAnimationTimer, uninstallUI Methods inherited from class javax.swing.plaf.ComponentUI contains, getAccessibleChild, getAccessibleChildrenCount Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Constructors SynthProgressBarUI public SynthProgressBarUI() Methods createUI public static ComponentUI createUI(JComponent x) Creates a new UI object for the given component. Parameters: x - component to create UI object for Returns: the UI object installListeners protected void installListeners() Overrides: installListeners in class BasicProgressBarUI uninstallListeners protected void uninstallListeners() Removes all listeners installed by this object. Overrides: uninstallListeners in class BasicProgressBarUI installDefaults protected void installDefaults() Overrides: installDefaults in class BasicProgressBarUI uninstallDefaults protected void uninstallDefaults() Overrides: uninstallDefaults in class BasicProgressBarUI getContext public SynthContext getContext(JComponent c) Returns the Context for the specified component. Specified by: getContext in interface SynthUI Parameters: c - Component requesting SynthContext. Returns: SynthContext describing component. getBaseline public int getBaseline(JComponent c, int width, int height) Returns the baseline. Overrides: getBaseline in class BasicProgressBarUI Parameters: c - JComponent baseline is being requested for width - the width to get the baseline for height - the height to get the baseline for Returns: baseline or a value < 0 indicating there is no reasonable baseline See Also: JComponent.getBaseline(int, int) getBox protected Rectangle getBox(Rectangle r) Stores the position and size of the bouncing box that would be painted for the current animation index in r and returns r. Subclasses that add to the painting performed in this class's implementation of paintIndeterminate -- to draw an outline around the bouncing box, for example -- can use this method to get the location of the bouncing box that was just painted. By overriding this method, you have complete control over the size and position of the bouncing box, without having to reimplement paintIndeterminate. Overrides: getBox in class BasicProgressBarUI Parameters: r - the Rectangle instance to be modified; may be null Returns: null if no box should be drawn; otherwise, returns the passed-in rectangle (if non-null) or a new rectangle See Also: BasicProgressBarUI.setAnimationIndex(int) setAnimationIndex protected void setAnimationIndex(int newValue) Sets the index of the current animation frame to the specified value and requests that the progress bar be repainted. Subclasses that don't use the default painting code might need to override this method to change the way that the repaint method is invoked. Overrides: setAnimationIndex in class BasicProgressBarUI Parameters: newValue - the new animation index; no checking is performed on its value See Also: BasicProgressBarUI.incrementAnimationIndex() update public void update(Graphics g, JComponent c) Notifies this UI delegate to repaint the specified component. This method paints the component background, then calls the paint(SynthContext,Graphics) method. In general, this method does not need to be overridden by subclasses. All Look and Feel rendering code should reside in the paint method. Overrides: update in class ComponentUI Parameters: g - the Graphics object used for painting c - the component being painted See Also: paint(SynthContext,Graphics) paint public void paint(Graphics g, JComponent c) Paints the specified component according to the Look and Feel. This method is not used by Synth Look and Feel. Painting is handled by the paint(SynthContext,Graphics) method. Overrides: paint in class BasicProgressBarUI Parameters: g - the Graphics object used for painting c - the component being painted See Also: paint(SynthContext,Graphics) paint protected void paint(SynthContext context, Graphics g) Paints the specified component. Parameters: context - context for the component being painted g - the Graphics object used for painting See Also: update(Graphics,JComponent) paintText protected void paintText(SynthContext context, Graphics g, String title) Paints the component's text. Parameters: context - context for the component being painted g - Graphics object used for painting title - the text to paint paintBorder public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) Paints the border. Specified by: paintBorder in interface SynthUI Parameters: context - a component context g - Graphics to paint on x - the X coordinate y - the Y coordinate w - width of the border h - height of the border propertyChange public void propertyChange(PropertyChangeEvent e) This method gets called when a bound property is changed. Specified by: propertyChange in interface PropertyChangeListener Parameters: e - A PropertyChangeEvent object describing the event source and the property that has changed. getPreferredSize public Dimension getPreferredSize(JComponent c) Returns the specified component's preferred size appropriate for the look and feel. If null is returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returns null. Overrides: getPreferredSize in class BasicProgressBarUI Parameters: c - the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components See Also: JComponent.getPreferredSize(), LayoutManager.preferredLayoutSize(java.awt.Container)
ScrollView QML Type Scrollable view. More... Import Statement: import QtQuick.Controls 2.5 Since: Qt 5.9 Inherits: Pane List of all members, including inherited members Properties contentChildren : list<Item> contentData : list<Object> Detailed Description ScrollView provides scrolling for user-defined content. It can be used to either replace a Flickable, or to decorate an existing one. The first example demonstrates the simplest usage of ScrollView. ScrollView { width: 200 height: 200 clip: true Label { text: "ABC" font.pixelSize: 224 } } Note: ScrollView does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the clip property to true, as shown above. The second example illustrates using an existing Flickable, that is, a ListView. ScrollView { width: 200 height: 200 ListView { model: 20 delegate: ItemDelegate { text: "Item " + index } } } Sizing As with Flickable, there are several things to keep in mind when using ScrollView: If only a single item is used within a ScrollView, the content size is automatically calculated based on the implicit size of its contained item. However, if more than one item is used (or an implicit size is not provided), the contentWidth and contentHeight properties must be set to the combined size of its contained items. If the content size is less than or equal to the size of the ScrollView, it will not be flickable. Scroll Bars The horizontal and vertical scroll bars can be accessed and customized using the ScrollBar.horizontal and ScrollBar.vertical attached properties. The following example adjusts the scroll bar policies so that the horizontal scroll bar is always off, and the vertical scroll bar is always on. ScrollView { // ... ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.vertical.policy: ScrollBar.AlwaysOn } Touch vs. Mouse Interaction On touch, ScrollView enables flicking and makes the scroll bars non-interactive. When interacted with a mouse device, flicking is disabled and the scroll bars are interactive. Scroll bars can be made interactive on touch, or non-interactive when interacted with a mouse device, by setting the interactive property explicitly to true or false, respectively. ScrollView { // ... ScrollBar.horizontal.interactive: true ScrollBar.vertical.interactive: true } See also ScrollBar, ScrollIndicator, Customizing ScrollView, Container Controls, and Focus Management in Qt Quick Controls 2. Property Documentation contentChildren : list<Item> This property holds the list of content children. The list contains all items that have been declared in QML as children of the view. Note: Unlike contentData, contentChildren does not include non-visual QML objects. See also Item8b7c:f320:99b9:690f:4595:cd17:293a:c069hildren and contentData. [default] contentData : list<Object> This property holds the list of content data. The list contains all objects that have been declared in QML as children of the view. Note: Unlike contentChildren, contentData does include non-visual QML objects. See also Item8b7c:f320:99b9:690f:4595:cd17:293a:c069ta and contentChildren.
Class AtomicBoolean java.lang.Object java.util.concurrent.atomic.AtomicBoolean All Implemented Interfaces: Serializable public class AtomicBoolean extends Object implements Serializable A boolean value that may be updated atomically. See the java.util.concurrent.atomic package specification for description of the properties of atomic variables. An AtomicBoolean is used in applications such as atomically updated flags, and cannot be used as a replacement for a Boolean. Since: 1.5 See Also: Serialized Form Constructors Constructor and Description AtomicBoolean() Creates a new AtomicBoolean with initial value false. AtomicBoolean(boolean initialValue) Creates a new AtomicBoolean with the given initial value. Methods Modifier and Type Method and Description boolean compareAndSet(boolean expect, boolean update) Atomically sets the value to the given updated value if the current value == the expected value. boolean get() Returns the current value. boolean getAndSet(boolean newValue) Atomically sets to the given value and returns the previous value. void lazySet(boolean newValue) Eventually sets to the given value. void set(boolean newValue) Unconditionally sets to the given value. String toString() Returns the String representation of the current value. boolean weakCompareAndSet(boolean expect, boolean update) Atomically sets the value to the given updated value if the current value == the expected value. Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait Constructors AtomicBoolean public AtomicBoolean(boolean initialValue) Creates a new AtomicBoolean with the given initial value. Parameters: initialValue - the initial value AtomicBoolean public AtomicBoolean() Creates a new AtomicBoolean with initial value false. Methods get public final boolean get() Returns the current value. Returns: the current value compareAndSet public final boolean compareAndSet(boolean expect, boolean update) Atomically sets the value to the given updated value if the current value == the expected value. Parameters: expect - the expected value update - the new value Returns: true if successful. False return indicates that the actual value was not equal to the expected value. weakCompareAndSet public boolean weakCompareAndSet(boolean expect, boolean update) Atomically sets the value to the given updated value if the current value == the expected value. May fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate alternative to compareAndSet. Parameters: expect - the expected value update - the new value Returns: true if successful set public final void set(boolean newValue) Unconditionally sets to the given value. Parameters: newValue - the new value lazySet public final void lazySet(boolean newValue) Eventually sets to the given value. Parameters: newValue - the new value Since: 1.6 getAndSet public final boolean getAndSet(boolean newValue) Atomically sets to the given value and returns the previous value. Parameters: newValue - the new value Returns: the previous value toString public String toString() Returns the String representation of the current value. Overrides: toString in class Object Returns: the String representation of the current value
module ActiveJo8b7c:f320:99b9:690f:4595:cd17:293a:c069Core Provides general behavior that will be included into every Active Job object that inherits from ActiveJo8b7c:f320:99b9:690f:4595:cd17:293a:c069Base. Public Class Methods new(*arguments) Show source # File activejob/lib/active_job/core.rb, line 69 def initialize(*arguments) @arguments = arguments @job_id = SecureRandom.uuid @queue_name = self.class.queue_name @priority = self.class.priority @executions = 0 end Creates a new job instance. Takes the arguments that will be passed to the perform method. Public Instance Methods deserialize(job_data) Show source # File activejob/lib/active_job/core.rb, line 112 def deserialize(job_data) self.job_id = job_data["job_id"] self.provider_job_id = job_data["provider_job_id"] self.queue_name = job_data["queue_name"] self.priority = job_data["priority"] self.serialized_arguments = job_data["arguments"] self.executions = job_data["executions"] self.locale = job_data["locale"] || I18n.locale.to_s end Attaches the stored job data to the current instance. Receives a hash returned from serialize Examples class DeliverWebhookJob < ActiveJo8b7c:f320:99b9:690f:4595:cd17:293a:c069Base def serialize super.merge('attempt_number' => (@attempt_number || 0) + 1) end def deserialize(job_data) super @attempt_number = job_data['attempt_number'] end rescue_from(TimeoutError) do |exception| raise exception if @attempt_number > 5 retry_job(wait: 10) end end serialize() Show source # File activejob/lib/active_job/core.rb, line 79 def serialize { "job_class" => self.class.name, "job_id" => job_id, "provider_job_id" => provider_job_id, "queue_name" => queue_name, "priority" => priority, "arguments" => serialize_arguments(arguments), "executions" => executions, "locale" => I18n.locale.to_s } end Returns a hash with the job data that can safely be passed to the queueing adapter.
tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069ops8b7c:f320:99b9:690f:4595:cd17:293a:c069LoopCond #include <control_flow_ops.h> Forwards the input to the output. Summary This operator represents the loop termination condition used by the "pivot" switches of a loop. Arguments: scope: A Scope object input: A boolean scalar, representing the branch predicate of the Switch op. Returns: Output: The same tensor as input. Constructors and Destructors LoopCond(const 8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Scope & scope, 8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Input input) Public attributes operation Operation output 8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Output Public functions node() const 8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Node * operator8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Input() const operator8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Output() const Public attributes operation Operation operation output 8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Output output Public functions LoopCond LoopCond( const 8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Scope & scope, 8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Input input ) node 8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Node * node() const operator8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Input operator8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Input() const operator8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Output operator8b7c:f320:99b9:690f:4595:cd17:293a:c069tensorflow8b7c:f320:99b9:690f:4595:cd17:293a:c069Output() const
Adapting to the new two-value syntax of display CSS Display Module Level 3 describes the two-value syntax for the display property. This guide explains the change to the syntax, including the reasoning behind this change. It also details the in-built backwards compatibility for the display property. What happens when we change the value of the display property? One of the first things we learn about CSS is that some elements are block-level and some are inline-level. For example, an <h1> or a <p> are block-level by default, and a <span> is inline-level. Using the display property we can switch between block and inline. For example to make a heading inline we would use the following CSS: h1 { display: inline; } More recently we have gained CSS Grid Layout and Flexbox. To access these we also use values of the display property — display: grid and display: flex. Only when the value of display is changed do the children become flex or grid items and begin to respond to the other properties in the grid or flexbox specifications. Changing an element's display value changes the formatting context of its direct children. What grid and flexbox demonstrate, however, is that an element has both an outer and an inner display type. The outer display type describes whether the element is block-level or inline-level. The inner display type describes how the children of that box behave. As an example, when we use display: flex we create a block-level container, with flex children. The children are described as participating in a flex formatting context. You can see this if you take a <span> — normally an inline-level element — and apply display: flex to it. The <span> becomes a block-level element. It behaves as block-level things do in relationship to other boxes in the layout. It's as if you had applied display: block to the span, however we also get the changed behavior of the children. The live example below has a <span> with display: flex applied. It has become a block-level box taking up all available space in the inline direction. You can now use justify-content: space-between; to put this space between the two flex items. We can create inline flex containers. If you create a flex container using the single value of inline-flex you will have an inline-level box with flex children. The children behave in the same way as the flex children of a block-level container. The only thing that has changed is that the parent is now an inline-level box. It therefore behaves like other inline-level things, and doesn't take up the full width (or size in the inline dimension) that a block-level box does. This means that some following text could come up alongside the flex container. The same is true when working with grid layout. Using display: grid will give you a block-level box, which creates a grid formatting context for the direct children. Using display: inline-grid will create an inline-level box, which creates a grid formatting context for the children. The two-value syntax As you can see from the above explanation, the display property has gained considerable new powers. In addition to indicating whether something is block-level or inline-level in relationship to other boxes on the page, it now also indicates the formatting context inside the box it is applied to. In order to better describe this behavior, the display property has been refactored to allow for two values — an outer and inner value — to be set on it, as well as the single values we are used to. This means that instead of setting display: flex to create a block-level box with flex children, we will use display: block flex. Instead of display: inline-flex to create an inline-level box with flex children, we will use display: inline flex. The example below, which will work in Firefox 70 and upwards, demonstrates these values. There are mappings for all of the existing values of display; the most common ones are listed in the table below. To see a full list take a look at the table found in the display property specification. Single value New value block block flow flow-root block flow-root inline inline flow inline-block inline flow-root flex block flex inline-flex inline flex grid block grid inline-grid inline grid display: block flow-root and display: inline flow-root In terms of how these new values help to clarify CSS layout, we can take a look at a couple of values in the table that might seem less familiar. The two-value display: block flow-root maps to a fairly recent single value; display: flow-root. This value's only purpose is to create a new Block Formatting Context (BFC). A BFC ensures that everything inside your box stays inside it, and things from outside the box cannot intrude into it. The most obvious use-case for creating a new BFC is to contain floats, and avoid the need for clearfix hacks. In the example below we have a floated item inside a container. The float is contained by the bordered box, which wraps it and the text alongside. If you remove the line display: flow-root then the float will poke out of the bottom of the box. If you are using Firefox you can replace it with the newer display: block flow-root, which will achieve the same as the single flow-root value. The flow-root value makes sense if you think about block and inline layout, which is sometimes called normal flow. Our HTML page creates a new formatting context (floats and margins cannot extend out from the boundaries) and our content lays out in normal flow, using block and inline layout, unless we change the value of display to use some other formatting context. Creating a grid or flex container also creates a new formatting context (a grid or flex formatting context, respectively.) These also contain everything inside them. However, if you want to contain floats and margins but continue using block and inline layout, you can create a new flow root, and start over with block and inline layout. From that point downwards everything is contained inside the new flow root. The two-value syntax for display: flow-root being display: block flow-root therefore makes a lot of sense. You are creating a block formatting context, with a block-level box and children participating in normal flow. What about the matched pair display: inline flow-root? This is the new way of describing display: inline-block. The value display: inline-block has been around since the early days of CSS. The reason we tend to use it is to allow padding to push inline items away from an element, when creating navigation items for example, or when wanting to add a background with padding to an inline element as in the example below. An element with display: inline-block however, will also contain floats. It contains everything inside the inline-level box. Therefore display: inline-block does exactly what display: flow-root does, but with an inline-level, rather than a block-level box. The new syntax accurately describes what is happening with this value. In the example above, you can change display: inline-block to display: inline flow-root in Firefox and get the same result. What about the old values of display? The single values of display are described in the specification as legacy values, and currently you gain no benefit from using the two-value versions, as there is a direct mapping for each two-value version to a legacy version, as demonstrated in the table above. To deal with single values of display the specification explains what to do if only the outer value of block or inline is used: "If a <display-outside> value is specified but <display-inside> is omitted, the element's inner display type defaults to flow." This means that the behavior is exactly as it is in a single value world. If you specify display: block or display: inline, that changes the outer display value of the box but any children continue in normal flow. If only an inner value of flex, grid, or flow-root is specified then the specification explains that the outer value should be set to block: "If a <display-inside> value is specified but <display-outside> is omitted, the element's outer display type defaults to block—except for ruby, which defaults to inline." Finally, we have some legacy pre-composed inline-level values of: inline-block inline-table inline-flex inline-grid If a supporting browser comes across these as single values then it treats them the same as the two-value versions: inline flow-root inline table inline flex inline grid So all of the current situations are neatly covered, meaning that we maintain compatibility of existing and new sites that use the single values, while allowing the spec to evolve. Can I start to use the two-value syntax? As demonstrated above, there is not a lot of advantage in using the two-value version right now; if you did, your page would only work in Firefox! Other browsers do not yet implement the two-value versions. Therefore display: block flex will only get you flex layout in Firefox and will be ignored as invalid in Chrome. You can see current support in the Multi-keyword values row of the browser compatibility table for the CSS display property. See also the following Chrome issue. There is value in thinking about the values of display in this two-value way however. If you consider the outer and inner values when you change the value of display, you will understand immediately what impact the value will have on the box itself, and how it displays and behaves in the layout, and the direct children. 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 29, 2022, by MDN contributors
offset-position Experimental: This is an experimental technologyCheck the Browser compatibility table carefully before using this in production. The offset-position CSS property defines the initial position of the offset-path. Syntax /* Keyword values */ offset-position: auto; offset-position: top; offset-position: bottom; offset-position: left; offset-position: right; offset-position: center; /* <percentage> values */ offset-position: 25% 75%; /* <length> values */ offset-position: 0 0; offset-position: 1cm 2cm; offset-position: 10ch 8em; /* Edge offsets values */ offset-position: bottom 10px right 20px; offset-position: right 3em bottom 10px; offset-position: bottom 10px right; offset-position: top right 10px; /* Global values */ offset-position: inherit; offset-position: initial; offset-position: revert; offset-position: revert-layer; offset-position: unset; Values auto The initial position is the position of the box specified by the position property. <position> A <position>. A position defines an x/y coordinate, to place an item relative to the edges of an element's box. It can be defined using one to four values. If two non-keyword values are used, the first value represents the horizontal position and the second represents the vertical position. If only one value is specified, the second value is assumed to be center. If three or four values are used, the length-percentage values are offsets for the preceding keyword value(s). For more explanation of these value types, see background-position. Formal definition Initial value auto Applies to transformable elements Inherited no Percentages referToSizeOfContainingBlock Computed value for <length> the absolute value, otherwise a percentage Animation type a position Formal syntax offset-position = auto | <position> <position> = [ left | center | right | top | bottom | start | end | <length-percentage> ] | [ left | center | right | x-start | x-end | <length-percentage> ] [ top | center | bottom | y-start | y-end | <length-percentage> ] | [ center | [ left | right | x-start | x-end ] <length-percentage>? ] && [ center | [ top | bottom | y-start | y-end ] <length-percentage>? ] | [ center | [ start | end ] <length-percentage>? ] [ center | [ start | end ] <length-percentage>? ] <length-percentage> = <length> | <percentage> Examples Setting initial offset position <div id="motion-demo"></div> #motion-demo { offset-path: path('M20,20 C20,100 200,0 200,100'); offset-position: left top; animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } Specifications Specification Motion Path Module Level 1 # offset-position-property 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 offset-position No See bug 638055. No See bug 638055. No See bug 1559232. No No See bug 638055. No No See bug 638055. No See bug 638055. No See bug 1559232. No See bug 638055. No No See bug 638055. See also offset offset-anchor offset-distance offset-path offset-rotate 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 5, 2022, by MDN contributors
CronJob CronJob represents the configuration of a single cron job. apiVersion: batch/v1 import "k8s.io/api/batch/v1" CronJob CronJob represents the configuration of a single cron job. apiVersion: batch/v1 kind: CronJob metadata (ObjectMeta) Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata spec (CronJobSpec) Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status status (CronJobStatus) Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status CronJobSpec CronJobSpec describes how the job execution will look like and when it will actually run. jobTemplate (JobTemplateSpec), required Specifies the job that will be created when executing a CronJob. JobTemplateSpec describes the data a Job should have when created from a template jobTemplate.metadata (ObjectMeta) Standard object's metadata of the jobs created from this template. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata jobTemplate.spec (JobSpec) Specification of the desired behavior of the job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status schedule (string), required The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. timeZone (string) The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will default to the time zone of the kube-controller-manager process. The set of valid time zone names and the time zone offset is loaded from the system-wide time zone database by the API server during CronJob validation and the controller manager during execution. If no system-wide time zone database can be found a bundled version of the database is used instead. If the time zone name becomes invalid during the lifetime of a CronJob or due to a change in host configuration, the controller will stop creating new new Jobs and will create a system event with the reason UnknownTimeZone. More information can be found in https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones This is beta field and must be enabled via the CronJobTimeZone feature gate. concurrencyPolicy (string) Specifies how to treat concurrent executions of a Job. Valid values are: - "Allow" (default): allows CronJobs to run concurrently; - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - "Replace": cancels currently running job and replaces it with a new one startingDeadlineSeconds (int64) Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones. suspend (boolean) This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false. successfulJobsHistoryLimit (int32) The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3. failedJobsHistoryLimit (int32) The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1. CronJobStatus CronJobStatus represents the current state of a cron job. active ([]ObjectReference) Atomic: will be replaced during a merge A list of pointers to currently running jobs. lastScheduleTime (Time) Information when was the last time the job was successfully scheduled. Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers. lastSuccessfulTime (Time) Information when was the last time the job successfully completed. Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers. CronJobList CronJobList is a collection of cron jobs. apiVersion: batch/v1 kind: CronJobList metadata (ListMeta) Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata items ([]CronJob), required items is the list of CronJobs. © 2022 The Kubernetes Authors | Documentation Distributed under CC BY 4.0 Copyright
win_command - Executes a command on a remote Windows node New in version 2.2. Synopsis Options Examples Return Values Notes Status Maintenance Info Synopsis The win_command module takes the command name followed by a list of space-delimited arguments. The given command will be executed on all selected nodes. It will not be processed through the shell, so variables like $env:HOME and operations like "<", ">", "|", and ";" will not work (use the win_shell module if you need these features). For non-Windows targets, use the command module instead. Options parameter required default choices comments chdir no set the specified path as the current working directory before executing a command creates no a path or path filter pattern; when the referenced path exists on the target host, the task will be skipped. free_form yes the win_command module takes a free form command to run. There is no parameter actually named 'free form'. See the examples! removes no a path or path filter pattern; when the referenced path does not exist on the target host, the task will be skipped. Examples - name: Save the result of 'whoami' in 'whoami_out' win_command: whoami register: whoami_out - name: Run command that only runs if folder exists and runs from a specific folder win_command: wbadmin -backupTarget:C:\backup\ args: chdir: C:\somedir\ creates: C:\backup\ Return Values Common return values are documented here Return Values, the following are the fields unique to this module: name description returned type sample cmd The command executed by the task always string rabbitmqctl join_cluster rabbit@master delta The command execution delta time always string 0:00:00.325771 end The command execution end time always string 2016-02-25 09:18:26.755339 msg changed always boolean True rc The command return code (0 means success) always int 0 start The command execution start time always string 2016-02-25 09:18:26.429568 stderr The command standard error always string ls: cannot access foo: No such file or directory stdout The command standard output always string Clustering node rabbit@slave1 with rabbit@master ... stdout_lines The command standard output split in lines always list ["u'Clustering node rabbit@slave1 with rabbit@master ...'"] Notes Note If you want to run a command through a shell (say you are using <, >, |, etc), you actually want the win_shell module instead. The win_command module is much more secure as it’s not affected by the user’s environment. creates, removes, and chdir can be specified after the command. For instance, if you only want to run a command if a certain file does not exist, use this. For non-Windows targets, use the command module instead. Status This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface. Maintenance Info For more information about Red Hat’s this support of this module, please refer to this knowledge base article<https://access.redhat.com/articles/rhel-top-support-policies> For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules. © 2012–2018 Michael DeHaan
matplotlib.axis.Axis.get_path_effects Axis.get_path_effects(self)
Type-generic math The header <tgmath.h> includes the headers <math.h> and <complex.h> and defines several type-generic macros that determine which real or, when applicable, complex function to call based on the types of the arguments. For each macro, the parameters whose corresponding real type in the unsuffixed math.h function is double are known as generic parameters (for example, both parameters of pow are generic parameters, but only the first parameter of scalbn is a generic parameter). When a <tgmath.h> macro is used the types of the arguments passed to the generic parameters determine which function is selected by the macro as described below. If the types of the arguments are not compatible with the parameter types of the selected function, the behavior is undefined (e.g. if a complex argument is passed into a real-only <tgmath.h>'s macro: float complex fc; ceil(fc); or double complex dc; double d; fmax(dc, d); are examples of undefined behavior). Note: type-generic macros were implemented in implementation-defined manner in C99, but C11 keyword _Generic makes it possible to implement these macros in portable manner. Complex/real type-generic macros For all functions that have both real and complex counterparts, a type-generic macro XXX exists, which calls either of: real function: float variant XXXf double variant XXX long double variant XXXl complex function: float variant cXXXf double variant cXXX long double variant cXXXl An exception to the above rule is the fabs macro (see the table below). The function to call is determined as follows: If any of the arguments for the generic parameters is imaginary, the behavior is specified on each function reference page individually (in particular, sin, cos, tag, cosh, sinh, tanh, asin, atan, asinh, and atanh call real functions, the return types of sin, tan, sinh, tanh, asin, atan, asinh, and atanh are imaginary, and the return types of cos and cosh are real). If any of the arguments for the generic parameters is complex, then the complex function is called, otherwise the real function is called. If any of the arguments for the generic parameters is long double, then the long double variant is called. Otherwise, if any of the parameters is double or integer, then the double variant is called. Otherwise, float variant is called. The type-generic macros are as follows: Type-generic macro Real function variants Complex function variants float double long double float double long double fabs fabsf fabs fabsl cabsf cabs cabsl exp expf exp expl cexpf cexp cexpl log logf log logl clogf clog clogl pow powf pow powl cpowf cpow cpowl sqrt sqrtf sqrt sqrtl csqrtf csqrt csqrtl sin sinf sin sinl csinf csin csinl cos cosf cos cosl ccosf ccos ccosl tan tanf tan tanl ctanf ctan ctanl asin asinf asin asinl casinf casin casinl acos acosf acos acosl cacosf cacos cacosl atan atanf atan atanl catanf catan catanl sinh sinhf sinh sinhl csinhf csinh csinhl cosh coshf cosh coshl ccoshf ccosh ccoshl tanh tanhf tanh tanhl ctanhf ctanh ctanhl asinh asinhf asinh asinhl casinhf casinh casinhl acosh acoshf acosh acoshl cacoshf cacosh cacoshl atanh atanhf atanh atanhl catanhf catanh catanhl Real-only functions For all functions that do not have complex counterparts, with the exception of modf, a type-generic macro XXX exists, which calls either of the variants of a real function: float variant XXXf double variant XXX long double variant XXXl The function to call is determined as follows: If any of the arguments for the generic parameters is long double, then the long double variant is called. Otherwise, if any of the arguments for the generic parameters is double, then the double variant is called. Otherwise, float variant is called. Type-generic macro Real function variants float double long double atan2 atan2f atan2 atan2l cbrt cbrtf cbrt cbrtl ceil ceilf ceil ceill copysign copysignf copysign copysignl erf erff erf erfl erfc erfcf erfc erfcl exp2 exp2f exp2 exp2l expm1 expm1f expm1 expm1l fdim fdimf fdim fdiml floor floorf floor floorl fma fmaf fma fmal fmax fmaxf fmax fmaxl fmin fminf fmin fminl fmod fmodf fmod fmodl frexp frexpf frexp frexpl hypot hypotf hypot hypotl ilogb ilogbf ilogb ilogbl ldexp ldexpf ldexp ldexpl lgamma lgammaf lgamma lgammal llrint llrintf llrint llrintl llround llroundf llround llroundl log10 log10f log10 log10l log1p log1pf log1p log1pl log2 log2f log2 log2l logb logbf logb logbl lrint lrintf lrint lrintl lround lroundf lround lroundl nearbyint nearbyintf nearbyint nearbyintl nextafter nextafterf nextafter nextafterl nexttoward nexttowardf nexttoward nexttowardl remainder remainderf remainder remainderl remquo remquof remquo remquol rint rintf rint rintl round roundf round roundl scalbln scalblnf scalbln scalblnl scalbn scalbnf scalbn scalbnl tgamma tgammaf tgamma tgammal trunc truncf trunc truncl Complex-only functions For all complex number functions that do not have real counterparts, a type-generic macro cXXX exists, which calls either of the variants of a complex function: float complex variant cXXXf double complex variant cXXX long double complex variant cXXXl The function to call is determined as follows: If any of the arguments for the generic parameters is real, complex, or imaginary, then the appropriate complex function is called. Type-generic macro Complex function variants float double long double carg cargf carg cargl conj conjf conj conjl creal crealf creal creall cimag cimagf cimag cimagl cproj cprojf cproj cprojl Example #include <stdio.h> #include <tgmath.h> int main(void) { int i = 2; printf("sqrt(2) = %f\n", sqrt(i)); // argument type is int, calls sqrt float f = 0.5; printf("sin(0.5f) = %f\n", sin(f)); // argument type is float, calls sinf float complex dc = 1 + 0.5*I; float complex z = sqrt(dc); // argument type is float complex, calls csqrtf printf("sqrt(1 + 0.5i) = %f+%fi\n", creal(z), // argument type is float complex, calls crealf cimag(z)); // argument type is float complex, calls cimagf } Output: sqrt(2) = 1.414214 sin(0.5f) = 0.479426 sqrt(1 + 0.5i) = 1.029086+0.242934i References C17 standard (ISO/IEC 9899:2018): 7.25 Type-generic math <tgmath.h> (p: 272-273) C11 standard (ISO/IEC 9899:2011): 7.25 Type-generic math <tgmath.h> (p: 373-375) C99 standard (ISO/IEC 9899:1999): 7.22 Type-generic math <tgmath.h> (p: 335-337)
ovirt.ovirt.ovirt_quota – Module to manage datacenter quotas in oVirt/RHV Note This plugin is part of the ovirt.ovirt collection (version 1.3.0). To install it use: ansible-galaxy collection install ovirt.ovirt. To use it in a playbook, specify: ovirt.ovirt.ovirt_quota. New in version 1.0.0: of ovirt.ovirt Synopsis Requirements Parameters Notes Examples Return Values Synopsis Module to manage datacenter quotas in oVirt/RHV Requirements The below requirements are needed on the host that executes this module. python >= 2.7 ovirt-engine-sdk-python >= 4.4.0 Parameters Parameter Choices/Defaults Comments auth dictionary / required Dictionary with values needed to create HTTP/HTTPS connection to oVirt: ca_file string 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. headers dictionary Dictionary of HTTP headers to be added to each API call. hostname string A string containing the hostname of the server, usually something like `server.example.com`. Default value is set by OVIRT_HOSTNAME environment variable. Either url or hostname is required. insecure boolean Choices: no yes A boolean flag that indicates if the server TLS certificate and host name should be checked. kerberos boolean Choices: no yes A boolean flag indicating if Kerberos authentication should be used instead of the default basic authentication. password string / required The password of the user. Default value is set by OVIRT_PASSWORD environment variable. token string Token to be used instead of login with username/password. Default value is set by OVIRT_TOKEN environment variable. url string A string containing the API URL of the server, usually something like `https://server.example.com/ovirt-engine/api`. Default value is set by OVIRT_URL environment variable. Either url or hostname is required. username string / required The name of the user, something like [email protected]. Default value is set by OVIRT_USERNAME environment variable. cluster_grace integer Cluster grace(hard limit) defined in percentage (1-100). aliases: cluster_hard_limit cluster_threshold integer Cluster threshold(soft limit) defined in percentage (0-100). aliases: cluster_soft_limit clusters list / elements=dictionary List of dictionary of cluster limits, which is valid to specific cluster. If cluster isn't specified it's valid to all clusters in system: cluster string Name of the cluster. cpu string CPU limit. memory string Memory limit (in GiB). data_center string / required Name of the datacenter where quota should be managed. description string Description of the quota to manage. fetch_nested boolean Choices: no yes 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. id string ID of the quota to manage. name string / required Name of the quota to manage. nested_attributes list / elements=string Specifies list of the attributes which should be fetched from the API. This parameter apply only when fetch_nested is true. poll_interval integer Default:3 Number of the seconds the module waits until another poll request on entity status is sent. state string Choices: present ← absent Should the quota be present/absent. storage_grace integer Storage grace(hard limit) defined in percentage (1-100). aliases: storage_hard_limit storage_threshold integer Storage threshold(soft limit) defined in percentage (0-100). aliases: storage_soft_limit storages list / elements=dictionary List of dictionary of storage limits, which is valid to specific storage. If storage isn't specified it's valid to all storages in system: size string Size limit (in GiB). storage string Name of the storage. timeout integer Default:180 The amount of time in seconds the module should wait for the instance to get into desired state. wait boolean Choices: no yes ← yes if the module should wait for the entity to get into desired state. Notes Note 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.4.0 Examples # Examples don't contain auth parameter for simplicity, # look at ovirt_auth module to see how to reuse authentication: # Add cluster quota to cluster cluster1 with memory limit 20GiB and CPU limit to 10: - ovirt.ovirt.ovirt_quota: name: quota1 data_center: dcX clusters: - name: cluster1 memory: 20 cpu: 10 # Add cluster quota to all clusters with memory limit 30GiB and CPU limit to 15: - ovirt.ovirt.ovirt_quota: name: quota2 data_center: dcX clusters: - memory: 30 cpu: 15 # Add storage quota to storage data1 with size limit to 100GiB - ovirt.ovirt.ovirt_quota: name: quota3 data_center: dcX storage_grace: 40 storage_threshold: 60 storages: - name: data1 size: 100 # Remove quota quota1 (Note the quota must not be assigned to any VM/disk): - ovirt.ovirt.ovirt_quota: state: absent data_center: dcX name: quota1 # Change Quota Name - ovirt.ovirt.ovirt_quota: id: 00000000-0000-0000-0000-000000000000 name: "new_quota_name" data_center: dcX Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description id string On success if quota is found. ID of the quota which is managed Sample: 7de90f31-222c-436c-a1ca-7e655bd5b60c quota dictionary On success if quota is found. Dictionary of all the quota attributes. Quota attributes can be found on your oVirt/RHV instance at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/quota. Authors Ondra Machacek (@machacekondra) Martin Necas (@mnecas) © 2012–2018 Michael DeHaan
public static function MarkupTrait8b7c:f320:99b9:690f:4595:cd17:293a:c069reate public static MarkupTrait8b7c:f320:99b9:690f:4595:cd17:293a:c069reate($string) Creates a Markup object if necessary. If $string is equal to a blank string then it is not necessary to create a Markup object. If $string is an object that implements MarkupInterface it is returned unchanged. Parameters mixed $string: The string to mark as safe. This value will be cast to a string. Return value string|\Drupal\Component\Render\MarkupInterface A safe string. File core/lib/Drupal/Component/Render/MarkupTrait.php, line 34 Class MarkupTrait Implements MarkupInterface and Countable for rendered objects. Namespace Drupal\Component\Render Code public static function create($string) { if ($string instanceof MarkupInterface) { return $string; } $string = (string) $string; if ($string === '') { return ''; } $safe_string = new static(); $safe_string->string = $string; return $safe_string; }
dart:io ANY_IP_V6 property InternetAddress ANY_IP_V6 IP version 6 any address. Use this address when listening on all adapters IP addresses using IP version 6 (IPv6). Source external static InternetAddress get ANY_IP_V6;
Getting Started Keyword lists and maps Now let’s talk about associative data structures. Associative data structures are able to associate a key to a certain value. Different languages call these different names like dictionaries, hashes, associative arrays, etc. In Elixir, we have two main associative data structures: keyword lists and maps. It’s time to learn more about them! Keyword lists Keyword lists are a data-structure used to pass options to functions. Imagine you want to split a string of numbers. We can use String.split/2: iex> String.split("1 2 3", " ") ["1", "2", "3"] However, what happens if there is an additional space between the numbers: iex> String.split("1 2 3", " ") ["1", "", "2", "", "3"] As you can see, there are now empty strings in our results. Luckily, the String.split/3 function allows the trim option to be set to true: iex> String.split("1 2 3", " ", [trim: true]) ["1", "2", "3"] [trim: true] is a keyword list. Furthermore, when a keyword list is the last argument of a function, we can skip the brackets and write: iex> String.split("1 2 3", " ", trim: true) ["1", "2", "3"] As the name implies, keyword lists are simply lists. In particular, keyword lists are 2-item tuples where the first element (the key) is an atom and the second element can be any value. Both representations are the same: iex> [{:trim, true}] == [trim: true] true Since keyword lists are lists, we can use all operations available to lists. For example, we can use ++ to add new values to a keyword list: iex> list = [a: 1, b: 2] [a: 1, b: 2] iex> list ++ [c: 3] [a: 1, b: 2, c: 3] iex> [a: 0] ++ list [a: 0, a: 1, b: 2] You can read the value of a keyword list using the brackets syntax: iex> list[:a] 1 iex> list[:b] 2 In case of duplicate keys, values added to the front are the ones fetched: iex> new_list = [a: 0] ++ list [a: 0, a: 1, b: 2] iex> new_list[:a] 0 Keyword lists are important because they have three special characteristics: Keys must be atoms. Keys are ordered, as specified by the developer. Keys can be given more than once. For example, the Ecto library makes use of these features to provide an elegant DSL for writing database queries: query = from w in Weather, where: w.prcp > 0, where: w.temp < 20, select: w Although we can pattern match on keyword lists, it is rarely done in practice since pattern matching on lists requires the number of items and their order to match: iex> [a: a] = [a: 1] [a: 1] iex> a 1 iex> [a: a] = [a: 1, b: 2] ** (MatchError) no match of right hand side value: [a: 1, b: 2] iex> [b: b, a: a] = [a: 1, b: 2] ** (MatchError) no match of right hand side value: [a: 1, b: 2] In order to manipulate keyword lists, Elixir provides the Keyword module. Remember, though, keyword lists are simply lists, and as such they provide the same linear performance characteristics as them: the longer the list, the longer it will take to find a key, to count the number of items, and so on. For this reason, keyword lists are used in Elixir mainly for passing optional values. If you need to store many items or guarantee one-key associates with at maximum one-value, you should use maps instead. Maps Whenever you need a key-value store, maps are the “go to” data structure in Elixir. A map is created using the %{} syntax: iex> map = %{:a => 1, 2 => :b} %{2 => :b, :a => 1} iex> map[:a] 1 iex> map[2] :b iex> map[:c] nil Compared to keyword lists, we can already see two differences: Maps allow any value as a key. Maps’ keys do not follow any ordering. In contrast to keyword lists, maps are very useful with pattern matching. When a map is used in a pattern, it will always match on a subset of the given value: iex> %{} = %{:a => 1, 2 => :b} %{2 => :b, :a => 1} iex> %{:a => a} = %{:a => 1, 2 => :b} %{2 => :b, :a => 1} iex> a 1 iex> %{:c => c} = %{:a => 1, 2 => :b} ** (MatchError) no match of right hand side value: %{2 => :b, :a => 1} As shown above, a map matches as long as the keys in the pattern exist in the given map. Therefore, an empty map matches all maps. Variables can be used when accessing, matching and adding map keys: iex> n = 1 1 iex> map = %{n => :one} %{1 => :one} iex> map[n] :one iex> %{^n => :one} = %{1 => :one, 2 => :two, 3 => :three} %{1 => :one, 2 => :two, 3 => :three} The Map module provides a very similar API to the Keyword module with convenience functions to manipulate maps: iex> Map.get(%{:a => 1, 2 => :b}, :a) 1 iex> Map.put(%{:a => 1, 2 => :b}, :c, 3) %{2 => :b, :a => 1, :c => 3} iex> Map.to_list(%{:a => 1, 2 => :b}) [{2, :b}, {:a, 1}] Maps have the following syntax for updating a key’s value: iex> map = %{:a => 1, 2 => :b} %{2 => :b, :a => 1} iex> %{map | 2 => "two"} %{2 => "two", :a => 1} iex> %{map | :c => 3} ** (KeyError) key :c not found in: %{2 => :b, :a => 1} The syntax above requires the given key to exist. It cannot be used to add new keys. For example, using it with the :c key failed because there is no :c in the map. When all the keys in a map are atoms, you can use the keyword syntax for convenience: iex> map = %{a: 1, b: 2} %{a: 1, b: 2} Another interesting property of maps is that they provide their own syntax for accessing atom keys: iex> map = %{:a => 1, 2 => :b} %{2 => :b, :a => 1} iex> map.a 1 iex> map.c ** (KeyError) key :c not found in: %{2 => :b, :a => 1} Elixir developers typically prefer to use the map.field syntax and pattern matching instead of the functions in the Map module when working with maps because they lead to an assertive style of programming. This blog post by José Valim provides insight and examples on how you get more concise and faster software by writing assertive code in Elixir. do-blocks and keywords As we have seen, keywords are mostly used in the language to pass optional values. In fact, we have used keywords before in this guide. For example, we have seen: iex> if true do ...> "This will be seen" ...> else ...> "This won't" ...> end "This will be seen" It happens that do blocks are nothing more than a syntax convenience on top of keywords. We can rewrite the above to: iex> if true, do: "This will be seen", else: "This won't" "This will be seen" Pay close attention to both syntaxes. In the keyword list format, we separate each key-value pair with commas, and each key is followed by :. In the do-blocks, we get rid of the commas and separate each keyword by a newline. They are useful exactly because they remove the verbosity when writing blocks of code. Most of the time, you will use the block syntax, but it is good to know they are equivalent. Note that only a handful of keyword lists can be converted to blocks: do, else, catch, rescue, and after. Those are all the keywords used by Elixir control-flow constructs. We have already learned some of them and we will learn others in the future. With this out of the way, let’s see how we can work with nested data structures. Nested data structures Often we will have maps inside maps, or even keywords lists inside maps, and so forth. Elixir provides conveniences for manipulating nested data structures via the put_in/2, update_in/2 and other macros giving the same conveniences you would find in imperative languages while keeping the immutable properties of the language. Imagine you have the following structure: iex> users = [ john: %{name: "John", age: 27, languages: ["Erlang", "Ruby", "Elixir"]}, mary: %{name: "Mary", age: 29, languages: ["Elixir", "F#", "Clojure"]} ] [ john: %{age: 27, languages: ["Erlang", "Ruby", "Elixir"], name: "John"}, mary: %{age: 29, languages: ["Elixir", "F#", "Clojure"], name: "Mary"} ] We have a keyword list of users where each value is a map containing the name, age and a list of programming languages each user likes. If we wanted to access the age for john, we could write: iex> users[:john].age 27 It happens we can also use this same syntax for updating the value: iex> users = put_in users[:john].age, 31 [ john: %{age: 31, languages: ["Erlang", "Ruby", "Elixir"], name: "John"}, mary: %{age: 29, languages: ["Elixir", "F#", "Clojure"], name: "Mary"} ] The update_in/2 macro is similar but allows us to pass a function that controls how the value changes. For example, let’s remove “Clojure” from Mary’s list of languages: iex> users = update_in users[:mary].languages, fn languages -> List.delete(languages, "Clojure") end [ john: %{age: 31, languages: ["Erlang", "Ruby", "Elixir"], name: "John"}, mary: %{age: 29, languages: ["Elixir", "F#"], name: "Mary"} ] There is more to learn about put_in/2 and update_in/2, including the get_and_update_in/2 that allows us to extract a value and update the data [email protected]. There are also put_in/3, update_in/3 and get_and_update_in/3 which allow dynamic access into the data structure. Check their respective documentation in the Kernel module for more information. This concludes our introduction to associative data structures in Elixir. You will find out that, given keyword lists and maps, you will always have the right tool to tackle problems that require associative data structures in Elixir.
dart:collection union method Set<E> union( Set<E> other ) override Creates a new set which contains all the elements of this set and other. That is, the returned set contains all the elements of this Set and all the elements of other. final characters1 = <String>{'A', 'B', 'C'}; final characters2 = <String>{'A', 'E', 'F'}; final unionSet1 = characters1.union(characters2); print(unionSet1); // {A, B, C, E, F} final unionSet2 = characters2.union(characters1); print(unionSet2); // {A, E, F, B, C} Implementation Set<E> union(Set<E> other) { return toSet()..addAll(other); }
ansible.windows.win_user – Manages local Windows user accounts Note This plugin is part of the ansible.windows collection (version 1.3.0). To install it use: ansible-galaxy collection install ansible.windows. To use it in a playbook, specify: ansible.windows.win_user. Synopsis Parameters Notes See Also Examples Return Values Synopsis Manages local Windows user accounts. For non-Windows targets, use the ansible.builtin.user module instead. Parameters Parameter Choices/Defaults Comments account_disabled boolean Choices: no yes yes will disable the user account. no will clear the disabled flag. account_locked boolean Choices: no yes Only no can be set and it will unlock the user account if locked. description string Description of the user. fullname string Full name of the user. groups list / elements=string Adds or removes the user from this comma-separated list of groups, depending on the value of groups_action. When groups_action is replace and groups is set to the empty string ('groups='), the user is removed from all groups. groups_action string Choices: add replace ← remove If add, the user is added to each group in groups where not already a member. If replace, the user is added as a member of each group in groups and removed from any other groups. If remove, the user is removed from each group in groups. home_directory string added in 1.0.0 of ansible.windows The designated home directory of the user. login_script string added in 1.0.0 of ansible.windows The login script of the user. name string / required Name of the user to create, remove or modify. password string Optionally set the user's password to this (plain text) value. password_expired boolean Choices: no yes yes will require the user to change their password at next login. no will clear the expired password flag. password_never_expires boolean Choices: no yes yes will set the password to never expire. no will allow the password to expire. profile string added in 1.0.0 of ansible.windows The profile path of the user. state string Choices: absent present ← query When absent, removes the user account if it exists. When present, creates or updates the user account. When query, retrieves the user account details without making any changes. update_password string Choices: always ← on_create always will update passwords if they differ. on_create will only set the password for newly created users. user_cannot_change_password boolean Choices: no yes yes will prevent the user from changing their password. no will allow the user to change their password. Notes Note The return values are based on the user object after the module options have been set. When running in check mode the values will still reflect the existing user settings and not what they would have been changed to. See Also See also ansible.builtin.user The official documentation on the ansible.builtin.user module. ansible.windows.win_domain_membership The official documentation on the ansible.windows.win_domain_membership module. community.windows.win_domain_user The official documentation on the community.windows.win_domain_user module. ansible.windows.win_group The official documentation on the ansible.windows.win_group module. ansible.windows.win_group_membership The official documentation on the ansible.windows.win_group_membership module. community.windows.win_user_profile The official documentation on the community.windows.win_user_profile module. Examples - name: Ensure user bob is present ansible.windows.win_user: name: bob password: B0bP4ssw0rd state: present groups: - Users - name: Ensure user bob is absent ansible.windows.win_user: name: bob state: absent Return Values Common return values are documented here, the following are the fields unique to this module: Key Returned Description account_disabled boolean user exists Whether the user is disabled. account_locked boolean user exists Whether the user is locked. description string user exists The description set for the user. Sample: Username for test fullname string user exists The full name set for the user. Sample: Test Username groups list / elements=string user exists A list of groups and their ADSI path the user is a member of. Sample: [{'name': 'Administrators', 'path': 'WinNT://WORKGROUP/USER-PC/Administrators'}] name string always The name of the user Sample: username password_expired boolean user exists Whether the password is expired. password_never_expires boolean user exists Whether the password is set to never expire. Sample: True path string user exists The ADSI path for the user. Sample: WinNT://WORKGROUP/USER-PC/username sid string user exists The SID for the user. Sample: S-1-5-21-3322259488-2828151810-3939402796-1001 user_cannot_change_password boolean user exists Whether the user can change their own password. Authors Paul Durivage (@angstwad) Chris Church (@cchurch) © 2012–2018 Michael DeHaan
File class File extends File (View source) Traits FileHelpers Methods string path() Get the fully qualified path to the file. from FileHelpers string extension() Get the file's extension. from FileHelpers string clientExtension() Get the file's extension supplied by the client. from FileHelpers string hashName(string $path = null) Get a filename for the file that is the MD5 hash of the contents. from FileHelpers Details string path() Get the fully qualified path to the file. Return Value string string extension() Get the file's extension. Return Value string string clientExtension() Get the file's extension supplied by the client. Return Value string string hashName(string $path = null) Get a filename for the file that is the MD5 hash of the contents. Parameters string $path Return Value string
codePointCount kotlin-stdlib / kotlin.text / codePointCount Platform and version requirements: JVM (1.0) fun String.codePointCount(     beginIndex: Int,     endIndex: Int ): Int Returns the number of Unicode code points in the specified text range of this String.
function user_block_save user_block_save($delta = '', $edit = array()) Implements hook_block_save(). File modules/user/user.module, line 1415 Enables the user registration and login system. Code function user_block_save($delta = '', $edit = array()) { global $user; switch ($delta) { case 'new': variable_set('user_block_whois_new_count', $edit['user_block_whois_new_count']); break; case 'online': variable_set('user_block_seconds_online', $edit['user_block_seconds_online']); variable_set('user_block_max_list_count', $edit['user_block_max_list_count']); break; } }
list - simply returns what it is given. New in version 2.0. Synopsis Examples Return Values Status Author Synopsis this is mostly a noop, to be used as a with_list loop when you dont want the content transformed in any way. Examples - name: unlike with_items you will get 3 items from this loop, the 2nd one being a list debug: var=item with_list: - 1 - [2,3] - 4 Return Values Common return values are documented here, the following are the fields unique to this lookup: Key Returned Description _list basically the same as you fed in Status Author Ansible core team Hint If you notice any issues in this documentation you can edit this document to improve it. © 2012–2018 Michael DeHaan
Note Click here to download the full example code or to run this example in your browser via Binder Gaussian processes on discrete data structures This example illustrates the use of Gaussian processes for regression and classification tasks on data that are not in fixed-length feature vector form. This is achieved through the use of kernel functions that operates directly on discrete structures such as variable-length sequences, trees, and graphs. Specifically, here the input variables are some gene sequences stored as variable-length strings consisting of letters ‘A’, ‘T’, ‘C’, and ‘G’, while the output variables are floating point numbers and True/False labels in the regression and classification tasks, respectively. A kernel between the gene sequences is defined using R-convolution [1] by integrating a binary letter-wise kernel over all pairs of letters among a pair of strings. This example will generate three figures. In the first figure, we visualize the value of the kernel, i.e. the similarity of the sequences, using a colormap. Brighter color here indicates higher similarity. In the second figure, we show some regression result on a dataset of 6 sequences. Here we use the 1st, 2nd, 4th, and 5th sequences as the training set to make predictions on the 3rd and 6th sequences. In the third figure, we demonstrate a classification model by training on 6 sequences and make predictions on another 5 sequences. The ground truth here is simply whether there is at least one ‘A’ in the sequence. Here the model makes four correct classifications and fails on one. [1] Haussler, D. (1999). Convolution kernels on discrete structures (Vol. 646). Technical report, Department of Computer Science, University of California at Santa Cruz. /home/runner/work/scikit-learn/scikit-learn/sklearn/gaussian_process/kernels.py:420: ConvergenceWarning: The optimal value found for dimension 0 of parameter baseline_similarity is close to the specified lower bound 1e-05. Decreasing the bound and calling fit again may find a better value. warnings.warn( /home/runner/work/scikit-learn/scikit-learn/examples/gaussian_process/plot_gpr_on_structured_data.py:174: UserWarning: You passed a edgecolor/edgecolors ((0, 1.0, 0.3)) for an unfilled marker ('x'). Matplotlib is ignoring the edgecolor in favor of the facecolor. This behavior may change in the future. plt.scatter( import numpy as np import matplotlib.pyplot as plt from sklearn.gaussian_process.kernels import Kernel, Hyperparameter from sklearn.gaussian_process.kernels import GenericKernelMixin from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process import GaussianProcessClassifier from sklearn.base import clone class SequenceKernel(GenericKernelMixin, Kernel): """ A minimal (but valid) convolutional kernel for sequences of variable lengths.""" def __init__(self, baseline_similarity=0.5, baseline_similarity_bounds=(1e-5, 1)): self.baseline_similarity = baseline_similarity self.baseline_similarity_bounds = baseline_similarity_bounds @property def hyperparameter_baseline_similarity(self): return Hyperparameter( "baseline_similarity", "numeric", self.baseline_similarity_bounds ) def _f(self, s1, s2): """ kernel value between a pair of sequences """ return sum( [1.0 if c1 == c2 else self.baseline_similarity for c1 in s1 for c2 in s2] ) def _g(self, s1, s2): """ kernel derivative between a pair of sequences """ return sum([0.0 if c1 == c2 else 1.0 for c1 in s1 for c2 in s2]) def __call__(self, X, Y=None, eval_gradient=False): if Y is None: Y = X if eval_gradient: return ( np.array([[self._f(x, y) for y in Y] for x in X]), np.array([[[self._g(x, y)] for y in Y] for x in X]), ) else: return np.array([[self._f(x, y) for y in Y] for x in X]) def diag(self, X): return np.array([self._f(x, x) for x in X]) def is_stationary(self): return False def clone_with_theta(self, theta): cloned = clone(self) cloned.theta = theta return cloned kernel = SequenceKernel() """ Sequence similarity matrix under the kernel =========================================== """ X = np.array(["AGCT", "AGC", "AACT", "TAA", "AAA", "GAACA"]) K = kernel(X) D = kernel.diag(X) plt.figure(figsize=(8, 5)) plt.imshow(np.diag(D**-0.5).dot(K).dot(np.diag(D**-0.5))) plt.xticks(np.arange(len(X)), X) plt.yticks(np.arange(len(X)), X) plt.title("Sequence similarity under the kernel") """ Regression ========== """ X = np.array(["AGCT", "AGC", "AACT", "TAA", "AAA", "GAACA"]) Y = np.array([1.0, 1.0, 2.0, 2.0, 3.0, 3.0]) training_idx = [0, 1, 3, 4] gp = GaussianProcessRegressor(kernel=kernel) gp.fit(X[training_idx], Y[training_idx]) plt.figure(figsize=(8, 5)) plt.bar(np.arange(len(X)), gp.predict(X), color="b", label="prediction") plt.bar(training_idx, Y[training_idx], width=0.2, color="r", alpha=1, label="training") plt.xticks(np.arange(len(X)), X) plt.title("Regression on sequences") plt.legend() """ Classification ============== """ X_train = np.array(["AGCT", "CGA", "TAAC", "TCG", "CTTT", "TGCT"]) # whether there are 'A's in the sequence Y_train = np.array([True, True, True, False, False, False]) gp = GaussianProcessClassifier(kernel) gp.fit(X_train, Y_train) X_test = ["AAA", "ATAG", "CTC", "CT", "C"] Y_test = [True, True, False, False, False] plt.figure(figsize=(8, 5)) plt.scatter( np.arange(len(X_train)), [1.0 if c else -1.0 for c in Y_train], s=100, marker="o", edgecolor="none", facecolor=(1, 0.75, 0), label="training", ) plt.scatter( len(X_train) + np.arange(len(X_test)), [1.0 if c else -1.0 for c in Y_test], s=100, marker="o", edgecolor="none", facecolor="r", label="truth", ) plt.scatter( len(X_train) + np.arange(len(X_test)), [1.0 if c else -1.0 for c in gp.predict(X_test)], s=100, marker="x", edgecolor=(0, 1.0, 0.3), linewidth=2, label="prediction", ) plt.xticks(np.arange(len(X_train) + len(X_test)), np.concatenate((X_train, X_test))) plt.yticks([-1, 1], [False, True]) plt.title("Classification on sequences") plt.legend() plt.show() Total running time of the script: ( 0 minutes 0.190 seconds) Download Python source code: plot_gpr_on_structured_data.py Download Jupyter notebook: plot_gpr_on_structured_data.ipynb
Class NoSuchPaddingException java.lang.Object java.lang.Throwable java.lang.Exception java.security.GeneralSecurityException javax.crypto.NoSuchPaddingException All Implemented Interfaces: Serializable public class NoSuchPaddingException extends GeneralSecurityException This exception is thrown when a particular padding mechanism is requested but is not available in the environment. Since: 1.4 See Also: Serialized Form Constructor Summary Constructor Description NoSuchPaddingException() Constructs a NoSuchPaddingException with no detail message. NoSuchPaddingException(String msg) Constructs a NoSuchPaddingException with the specified detail message. Method Summary Methods declared in class java.lang.Throwable addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString Methods declared in class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait Constructor Details NoSuchPaddingException public NoSuchPaddingException() Constructs a NoSuchPaddingException with no detail message. A detail message is a String that describes this particular exception. NoSuchPaddingException public NoSuchPaddingException(String msg) Constructs a NoSuchPaddingException with the specified detail message. Parameters: msg - the detail message.
public function Attribut8b7c:f320:99b9:690f:4595:cd17:293a:c069__construct public Attribut8b7c:f320:99b9:690f:4595:cd17:293a:c069__construct($attributes = array()) Constructs a \Drupal\Core\Template\Attribute object. Parameters array $attributes: An associative array of key-value pairs to be converted to attributes. File core/lib/Drupal/Core/Template/Attribute.php, line 80 Class Attribute Collects, sanitizes, and renders HTML attributes. Namespace Drupal\Core\Template Code public function __construct($attributes = array()) { foreach ($attributes as $name => $value) { $this->offsetSet($name, $value); } }
GraphicsShaderFill package flash.display implements IGraphicsFill, IGraphicsData Available on flash Constructor new(?shader:Shader, ?matrix:Matrix) Variables matrix:Matrix shader:Shader
Mix.Shell behaviour Defines Mix.Shell contract. Summary Functions cmd(command, options \\ [], callback) Executes the given command as a shell command and invokes the callback for the streamed response. printable_app_name() Returns the printable app name. Callbacks cmd(command) Executes the given command and returns its exit status. cmd(command, options) Executes the given command and returns its exit status. error(message) Prints the given ANSI error to the shell. info(message) Prints the given ANSI message to the shell. print_app() Prints the current application to the shell if it was not printed yet. prompt(message) Prompts the user for input. yes?(message) Prompts the user for confirmation. Functions cmd(command, options \\ [], callback)Source Executes the given command as a shell command and invokes the callback for the streamed response. This is most commonly used by shell implementations but can also be invoked directly. Options :cd - (since v1.11.0) the directory to run the command in :stderr_to_stdout - redirects stderr to stdout, defaults to true :env - a list of environment variables, defaults to [] :quiet - overrides the callback to no-op printable_app_name()Source Returns the printable app name. This function returns the current application name, but only if the application name should be printed. Calling this function automatically toggles its value to false until the current project is re-entered. The goal is to avoid printing the application name multiple times. Callbacks cmd(command)Source Specs cmd(command 8b7c:f320:99b9:690f:4595:cd17:293a:c069 String.t()) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 integer() Executes the given command and returns its exit status. cmd(command, options)Source Specs cmd(command 8b7c:f320:99b9:690f:4595:cd17:293a:c069 String.t(), options 8b7c:f320:99b9:690f:4595:cd17:293a:c069 keyword()) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 integer() Executes the given command and returns its exit status. Options :print_app - when false, does not print the app name when the command outputs something :stderr_to_stdout - when false, does not redirect stderr to stdout :quiet - when true, do not print the command output :env - environment options to the executed command error(message)Source Specs error(message 8b7c:f320:99b9:690f:4595:cd17:293a:c069 IO.ANSI.ansidata()) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 :ok Prints the given ANSI error to the shell. info(message)Source Specs info(message 8b7c:f320:99b9:690f:4595:cd17:293a:c069 IO.ANSI.ansidata()) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 :ok Prints the given ANSI message to the shell. print_app()Source Specs print_app() 8b7c:f320:99b9:690f:4595:cd17:293a:c069 :ok Prints the current application to the shell if it was not printed yet. prompt(message)Source Specs prompt(message 8b7c:f320:99b9:690f:4595:cd17:293a:c069 binary()) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 binary() Prompts the user for input. yes?(message)Source Specs yes?(message 8b7c:f320:99b9:690f:4595:cd17:293a:c069 binary()) 8b7c:f320:99b9:690f:4595:cd17:293a:c069 boolean() Prompts the user for confirmation.
Class: Phaser.Component.Overlap Constructor new Overlap() The Overlap component allows a Game Object to check if it overlaps with the bounds of another Game Object. Source code: gameobjects/components/Overlap.js (Line 12) Public Methods overlap(displayObject) → {boolean} Checks to see if the bounds of this Game Object overlaps with the bounds of the given Display Object,which can be a Sprite, Image, TileSprite or anything that extends those such as Button or provides a getBounds method and result. This check ignores the hitArea property if set and runs a getBounds comparison on both objects to determine the result. Therefore it's relatively expensive to use in large quantities, i.e. with lots of Sprites at a high frequency.It should be fine for low-volume testing where physics isn't required. Parameters Name Type Description displayObject Phaser.Sprite | Phaser.Image | Phaser.TileSprite | Phaser.Button | PIXI.DisplayObject The display object to check against. Returns boolean - True if the bounds of this Game Object intersects at any point with the bounds of the given display object. Source code: gameobjects/components/Overlap.js (Line 29)
tf.keras.models.model_from_json View source on GitHub Parses a JSON model configuration string and returns a model instance. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.models.model_from_json tf.keras.models.model_from_json( json_string, custom_objects=None ) Usage: model = tf.keras.Sequential([ tf.keras.layers.Dense(5, input_shape=(3,)), tf.keras.layers.Softmax()]) config = model.to_json() loaded_model = tf.keras.models.model_from_json(config) Args json_string JSON string encoding a model configuration. custom_objects Optional dictionary mapping names (strings) to custom classes or functions to be considered during deserialization. Returns A Keras model instance (uncompiled).
SVG in CSS backgrounds Method of using SVG images as CSS backgrounds Spec https://www.w3.org/TR/css3-background/#background-image Status W3C Candidate Recommendation IE Edge Firefox Chrome Safari Opera       110         108 109 TP       107 108 16.2   11 107 106 107 16.1 91 10 106 105 106 16.0 90 9 105 104 105 15.6 89 8 104 103 104 15.5 88 Show all 7 103 102 103 15.4 87 6 102 101 102 15.2-15.3 86 5.5 101 100 101 15.1 85   100 99 100 15 84   99 98 99 14.1 83   98 97 98 14 82   97 96 97 13.1 81   96 95 96 13 80   95 94 95 12.1 79   94 93 94 12 78   93 92 93 11.1 77   92 91 92 11 76   91 90 91 10.1 75   90 89 90 10 74   89 88 89 9.1 73   88 87 88 9 72   87 86 87 8 71   86 85 86 7.1 70   85 84 85 7 69   84 83 84 6.1 68   83 82 83 6 67   81 81 81 5.1 66   80 80 80 5 65   79 79 79 4 (1) 64   18 78 78 3.2 (1) 63   17 77 77 3.1 62   16 76 76   60   15 (3) 75 75   58   14 (3) 74 74   57   13 (3) 73 73   56   12 (3) 72 72   55     71 71   54     70 70   53     69 69   52     68 68   51     67 67   50     66 66   49     65 65   48     64 64   47     63 63   46     62 62   45     61 61   44     60 60   43     59 59   42     58 58   41     57 57   40     56 56   39     55 55   38     54 54   37     53 53   36     52 52   35     51 51   34     50 50   33     49 49   32     48 48   31     47 47   30     46 46   29     45 45   28     44 44   27     43 43   26     42 42   25     41 41   24     40 40   23     39 39   22     38 38   21     37 37   20     36 36   19     35 35   18     34 34   17     33 33   16     32 32   15     31 31   12.1     30 30   12     29 29   11.6     28 28   11.5     27 27   11.1     26 26   11     25 25   10.6     24 24   10.5     23 (2) 23   10.0-10.1     22 (2) 22   9.5-9.6     21 (2) 21   9     20 (2) 20         19 (2) 19         18 (2) 18         17 (2) 17         16 (2) 16         15 (2) 15         14 (2) 14         13 (2) 13         12 (2) 12         11 (2) 11         10 (2) 10         9 (2) 9         8 (2) 8         7 (2) 7         6 (2) 6         5 (2) 5         4 (2) 4         3.6           3.5           3           2       Safari on iOS Opera Mini Android Browser Blackberry Browser Opera Mobile Android Chrome Android Firefox IE Mobile Android UC Browser Samsung Internet QQ Browser Baidu Browser KaiOS Browser 16.1 all (2) 107 10 64 107 106 11 13.4 18.0 13.1 13.18 2.5 16.0   4.4.3-4.4.4 7 12.1 (2)     10   17.0       15.6   4.4   12 (2)         16.0       15.5   4.2-4.3   11.5 (2)         15.0       Show all 15.4   4.1   11.1 (2)         14.0       15.2-15.3   4   11 (2)         13.0       15.0-15.1   3   10 (2)         12.0       14.5-14.8   2.3             11.1-11.2       14.0-14.4   2.2             10.1       13.4-13.7   2.1             9.2       13.3                 8.2       13.2                 7.2-7.4       13.0-13.1                 6.2-6.4       12.2-12.5                 5.0-5.4       12.0-12.1                 4       11.3-11.4                         11.0-11.2                         10.3                         10.0-10.2                         9.3                         9.0-9.2                         8.1-8.4                         8                         7.0-7.1                         6.0-6.1                         5.0-5.1                         4.2-4.3                         4.0-4.1 (1)                         3.2 (1)                         Notes Partial support in iOS Safari and older Safari versions refers to failing to support tiling or the background-position property. Partial support in older Firefox and Opera Mini/Mobile refers to SVG images being blurry when scaled. Partial support in Edge 15 and older refers to a lack of support for SVG data URIs. see bug Bugs Opera messes background repeat when changing zoom level: known issue in Opera's private bug tracker (CORE-33071) IE 10 Mobile does not always provide crisp SVG backgrounds, particularly when zooming in. Android 2.x will not display the fallback background-image in addition to not displaying the SVG if it is implemented using multiple background-image properties on the same element. (e.g. PNG background-image fallback + SVG background-image) Resources Tutorial for advanced effects Data by caniuse.com Licensed under the Creative Commons Attribution License v4.0. https://caniuse.com/svg-css
Chef EAS [edit on GitHub] The Chef Enterprise Application Stack (EAS) allows organizations to automate infrastructure, security, and application delivery together, helping them deploy software quickly while maintaining compliance with industry regulations. Chef EAS helps teams drive efficiency and consistency for any application across multi-cloud and heterogeneous infrastructure. Chef EAS includes the following Chef solutions: Chef Habitat builds and deploys your applications because delivering applications is where you derive your business value Chef Infra configures your infrastructure, because your applications also needs to run on a stable and scalable system Chef InSpec validates and secures both your applications and your infrastructure Chef Automate visualizes your applications, their infrastructure, and the compliance status for both. Chef Workstation provides a unified experience for all of Chef EAS Chef EAS Application Management with Chef Habitat Chef Habitat automates building and deploying applications, turning a web of delicate procedures into a resilient and repeatable process. A Chef Habitat package contains the compiled binary and a manifest of all the dependencies required for building and running your application. This results in a lightweight and portable artifact that you can deploy to bare metal or virtual machines, as well as export to immutable formats, such as Docker containers or Kubernetes pods. Bundling applications with a complete dependency manifest ensures that your application behaves as consistently on a developer’s laptop as it does in its on-prem VM farm staging environment, and it also behaves as consistently there as it does in its cloud-based deployment environment. The Chef Automate EAS Application Tab With the new application operations dashboard in Chef Automate, operations teams gain comprehensive and customizable visibility into the health of the services that make up the application. This makes it easier to understand what is degrading the health of an applications and to keep it running smoothly. The Chef Automate EAS Application dashboard allows you to organize and display your applications data from Chef Habitat in an intuitive way. The Chef Automate EAS Application Dashboard provides visibility into your application artifacts and channels by letting you see which versions of your packages are running on your system. Chef Automate organizes data from the application and environment tags provided by the Chef Habitat supervisor. Prerequisites The Chef Automate EAS application feature introduces several concepts from Chef Habitat, which are introduced in the following Glossary. Find Chef Automate EAS system requirements, installation, and configuration instructions in the Setting up the Applications Dashboard. Glossary Application - An application is a program that is made up of multiple underlying services. Chef Habitat provides automation capabilities for building and delivering your applications service-by-service to any environment regardless of the infrastructure on which it is deployed. In Chef Habitat, you define your application and its dependencies, configuration, management, and behavior in a plan.sh or plan.ps1 file. Application Lifecycle - In a typical enterprise software an application goes through stages of development, testing, acceptance, production, which together are called the application lifecycle. The application lifecycle is supported by codified infrastructure and configuration that correlates with each stage, which is called an application delivery pipeline. Artifact - A Chef Habitat artifact (also known as a “hart file”) is a software package produced by the Chef Habitat build tools. It is comparable to a deb file on Debian-based Linux systems, or a rpm file on RedHat-based Linux systems. While very simple application have two or three underlying services, most modern applications follow architecture patterns with many services that result in multiple artifacts. Artifacts are built according to the instructions in the plan.sh or plan.ps1 file. Each artifact contains a software library or application, configuration settings for the application, and lifecycle hooks. Channel - Chef Habitat supports continuous deployments through the use of channels, which are tags used to describe the status of your artifact. Channel are conceptual spaces expressed in code by adding a tag to an artifact, which is called a “promotion”. Once promoted, an artifact is considered to “be” in that channel. In most cases, artifacts have three possible channels: “unstable”, “testing”, and “stable”. The “unstable” tag denotes an artifact that is still in active development, “testing” means that the artifact is a candidate for release, and “stable” means that it is ready for consumption. When you upload your artifact to Builder, Chef Habitat labels your application artifact with the unstable tag, which means that it is in the “unstable” channel. When you promote your application artifact to another channel, such as “test” or “stable”, Chef Habitat applies the new tag and makes it available to the respective channel. You can apply more than one tag to a single artifact, for example, artifacts are often tagged for both the “unstable” and “test” channels. For more information, see the Chef Habitat Continuous Deployment Using Channels documentation. Deployment - Each instance of an artifact downloaded from a channel into an environment is called a deployment. Environment - An environment is the coded expression of the combined infrastructure and configuration that your application requires. Chef Habitat supports continuous delivery by letting you define how the environments in your application’s delivery pipeline consume each of your artifacts. Examples of environments include “development,” “acceptance,” and “production”. Every environment in your application lifecycle has its own Supervisors, service groups, and services. Supervisor - The Supervisor is Chef Habitat’s process manager, which means it controls the processes related to a package, including starting, monitoring, and updating services. Each Supervisor runs a single instance of a service. Each Supervisor in an environment subscribes to a channel, which means they watch for new versions of services promoted in that channel. Once a supervisor detects a new artifact in a channel, it deploys the new package into its own environment and updates all of the services for that service group. For more information about automated deployments, see the Chef Habitat update-strategy documentation. Service - A service is any single running instance of a Chef Habitat package running in an environment and managed by a Supervisor. Service Group - A service group is a label that you apply to multiple instances of a single service running in an environment. Service groups let you manage all of the services with this label as a single entity with a single operation. For example, if you have five Redis replicas running in your test environment, then these as a service group collects them as a single thing. This lets you stop, restart, or reconfigure all five examples of this Redis service in a single operation. Service groups also let you gather information for configuration templating by extracting information from each of them–such as their ip addresses–in a single operation.
ReflectionFunctionAbstract8b7c:f320:99b9:690f:4595:cd17:293a:c069getClosureThis (PHP 5 >= 5.4.0, PHP 7, PHP 8) ReflectionFunctionAbstract8b7c:f320:99b9:690f:4595:cd17:293a:c069getClosureThis — Returns this pointer bound to closure Description public ReflectionFunctionAbstract8b7c:f320:99b9:690f:4595:cd17:293a:c069getClosureThis(): ?object WarningThis function is currently not documented; only its argument list is available. Parameters This function has no parameters. Return Values Returns $this pointer. Returns null in case of an error.
lastIndexOf kotlin-stdlib / kotlin.collections / AbstractMutableList / lastIndexOf Platform and version requirements: open fun lastIndexOf(element: @UnsafeVariance E): Int Platform and version requirements: JS (1.1) open fun lastIndexOf(element: E): Int Returns the index of the last occurrence of the specified element in the list, or -1 if the specified element is not contained in the list.
public static function Unico8b7c:f320:99b9:690f:4595:cd17:293a:c069truncate public static Unico8b7c:f320:99b9:690f:4595:cd17:293a:c069truncate($string, $max_length, $wordsafe = FALSE, $add_ellipsis = FALSE, $min_wordsafe_length = 1) Truncates a UTF-8-encoded string safely to a number of characters. Parameters string $string: The string to truncate. int $max_length: An upper limit on the returned string length, including trailing ellipsis if $add_ellipsis is TRUE. bool $wordsafe: If TRUE, attempt to truncate on a word boundary. Word boundaries are spaces, punctuation, and Unicode characters used as word boundaries in non-Latin languages; see Unico8b7c:f320:99b9:690f:4595:cd17:293a:c069PREG_CLASS_WORD_BOUNDARY for more information. If a word boundary cannot be found that would make the length of the returned string fall within length guidelines (see parameters $max_length and $min_wordsafe_length), word boundaries are ignored. bool $add_ellipsis: If TRUE, add '...' to the end of the truncated string (defaults to FALSE). The string length will still fall within $max_length. int $min_wordsafe_length: If $wordsafe is TRUE, the minimum acceptable length for truncation (before adding an ellipsis, if $add_ellipsis is TRUE). Has no effect if $wordsafe is FALSE. This can be used to prevent having a very short resulting string that will not be understandable. For instance, if you are truncating the string "See myverylongurlexample.com for more information" to a word-safe return length of 20, the only available word boundary within 20 characters is after the word "See", which wouldn't leave a very informative string. If you had set $min_wordsafe_length to 10, though, the function would realise that "See" alone is too short, and would then just truncate ignoring word boundaries, giving you "See myverylongurl..." (assuming you had set $add_ellipses to TRUE). Return value string The truncated string. File core/lib/Drupal/Component/Utility/Unicode.php, line 522 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Code public static function truncate($string, $max_length, $wordsafe = FALSE, $add_ellipsis = FALSE, $min_wordsafe_length = 1) { $ellipsis = ''; $max_length = max($max_length, 0); $min_wordsafe_length = max($min_wordsafe_length, 0); if (stati8b7c:f320:99b9:690f:4595:cd17:293a:c069strlen($string) <= $max_length) { // No truncation needed, so don't add ellipsis, just return. return $string; } if ($add_ellipsis) { // Truncate ellipsis in case $max_length is small. $ellipsis = stati8b7c:f320:99b9:690f:4595:cd17:293a:c069substr('…', 0, $max_length); $max_length -= stati8b7c:f320:99b9:690f:4595:cd17:293a:c069strlen($ellipsis); $max_length = max($max_length, 0); } if ($max_length <= $min_wordsafe_length) { // Do not attempt word-safe if lengths are bad. $wordsafe = FALSE; } if ($wordsafe) { $matches = array(); // Find the last word boundary, if there is one within $min_wordsafe_length // to $max_length characters. preg_match() is always greedy, so it will // find the longest string possible. $found = preg_match('/^(.{' . $min_wordsafe_length . ',' . $max_length . '})[' . Unico8b7c:f320:99b9:690f:4595:cd17:293a:c069PREG_CLASS_WORD_BOUNDARY . ']/u', $string, $matches); if ($found) { $string = $matches[1]; } else { $string = stati8b7c:f320:99b9:690f:4595:cd17:293a:c069substr($string, 0, $max_length); } } else { $string = stati8b7c:f320:99b9:690f:4595:cd17:293a:c069substr($string, 0, $max_length); } if ($add_ellipsis) { // If we're adding an ellipsis, remove any trailing periods. $string = rtrim($string, '.'); $string .= $ellipsis; } return $string; }
Google Cloud Logging driver The Google Cloud Logging driver sends container logs to Google Cloud Logging. Usage You can configure the default logging driver by passing the --log-driver option to the Docker daemon: dockerd --log-driver=gcplogs You can set the logging driver for a specific container by using the --log-driver option to docker run: docker run --log-driver=gcplogs ... This log driver does not implement a reader so it is incompatible with docker logs. If Docker detects that it is running in a Google Cloud Project, it will discover configuration from the instance metadata service. Otherwise, the user must specify which project to log to using the --gcp-project log option and Docker will attempt to obtain credentials from the Google Application Default Credential. The --gcp-project takes precedence over information discovered from the metadata server so a Docker daemon running in a Google Cloud Project can be overridden to log to a different Google Cloud Project using --gcp-project. gcplogs options You can use the --log-opt NAME=VALUE flag to specify these additional Google Cloud Logging driver options: Option Required Description gcp-project optional Which GCP project to log to. Defaults to discovering this value from the GCE metadata service. gcp-log-cmd optional Whether to log the command that the container was started with. Defaults to false. labels optional Comma-separated list of keys of labels, which should be included in message, if these labels are specified for container. env optional Comma-separated list of keys of environment variables, which should be included in message, if these variables are specified for container. If there is collision between label and env keys, the value of the env takes precedence. Both options add additional fields to the attributes of a logging message. Below is an example of the logging options required to log to the default logging destination which is discovered by querying the GCE metadata server. docker run --log-driver=gcplogs \ --log-opt gcp-log-cmd=true \ --env "TEST=false" \ --label location=west \ your/application This configuration also directs the driver to include in the payload the label location, the environment variable ENV, and the command used to start the container.
tf.keras.callbacks.History View source on GitHub Callback that records events into a History object. Inherits From: Callback View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.callbacks.History, `tf.compat.v2.keras.callbacks.History` tf.keras.callbacks.History() This callback is automatically applied to every Keras model. The History object gets returned by the fit method of models. Methods on_batch_begin View source on_batch_begin( batch, logs=None ) A backwards compatibility alias for on_train_batch_begin. on_batch_end View source on_batch_end( batch, logs=None ) A backwards compatibility alias for on_train_batch_end. on_epoch_begin View source on_epoch_begin( epoch, logs=None ) Called at the start of an epoch. Subclasses should override for any actions to run. This function should only be called during TRAIN mode. Arguments epoch integer, index of epoch. logs dict. Currently no data is passed to this argument for this method but that may change in the future. on_epoch_end View source on_epoch_end( epoch, logs=None ) Called at the end of an epoch. Subclasses should override for any actions to run. This function should only be called during TRAIN mode. Arguments epoch integer, index of epoch. logs dict, metric results for this training epoch, and for the validation epoch if validation is performed. Validation result keys are prefixed with val_. on_predict_batch_begin View source on_predict_batch_begin( batch, logs=None ) Called at the beginning of a batch in predict methods. Subclasses should override for any actions to run. Arguments batch integer, index of batch within the current epoch. logs dict. Has keys batch and size representing the current batch number and the size of the batch. on_predict_batch_end View source on_predict_batch_end( batch, logs=None ) Called at the end of a batch in predict methods. Subclasses should override for any actions to run. Arguments batch integer, index of batch within the current epoch. logs dict. Metric results for this batch. on_predict_begin View source on_predict_begin( logs=None ) Called at the beginning of prediction. Subclasses should override for any actions to run. Arguments logs dict. Currently no data is passed to this argument for this method but that may change in the future. on_predict_end View source on_predict_end( logs=None ) Called at the end of prediction. Subclasses should override for any actions to run. Arguments logs dict. Currently no data is passed to this argument for this method but that may change in the future. on_test_batch_begin View source on_test_batch_begin( batch, logs=None ) Called at the beginning of a batch in evaluate methods. Also called at the beginning of a validation batch in the fit methods, if validation data is provided. Subclasses should override for any actions to run. Arguments batch integer, index of batch within the current epoch. logs dict. Has keys batch and size representing the current batch number and the size of the batch. on_test_batch_end View source on_test_batch_end( batch, logs=None ) Called at the end of a batch in evaluate methods. Also called at the end of a validation batch in the fit methods, if validation data is provided. Subclasses should override for any actions to run. Arguments batch integer, index of batch within the current epoch. logs dict. Metric results for this batch. on_test_begin View source on_test_begin( logs=None ) Called at the beginning of evaluation or validation. Subclasses should override for any actions to run. Arguments logs dict. Currently no data is passed to this argument for this method but that may change in the future. on_test_end View source on_test_end( logs=None ) Called at the end of evaluation or validation. Subclasses should override for any actions to run. Arguments logs dict. Currently no data is passed to this argument for this method but that may change in the future. on_train_batch_begin View source on_train_batch_begin( batch, logs=None ) Called at the beginning of a training batch in fit methods. Subclasses should override for any actions to run. Arguments batch integer, index of batch within the current epoch. logs dict. Has keys batch and size representing the current batch number and the size of the batch. on_train_batch_end View source on_train_batch_end( batch, logs=None ) Called at the end of a training batch in fit methods. Subclasses should override for any actions to run. Arguments batch integer, index of batch within the current epoch. logs dict. Metric results for this batch. on_train_begin View source on_train_begin( logs=None ) Called at the beginning of training. Subclasses should override for any actions to run. Arguments logs dict. Currently no data is passed to this argument for this method but that may change in the future. on_train_end View source on_train_end( logs=None ) Called at the end of training. Subclasses should override for any actions to run. Arguments logs dict. Currently no data is passed to this argument for this method but that may change in the future. set_model View source set_model( model ) set_params View source set_params( params )
Colon Colon Operator Description Generate regular sequences. Usage from:to a:b Arguments from starting value of sequence. to (maximal) end value of the sequence. a, b factors of the same length. Details The binary operator : has two meanings: for factors a:b is equivalent to interaction(a, b) (but the levels are ordered and labelled differently). For other arguments from:to is equivalent to seq(from, to), and generates a sequence from from to to in steps of 1 or -1. Value to will be included if it differs from from by an integer up to a numeric fuzz of about 1e-7. Non-numeric arguments are coerced internally (hence without dispatching methods) to numeric—complex values will have their imaginary parts discarded with a warning. Value For numeric arguments, a numeric vector. This will be of type integer if from is integer-valued and the result is representable in the R integer type, otherwise of type "double" (aka mode "numeric"). For factors, an unordered factor with levels labelled as la:lb and ordered lexicographically (that is, lb varies fastest). References Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole. (for numeric arguments: S does not have : for factors.) See Also seq (a generalization of from:to). As an alternative to using : for factors, interaction. For : used in the formal representation of an interaction, see formula. Examples 1:4 pi:6 # real 6:pi # integer f1 <- gl(2, 3); f1 f2 <- gl(3, 2); f2 f1:f2 # a factor, the "cross" f1 x f2 Copyright (
dart:io sigbus constant ProcessSignal const sigbus Implementation static const ProcessSignal sigbus = const ProcessSignal._(7, "SIGBUS");
pandas.Series.asof Series.asof(self, where, subset=None) [source] Return the last row(s) without any NaNs before where. The last row (for each element in where, if list) without any NaN is taken. In case of a DataFrame, the last row without NaN considering only the subset of columns (if not None) New in version 0.19.0: For DataFrame If there is no good value, NaN is returned for a Series or a Series of NaN values for a DataFrame Parameters: where : date or array-like of dates Date(s) before which the last row(s) are returned. subset : str or array-like of str, default None For DataFrame, if not None, only use these columns to check for NaNs. Returns: scalar, Series, or DataFrame The return can be: scalar : when self is a Series and where is a scalar Series: when self is a Series and where is an array-like, or when self is a DataFrame and where is a scalar DataFrame : when self is a DataFrame and where is an array-like Return scalar, Series, or DataFrame. See also merge_asof Perform an asof merge. Similar to left join. Notes Dates are assumed to be sorted. Raises if this is not the case. Examples A Series and a scalar where. >>> s = pd.Series([1, 2, np.nan, 4], index=[10, 20, 30, 40]) >>> s 10 1.0 20 2.0 30 NaN 40 4.0 dtype: float64 >>> s.asof(20) 2.0 For a sequence where, a Series is returned. The first value is NaN, because the first element of where is before the first index value. >>> s.asof([5, 20]) 5 NaN 20 2.0 dtype: float64 Missing values are not considered. The following is 2.0, not NaN, even though NaN is at the index location for 30. >>> s.asof(30) 2.0 Take all columns into consideration >>> df = pd.DataFrame({'a': [10, 20, 30, 40, 50], ... 'b': [None, None, None, None, 500]}, ... index=pd.DatetimeIndex(['2018-02-27 09:01:00', ... '2018-02-27 09:02:00', ... '2018-02-27 09:03:00', ... '2018-02-27 09:04:00', ... '2018-02-27 09:05:00'])) >>> df.asof(pd.DatetimeIndex(['2018-02-27 09:03:30', ... '2018-02-27 09:04:30'])) a b 2018-02-27 09:03:30 NaN NaN 2018-02-27 09:04:30 NaN NaN Take a single column into consideration >>> df.asof(pd.DatetimeIndex(['2018-02-27 09:03:30', ... '2018-02-27 09:04:30']), ... subset=['a']) a b 2018-02-27 09:03:30 30.0 NaN 2018-02-27 09:04:30 40.0 NaN
tf.queue.RandomShuffleQueue View source on GitHub A queue implementation that dequeues elements in a random order. Inherits From: QueueBase View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.RandomShuffleQueue, tf.compat.v1.io.RandomShuffleQueue, tf.compat.v1.queue.RandomShuffleQueue tf.queue.RandomShuffleQueue( capacity, min_after_dequeue, dtypes, shapes=None, names=None, seed=None, shared_name=None, name='random_shuffle_queue' ) See tf.queue.QueueBase for a description of the methods on this class. Args capacity An integer. The upper bound on the number of elements that may be stored in this queue. min_after_dequeue An integer (described above). dtypes A list of DType objects. The length of dtypes must equal the number of tensors in each queue element. shapes (Optional.) A list of fully-defined TensorShape objects with the same length as dtypes, or None. names (Optional.) A list of string naming the components in the queue with the same length as dtypes, or None. If specified the dequeue methods return a dictionary with the names as keys. seed A Python integer. Used to create a random seed. See tf.compat.v1.set_random_seed for behavior. shared_name (Optional.) If non-empty, this queue will be shared under the given name across multiple sessions. name Optional name for the queue operation. Attributes dtypes The list of dtypes for each component of a queue element. name The name of the underlying queue. names The list of names for each component of a queue element. queue_ref The underlying queue reference. shapes The list of shapes for each component of a queue element. Methods close View source close( cancel_pending_enqueues=False, name=None ) Closes this queue. This operation signals that no more elements will be enqueued in the given queue. Subsequent enqueue and enqueue_many operations will fail. Subsequent dequeue and dequeue_many operations will continue to succeed if sufficient elements remain in the queue. Subsequently dequeue and dequeue_many operations that would otherwise block waiting for more elements (if close hadn't been called) will now fail immediately. If cancel_pending_enqueues is True, all pending requests will also be canceled. Args cancel_pending_enqueues (Optional.) A boolean, defaulting to False (described above). name A name for the operation (optional). Returns The operation that closes the queue. dequeue View source dequeue( name=None ) Dequeues one element from this queue. If the queue is empty when this operation executes, it will block until there is an element to dequeue. At runtime, this operation may raise an error if the queue is tf.QueueBase.close before or during its execution. If the queue is closed, the queue is empty, and there are no pending enqueue operations that can fulfill this request, tf.errors.OutOfRangeError will be raised. If the session is tf.Session.close, tf.errors.CancelledError will be raised. Args name A name for the operation (optional). Returns The tuple of tensors that was dequeued. dequeue_many View source dequeue_many( n, name=None ) Dequeues and concatenates n elements from this queue. This operation concatenates queue-element component tensors along the 0th dimension to make a single component tensor. All of the components in the dequeued tuple will have size n in the 0th dimension. If the queue is closed and there are less than n elements left, then an OutOfRange exception is raised. At runtime, this operation may raise an error if the queue is tf.QueueBase.close before or during its execution. If the queue is closed, the queue contains fewer than n elements, and there are no pending enqueue operations that can fulfill this request, tf.errors.OutOfRangeError will be raised. If the session is tf.Session.close, tf.errors.CancelledError will be raised. Args n A scalar Tensor containing the number of elements to dequeue. name A name for the operation (optional). Returns The list of concatenated tensors that was dequeued. dequeue_up_to View source dequeue_up_to( n, name=None ) Dequeues and concatenates n elements from this queue. Note: This operation is not supported by all queues. If a queue does not support DequeueUpTo, then a tf.errors.UnimplementedError is raised. This operation concatenates queue-element component tensors along the 0th dimension to make a single component tensor. If the queue has not been closed, all of the components in the dequeued tuple will have size n in the 0th dimension. If the queue is closed and there are more than 0 but fewer than n elements remaining, then instead of raising a tf.errors.OutOfRangeError like tf.QueueBase.dequeue_many, less than n elements are returned immediately. If the queue is closed and there are 0 elements left in the queue, then a tf.errors.OutOfRangeError is raised just like in dequeue_many. Otherwise the behavior is identical to dequeue_many. Args n A scalar Tensor containing the number of elements to dequeue. name A name for the operation (optional). Returns The tuple of concatenated tensors that was dequeued. enqueue View source enqueue( vals, name=None ) Enqueues one element to this queue. If the queue is full when this operation executes, it will block until the element has been enqueued. At runtime, this operation may raise an error if the queue is tf.QueueBase.close before or during its execution. If the queue is closed before this operation runs, tf.errors.CancelledError will be raised. If this operation is blocked, and either (i) the queue is closed by a close operation with cancel_pending_enqueues=True, or (ii) the session is tf.Session.close, tf.errors.CancelledError will be raised. Args vals A tensor, a list or tuple of tensors, or a dictionary containing the values to enqueue. name A name for the operation (optional). Returns The operation that enqueues a new tuple of tensors to the queue. enqueue_many View source enqueue_many( vals, name=None ) Enqueues zero or more elements to this queue. This operation slices each component tensor along the 0th dimension to make multiple queue elements. All of the tensors in vals must have the same size in the 0th dimension. If the queue is full when this operation executes, it will block until all of the elements have been enqueued. At runtime, this operation may raise an error if the queue is tf.QueueBase.close before or during its execution. If the queue is closed before this operation runs, tf.errors.CancelledError will be raised. If this operation is blocked, and either (i) the queue is closed by a close operation with cancel_pending_enqueues=True, or (ii) the session is tf.Session.close, tf.errors.CancelledError will be raised. Args vals A tensor, a list or tuple of tensors, or a dictionary from which the queue elements are taken. name A name for the operation (optional). Returns The operation that enqueues a batch of tuples of tensors to the queue. from_list View source @staticmethod from_list( index, queues ) Create a queue using the queue reference from queues[index]. Args index An integer scalar tensor that determines the input that gets selected. queues A list of QueueBase objects. Returns A QueueBase object. Raises TypeError When queues is not a list of QueueBase objects, or when the data types of queues are not all the same. is_closed View source is_closed( name=None ) Returns true if queue is closed. This operation returns true if the queue is closed and false if the queue is open. Args name A name for the operation (optional). Returns True if the queue is closed and false if the queue is open. size View source size( name=None ) Compute the number of elements in this queue. Args name A name for the operation (optional). Returns A scalar tensor containing the number of elements in this queue.
Installation Installation Configuration Basic Configuration Environment Configuration Configuration Caching Accessing Configuration Values Naming Your Application Maintenance Mode Installation Server Requirements The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the Laravel Homestead virtual machine: PHP >= 5.5.9 OpenSSL PHP Extension PDO PHP Extension Mbstring PHP Extension Tokenizer PHP Extension Installing Laravel Laravel utilizes Composer to manage its dependencies. So, before using Laravel, make sure you have Composer installed on your machine. Via Laravel Installer First, download the Laravel installer using Composer: composer global require "laravel/installer" Make sure to place the ~/.composer/vendor/bin directory in your PATH so the laravel executable can be located by your system. Once installed, the simple laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog will create a directory named blog containing a fresh Laravel installation with all of Laravel's dependencies already installed. This method of installation is much faster than installing via Composer: laravel new blog Via Composer Create-Project Alternatively, you may also install Laravel by issuing the Composer create-project command in your terminal: composer create-project laravel/laravel blog "5.1.*" Configuration Basic Configuration All of the configuration files for the Laravel framework are stored in the config directory. Each option is documented, so feel free to look through the files and get familiar with the options available to you. Directory Permissions After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server. If you are using the Homestead virtual machine, these permissions should already be set. Application Key The next thing you should do after installing Laravel is set your application key to a random string. If you installed Laravel via Composer or the Laravel installer, this key has already been set for you by the key:generate command. Typically, this string should be 32 characters long. The key can be set in the .env environment file. If you have not renamed the .env.example file to .env, you should do that now. If the application key is not set, your user sessions and other encrypted data will not be secure! Additional Configuration Laravel needs almost no other configuration out of the box. You are free to get started developing! However, you may wish to review the config/app.php file and its documentation. It contains several options such as timezone and locale that you may wish to change according to your application. You may also want to configure a few additional components of Laravel, such as: Cache Database Session Once Laravel is installed, you should also configure your local environment. Pretty URLs Apache The framework ships with a public/.htaccess file that is used to allow URLs without index.php. If you use Apache to serve your Laravel application, be sure to enable the mod_rewrite module. If the .htaccess file that ships with Laravel does not work with your Apache installation, try this one: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] Nginx On Nginx, the following directive in your site configuration will allow "pretty" URLs: location / { try_files $uri $uri/ /index.php?$query_string; } Of course, when using Homestead, pretty URLs will be configured automatically. Environment Configuration It is often helpful to have different configuration values based on the environment the application is running in. For example, you may wish to use a different cache driver locally than you do on your production server. It's easy using environment based configuration. To make this a cinch, Laravel utilizes the DotEnv PHP library by Vance Lucas. In a fresh Laravel installation, the root directory of your application will contain a .env.example file. If you install Laravel via Composer, this file will automatically be renamed to .env. Otherwise, you should rename the file manually. All of the variables listed in this file will be loaded into the $_ENV PHP super-global when your application receives a request. You may use the env helper to retrieve values from these variables. In fact, if you review the Laravel configuration files, you will notice several of the options already using this helper! Feel free to modify your environment variables as needed for your own local server, as well as your production environment. However, your .env file should not be committed to your application's source control, since each developer / server using your application could require a different environment configuration. If you are developing with a team, you may wish to continue including a .env.example file with your application. By putting place-holder values in the example configuration file, other developers on your team can clearly see which environment variables are needed to run your application. Accessing The Current Application Environment The current application environment is determined via the APP_ENV variable from your .env file. You may access this value via the environment method on the App facade: $environment = App8b7c:f320:99b9:690f:4595:cd17:293a:c069nvironment(); You may also pass arguments to the environment method to check if the environment matches a given value. You may even pass multiple values if necessary: if (App8b7c:f320:99b9:690f:4595:cd17:293a:c069nvironment('local')) { // The environment is local } if (App8b7c:f320:99b9:690f:4595:cd17:293a:c069nvironment('local', 'staging')) { // The environment is either local OR staging... } An application instance may also be accessed via the app helper method: $environment = app()->environment(); Configuration Caching To give your application a speed boost, you should cache all of your configuration files into a single file using the config:cache Artisan command. This will combine all of the configuration options for your application into a single file which can be loaded quickly by the framework. You should typically run the php artisan config:cache command as part of your production deployment routine. The command should not be run during local development as configuration options will frequently need to be changed during the course of your application's development. Accessing Configuration Values You may easily access your configuration values using the global config helper function. The configuration values may be accessed using "dot" syntax, which includes the name of the file and option you wish to access. A default value may also be specified and will be returned if the configuration option does not exist: $value = config('app.timezone'); To set configuration values at runtime, pass an array to the config helper: config(['app.timezone' => 'America/Chicago']); Naming Your Application After installing Laravel, you may wish to "name" your application. By default, the app directory is namespaced under App, and autoloaded by Composer using the PSR-4 autoloading standard. However, you may change the namespace to match the name of your application, which you can easily do via the app:name Artisan command. For example, if your application is named "Horsefly", you could run the following command from the root of your installation: php artisan app:name Horsefly Renaming your application is entirely optional, and you are free to keep the App namespace if you wish. Maintenance Mode When your application is in maintenance mode, a custom view will be displayed for all requests into your application. This makes it easy to "disable" your application while it is updating or when you are performing maintenance. A maintenance mode check is included in the default middleware stack for your application. If the application is in maintenance mode, an HttpException will be thrown with a status code of 503. To enable maintenance mode, simply execute the down Artisan command: php artisan down To disable maintenance mode, use the up command: php artisan up Maintenance Mode Response Template The default template for maintenance mode responses is located in resources/views/errors/503.blade.php. Maintenance Mode & Queues While your application is in maintenance mode, no queued jobs will be handled. The jobs will continue to be handled as normal once the application is out of maintenance mode.
collapse.groupedData Collapse a groupedData Object Description If object has a single grouping factor, it is returned unchanged. Else, it is summarized by the values of the displayLevel grouping factor (or the combination of its values and the values of the covariate indicated in preserve, if any is present). The collapsed data is used to produce a new groupedData object, with grouping factor given by the displayLevel factor. Usage ## S3 method for class 'groupedData' collapse(object, collapseLevel, displayLevel, outer, inner, preserve, FUN, subset, ...) Arguments object an object inheriting from class groupedData, generally with multiple grouping factors. collapseLevel an optional positive integer or character string indicating the grouping level to use when collapsing the data. Level values increase from outermost to innermost grouping. Default is the highest or innermost level of grouping. displayLevel an optional positive integer or character string indicating the grouping level to use as the grouping factor for the collapsed data. Default is collapseLevel. outer an optional logical value or one-sided formula, indicating covariates that are outer to the displayLevel grouping factor. If equal to TRUE, the displayLevel element attr(object, "outer") is used to indicate the outer covariates. An outer covariate is invariant within the sets of rows defined by the grouping factor. Ordering of the groups is done in such a way as to preserve adjacency of groups with the same value of the outer variables. Defaults to NULL, meaning that no outer covariates are to be used. inner an optional logical value or one-sided formula, indicating a covariate that is inner to the displayLevel grouping factor. If equal to TRUE, attr(object, "outer") is used to indicate the inner covariate. An inner covariate can change within the sets of rows defined by the grouping factor. Defaults to NULL, meaning that no inner covariate is present. preserve an optional one-sided formula indicating a covariate whose levels should be preserved when collapsing the data according to the collapseLevel grouping factor. The collapsing factor is obtained by pasting together the levels of the collapseLevel grouping factor and the values of the covariate to be preserved. Default is NULL, meaning that no covariates need to be preserved. FUN an optional summary function or a list of summary functions to be used for collapsing the data. The function or functions are applied only to variables in object that vary within the groups defined by collapseLevel. Invariant variables are always summarized by group using the unique value that they assume within that group. If FUN is a single function it will be applied to each non-invariant variable by group to produce the summary for that variable. If FUN is a list of functions, the names in the list should designate classes of variables in the data such as ordered, factor, or numeric. The indicated function will be applied to any non-invariant variables of that class. The default functions to be used are mean for numeric factors, and Mode for both factor and ordered. The Mode function, defined internally in gsummary, returns the modal or most popular value of the variable. It is different from the mode function that returns the S-language mode of the variable. subset an optional named list. Names can be either positive integers representing grouping levels, or names of grouping factors. Each element in the list is a vector indicating the levels of the corresponding grouping factor to be preserved in the collapsed data. Default is NULL, meaning that all levels are used. ... some methods for this generic require additional arguments. None are used in this method. Value a groupedData object with a single grouping factor given by the displayLevel grouping factor, resulting from collapsing object over the levels of the collapseLevel grouping factor. Author(s) José Pinheiro and Douglas Bates [email protected] See Also groupedData, plot.nmGroupedData Examples # collapsing by Dog collapse(Pixel, collapse = 1) # same as collapse(Pixel, collapse = "Dog") Copyright (
User class User extends Model implements Authenticatable, Authorizable, CanResetPassword (View source) Traits Authenticatable Authorizable CanResetPassword MustVerifyEmail HasAttributes HasEvents HasGlobalScopes HasRelationships HasTimestamps HidesAttributes GuardsAttributes ForwardsCalls Constants CREATED_AT The name of the "created at" column. UPDATED_AT The name of the "updated at" column. Properties protected array $attributes The model's attributes. from HasAttributes protected array $original The model attribute's original state. from HasAttributes protected array $changes The changed model attributes. from HasAttributes protected array $casts The attributes that should be cast. from HasAttributes protected array $classCastCache The attributes that have been cast using custom classes. from HasAttributes static protected string[] $primitiveCastTypes The built-in, primitive cast types supported by Eloquent. from HasAttributes protected array $dates The attributes that should be mutated to dates. from HasAttributes protected string $dateFormat The storage format of the model's date columns. from HasAttributes protected array $appends The accessors to append to the model's array form. from HasAttributes static bool $snakeAttributes Indicates whether attributes are snake cased on arrays. from HasAttributes static protected array $mutatorCache The cache of the mutated attributes for each class. from HasAttributes static Encrypter $encrypter The encrypter instance that is used to encrypt attributes. from HasAttributes protected array $dispatchesEvents The event map for the model. from HasEvents protected array $observables User exposed observable events. from HasEvents protected array $relations The loaded relationships for the model. from HasRelationships protected array $touches The relationships that should be touched on save. from HasRelationships static string[] $manyMethods The many to many relationship methods. from HasRelationships static protected array $relationResolvers The relation resolver callbacks. from HasRelationships bool $timestamps Indicates if the model should be timestamped. from HasTimestamps protected array $hidden The attributes that should be hidden for serialization. from HidesAttributes protected array $visible The attributes that should be visible in serialization. from HidesAttributes protected string[] $fillable The attributes that are mass assignable. from GuardsAttributes protected string[]|bool $guarded The attributes that aren't mass assignable. from GuardsAttributes static protected bool $unguarded Indicates if all mass assignment is enabled. from GuardsAttributes static protected array $guardableColumns The actual columns that exist on the database and can be guarded. from GuardsAttributes protected string|null $connection The connection name for the model. from Model protected string $table The table associated with the model. from Model protected string $primaryKey The primary key for the model. from Model protected string $keyType The "type" of the primary key ID. from Model bool $incrementing Indicates if the IDs are auto-incrementing. from Model protected array $with The relations to eager load on every query. from Model protected array $withCount The relationship counts that should be eager loaded on every query. from Model protected int $perPage The number of models to return for pagination. from Model bool $exists Indicates if the model exists. from Model bool $wasRecentlyCreated Indicates if the model was inserted during the current request lifecycle. from Model static protected ConnectionResolverInterface $resolver The connection resolver instance. from Model static protected Dispatcher $dispatcher The event dispatcher instance. from Model static protected array $booted The array of booted models. from Model static protected array $traitInitializers The array of trait initializers that will be called on each new instance. from Model static protected array $globalScopes The array of global scopes on the model. from Model static protected array $ignoreOnTouch The list of models classes that should not be affected with touch. from Model protected string $rememberTokenName The column name of the "remember me" token. from Authenticatable Methods array attributesToArray() Convert the model's attributes to an array. from HasAttributes array addDateAttributesToArray(array $attributes) Add the date attributes to the attributes array. from HasAttributes array addMutatedAttributesToArray(array $attributes, array $mutatedAttributes) Add the mutated attributes to the attributes array. from HasAttributes array addCastAttributesToArray(array $attributes, array $mutatedAttributes) Add the casted attributes to the attributes array. from HasAttributes array getArrayableAttributes() Get an attribute array of all arrayable attributes. from HasAttributes array getArrayableAppends() Get all of the appendable values that are arrayable. from HasAttributes array relationsToArray() Get the model's relationships in array form. from HasAttributes array getArrayableRelations() Get an attribute array of all arrayable relations. from HasAttributes array getArrayableItems(array $values) Get an attribute array of all arrayable values. from HasAttributes mixed getAttribute(string $key) Get an attribute from the model. from HasAttributes mixed getAttributeValue(string $key) Get a plain attribute (not a relationship). from HasAttributes mixed getAttributeFromArray(string $key) Get an attribute from the $attributes array. from HasAttributes mixed getRelationValue(string $key) Get a relationship. from HasAttributes mixed getRelationshipFromMethod(string $method) Get a relationship value from a method. from HasAttributes bool hasGetMutator(string $key) Determine if a get mutator exists for an attribute. from HasAttributes mixed mutateAttribute(string $key, mixed $value) Get the value of an attribute using its mutator. from HasAttributes mixed mutateAttributeForArray(string $key, mixed $value) Get the value of an attribute using its mutator for array conversion. from HasAttributes void mergeCasts(array $casts) Merge new casts with existing casts on the model. from HasAttributes mixed castAttribute(string $key, mixed $value) Cast an attribute to a native PHP type. from HasAttributes mixed getClassCastableAttributeValue(string $key, mixed $value) Cast the given attribute using a custom cast class. from HasAttributes string getCastType(string $key) Get the type of cast for a model attribute. from HasAttributes mixed deviateClassCastableAttribute(string $method, string $key, mixed $value) Increment or decrement the given attribute using the custom cast class. from HasAttributes mixed serializeClassCastableAttribute(string $key, mixed $value) Serialize the given attribute using the custom cast class. from HasAttributes bool isCustomDateTimeCast(string $cast) Determine if the cast type is a custom date time cast. from HasAttributes bool isDecimalCast(string $cast) Determine if the cast type is a decimal cast. from HasAttributes mixed setAttribute(string $key, mixed $value) Set a given attribute on the model. from HasAttributes bool hasSetMutator(string $key) Determine if a set mutator exists for an attribute. from HasAttributes mixed setMutatedAttributeValue(string $key, mixed $value) Set the value of an attribute using its mutator. from HasAttributes bool isDateAttribute(string $key) Determine if the given attribute is a date or date castable. from HasAttributes $this fillJsonAttribute(string $key, mixed $value) Set a given JSON attribute on the model. from HasAttributes void setClassCastableAttribute(string $key, mixed $value) Set the value of a class castable attribute. from HasAttributes $this getArrayAttributeWithValue(string $path, string $key, mixed $value) Get an array attribute with the given key and value set. from HasAttributes array getArrayAttributeByKey(string $key) Get an array attribute or return an empty array if it is not set. from HasAttributes string castAttributeAsJson(string $key, mixed $value) Cast the given attribute to JSON. from HasAttributes string asJson(mixed $value) Encode the given value as JSON. from HasAttributes mixed fromJson(string $value, bool $asObject = false) Decode the given JSON back into an array or object. from HasAttributes mixed fromEncryptedString(string $value) Decrypt the given encrypted string. from HasAttributes string castAttributeAsEncryptedString(string $key, mixed $value) Cast the given attribute to an encrypted string. from HasAttributes static void encryptUsing(Encrypter $encrypter) Set the encrypter instance that will be used to encrypt attributes. from HasAttributes mixed fromFloat(mixed $value) Decode the given float. from HasAttributes string asDecimal(float $value, int $decimals) Return a decimal as string. from HasAttributes Carbon asDate(mixed $value) Return a timestamp as DateTime object with time set to 00:00:00. from HasAttributes Carbon asDateTime(mixed $value) Return a timestamp as DateTime object. from HasAttributes bool isStandardDateFormat(string $value) Determine if the given value is a standard date format. from HasAttributes string|null fromDateTime(mixed $value) Convert a DateTime to a storable string. from HasAttributes int asTimestamp(mixed $value) Return a timestamp as unix timestamp. from HasAttributes string serializeDate(DateTimeInterface $date) Prepare a date for array / JSON serialization. from HasAttributes array getDates() Get the attributes that should be converted to dates. from HasAttributes string getDateFormat() Get the format for database stored dates. from HasAttributes $this setDateFormat(string $format) Set the date format used by the model. from HasAttributes bool hasCast(string $key, array|string|null $types = null) Determine whether an attribute should be cast to a native type. from HasAttributes array getCasts() Get the casts array. from HasAttributes bool isDateCastable(string $key) Determine whether a value is Date / DateTime castable for inbound manipulation. from HasAttributes bool isJsonCastable(string $key) Determine whether a value is JSON castable for inbound manipulation. from HasAttributes bool isEncryptedCastable(string $key) Determine whether a value is an encrypted castable for inbound manipulation. from HasAttributes bool isClassCastable(string $key) Determine if the given key is cast using a custom class. from HasAttributes bool isClassDeviable(string $key) Determine if the key is deviable using a custom class. from HasAttributes bool isClassSerializable(string $key) Determine if the key is serializable using a custom class. from HasAttributes mixed resolveCasterClass(string $key) Resolve the custom caster class for a given key. from HasAttributes string parseCasterClass(string $class) Parse the given caster class, removing any arguments. from HasAttributes void mergeAttributesFromClassCasts() Merge the cast class attributes back into the model. from HasAttributes array normalizeCastClassResponse(string $key, mixed $value) Normalize the response from a custom class caster. from HasAttributes array getAttributes() Get all of the current attributes on the model. from HasAttributes $this setRawAttributes(array $attributes, bool $sync = false) Set the array of model attributes. No checking is done. from HasAttributes mixed|array getOriginal(string|null $key = null, mixed $default = null) Get the model's original attribute values. from HasAttributes mixed|array getOriginalWithoutRewindingModel(string|null $key = null, mixed $default = null) Get the model's original attribute values. from HasAttributes mixed|array getRawOriginal(string|null $key = null, mixed $default = null) Get the model's raw original attribute values. from HasAttributes array only(array|mixed $attributes) Get a subset of the model's attributes. from HasAttributes $this syncOriginal() Sync the original attributes with the current. from HasAttributes $this syncOriginalAttribute(string $attribute) Sync a single original attribute with its current value. from HasAttributes $this syncOriginalAttributes(array|string $attributes) Sync multiple original attribute with their current values. from HasAttributes $this syncChanges() Sync the changed attributes. from HasAttributes bool isDirty(array|string|null $attributes = null) Determine if the model or any of the given attribute(s) have been modified. from HasAttributes bool isClean(array|string|null $attributes = null) Determine if the model and all the given attribute(s) have remained the same. from HasAttributes bool wasChanged(array|string|null $attributes = null) Determine if the model or any of the given attribute(s) have been modified. from HasAttributes bool hasChanges(array $changes, array|string|null $attributes = null) Determine if any of the given attributes were changed. from HasAttributes array getDirty() Get the attributes that have been changed since last sync. from HasAttributes array getChanges() Get the attributes that were changed. from HasAttributes bool originalIsEquivalent(string $key) Determine if the new and old values for a given key are equivalent. from HasAttributes mixed transformModelValue(string $key, mixed $value) Transform a raw model value using mutators, casts, etc. from HasAttributes $this append(array|string $attributes) Append attributes to query when building a query. from HasAttributes $this setAppends(array $appends) Set the accessors to append to model arrays. from HasAttributes bool hasAppended(string $attribute) Return whether the accessor attribute has been appended. from HasAttributes array getMutatedAttributes() Get the mutated attributes for a given instance. from HasAttributes static void cacheMutatedAttributes(string $class) Extract and cache all the mutated attributes of a class. from HasAttributes static array getMutatorMethods(mixed $class) Get all of the attribute mutator methods. from HasAttributes static void observe(object|array|string $classes) Register observers with the model. from HasEvents void registerObserver(object|string $class) Register a single observer with the model. from HasEvents array getObservableEvents() Get the observable event names. from HasEvents $this setObservableEvents(array $observables) Set the observable event names. from HasEvents void addObservableEvents(array|mixed $observables) Add an observable event name. from HasEvents void removeObservableEvents(array|mixed $observables) Remove an observable event name. from HasEvents static void registerModelEvent(string $event, Closure|string $callback) Register a model event with the dispatcher. from HasEvents mixed fireModelEvent(string $event, bool $halt = true) Fire the given event for the model. from HasEvents mixed|null fireCustomModelEvent(string $event, string $method) Fire a custom model event for the given event. from HasEvents mixed filterModelEventResults(mixed $result) Filter the model event results. from HasEvents static void retrieved(Closure|string $callback) Register a retrieved model event with the dispatcher. from HasEvents static void saving(Closure|string $callback) Register a saving model event with the dispatcher. from HasEvents static void saved(Closure|string $callback) Register a saved model event with the dispatcher. from HasEvents static void updating(Closure|string $callback) Register an updating model event with the dispatcher. from HasEvents static void updated(Closure|string $callback) Register an updated model event with the dispatcher. from HasEvents static void creating(Closure|string $callback) Register a creating model event with the dispatcher. from HasEvents static void created(Closure|string $callback) Register a created model event with the dispatcher. from HasEvents static void replicating(Closure|string $callback) Register a replicating model event with the dispatcher. from HasEvents static void deleting(Closure|string $callback) Register a deleting model event with the dispatcher. from HasEvents static void deleted(Closure|string $callback) Register a deleted model event with the dispatcher. from HasEvents static void flushEventListeners() Remove all of the event listeners for the model. from HasEvents static Dispatcher getEventDispatcher() Get the event dispatcher instance. from HasEvents static void setEventDispatcher(Dispatcher $dispatcher) Set the event dispatcher instance. from HasEvents static void unsetEventDispatcher() Unset the event dispatcher for models. from HasEvents static mixed withoutEvents(callable $callback) Execute a callback without firing any model events for any model type. from HasEvents static mixed addGlobalScope(Scope|Closure|string $scope, Closure $implementation = null) Register a new global scope on the model. from HasGlobalScopes static bool hasGlobalScope(Scope|string $scope) Determine if a model has a global scope. from HasGlobalScopes static Scope|Closure|null getGlobalScope(Scope|string $scope) Get a global scope registered with the model. from HasGlobalScopes array getGlobalScopes() Get the global scopes for this class instance. from HasGlobalScopes static void resolveRelationUsing(string $name, Closure $callback) Define a dynamic relation resolver. from HasRelationships HasOne hasOne(string $related, string|null $foreignKey = null, string|null $localKey = null) Define a one-to-one relationship. from HasRelationships HasOne newHasOne(Builder $query, Model $parent, string $foreignKey, string $localKey) Instantiate a new HasOne relationship. from HasRelationships HasOneThrough hasOneThrough(string $related, string $through, string|null $firstKey = null, string|null $secondKey = null, string|null $localKey = null, string|null $secondLocalKey = null) Define a has-one-through relationship. from HasRelationships HasOneThrough newHasOneThrough(Builder $query, Model $farParent, Model $throughParent, string $firstKey, string $secondKey, string $localKey, string $secondLocalKey) Instantiate a new HasOneThrough relationship. from HasRelationships MorphOne morphOne(string $related, string $name, string|null $type = null, string|null $id = null, string|null $localKey = null) Define a polymorphic one-to-one relationship. from HasRelationships MorphOne newMorphOne(Builder $query, Model $parent, string $type, string $id, string $localKey) Instantiate a new MorphOne relationship. from HasRelationships BelongsTo belongsTo(string $related, string|null $foreignKey = null, string|null $ownerKey = null, string|null $relation = null) Define an inverse one-to-one or many relationship. from HasRelationships BelongsTo newBelongsTo(Builder $query, Model $child, string $foreignKey, string $ownerKey, string $relation) Instantiate a new BelongsTo relationship. from HasRelationships MorphTo morphTo(string|null $name = null, string|null $type = null, string|null $id = null, string|null $ownerKey = null) Define a polymorphic, inverse one-to-one or many relationship. from HasRelationships MorphTo morphEagerTo(string $name, string $type, string $id, string $ownerKey) Define a polymorphic, inverse one-to-one or many relationship. from HasRelationships MorphTo morphInstanceTo(string $target, string $name, string $type, string $id, string $ownerKey) Define a polymorphic, inverse one-to-one or many relationship. from HasRelationships MorphTo newMorphTo(Builder $query, Model $parent, string $foreignKey, string $ownerKey, string $type, string $relation) Instantiate a new MorphTo relationship. from HasRelationships static string getActualClassNameForMorph(string $class) Retrieve the actual class name for a given morph class. from HasRelationships string guessBelongsToRelation() Guess the "belongs to" relationship name. from HasRelationships HasMany hasMany(string $related, string|null $foreignKey = null, string|null $localKey = null) Define a one-to-many relationship. from HasRelationships HasMany newHasMany(Builder $query, Model $parent, string $foreignKey, string $localKey) Instantiate a new HasMany relationship. from HasRelationships HasManyThrough hasManyThrough(string $related, string $through, string|null $firstKey = null, string|null $secondKey = null, string|null $localKey = null, string|null $secondLocalKey = null) Define a has-many-through relationship. from HasRelationships HasManyThrough newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, string $firstKey, string $secondKey, string $localKey, string $secondLocalKey) Instantiate a new HasManyThrough relationship. from HasRelationships MorphMany morphMany(string $related, string $name, string|null $type = null, string|null $id = null, string|null $localKey = null) Define a polymorphic one-to-many relationship. from HasRelationships MorphMany newMorphMany(Builder $query, Model $parent, string $type, string $id, string $localKey) Instantiate a new MorphMany relationship. from HasRelationships BelongsToMany belongsToMany(string $related, string|null $table = null, string|null $foreignPivotKey = null, string|null $relatedPivotKey = null, string|null $parentKey = null, string|null $relatedKey = null, string|null $relation = null) Define a many-to-many relationship. from HasRelationships BelongsToMany newBelongsToMany(Builder $query, Model $parent, string $table, string $foreignPivotKey, string $relatedPivotKey, string $parentKey, string $relatedKey, string|null $relationName = null) Instantiate a new BelongsToMany relationship. from HasRelationships MorphToMany morphToMany(string $related, string $name, string|null $table = null, string|null $foreignPivotKey = null, string|null $relatedPivotKey = null, string|null $parentKey = null, string|null $relatedKey = null, bool $inverse = false) Define a polymorphic many-to-many relationship. from HasRelationships MorphToMany newMorphToMany(Builder $query, Model $parent, string $name, string $table, string $foreignPivotKey, string $relatedPivotKey, string $parentKey, string $relatedKey, string|null $relationName = null, bool $inverse = false) Instantiate a new MorphToMany relationship. from HasRelationships MorphToMany morphedByMany(string $related, string $name, string|null $table = null, string|null $foreignPivotKey = null, string|null $relatedPivotKey = null, string|null $parentKey = null, string|null $relatedKey = null) Define a polymorphic, inverse many-to-many relationship. from HasRelationships string|null guessBelongsToManyRelation() Get the relationship name of the belongsToMany relationship. from HasRelationships string joiningTable(string $related, Model|null $instance = null) Get the joining table name for a many-to-many relation. from HasRelationships string joiningTableSegment() Get this model's half of the intermediate table name for belongsToMany relationships. from HasRelationships bool touches(string $relation) Determine if the model touches a given relation. from HasRelationships void touchOwners() Touch the owning relations of the model. from HasRelationships array getMorphs(string $name, string $type, string $id) Get the polymorphic relationship columns. from HasRelationships string getMorphClass() Get the class name for polymorphic relations. from HasRelationships mixed newRelatedInstance(string $class) Create a new model instance for a related model. from HasRelationships array getRelations() Get all the loaded relations for the instance. from HasRelationships mixed getRelation(string $relation) Get a specified relationship. from HasRelationships bool relationLoaded(string $key) Determine if the given relation is loaded. from HasRelationships $this setRelation(string $relation, mixed $value) Set the given relationship on the model. from HasRelationships $this unsetRelation(string $relation) Unset a loaded relationship. from HasRelationships $this setRelations(array $relations) Set the entire relations array on the model. from HasRelationships $this withoutRelations() Duplicate the instance and unset all the loaded relations. from HasRelationships $this unsetRelations() Unset all the loaded relations for the instance. from HasRelationships array getTouchedRelations() Get the relationships that are touched on save. from HasRelationships $this setTouchedRelations(array $touches) Set the relationships that are touched on save. from HasRelationships bool touch() Update the model's update timestamp. from HasTimestamps void updateTimestamps() Update the creation and update timestamps. from HasTimestamps $this setCreatedAt(mixed $value) Set the value of the "created at" attribute. from HasTimestamps $this setUpdatedAt(mixed $value) Set the value of the "updated at" attribute. from HasTimestamps Carbon freshTimestamp() Get a fresh timestamp for the model. from HasTimestamps string freshTimestampString() Get a fresh timestamp for the model. from HasTimestamps bool usesTimestamps() Determine if the model uses timestamps. from HasTimestamps string|null getCreatedAtColumn() Get the name of the "created at" column. from HasTimestamps string|null getUpdatedAtColumn() Get the name of the "updated at" column. from HasTimestamps string getQualifiedCreatedAtColumn() Get the fully qualified "created at" column. from HasTimestamps string getQualifiedUpdatedAtColumn() Get the fully qualified "updated at" column. from HasTimestamps array getHidden() Get the hidden attributes for the model. from HidesAttributes $this setHidden(array $hidden) Set the hidden attributes for the model. from HidesAttributes array getVisible() Get the visible attributes for the model. from HidesAttributes $this setVisible(array $visible) Set the visible attributes for the model. from HidesAttributes $this makeVisible(array|string|null $attributes) Make the given, typically hidden, attributes visible. from HidesAttributes $this makeVisibleIf(bool|Closure $condition, array|string|null $attributes) Make the given, typically hidden, attributes visible if the given truth test passes. from HidesAttributes $this makeHidden(array|string|null $attributes) Make the given, typically visible, attributes hidden. from HidesAttributes $this makeHiddenIf(bool|Closure $condition, array|string|null $attributes) Make the given, typically visible, attributes hidden if the given truth test passes. from HidesAttributes array getFillable() Get the fillable attributes for the model. from GuardsAttributes $this fillable(array $fillable) Set the fillable attributes for the model. from GuardsAttributes $this mergeFillable(array $fillable) Merge new fillable attributes with existing fillable attributes on the model. from GuardsAttributes array getGuarded() Get the guarded attributes for the model. from GuardsAttributes $this guard(array $guarded) Set the guarded attributes for the model. from GuardsAttributes $this mergeGuarded(array $guarded) Merge new guarded attributes with existing guarded attributes on the model. from GuardsAttributes static void unguard(bool $state = true) Disable all mass assignable restrictions. from GuardsAttributes static void reguard() Enable the mass assignment restrictions. from GuardsAttributes static bool isUnguarded() Determine if current state is "unguarded". from GuardsAttributes static mixed unguarded(callable $callback) Run the given callable while being unguarded. from GuardsAttributes bool isFillable(string $key) Determine if the given attribute may be mass assigned. from GuardsAttributes bool isGuarded(string $key) Determine if the given key is guarded. from GuardsAttributes bool isGuardableColumn(string $key) Determine if the given column is a valid, guardable column. from GuardsAttributes bool totallyGuarded() Determine if the model is totally guarded. from GuardsAttributes array fillableFromArray(array $attributes) Get the fillable attributes of a given array. from GuardsAttributes mixed forwardCallTo(mixed $object, string $method, array $parameters) Forward a method call to the given object. from ForwardsCalls static void throwBadMethodCallException(string $method) Throw a bad method call exception for the given method. from ForwardsCalls void __construct(array $attributes = []) Create a new Eloquent model instance. from Model void bootIfNotBooted() Check if the model needs to be booted and if so, do it. from Model static void booting() Perform any actions required before the model boots. from Model static void boot() Bootstrap the model and its traits. from Model static void bootTraits() Boot all of the bootable traits on the model. from Model void initializeTraits() Initialize any initializable traits on the model. from Model static void booted() Perform any actions required after the model boots. from Model static void clearBootedModels() Clear the list of booted models so they will be re-booted. from Model static void withoutTouching(callable $callback) Disables relationship model touching for the current class during given callback scope. from Model static void withoutTouchingOn(array $models, callable $callback) Disables relationship model touching for the given model classes during given callback scope. from Model static bool isIgnoringTouch(string|null $class = null) Determine if the given model is ignoring touches. from Model $this fill(array $attributes) Fill the model with an array of attributes. from Model $this forceFill(array $attributes) Fill the model with an array of attributes. Force mass assignment. from Model string qualifyColumn(string $column) Qualify the given column name by the model's table. from Model Model newInstance(array $attributes = [], bool $exists = false) Create a new instance of the given model. from Model Model newFromBuilder(array $attributes = [], string|null $connection = null) Create a new model instance that is existing. from Model static Builder on(string|null $connection = null) Begin querying the model on a given connection. from Model static Builder onWriteConnection() Begin querying the model on the write connection. from Model static Collection|Model[] all(array|mixed $columns = ['*']) Get all of the models from the database. from Model static Builder with(array|string $relations) Begin querying a model with eager loading. from Model $this load(array|string $relations) Eager load relations on the model. from Model $this loadMorph(string $relation, array $relations) Eager load relationships on the polymorphic relation of a model. from Model $this loadMissing(array|string $relations) Eager load relations on the model if they are not already eager loaded. from Model $this loadAggregate(array|string $relations, string $column, string $function = null) Eager load relation's column aggregations on the model. from Model $this loadCount(array|string $relations) Eager load relation counts on the model. from Model $this loadMax(array|string $relations, string $column) Eager load relation max column values on the model. from Model $this loadMin(array|string $relations, string $column) Eager load relation min column values on the model. from Model $this loadSum(array|string $relations, string $column) Eager load relation's column summations on the model. from Model $this loadAvg(array|string $relations, string $column) Eager load relation average column values on the model. from Model $this loadMorphAggregate(string $relation, array $relations, string $column, string $function = null) Eager load relationship column aggregation on the polymorphic relation of a model. from Model $this loadMorphCount(string $relation, array $relations) Eager load relationship counts on the polymorphic relation of a model. from Model $this loadMorphMax(string $relation, array $relations, string $column) Eager load relationship max column values on the polymorphic relation of a model. from Model $this loadMorphMin(string $relation, array $relations, string $column) Eager load relationship min column values on the polymorphic relation of a model. from Model $this loadMorphSum(string $relation, array $relations, string $column) Eager load relationship column summations on the polymorphic relation of a model. from Model $this loadMorphAvg(string $relation, array $relations, string $column) Eager load relationship average column values on the polymorphic relation of a model. from Model int increment(string $column, float|int $amount = 1, array $extra = []) Increment a column's value by a given amount. from Model int decrement(string $column, float|int $amount = 1, array $extra = []) Decrement a column's value by a given amount. from Model int incrementOrDecrement(string $column, float|int $amount, array $extra, string $method) Run the increment or decrement method on the model. from Model bool update(array $attributes = [], array $options = []) Update the model in the database. from Model bool push() Save the model and all of its relationships. from Model bool saveQuietly(array $options = []) Save the model to the database without raising any events. from Model bool save(array $options = []) Save the model to the database. from Model bool saveOrFail(array $options = []) Save the model to the database using transaction. from Model void finishSave(array $options) Perform any actions that are necessary after the model is saved. from Model bool performUpdate(Builder $query) Perform a model update operation. from Model Builder setKeysForSelectQuery(Builder $query) Set the keys for a select query. from Model mixed getKeyForSelectQuery() Get the primary key value for a select query. from Model Builder setKeysForSaveQuery(Builder $query) Set the keys for a save update query. from Model mixed getKeyForSaveQuery() Get the primary key value for a save query. from Model bool performInsert(Builder $query) Perform a model insert operation. from Model void insertAndSetId(Builder $query, array $attributes) Insert the given attributes and set the ID on the model. from Model static int destroy(Collection|array|int|string $ids) Destroy the models for the given IDs. from Model bool|null delete() Delete the model from the database. from Model bool|null forceDelete() Force a hard delete on a soft deleted model. from Model void performDeleteOnModel() Perform the actual delete query on this model instance. from Model static Builder query() Begin querying the model. from Model Builder newQuery() Get a new query builder for the model's table. from Model Builder|Model newModelQuery() Get a new query builder that doesn't have any global scopes or eager loading. from Model Builder newQueryWithoutRelationships() Get a new query builder with no relationships loaded. from Model Builder registerGlobalScopes(Builder $builder) Register the global scopes for this builder instance. from Model Builder|Model newQueryWithoutScopes() Get a new query builder that doesn't have any global scopes. from Model Builder newQueryWithoutScope(Scope|string $scope) Get a new query instance without a given scope. from Model Builder newQueryForRestoration(array|int $ids) Get a new query to restore one or more models by their queueable IDs. from Model Builder|Model newEloquentBuilder(Builder $query) Create a new Eloquent query builder for the model. from Model Builder newBaseQueryBuilder() Get a new query builder instance for the connection. from Model Collection newCollection(array $models = []) Create a new Eloquent Collection instance. from Model Pivot newPivot(Model $parent, array $attributes, string $table, bool $exists, string|null $using = null) Create a new pivot model instance. from Model bool hasNamedScope(string $scope) Determine if the model has a given scope. from Model mixed callNamedScope(string $scope, array $parameters = []) Apply the given named scope if possible. from Model array toArray() Convert the model instance to an array. from Model string toJson(int $options = 0) Convert the model instance to JSON. from Model array jsonSerialize() Convert the object into something JSON serializable. from Model Model|null fresh(array|string $with = []) Reload a fresh model instance from the database. from Model $this refresh() Reload the current model instance with fresh attributes from the database. from Model Model replicate(array $except = null) Clone the model into a new, non-existing instance. from Model bool is(Model|null $model) Determine if two models have the same ID and belong to the same table. from Model bool isNot(Model|null $model) Determine if two models are not the same. from Model Connection getConnection() Get the database connection for the model. from Model string|null getConnectionName() Get the current connection name for the model. from Model $this setConnection(string|null $name) Set the connection associated with the model. from Model static Connection resolveConnection(string|null $connection = null) Resolve a connection instance. from Model static ConnectionResolverInterface getConnectionResolver() Get the connection resolver instance. from Model static void setConnectionResolver(ConnectionResolverInterface $resolver) Set the connection resolver instance. from Model static void unsetConnectionResolver() Unset the connection resolver for models. from Model string getTable() Get the table associated with the model. from Model $this setTable(string $table) Set the table associated with the model. from Model string getKeyName() Get the primary key for the model. from Model $this setKeyName(string $key) Set the primary key for the model. from Model string getQualifiedKeyName() Get the table qualified key name. from Model string getKeyType() Get the auto-incrementing key type. from Model $this setKeyType(string $type) Set the data type for the primary key. from Model bool getIncrementing() Get the value indicating whether the IDs are incrementing. from Model $this setIncrementing(bool $value) Set whether IDs are incrementing. from Model mixed getKey() Get the value of the model's primary key. from Model mixed getQueueableId() Get the queueable identity for the entity. from Model array getQueueableRelations() Get the queueable relationships for the entity. from Model string|null getQueueableConnection() Get the queueable connection for the entity. from Model mixed getRouteKey() Get the value of the model's route key. from Model string getRouteKeyName() Get the route key for the model. from Model Model|null resolveRouteBinding(mixed $value, string|null $field = null) Retrieve the model for a bound value. from Model Model|null resolveChildRouteBinding(string $childType, mixed $value, string|null $field) Retrieve the child model for a bound value. from Model string getForeignKey() Get the default foreign key name for the model. from Model int getPerPage() Get the number of models to return per page. from Model $this setPerPage(int $perPage) Set the number of models to return per page. from Model mixed __get(string $key) Dynamically retrieve attributes on the model. from Model void __set(string $key, mixed $value) Dynamically set attributes on the model. from Model bool offsetExists(mixed $offset) Determine if the given attribute exists. from Model mixed offsetGet(mixed $offset) Get the value for a given offset. from Model void offsetSet(mixed $offset, mixed $value) Set the value for a given offset. from Model void offsetUnset(mixed $offset) Unset the value for a given offset. from Model bool __isset(string $key) Determine if an attribute or relation exists on the model. from Model void __unset(string $key) Unset an attribute on the model. from Model mixed __call(string $method, array $parameters) Handle dynamic method calls into the model. from Model static mixed __callStatic(string $method, array $parameters) Handle dynamic static method calls into the model. from Model string __toString() Convert the model to its string representation. from Model array __sleep() Prepare the object for serialization. from Model void __wakeup() When a model is being unserialized, check if it needs to be booted. from Model string getAuthIdentifierName() Get the name of the unique identifier for the user. from Authenticatable mixed getAuthIdentifier() Get the unique identifier for the user. from Authenticatable string getAuthPassword() Get the password for the user. from Authenticatable string|null getRememberToken() Get the token value for the "remember me" session. from Authenticatable void setRememberToken(string $value) Set the token value for the "remember me" session. from Authenticatable string getRememberTokenName() Get the column name for the "remember me" token. from Authenticatable bool can(iterable|string $abilities, array|mixed $arguments = []) Determine if the entity has the given abilities. from Authorizable bool canAny(iterable|string $abilities, array|mixed $arguments = []) Determine if the entity has any of the given abilities. from Authorizable bool cant(iterable|string $abilities, array|mixed $arguments = []) Determine if the entity does not have the given abilities. from Authorizable bool cannot(iterable|string $abilities, array|mixed $arguments = []) Determine if the entity does not have the given abilities. from Authorizable string getEmailForPasswordReset() Get the e-mail address where password reset links are sent. from CanResetPassword void sendPasswordResetNotification(string $token) Send the password reset notification. from CanResetPassword bool hasVerifiedEmail() Determine if the user has verified their email address. from MustVerifyEmail bool markEmailAsVerified() Mark the given user's email as verified. from MustVerifyEmail void sendEmailVerificationNotification() Send the email verification notification. from MustVerifyEmail string getEmailForVerification() Get the email address that should be used for verification. from MustVerifyEmail Details array attributesToArray() Convert the model's attributes to an array. Return Value array protected array addDateAttributesToArray(array $attributes) Add the date attributes to the attributes array. Parameters array $attributes Return Value array protected array addMutatedAttributesToArray(array $attributes, array $mutatedAttributes) Add the mutated attributes to the attributes array. Parameters array $attributes array $mutatedAttributes Return Value array protected array addCastAttributesToArray(array $attributes, array $mutatedAttributes) Add the casted attributes to the attributes array. Parameters array $attributes array $mutatedAttributes Return Value array protected array getArrayableAttributes() Get an attribute array of all arrayable attributes. Return Value array protected array getArrayableAppends() Get all of the appendable values that are arrayable. Return Value array array relationsToArray() Get the model's relationships in array form. Return Value array protected array getArrayableRelations() Get an attribute array of all arrayable relations. Return Value array protected array getArrayableItems(array $values) Get an attribute array of all arrayable values. Parameters array $values Return Value array mixed getAttribute(string $key) Get an attribute from the model. Parameters string $key Return Value mixed mixed getAttributeValue(string $key) Get a plain attribute (not a relationship). Parameters string $key Return Value mixed protected mixed getAttributeFromArray(string $key) Get an attribute from the $attributes array. Parameters string $key Return Value mixed mixed getRelationValue(string $key) Get a relationship. Parameters string $key Return Value mixed protected mixed getRelationshipFromMethod(string $method) Get a relationship value from a method. Parameters string $method Return Value mixed Exceptions LogicException bool hasGetMutator(string $key) Determine if a get mutator exists for an attribute. Parameters string $key Return Value bool protected mixed mutateAttribute(string $key, mixed $value) Get the value of an attribute using its mutator. Parameters string $key mixed $value Return Value mixed protected mixed mutateAttributeForArray(string $key, mixed $value) Get the value of an attribute using its mutator for array conversion. Parameters string $key mixed $value Return Value mixed void mergeCasts(array $casts) Merge new casts with existing casts on the model. Parameters array $casts Return Value void protected mixed castAttribute(string $key, mixed $value) Cast an attribute to a native PHP type. Parameters string $key mixed $value Return Value mixed protected mixed getClassCastableAttributeValue(string $key, mixed $value) Cast the given attribute using a custom cast class. Parameters string $key mixed $value Return Value mixed protected string getCastType(string $key) Get the type of cast for a model attribute. Parameters string $key Return Value string protected mixed deviateClassCastableAttribute(string $method, string $key, mixed $value) Increment or decrement the given attribute using the custom cast class. Parameters string $method string $key mixed $value Return Value mixed protected mixed serializeClassCastableAttribute(string $key, mixed $value) Serialize the given attribute using the custom cast class. Parameters string $key mixed $value Return Value mixed protected bool isCustomDateTimeCast(string $cast) Determine if the cast type is a custom date time cast. Parameters string $cast Return Value bool protected bool isDecimalCast(string $cast) Determine if the cast type is a decimal cast. Parameters string $cast Return Value bool mixed setAttribute(string $key, mixed $value) Set a given attribute on the model. Parameters string $key mixed $value Return Value mixed bool hasSetMutator(string $key) Determine if a set mutator exists for an attribute. Parameters string $key Return Value bool protected mixed setMutatedAttributeValue(string $key, mixed $value) Set the value of an attribute using its mutator. Parameters string $key mixed $value Return Value mixed protected bool isDateAttribute(string $key) Determine if the given attribute is a date or date castable. Parameters string $key Return Value bool $this fillJsonAttribute(string $key, mixed $value) Set a given JSON attribute on the model. Parameters string $key mixed $value Return Value $this protected void setClassCastableAttribute(string $key, mixed $value) Set the value of a class castable attribute. Parameters string $key mixed $value Return Value void protected $this getArrayAttributeWithValue(string $path, string $key, mixed $value) Get an array attribute with the given key and value set. Parameters string $path string $key mixed $value Return Value $this protected array getArrayAttributeByKey(string $key) Get an array attribute or return an empty array if it is not set. Parameters string $key Return Value array protected string castAttributeAsJson(string $key, mixed $value) Cast the given attribute to JSON. Parameters string $key mixed $value Return Value string protected string asJson(mixed $value) Encode the given value as JSON. Parameters mixed $value Return Value string mixed fromJson(string $value, bool $asObject = false) Decode the given JSON back into an array or object. Parameters string $value bool $asObject Return Value mixed mixed fromEncryptedString(string $value) Decrypt the given encrypted string. Parameters string $value Return Value mixed protected string castAttributeAsEncryptedString(string $key, mixed $value) Cast the given attribute to an encrypted string. Parameters string $key mixed $value Return Value string static void encryptUsing(Encrypter $encrypter) Set the encrypter instance that will be used to encrypt attributes. Parameters Encrypter $encrypter Return Value void mixed fromFloat(mixed $value) Decode the given float. Parameters mixed $value Return Value mixed protected string asDecimal(float $value, int $decimals) Return a decimal as string. Parameters float $value int $decimals Return Value string protected Carbon asDate(mixed $value) Return a timestamp as DateTime object with time set to 00:00:00. Parameters mixed $value Return Value Carbon protected Carbon asDateTime(mixed $value) Return a timestamp as DateTime object. Parameters mixed $value Return Value Carbon protected bool isStandardDateFormat(string $value) Determine if the given value is a standard date format. Parameters string $value Return Value bool string|null fromDateTime(mixed $value) Convert a DateTime to a storable string. Parameters mixed $value Return Value string|null protected int asTimestamp(mixed $value) Return a timestamp as unix timestamp. Parameters mixed $value Return Value int protected string serializeDate(DateTimeInterface $date) Prepare a date for array / JSON serialization. Parameters DateTimeInterface $date Return Value string array getDates() Get the attributes that should be converted to dates. Return Value array string getDateFormat() Get the format for database stored dates. Return Value string $this setDateFormat(string $format) Set the date format used by the model. Parameters string $format Return Value $this bool hasCast(string $key, array|string|null $types = null) Determine whether an attribute should be cast to a native type. Parameters string $key array|string|null $types Return Value bool array getCasts() Get the casts array. Return Value array protected bool isDateCastable(string $key) Determine whether a value is Date / DateTime castable for inbound manipulation. Parameters string $key Return Value bool protected bool isJsonCastable(string $key) Determine whether a value is JSON castable for inbound manipulation. Parameters string $key Return Value bool protected bool isEncryptedCastable(string $key) Determine whether a value is an encrypted castable for inbound manipulation. Parameters string $key Return Value bool protected bool isClassCastable(string $key) Determine if the given key is cast using a custom class. Parameters string $key Return Value bool protected bool isClassDeviable(string $key) Determine if the key is deviable using a custom class. Parameters string $key Return Value bool Exceptions InvalidCastException protected bool isClassSerializable(string $key) Determine if the key is serializable using a custom class. Parameters string $key Return Value bool Exceptions InvalidCastException protected mixed resolveCasterClass(string $key) Resolve the custom caster class for a given key. Parameters string $key Return Value mixed protected string parseCasterClass(string $class) Parse the given caster class, removing any arguments. Parameters string $class Return Value string protected void mergeAttributesFromClassCasts() Merge the cast class attributes back into the model. Return Value void protected array normalizeCastClassResponse(string $key, mixed $value) Normalize the response from a custom class caster. Parameters string $key mixed $value Return Value array array getAttributes() Get all of the current attributes on the model. Return Value array $this setRawAttributes(array $attributes, bool $sync = false) Set the array of model attributes. No checking is done. Parameters array $attributes bool $sync Return Value $this mixed|array getOriginal(string|null $key = null, mixed $default = null) Get the model's original attribute values. Parameters string|null $key mixed $default Return Value mixed|array protected mixed|array getOriginalWithoutRewindingModel(string|null $key = null, mixed $default = null) Get the model's original attribute values. Parameters string|null $key mixed $default Return Value mixed|array mixed|array getRawOriginal(string|null $key = null, mixed $default = null) Get the model's raw original attribute values. Parameters string|null $key mixed $default Return Value mixed|array array only(array|mixed $attributes) Get a subset of the model's attributes. Parameters array|mixed $attributes Return Value array $this syncOriginal() Sync the original attributes with the current. Return Value $this $this syncOriginalAttribute(string $attribute) Sync a single original attribute with its current value. Parameters string $attribute Return Value $this $this syncOriginalAttributes(array|string $attributes) Sync multiple original attribute with their current values. Parameters array|string $attributes Return Value $this $this syncChanges() Sync the changed attributes. Return Value $this bool isDirty(array|string|null $attributes = null) Determine if the model or any of the given attribute(s) have been modified. Parameters array|string|null $attributes Return Value bool bool isClean(array|string|null $attributes = null) Determine if the model and all the given attribute(s) have remained the same. Parameters array|string|null $attributes Return Value bool bool wasChanged(array|string|null $attributes = null) Determine if the model or any of the given attribute(s) have been modified. Parameters array|string|null $attributes Return Value bool protected bool hasChanges(array $changes, array|string|null $attributes = null) Determine if any of the given attributes were changed. Parameters array $changes array|string|null $attributes Return Value bool array getDirty() Get the attributes that have been changed since last sync. Return Value array array getChanges() Get the attributes that were changed. Return Value array bool originalIsEquivalent(string $key) Determine if the new and old values for a given key are equivalent. Parameters string $key Return Value bool protected mixed transformModelValue(string $key, mixed $value) Transform a raw model value using mutators, casts, etc. Parameters string $key mixed $value Return Value mixed $this append(array|string $attributes) Append attributes to query when building a query. Parameters array|string $attributes Return Value $this $this setAppends(array $appends) Set the accessors to append to model arrays. Parameters array $appends Return Value $this bool hasAppended(string $attribute) Return whether the accessor attribute has been appended. Parameters string $attribute Return Value bool array getMutatedAttributes() Get the mutated attributes for a given instance. Return Value array static void cacheMutatedAttributes(string $class) Extract and cache all the mutated attributes of a class. Parameters string $class Return Value void static protected array getMutatorMethods(mixed $class) Get all of the attribute mutator methods. Parameters mixed $class Return Value array static void observe(object|array|string $classes) Register observers with the model. Parameters object|array|string $classes Return Value void Exceptions RuntimeException protected void registerObserver(object|string $class) Register a single observer with the model. Parameters object|string $class Return Value void Exceptions RuntimeException array getObservableEvents() Get the observable event names. Return Value array $this setObservableEvents(array $observables) Set the observable event names. Parameters array $observables Return Value $this void addObservableEvents(array|mixed $observables) Add an observable event name. Parameters array|mixed $observables Return Value void void removeObservableEvents(array|mixed $observables) Remove an observable event name. Parameters array|mixed $observables Return Value void static protected void registerModelEvent(string $event, Closure|string $callback) Register a model event with the dispatcher. Parameters string $event Closure|string $callback Return Value void protected mixed fireModelEvent(string $event, bool $halt = true) Fire the given event for the model. Parameters string $event bool $halt Return Value mixed protected mixed|null fireCustomModelEvent(string $event, string $method) Fire a custom model event for the given event. Parameters string $event string $method Return Value mixed|null protected mixed filterModelEventResults(mixed $result) Filter the model event results. Parameters mixed $result Return Value mixed static void retrieved(Closure|string $callback) Register a retrieved model event with the dispatcher. Parameters Closure|string $callback Return Value void static void saving(Closure|string $callback) Register a saving model event with the dispatcher. Parameters Closure|string $callback Return Value void static void saved(Closure|string $callback) Register a saved model event with the dispatcher. Parameters Closure|string $callback Return Value void static void updating(Closure|string $callback) Register an updating model event with the dispatcher. Parameters Closure|string $callback Return Value void static void updated(Closure|string $callback) Register an updated model event with the dispatcher. Parameters Closure|string $callback Return Value void static void creating(Closure|string $callback) Register a creating model event with the dispatcher. Parameters Closure|string $callback Return Value void static void created(Closure|string $callback) Register a created model event with the dispatcher. Parameters Closure|string $callback Return Value void static void replicating(Closure|string $callback) Register a replicating model event with the dispatcher. Parameters Closure|string $callback Return Value void static void deleting(Closure|string $callback) Register a deleting model event with the dispatcher. Parameters Closure|string $callback Return Value void static void deleted(Closure|string $callback) Register a deleted model event with the dispatcher. Parameters Closure|string $callback Return Value void static void flushEventListeners() Remove all of the event listeners for the model. Return Value void static Dispatcher getEventDispatcher() Get the event dispatcher instance. Return Value Dispatcher static void setEventDispatcher(Dispatcher $dispatcher) Set the event dispatcher instance. Parameters Dispatcher $dispatcher Return Value void static void unsetEventDispatcher() Unset the event dispatcher for models. Return Value void static mixed withoutEvents(callable $callback) Execute a callback without firing any model events for any model type. Parameters callable $callback Return Value mixed static mixed addGlobalScope(Scope|Closure|string $scope, Closure $implementation = null) Register a new global scope on the model. Parameters Scope|Closure|string $scope Closure $implementation Return Value mixed Exceptions InvalidArgumentException static bool hasGlobalScope(Scope|string $scope) Determine if a model has a global scope. Parameters Scope|string $scope Return Value bool static Scope|Closure|null getGlobalScope(Scope|string $scope) Get a global scope registered with the model. Parameters Scope|string $scope Return Value Scope|Closure|null array getGlobalScopes() Get the global scopes for this class instance. Return Value array static void resolveRelationUsing(string $name, Closure $callback) Define a dynamic relation resolver. Parameters string $name Closure $callback Return Value void HasOne hasOne(string $related, string|null $foreignKey = null, string|null $localKey = null) Define a one-to-one relationship. Parameters string $related string|null $foreignKey string|null $localKey Return Value HasOne protected HasOne newHasOne(Builder $query, Model $parent, string $foreignKey, string $localKey) Instantiate a new HasOne relationship. Parameters Builder $query Model $parent string $foreignKey string $localKey Return Value HasOne HasOneThrough hasOneThrough(string $related, string $through, string|null $firstKey = null, string|null $secondKey = null, string|null $localKey = null, string|null $secondLocalKey = null) Define a has-one-through relationship. Parameters string $related string $through string|null $firstKey string|null $secondKey string|null $localKey string|null $secondLocalKey Return Value HasOneThrough protected HasOneThrough newHasOneThrough(Builder $query, Model $farParent, Model $throughParent, string $firstKey, string $secondKey, string $localKey, string $secondLocalKey) Instantiate a new HasOneThrough relationship. Parameters Builder $query Model $farParent Model $throughParent string $firstKey string $secondKey string $localKey string $secondLocalKey Return Value HasOneThrough MorphOne morphOne(string $related, string $name, string|null $type = null, string|null $id = null, string|null $localKey = null) Define a polymorphic one-to-one relationship. Parameters string $related string $name string|null $type string|null $id string|null $localKey Return Value MorphOne protected MorphOne newMorphOne(Builder $query, Model $parent, string $type, string $id, string $localKey) Instantiate a new MorphOne relationship. Parameters Builder $query Model $parent string $type string $id string $localKey Return Value MorphOne BelongsTo belongsTo(string $related, string|null $foreignKey = null, string|null $ownerKey = null, string|null $relation = null) Define an inverse one-to-one or many relationship. Parameters string $related string|null $foreignKey string|null $ownerKey string|null $relation Return Value BelongsTo protected BelongsTo newBelongsTo(Builder $query, Model $child, string $foreignKey, string $ownerKey, string $relation) Instantiate a new BelongsTo relationship. Parameters Builder $query Model $child string $foreignKey string $ownerKey string $relation Return Value BelongsTo MorphTo morphTo(string|null $name = null, string|null $type = null, string|null $id = null, string|null $ownerKey = null) Define a polymorphic, inverse one-to-one or many relationship. Parameters string|null $name string|null $type string|null $id string|null $ownerKey Return Value MorphTo protected MorphTo morphEagerTo(string $name, string $type, string $id, string $ownerKey) Define a polymorphic, inverse one-to-one or many relationship. Parameters string $name string $type string $id string $ownerKey Return Value MorphTo protected MorphTo morphInstanceTo(string $target, string $name, string $type, string $id, string $ownerKey) Define a polymorphic, inverse one-to-one or many relationship. Parameters string $target string $name string $type string $id string $ownerKey Return Value MorphTo protected MorphTo newMorphTo(Builder $query, Model $parent, string $foreignKey, string $ownerKey, string $type, string $relation) Instantiate a new MorphTo relationship. Parameters Builder $query Model $parent string $foreignKey string $ownerKey string $type string $relation Return Value MorphTo static string getActualClassNameForMorph(string $class) Retrieve the actual class name for a given morph class. Parameters string $class Return Value string protected string guessBelongsToRelation() Guess the "belongs to" relationship name. Return Value string HasMany hasMany(string $related, string|null $foreignKey = null, string|null $localKey = null) Define a one-to-many relationship. Parameters string $related string|null $foreignKey string|null $localKey Return Value HasMany protected HasMany newHasMany(Builder $query, Model $parent, string $foreignKey, string $localKey) Instantiate a new HasMany relationship. Parameters Builder $query Model $parent string $foreignKey string $localKey Return Value HasMany HasManyThrough hasManyThrough(string $related, string $through, string|null $firstKey = null, string|null $secondKey = null, string|null $localKey = null, string|null $secondLocalKey = null) Define a has-many-through relationship. Parameters string $related string $through string|null $firstKey string|null $secondKey string|null $localKey string|null $secondLocalKey Return Value HasManyThrough protected HasManyThrough newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, string $firstKey, string $secondKey, string $localKey, string $secondLocalKey) Instantiate a new HasManyThrough relationship. Parameters Builder $query Model $farParent Model $throughParent string $firstKey string $secondKey string $localKey string $secondLocalKey Return Value HasManyThrough MorphMany morphMany(string $related, string $name, string|null $type = null, string|null $id = null, string|null $localKey = null) Define a polymorphic one-to-many relationship. Parameters string $related string $name string|null $type string|null $id string|null $localKey Return Value MorphMany protected MorphMany newMorphMany(Builder $query, Model $parent, string $type, string $id, string $localKey) Instantiate a new MorphMany relationship. Parameters Builder $query Model $parent string $type string $id string $localKey Return Value MorphMany BelongsToMany belongsToMany(string $related, string|null $table = null, string|null $foreignPivotKey = null, string|null $relatedPivotKey = null, string|null $parentKey = null, string|null $relatedKey = null, string|null $relation = null) Define a many-to-many relationship. Parameters string $related string|null $table string|null $foreignPivotKey string|null $relatedPivotKey string|null $parentKey string|null $relatedKey string|null $relation Return Value BelongsToMany protected BelongsToMany newBelongsToMany(Builder $query, Model $parent, string $table, string $foreignPivotKey, string $relatedPivotKey, string $parentKey, string $relatedKey, string|null $relationName = null) Instantiate a new BelongsToMany relationship. Parameters Builder $query Model $parent string $table string $foreignPivotKey string $relatedPivotKey string $parentKey string $relatedKey
CREATE TEXT SEARCH CONFIGURATION CREATE TEXT SEARCH CONFIGURATION — define a new text search configuration Synopsis CREATE TEXT SEARCH CONFIGURATION name ( PARSER = parser_name | COPY = source_config ) Description CREATE TEXT SEARCH CONFIGURATION creates a new text search configuration. A text search configuration specifies a text search parser that can divide a string into tokens, plus dictionaries that can be used to determine which tokens are of interest for searching. If only the parser is specified, then the new text search configuration initially has no mappings from token types to dictionaries, and therefore will ignore all words. Subsequent ALTER TEXT SEARCH CONFIGURATION commands must be used to create mappings to make the configuration useful. Alternatively, an existing text search configuration can be copied. If a schema name is given then the text search configuration is created in the specified schema. Otherwise it is created in the current schema. The user who defines a text search configuration becomes its owner. Refer to Chapter 12 for further information. Parameters name The name of the text search configuration to be created. The name can be schema-qualified. parser_name The name of the text search parser to use for this configuration. source_config The name of an existing text search configuration to copy. Notes The PARSER and COPY options are mutually exclusive, because when an existing configuration is copied, its parser selection is copied too. Compatibility There is no CREATE TEXT SEARCH CONFIGURATION statement in the SQL standard. See Also ALTER TEXT SEARCH CONFIGURATION, DROP TEXT SEARCH CONFIGURATION Prev Up Next CREATE TABLESPACE Home CREATE TEXT SEARCH DICTIONARY
.nextUntil() .nextUntil( [selector ] [, filter ] )Returns: jQuery Description: Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. version added: 1.4.nextUntil( [selector ] [, filter ] ) selector Type: Selector A string containing a selector expression to indicate where to stop matching following sibling elements. filter Type: Selector A string containing a selector expression to match elements against. version added: 1.6.nextUntil( [element ] [, filter ] ) element Type: Element or jQuery A DOM node or jQuery object indicating where to stop matching following sibling elements. filter Type: Selector A string containing a selector expression to match elements against. Given a selector expression that represents a set of DOM elements, the .nextUntil() method searches through the successors of these elements in the DOM tree, stopping when it reaches an element matched by the method's argument. The new jQuery object that is returned contains all following siblings up to but not including the one matched by the .nextUntil() argument. If the selector is not matched or is not supplied, all following siblings will be selected; in these cases it selects the same elements as the .nextAll() method does when no filter selector is provided. As of jQuery 1.6, A DOM node or jQuery object, instead of a selector, may be passed to the .nextUntil() method. The method optionally accepts a selector expression for its second argument. If this argument is supplied, the elements will be filtered by testing whether they match it. Example: Find the siblings that follow <dt id="term-2"> up to the next <dt> and give them a red background color. Also, find <dd> siblings that follow <dt id="term-1"> up to <dt id="term-3"> and give them a green text color. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>nextUntil demo</title> <script src="https://code.jquery.com/jquery-3.5.0.js"></script> </head> <body> <dl> <dt id="term-1">term 1</dt> <dd>definition 1-a</dd> <dd>definition 1-b</dd> <dd>definition 1-c</dd> <dd>definition 1-d</dd> <dt id="term-2">term 2</dt> <dd>definition 2-a</dd> <dd>definition 2-b</dd> <dd>definition 2-c</dd> <dt id="term-3">term 3</dt> <dd>definition 3-a</dd> <dd>definition 3-b</dd> </dl> <script> $( "#term-2" ) .nextUntil( "dt" ) .css( "background-color", "red" ); var term3 = document.getElementById( "term-3" ); $( "#term-1" ) .nextUntil( term3, "dd" ) .css( "color", "green" ); </script> </body> </html> Demo:
Testing Responses The TestResponse class provides a number of helpful functions for parsing and testing responses from your test cases. Usually a TestResponse will be provided for you as a result of your Controller Tests or HTTP Feature Tests, but you can always create your own directly using any ResponseInterface: $result = new \CodeIgniter\Test\TestResponse($response); $result->assertOK(); Testing the Response Whether you have received a TestResponse as a result of your tests or created one yourself, there are a number of new assertions that you can use in your tests. Accessing Request/Response request() You can access directly the Request object, if it was set during testing: $request = $results->request(); response() This allows you direct access to the response object: $response = $results->response(); Checking Response Status isOK() Returns a boolean true/false based on whether the response is perceived to be “ok”. This is primarily determined by a response status code in the 200 or 300’s. if ($result->isOK()) { ... } assertOK() This assertion simply uses the isOK() method to test a response. assertNotOK is the inverse of this assertion. $result->assertOK(); isRedirect() Returns a boolean true/false based on whether the response is a redirected response. if ($result->isRedirect()) { ... } assertRedirect() Asserts that the Response is an instance of RedirectResponse. assertNotRedirect is the inverse of this assertion. $result->assertRedirect(); assertRedirectTo() Asserts that the Response is an instance of RedirectResponse and the destination matches the uri given. $result->assertRedirectTo('foo/bar'); getRedirectUrl() Returns the URL set for a RedirectResponse, or null for failure. $url = $result->getRedirectUrl(); $this->assertEquals(site_url('foo/bar'), $url); assertStatus(int $code) Asserts that the HTTP status code returned matches $code. $result->assertStatus(403); Session Assertions assertSessionHas(string $key, $value = null) Asserts that a value exists in the resulting session. If $value is passed, will also assert that the variable’s value matches what was specified. $result->assertSessionHas('logged_in', 123); assertSessionMissing(string $key) Asserts that the resulting session does not include the specified $key. $result->assertSessionMissin('logged_in'); Header Assertions assertHeader(string $key, $value = null) Asserts that a header named $key exists in the response. If $value is not empty, will also assert that the values match. $result->assertHeader('Content-Type', 'text/html'); assertHeaderMissing(string $key) Asserts that a header name $key does not exist in the response. $result->assertHeader('Accepts'); Cookie Assertions assertCookie(string $key, $value = null, string $prefix = ‘’) Asserts that a cookie named $key exists in the response. If $value is not empty, will also assert that the values match. You can set the cookie prefix, if needed, by passing it in as the third parameter. $result->assertCookie('foo', 'bar'); assertCookieMissing(string $key) Asserts that a cookie named $key does not exist in the response. $result->assertCookieMissing('ci_session'); assertCookieExpired(string $key, string $prefix = ‘’) Asserts that a cookie named $key exists, but has expired. You can set the cookie prefix, if needed, by passing it in as the second parameter. $result->assertCookieExpired('foo'); DOM Helpers The response you get back contains a number of helper methods to inspect the HTML output within the response. These are useful for using within assertions in your tests. The see() method checks the text on the page to see if it exists either by itself, or more specifically within a tag, as specified by type, class, or id: // Check that "Hello World" is on the page $results->see('Hello World'); // Check that "Hello World" is within an h1 tag $results->see('Hello World', 'h1'); // Check that "Hello World" is within an element with the "notice" class $results->see('Hello World', '.notice'); // Check that "Hello World" is within an element with id of "title" $results->see('Hellow World', '#title'); The dontSee() method is the exact opposite: // Checks that "Hello World" does NOT exist on the page $results->dontSee('Hello World'); // Checks that "Hellow World" does NOT exist within any h1 tag $results->dontSee('Hello World', 'h1'); The seeElement() and dontSeeElement() are very similar to the previous methods, but do not look at the values of the elements. Instead, they simply check that the elements exist on the page: // Check that an element with class 'notice' exists $results->seeElement('.notice'); // Check that an element with id 'title' exists $results->seeElement('#title') // Verify that an element with id 'title' does NOT exist $results->dontSeeElement('#title'); You can use seeLink() to ensure that a link appears on the page with the specified text: // Check that a link exists with 'Upgrade Account' as the text8b7c:f320:99b9:690f:4595:cd17:293a:c069 $results->seeLink('Upgrade Account'); // Check that a link exists with 'Upgrade Account' as the text, AND a class of 'upsell' $results->seeLink('Upgrade Account', '.upsell'); The seeInField() method checks for any input tags exist with the name and value: // Check that an input exists named 'user' with the value 'John Snow' $results->seeInField('user', 'John Snow'); // Check a multi-dimensional input $results->seeInField('user[name]', 'John Snow'); Finally, you can check if a checkbox exists and is checked with the seeCheckboxIsChecked() method: // Check if checkbox is checked with class of 'foo' $results->seeCheckboxIsChecked('.foo'); // Check if checkbox with id of 'bar' is checked $results->seeCheckboxIsChecked('#bar'); DOM Assertions You can perform tests to see if specific elements/text/etc exist with the body of the response with the following assertions. assertSee(string $search = null, string $element = null) Asserts that text/HTML is on the page, either by itself or - more specifically - within a tag, as specified by type, class, or id: // Check that "Hello World" is on the page $result->assertSee('Hello World'); // Check that "Hello World" is within an h1 tag $result->assertSee('Hello World', 'h1'); // Check that "Hello World" is within an element with the "notice" class $result->assertSee('Hello World', '.notice'); // Check that "Hello World" is within an element with id of "title" $result->assertSee('Hellow World', '#title'); assertDontSee(string $search = null, string $element = null) Asserts the exact opposite of the assertSee() method: // Checks that "Hello World" does NOT exist on the page $results->dontSee('Hello World'); // Checks that "Hello World" does NOT exist within any h1 tag $results->dontSee('Hello World', 'h1'); assertSeeElement(string $search) Similar to assertSee(), however this only checks for an existing element. It does not check for specific text: // Check that an element with class 'notice' exists $results->seeElement('.notice'); // Check that an element with id 'title' exists $results->seeElement('#title') assertDontSeeElement(string $search) Similar to assertSee(), however this only checks for an existing element that is missing. It does not check for specific text: // Verify that an element with id 'title' does NOT exist $results->dontSeeElement('#title'); assertSeeLink(string $text, string $details=null) Asserts that an anchor tag is found with matching $text as the body of the tag: // Check that a link exists with 'Upgrade Account' as the text8b7c:f320:99b9:690f:4595:cd17:293a:c069 $results->seeLink('Upgrade Account'); // Check that a link exists with 'Upgrade Account' as the text, AND a class of 'upsell' $results->seeLink('Upgrade Account', '.upsell'); assertSeeInField(string $field, string $value=null) Asserts that an input tag exists with the name and value: // Check that an input exists named 'user' with the value 'John Snow' $results->assertSeeInField('user', 'John Snow'); // Check a multi-dimensional input $results->assertSeeInField('user[name]', 'John Snow'); Working With JSON Responses will frequently contain JSON responses, especially when working with API methods. The following methods can help to test the responses. getJSON() This method will return the body of the response as a JSON string: // Response body is this: ['foo' => 'bar'] $json = $result->getJSON(); // $json is this: { "foo": "bar" } You can use this method to determine if $response actually holds JSON content: // Verify the response is JSON $this->assertTrue($result->getJSON() !== false) Note Be aware that the JSON string will be pretty-printed in the result. assertJSONFragment(array $fragment) Asserts that $fragment is found within the JSON response. It does not need to match the entire JSON value. // Response body is this: [ 'config' => ['key-a', 'key-b'], ] // Is true $result->assertJSONFragment(['config' => ['key-a']]); assertJSONExact($test) Similar to assertJSONFragment(), but checks the entire JSON response to ensure exact matches. Working With XML getXML() If your application returns XML, you can retrieve it through this method.
socket_select (PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8) socket_select — Runs the select() system call on the given arrays of sockets with a specified timeout Description socket_select( ?array &$read, ?array &$write, ?array &$except, ?int $seconds, int $microseconds = 0 ): int|false socket_select() accepts arrays of sockets and waits for them to change status. Those coming with BSD sockets background will recognize that those socket arrays are in fact the so-called file descriptor sets. Three independent arrays of sockets are watched. Parameters read The sockets listed in the read array will be watched to see if characters become available for reading (more precisely, to see if a read will not block - in particular, a socket is also ready on end-of-file, in which case a socket_read() will return a zero length string). write The sockets listed in the write array will be watched to see if a write will not block. except The sockets listed in the except array will be watched for exceptions. seconds The seconds and microseconds together form the timeout parameter. The timeout is an upper bound on the amount of time elapsed before socket_select() return. seconds may be zero , causing socket_select() to return immediately. This is useful for polling. If seconds is null (no timeout), socket_select() can block indefinitely. microseconds Warning On exit, the arrays are modified to indicate which socket actually changed status. You do not need to pass every array to socket_select(). You can leave it out and use an empty array or null instead. Also do not forget that those arrays are passed by reference and will be modified after socket_select() returns. Note: Due a limitation in the current Zend Engine it is not possible to pass a constant modifier like null directly as a parameter to a function which expects this parameter to be passed by reference. Instead use a temporary variable or an expression with the leftmost member being a temporary variable: Example #1 Using null with socket_select() <?php $e = NULL; socket_select($r, $w, $e, 0); ?> Return Values On success socket_select() returns the number of sockets contained in the modified arrays, which may be zero if the timeout expires before anything interesting happens.On error false is returned. The error code can be retrieved with socket_last_error(). Note: Be sure to use the === operator when checking for an error. Since the socket_select() may return 0 the comparison with == would evaluate to true: Example #2 Understanding socket_select()'s result <?php $e = NULL; if (false === socket_select($r, $w, $e, 0)) {     echo "socket_select() failed, reason: " .         socket_strerror(socket_last_error()) . "\n"; } ?> Examples Example #3 socket_select() example <?php /* Prepare the read array */ $read   = array($socket1, $socket2); $write  = NULL; $except = NULL; $num_changed_sockets = socket_select($read, $write, $except, 0); if ($num_changed_sockets === false) {     /* Error handling */ } else if ($num_changed_sockets > 0) {     /* At least at one of the sockets something interesting happened */ } ?> Notes Note: Be aware that some socket implementations need to be handled very carefully. A few basic rules: You should always try to use socket_select() without timeout. Your program should have nothing to do if there is no data available. Code that depends on timeouts is not usually portable and difficult to debug. No socket must be added to any set if you do not intend to check its result after the socket_select() call, and respond appropriately. After socket_select() returns, all sockets in all arrays must be checked. Any socket that is available for writing must be written to, and any socket available for reading must be read from. If you read/write to a socket returns in the arrays be aware that they do not necessarily read/write the full amount of data you have requested. Be prepared to even only be able to read/write a single byte. It's common to most socket implementations that the only exception caught with the except array is out-of-bound data received on a socket. See Also socket_read() - Reads a maximum of length bytes from a socket socket_write() - Write to a socket socket_last_error() - Returns the last error on the socket socket_strerror() - Return a string describing a socket error
salt.beacons.smartos_vmadm Beacon that fires events on vm state changes ## minimal # - check for vm changes every 1 second (salt default) # - does not send events at startup beacons: vmadm: [] ## standard # - check for vm changes every 60 seconds # - send create event at startup for all vms beacons: vmadm: - interval: 60 - startup_create_event: True salt.beacons.smartos_vmadm.beacon(config) Poll vmadm for changes salt.beacons.smartos_vmadm.validate(config) Validate the beacon configuration
FindHDF5 Find HDF5, a library for reading and writing self describing array data. This module invokes the HDF5 wrapper compiler that should be installed alongside HDF5. Depending upon the HDF5 Configuration, the wrapper compiler is called either h5cc or h5pcc. If this succeeds, the module will then call the compiler with the -show argument to see what flags are used when compiling an HDF5 client application. The module will optionally accept the COMPONENTS argument. If no COMPONENTS are specified, then the find module will default to finding only the HDF5 C library. If one or more COMPONENTS are specified, the module will attempt to find the language bindings for the specified components. The only valid components are C, CXX, Fortran, HL, and Fortran_HL. If the COMPONENTS argument is not given, the module will attempt to find only the C bindings. This module will read the variable HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer a static link to a dynamic link for HDF5 and all of it’s dependencies. To use this feature, make sure that the HDF5_USE_STATIC_LIBRARIES variable is set before the call to find_package. To provide the module with a hint about where to find your HDF5 installation, you can set the environment variable HDF5_ROOT. The Find module will then look in this path when searching for HDF5 executables, paths, and libraries. Both the serial and parallel HDF5 wrappers are considered and the first directory to contain either one will be used. In the event that both appear in the same directory the serial version is preferentially selected. This behavior can be reversed by setting the variable HDF5_PREFER_PARALLEL to true. In addition to finding the includes and libraries required to compile an HDF5 client application, this module also makes an effort to find tools that come with the HDF5 distribution that may be useful for regression testing. This module will define the following variables: HDF5_FOUND - true if HDF5 was found on the system HDF5_VERSION - HDF5 version in format Major.Minor.Release HDF5_INCLUDE_DIRS - Location of the hdf5 includes HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated) HDF5_DEFINITIONS - Required compiler definitions for HDF5 HDF5_LIBRARIES - Required libraries for all requested bindings HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API for all bindings, if the HL component is enabled Available components are: C CXX Fortran and HL. For each enabled language binding, a corresponding HDF5_${LANG}_LIBRARIES variable, and potentially HDF5_${LANG}_DEFINITIONS, will be defined. If the HL component is enabled, then an HDF5_${LANG}_HL_LIBRARIES will also be defined. With all components enabled, the following variables will be defined: HDF5_C_DEFINITIONS -- Required compiler definitions for HDF5 C bindings HDF5_CXX_DEFINITIONS -- Required compiler definitions for HDF5 C++ bindings HDF5_Fortran_DEFINITIONS -- Required compiler definitions for HDF5 Fortran bindings HDF5_C_INCLUDE_DIRS -- Required include directories for HDF5 C bindings HDF5_CXX_INCLUDE_DIRS -- Required include directories for HDF5 C++ bindings HDF5_Fortran_INCLUDE_DIRS -- Required include directories for HDF5 Fortran bindings HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings HDF5_C_HL_LIBRARIES - Required libraries for the high level C bindings HDF5_CXX_HL_LIBRARIES - Required libraries for the high level C++ bindings HDF5_Fortran_HL_LIBRARIES - Required libraries for the high level Fortran bindings. HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C compiler which is also the HDF5 wrapper HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C++ compiler which is also the HDF5 wrapper HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary Fortran compiler which is also the HDF5 wrapper HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool The following variable can be set to guide the search for HDF5 libraries and includes: HDF5_ROOT Specify the path to the HDF5 installation to use. HDF5_FIND_DEBUG Set to a true value to get some extra debugging output. HDF5_NO_FIND_PACKAGE_CONFIG_FILE Set to a true value to skip trying to find hdf5-config.cmake.
TransitionBlockerList class TransitionBlockerList implements IteratorAggregate, Countable A list of transition blockers. Methods __construct(array $blockers = array()) void add(TransitionBlocker $blocker) void clear() bool isEmpty() ArrayIterator|TransitionBlocker[] getIterator() {@inheritdoc} int count() Details __construct(array $blockers = array()) Parameters array $blockers void add(TransitionBlocker $blocker) Parameters TransitionBlocker $blocker Return Value void void clear() Return Value void bool isEmpty() Return Value bool ArrayIterator|TransitionBlocker[] getIterator() {@inheritdoc} Return Value ArrayIterator|TransitionBlocker[] int count() Return Value int
Interface RunTime All Superinterfaces: IDLEntity, Object, RunTimeOperations, Serializable public interface RunTime extends RunTimeOperations, Object, IDLEntity Defines the base class that represents the Sending Context of a request. The sending context provides access to information about the runtime environment of the originator of a GIOP message. For example, when a value type is marshalled on a GIOP Request message, the receiver of the value type may need to ask the sender about the CodeBase for the implementation of the value type. Methods 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
tf.raw_ops.LogicalOr Returns the truth value of x OR y element-wise. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.raw_ops.LogicalOr tf.raw_ops.LogicalOr( x, y, name=None ) 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.
CheckFortranSourceCompiles Check if given Fortran source compiles and links into an executable. check_fortran_source_compiles check_fortran_source_compiles(<code> <resultVar> [FAIL_REGEX <regex>...] [SRC_EXT <extension>] ) Checks that the source supplied in <code> can be compiled as a Fortran source file and linked as an executable. The <code> must be a Fortran program containing at least an end statement–for example: check_fortran_source_compiles("character 8b7c:f320:99b9:690f:4595:cd17:293a:c069 b; error stop b; end" F2018ESTOPOK SRC_EXT F90) This command can help avoid costly build processes when a compiler lacks support for a necessary feature, or a particular vendor library is not compatible with the Fortran compiler version being used. This generate-time check may advise the user of such before the main build process. See also the check_fortran_source_runs() command to actually run the compiled code. The result will be stored in the internal cache variable <resultVar>, with a boolean true value for success and boolean false for failure. If FAIL_REGEX is provided, then failure is determined by checking if anything in the output matches any of the specified regular expressions. By default, the test source file will be given a .F file extension. The SRC_EXT option can be used to override this with .<extension> instead– .F90 is a typical choice. The underlying check is performed by the try_compile() command. The compile and link commands can be influenced by setting any of the following variables prior to calling check_fortran_source_compiles(): CMAKE_REQUIRED_FLAGS Additional flags to pass to the compiler. Note that the contents of CMAKE_Fortran_FLAGS and its associated configuration-specific variable are automatically added to the compiler command before the contents of CMAKE_REQUIRED_FLAGS. CMAKE_REQUIRED_DEFINITIONS A ;-list of compiler definitions of the form -DFOO or -DFOO=bar. A definition for the name specified by <resultVar> will also be added automatically. CMAKE_REQUIRED_INCLUDES A ;-list of header search paths to pass to the compiler. These will be the only header search paths used by try_compile(), i.e. the contents of the INCLUDE_DIRECTORIES directory property will be ignored. CMAKE_REQUIRED_LINK_OPTIONS A ;-list of options to add to the link command (see try_compile() for further details). CMAKE_REQUIRED_LIBRARIES A ;-list of libraries to add to the link command. These can be the name of system libraries or they can be Imported Targets (see try_compile() for further details). CMAKE_REQUIRED_QUIET If this variable evaluates to a boolean true value, all status messages associated with the check will be suppressed. The check is only performed once, with the result cached in the variable named by <resultVar>. Every subsequent CMake run will re-use this cached value rather than performing the check again, even if the <code> changes. In order to force the check to be re-evaluated, the variable named by <resultVar> must be manually removed from the cache.
salt.modules.win_ntp Management of NTP servers on Windows New in version 2014.1.0. salt.modules.win_ntp.get_servers() Get list of configured NTP servers CLI Example: salt '*' ntp.get_servers salt.modules.win_ntp.set_servers(*servers) Set Windows to use a list of NTP servers CLI Example: salt '*' ntp.set_servers 'pool.ntp.org' 'us.pool.ntp.org'
torch.sqrt torch.sqrt(input, *, out=None) → Tensor Returns a new tensor with the square-root of the elements of input. outi=inputi\text{out}_{i} = \sqrt{\text{input}_{i}} Parameters input (Tensor) – the input tensor. Keyword Arguments out (Tensor, optional) – the output tensor. Example: >>> a = torch.randn(4) >>> a tensor([-2.0755, 1.0226, 0.0831, 0.4806]) >>> torch.sqrt(a) tensor([ nan, 1.0112, 0.2883, 0.6933])
Note Click here to download the full example code or to run this example in your browser via Binder Clustering text documents using k-means This is an example showing how the scikit-learn API can be used to cluster documents by topics using a Bag of Words approach. Two algorithms are demoed: KMeans and its more scalable variant, MiniBatchKMeans. Additionally, latent semantic analysis is used to reduce dimensionality and discover latent patterns in the data. This example uses two different text vectorizers: a TfidfVectorizer and a HashingVectorizer. See the example notebook FeatureHasher and DictVectorizer Comparison for more information on vectorizers and a comparison of their processing times. For document analysis via a supervised learning approach, see the example script Classification of text documents using sparse features. # Author: Peter Prettenhofer <[email protected]> # Lars Buitinck # Olivier Grisel <[email protected]> # Arturo Amor <[email protected]> # License: BSD 3 clause Loading text data We load data from The 20 newsgroups text dataset, which comprises around 18,000 newsgroups posts on 20 topics. For illustrative purposes and to reduce the computational cost, we select a subset of 4 topics only accounting for around 3,400 documents. See the example Classification of text documents using sparse features to gain intuition on the overlap of such topics. Notice that, by default, the text samples contain some message metadata such as "headers", "footers" (signatures) and "quotes" to other posts. We use the remove parameter from fetch_20newsgroups to strip those features and have a more sensible clustering problem. import numpy as np from sklearn.datasets import fetch_20newsgroups categories = [ "alt.atheism", "talk.religion.misc", "comp.graphics", "sci.space", ] dataset = fetch_20newsgroups( remove=("headers", "footers", "quotes"), subset="all", categories=categories, shuffle=True, random_state=42, ) labels = dataset.target unique_labels, category_sizes = np.unique(labels, return_counts=True) true_k = unique_labels.shape[0] print(f"{len(dataset.data)} documents - {true_k} categories") 3387 documents - 4 categories Quantifying the quality of clustering results In this section we define a function to score different clustering pipelines using several metrics. Clustering algorithms are fundamentally unsupervised learning methods. However, since we happen to have class labels for this specific dataset, it is possible to use evaluation metrics that leverage this “supervised” ground truth information to quantify the quality of the resulting clusters. Examples of such metrics are the following: homogeneity, which quantifies how much clusters contain only members of a single class; completeness, which quantifies how much members of a given class are assigned to the same clusters; V-measure, the harmonic mean of completeness and homogeneity; Rand-Index, which measures how frequently pairs of data points are grouped consistently according to the result of the clustering algorithm and the ground truth class assignment; Adjusted Rand-Index, a chance-adjusted Rand-Index such that random cluster assignment have an ARI of 0.0 in expectation. If the ground truth labels are not known, evaluation can only be performed using the model results itself. In that case, the Silhouette Coefficient comes in handy. For more reference, see Clustering performance evaluation. from collections import defaultdict from sklearn import metrics from time import time evaluations = [] evaluations_std = [] def fit_and_evaluate(km, X, name=None, n_runs=5): name = km.__class__.__name__ if name is None else name train_times = [] scores = defaultdict(list) for seed in range(n_runs): km.set_params(random_state=seed) t0 = time() km.fit(X) train_times.append(time() - t0) scores["Homogeneity"].append(metrics.homogeneity_score(labels, km.labels_)) scores["Completeness"].append(metrics.completeness_score(labels, km.labels_)) scores["V-measure"].append(metrics.v_measure_score(labels, km.labels_)) scores["Adjusted Rand-Index"].append( metrics.adjusted_rand_score(labels, km.labels_) ) scores["Silhouette Coefficient"].append( metrics.silhouette_score(X, km.labels_, sample_size=2000) ) train_times = np.asarray(train_times) print(f"clustering done in {train_times.mean():.2f} ± {train_times.std():.2f} s ") evaluation = { "estimator": name, "train_time": train_times.mean(), } evaluation_std = { "estimator": name, "train_time": train_times.std(), } for score_name, score_values in scores.items(): mean_score, std_score = np.mean(score_values), np.std(score_values) print(f"{score_name}: {mean_score:.3f} ± {std_score:.3f}") evaluation[score_name] = mean_score evaluation_std[score_name] = std_score evaluations.append(evaluation) evaluations_std.append(evaluation_std) K-means clustering on text features Two feature extraction methods are used in this example: TfidfVectorizer uses an in-memory vocabulary (a Python dict) to map the most frequent words to features indices and hence compute a word occurrence frequency (sparse) matrix. The word frequencies are then reweighted using the Inverse Document Frequency (IDF) vector collected feature-wise over the corpus. HashingVectorizer hashes word occurrences to a fixed dimensional space, possibly with collisions. The word count vectors are then normalized to each have l2-norm equal to one (projected to the euclidean unit-sphere) which seems to be important for k-means to work in high dimensional space. Furthermore it is possible to post-process those extracted features using dimensionality reduction. We will explore the impact of those choices on the clustering quality in the following. Feature Extraction using TfidfVectorizer We first benchmark the estimators using a dictionary vectorizer along with an IDF normalization as provided by TfidfVectorizer. from sklearn.feature_extraction.text import TfidfVectorizer vectorizer = TfidfVectorizer( max_df=0.5, min_df=5, stop_words="english", ) t0 = time() X_tfidf = vectorizer.fit_transform(dataset.data) print(f"vectorization done in {time() - t0:.3f} s") print(f"n_samples: {X_tfidf.shape[0]}, n_features: {X_tfidf.shape[1]}") vectorization done in 0.372 s n_samples: 3387, n_features: 7929 After ignoring terms that appear in more than 50% of the documents (as set by max_df=0.5) and terms that are not present in at least 5 documents (set by min_df=5), the resulting number of unique terms n_features is around 8,000. We can additionally quantify the sparsity of the X_tfidf matrix as the fraction of non-zero entries devided by the total number of elements. print(f"{X_tfidf.nnz / np.prod(X_tfidf.shape):.3f}") 0.007 We find that around 0.7% of the entries of the X_tfidf matrix are non-zero. Clustering sparse data with k-means As both KMeans and MiniBatchKMeans optimize a non-convex objective function, their clustering is not guaranteed to be optimal for a given random init. Even further, on sparse high-dimensional data such as text vectorized using the Bag of Words approach, k-means can initialize centroids on extremely isolated data points. Those data points can stay their own centroids all along. The following code illustrates how the previous phenomenon can sometimes lead to highly imbalanced clusters, depending on the random initialization: from sklearn.cluster import KMeans for seed in range(5): kmeans = KMeans( n_clusters=true_k, max_iter=100, n_init=1, random_state=seed, ).fit(X_tfidf) cluster_ids, cluster_sizes = np.unique(kmeans.labels_, return_counts=True) print(f"Number of elements asigned to each cluster: {cluster_sizes}") print() print( "True number of documents in each category according to the class labels: " f"{category_sizes}" ) Number of elements asigned to each cluster: [ 1 1 3384 1] Number of elements asigned to each cluster: [1733 717 238 699] Number of elements asigned to each cluster: [1115 256 1417 599] Number of elements asigned to each cluster: [1695 649 446 597] Number of elements asigned to each cluster: [ 254 2117 459 557] True number of documents in each category according to the class labels: [799 973 987 628] To avoid this problem, one possibility is to increase the number of runs with independent random initiations n_init. In such case the clustering with the best inertia (objective function of k-means) is chosen. kmeans = KMeans( n_clusters=true_k, max_iter=100, n_init=5, ) fit_and_evaluate(kmeans, X_tfidf, name="KMeans\non tf-idf vectors") clustering done in 0.16 ± 0.04 s Homogeneity: 0.347 ± 0.009 Completeness: 0.397 ± 0.006 V-measure: 0.370 ± 0.007 Adjusted Rand-Index: 0.197 ± 0.014 Silhouette Coefficient: 0.007 ± 0.001 All those clustering evaluation metrics have a maximum value of 1.0 (for a perfect clustering result). Higher values are better. Values of the Adjusted Rand-Index close to 0.0 correspond to a random labeling. Notice from the scores above that the cluster assignment is indeed well above chance level, but the overall quality can certainly improve. Keep in mind that the class labels may not reflect accurately the document topics and therefore metrics that use labels are not necessarily the best to evaluate the quality of our clustering pipeline. Performing dimensionality reduction using LSA A n_init=1 can still be used as long as the dimension of the vectorized space is reduced first to make k-means more stable. For such purpose we use TruncatedSVD, which works on term count/tf-idf matrices. Since SVD results are not normalized, we redo the normalization to improve the KMeans result. Using SVD to reduce the dimensionality of TF-IDF document vectors is often known as latent semantic analysis (LSA) in the information retrieval and text mining literature. from sklearn.decomposition import TruncatedSVD from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Normalizer lsa = make_pipeline(TruncatedSVD(n_components=100), Normalizer(copy=False)) t0 = time() X_lsa = lsa.fit_transform(X_tfidf) explained_variance = lsa[0].explained_variance_ratio_.sum() print(f"LSA done in {time() - t0:.3f} s") print(f"Explained variance of the SVD step: {explained_variance * 100:.1f}%") LSA done in 0.365 s Explained variance of the SVD step: 18.4% Using a single initialization means the processing time will be reduced for both KMeans and MiniBatchKMeans. kmeans = KMeans( n_clusters=true_k, max_iter=100, n_init=1, ) fit_and_evaluate(kmeans, X_lsa, name="KMeans\nwith LSA on tf-idf vectors") clustering done in 0.02 ± 0.00 s Homogeneity: 0.393 ± 0.009 Completeness: 0.420 ± 0.020 V-measure: 0.405 ± 0.012 Adjusted Rand-Index: 0.342 ± 0.034 Silhouette Coefficient: 0.030 ± 0.002 We can observe that clustering on the LSA representation of the document is significantly faster (both because of n_init=1 and because the dimensionality of the LSA feature space is much smaller). Furthermore, all the clustering evaluation metrics have improved. We repeat the experiment with MiniBatchKMeans. from sklearn.cluster import MiniBatchKMeans minibatch_kmeans = MiniBatchKMeans( n_clusters=true_k, n_init=1, init_size=1000, batch_size=1000, ) fit_and_evaluate( minibatch_kmeans, X_lsa, name="MiniBatchKMeans\nwith LSA on tf-idf vectors", ) clustering done in 0.02 ± 0.00 s Homogeneity: 0.348 ± 0.070 Completeness: 0.381 ± 0.019 V-measure: 0.361 ± 0.050 Adjusted Rand-Index: 0.330 ± 0.106 Silhouette Coefficient: 0.024 ± 0.006 Top terms per cluster Since TfidfVectorizer can be inverted we can identify the cluster centers, which provide an intuition of the most influential words for each cluster. See the example script Classification of text documents using sparse features for a comparison with the most predictive words for each target class. original_space_centroids = lsa[0].inverse_transform(kmeans.cluster_centers_) order_centroids = original_space_centroids.argsort()[:, 8b7c:f320:99b9:690f:4595:cd17:293a:c069-1] terms = vectorizer.get_feature_names_out() for i in range(true_k): print(f"Cluster {i}: ", end="") for ind in order_centroids[i, :10]: print(f"{terms[ind]} ", end="") print() Cluster 0: think just don people like know want say good really Cluster 1: god people jesus say religion did does christian said evidence Cluster 2: thanks graphics image know edu does files file program mail Cluster 3: space launch orbit earth shuttle like nasa moon mission time HashingVectorizer An alternative vectorization can be done using a HashingVectorizer instance, which does not provide IDF weighting as this is a stateless model (the fit method does nothing). When IDF weighting is needed it can be added by pipelining the HashingVectorizer output to a TfidfTransformer instance. In this case we also add LSA to the pipeline to reduce the dimension and sparcity of the hashed vector space. from sklearn.feature_extraction.text import HashingVectorizer from sklearn.feature_extraction.text import TfidfTransformer lsa_vectorizer = make_pipeline( HashingVectorizer(stop_words="english", n_features=50_000), TfidfTransformer(), TruncatedSVD(n_components=100, random_state=0), Normalizer(copy=False), ) t0 = time() X_hashed_lsa = lsa_vectorizer.fit_transform(dataset.data) print(f"vectorization done in {time() - t0:.3f} s") vectorization done in 2.086 s One can observe that the LSA step takes a relatively long time to fit, especially with hashed vectors. The reason is that a hashed space is typically large (set to n_features=50_000 in this example). One can try lowering the number of features at the expense of having a larger fraction of features with hash collisions as shown in the example notebook FeatureHasher and DictVectorizer Comparison. We now fit and evaluate the kmeans and minibatch_kmeans instances on this hashed-lsa-reduced data: fit_and_evaluate(kmeans, X_hashed_lsa, name="KMeans\nwith LSA on hashed vectors") clustering done in 0.02 ± 0.01 s Homogeneity: 0.395 ± 0.012 Completeness: 0.445 ± 0.014 V-measure: 0.419 ± 0.013 Adjusted Rand-Index: 0.325 ± 0.012 Silhouette Coefficient: 0.030 ± 0.001 fit_and_evaluate( minibatch_kmeans, X_hashed_lsa, name="MiniBatchKMeans\nwith LSA on hashed vectors", ) clustering done in 0.02 ± 0.00 s Homogeneity: 0.353 ± 0.045 Completeness: 0.358 ± 0.043 V-measure: 0.356 ± 0.044 Adjusted Rand-Index: 0.316 ± 0.066 Silhouette Coefficient: 0.025 ± 0.003 Both methods lead to good results that are similar to running the same models on the traditional LSA vectors (without hashing). Clustering evaluation summary import pandas as pd import matplotlib.pyplot as plt fig, (ax0, ax1) = plt.subplots(ncols=2, figsize=(16, 6), sharey=True) df = pd.DataFrame(evaluations[8b7c:f320:99b9:690f:4595:cd17:293a:c069-1]).set_index("estimator") df_std = pd.DataFrame(evaluations_std[8b7c:f320:99b9:690f:4595:cd17:293a:c069-1]).set_index("estimator") df.drop( ["train_time"], axis="columns", ).plot.barh(ax=ax0, xerr=df_std) ax0.set_xlabel("Clustering scores") ax0.set_ylabel("") df["train_time"].plot.barh(ax=ax1, xerr=df_std["train_time"]) ax1.set_xlabel("Clustering time (s)") plt.tight_layout() KMeans and MiniBatchKMeans suffer from the phenomenon called the Curse of Dimensionality for high dimensional datasets such as text data. That is the reason why the overall scores improve when using LSA. Using LSA reduced data also improves the stability and requires lower clustering time, though keep in mind that the LSA step itself takes a long time, especially with hashed vectors. The Silhouette Coefficient is defined between 0 and 1. In all cases we obtain values close to 0 (even if they improve a bit after using LSA) because its definition requires measuring distances, in contrast with other evaluation metrics such as the V-measure and the Adjusted Rand Index which are only based on cluster assignments rather than distances. Notice that strictly speaking, one should not compare the Silhouette Coefficient between spaces of different dimension, due to the different notions of distance they imply. The homogeneity, completeness and hence v-measure metrics do not yield a baseline with regards to random labeling: this means that depending on the number of samples, clusters and ground truth classes, a completely random labeling will not always yield the same values. In particular random labeling won’t yield zero scores, especially when the number of clusters is large. This problem can safely be ignored when the number of samples is more than a thousand and the number of clusters is less than 10, which is the case of the present example. For smaller sample sizes or larger number of clusters it is safer to use an adjusted index such as the Adjusted Rand Index (ARI). See the example Adjustment for chance in clustering performance evaluation for a demo on the effect of random labeling. The size of the error bars show that MiniBatchKMeans is less stable than KMeans for this relatively small dataset. It is more interesting to use when the number of samples is much bigger, but it can come at the expense of a small degradation in clustering quality compared to the traditional k-means algorithm. Total running time of the script: ( 0 minutes 7.415 seconds) Download Python source code: plot_document_clustering.py Download Jupyter notebook: plot_document_clustering.ipynb
PostTooLargeException class PostTooLargeException extends Exception (View source)
PlaintextPasswordEncoder class PlaintextPasswordEncoder extends BasePasswordEncoder PlaintextPasswordEncoder does not do any encoding. Constants MAX_PASSWORD_LENGTH Methods __construct(bool $ignorePasswordCase = false) Constructor. string encodePassword(string $raw, string $salt) Encodes the raw password. bool isPasswordValid(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. Details __construct(bool $ignorePasswordCase = false) Constructor. Parameters bool $ignorePasswordCase Compare password case-insensitive string encodePassword(string $raw, string $salt) Encodes the raw password. Parameters string $raw The password to encode string $salt The salt Return Value string The encoded password bool isPasswordValid(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. Parameters string $encoded An encoded password string $raw A raw password string $salt The salt Return Value bool true if the password is valid, false otherwise
Selection API Note: This API is not available in Web Workers (not exposed via WorkerNavigator). The Selection API enables developers to access and manipulate the portion of a document selected by the user. The Window.getSelection() and Document.getSelection() methods return a Selection object representing the portion of the document selected by the user. A Selection object provides methods to: access the currently selected nodes modify the current selection, expanding or collapsing it or selecting an entirely different part of the document delete parts of the current selection from the DOM. The Selection API also provides two events, both firing on Document: the selectstart event is fired when the user starts to make a new selection the selectionchange event is fired when the current selection changes. Interfaces Selection An interface which represents the part of the document selected by the user or the current position of the caret. Document.getSelection() A method returning a Selection object representing the current selection or current position of the caret. Window.getSelection() A method returning a Selection object representing the current selection or current position of the caret. Document.selectionchange An event which is fired when the current selection is changed. Document.selectstart An event which is fired when a user starts a new selection. Specifications Specification Selection API # selection-interface 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 15, 2022, by MDN contributors
MACOSX_DEPLOYMENT_TARGET Specify the minimum version of macOS on which the target binaries are to be deployed. The MACOSX_DEPLOYMENT_TARGET environment variable sets the default value for the CMAKE_OSX_DEPLOYMENT_TARGET variable.
Package time import "time" Overview Index Examples Subdirectories Overview Package time provides functionality for measuring and displaying time. The calendrical calculations always assume a Gregorian calendar, with no leap seconds. Monotonic Clocks Operating systems provide both a “wall clock,” which is subject to changes for clock synchronization, and a “monotonic clock,” which is not. The general rule is that the wall clock is for telling time and the monotonic clock is for measuring time. Rather than split the API, in this package the Time returned by time.Now contains both a wall clock reading and a monotonic clock reading; later time-telling operations use the wall clock reading, but later time-measuring operations, specifically comparisons and subtractions, use the monotonic clock reading. For example, this code always computes a positive elapsed time of approximately 20 milliseconds, even if the wall clock is changed during the operation being timed: start := time.Now() ... operation that takes 20 milliseconds ... t := time.Now() elapsed := t.Sub(start) Other idioms, such as time.Since(start), time.Until(deadline), and time.Now().Before(deadline), are similarly robust against wall clock resets. The rest of this section gives the precise details of how operations use monotonic clocks, but understanding those details is not required to use this package. The Time returned by time.Now contains a monotonic clock reading. If Time t has a monotonic clock reading, t.Add adds the same duration to both the wall clock and monotonic clock readings to compute the result. Because t.AddDate(y, m, d), t.Round(d), and t.Truncate(d) are wall time computations, they always strip any monotonic clock reading from their results. Because t.In, t.Local, and t.UTC are used for their effect on the interpretation of the wall time, they also strip any monotonic clock reading from their results. The canonical way to strip a monotonic clock reading is to use t = t.Round(0). If Times t and u both contain monotonic clock readings, the operations t.After(u), t.Before(u), t.Equal(u), and t.Sub(u) are carried out using the monotonic clock readings alone, ignoring the wall clock readings. If either t or u contains no monotonic clock reading, these operations fall back to using the wall clock readings. On some systems the monotonic clock will stop if the computer goes to sleep. On such a system, t.Sub(u) may not accurately reflect the actual time that passed between t and u. Because the monotonic clock reading has no meaning outside the current process, the serialized forms generated by t.GobEncode, t.MarshalBinary, t.MarshalJSON, and t.MarshalText omit the monotonic clock reading, and t.Format provides no format for it. Similarly, the constructors time.Date, time.Parse, time.ParseInLocation, and time.Unix, as well as the unmarshalers t.GobDecode, t.UnmarshalBinary. t.UnmarshalJSON, and t.UnmarshalText always create times with no monotonic clock reading. The monotonic clock reading exists only in Time values. It is not a part of Duration values or the Unix times returned by t.Unix and friends. Note that the Go == operator compares not just the time instant but also the Location and the monotonic clock reading. See the documentation for the Time type for a discussion of equality testing for Time values. For debugging, the result of t.String does include the monotonic clock reading if present. If t != u because of different monotonic clock readings, that difference will be visible when printing t.String() and u.String(). Index Constants func After(d Duration) <-chan Time func Sleep(d Duration) func Tick(d Duration) <-chan Time type Duration func ParseDuration(s string) (Duration, error) func Since(t Time) Duration func Until(t Time) Duration func (d Duration) Abs() Duration func (d Duration) Hours() float64 func (d Duration) Microseconds() int64 func (d Duration) Milliseconds() int64 func (d Duration) Minutes() float64 func (d Duration) Nanoseconds() int64 func (d Duration) Round(m Duration) Duration func (d Duration) Seconds() float64 func (d Duration) String() string func (d Duration) Truncate(m Duration) Duration type Location func FixedZone(name string, offset int) *Location func LoadLocation(name string) (*Location, error) func LoadLocationFromTZData(name string, data []byte) (*Location, error) func (l *Location) String() string type Month func (m Month) String() string type ParseError func (e *ParseError) Error() string type Ticker func NewTicker(d Duration) *Ticker func (t *Ticker) Reset(d Duration) func (t *Ticker) Stop() type Time func Date(year int, month Month, day, hour, min, sec, nsec int, loc *Location) Time func Now() Time func Parse(layout, value string) (Time, error) func ParseInLocation(layout, value string, loc *Location) (Time, error) func Unix(sec int64, nsec int64) Time func UnixMicro(usec int64) Time func UnixMilli(msec int64) Time func (t Time) Add(d Duration) Time func (t Time) AddDate(years int, months int, days int) Time func (t Time) After(u Time) bool func (t Time) AppendFormat(b []byte, layout string) []byte func (t Time) Before(u Time) bool func (t Time) Clock() (hour, min, sec int) func (t Time) Date() (year int, month Month, day int) func (t Time) Day() int func (t Time) Equal(u Time) bool func (t Time) Format(layout string) string func (t Time) GoString() string func (t *Time) GobDecode(data []byte) error func (t Time) GobEncode() ([]byte, error) func (t Time) Hour() int func (t Time) ISOWeek() (year, week int) func (t Time) In(loc *Location) Time func (t Time) IsDST() bool func (t Time) IsZero() bool func (t Time) Local() Time func (t Time) Location() *Location func (t Time) MarshalBinary() ([]byte, error) func (t Time) MarshalJSON() ([]byte, error) func (t Time) MarshalText() ([]byte, error) func (t Time) Minute() int func (t Time) Month() Month func (t Time) Nanosecond() int func (t Time) Round(d Duration) Time func (t Time) Second() int func (t Time) String() string func (t Time) Sub(u Time) Duration func (t Time) Truncate(d Duration) Time func (t Time) UTC() Time func (t Time) Unix() int64 func (t Time) UnixMicro() int64 func (t Time) UnixMilli() int64 func (t Time) UnixNano() int64 func (t *Time) UnmarshalBinary(data []byte) error func (t *Time) UnmarshalJSON(data []byte) error func (t *Time) UnmarshalText(data []byte) error func (t Time) Weekday() Weekday func (t Time) Year() int func (t Time) YearDay() int func (t Time) Zone() (name string, offset int) func (t Time) ZoneBounds() (start, end Time) type Timer func AfterFunc(d Duration, f func()) *Timer func NewTimer(d Duration) *Timer func (t *Timer) Reset(d Duration) bool func (t *Timer) Stop() bool type Weekday func (d Weekday) String() string Examples After Date Duration Duration.Hours Duration.Microseconds Duration.Milliseconds Duration.Minutes Duration.Nanoseconds Duration.Round Duration.Seconds Duration.String Duration.Truncate FixedZone LoadLocation Location Month NewTicker Parse ParseDuration ParseInLocation Sleep Tick Time.Add Time.AddDate Time.After Time.AppendFormat Time.Before Time.Date Time.Day Time.Equal Time.Format Time.Format (Pad) Time.GoString Time.Round Time.String Time.Sub Time.Truncate Time.Unix Unix UnixMicro UnixMilli Package files format.go sleep.go sys_unix.go tick.go time.go zoneinfo.go zoneinfo_goroot.go zoneinfo_read.go zoneinfo_unix.go Constants These are predefined layouts for use in Time.Format and time.Parse. The reference time used in these layouts is the specific time stamp: 01/02 03:04:05PM '06 -0700 (January 2, 15:04:05, 2006, in time zone seven hours west of GMT). That value is recorded as the constant named Layout, listed below. As a Unix time, this is 1136239445. Since MST is GMT-0700, the reference would be printed by the Unix date command as: Mon Jan 2 15:04:05 MST 2006 It is a regrettable historic error that the date uses the American convention of putting the numerical month before the day. The example for Time.Format demonstrates the working of the layout string in detail and is a good reference. Note that the RFC822, RFC850, and RFC1123 formats should be applied only to local times. Applying them to UTC times will use "UTC" as the time zone abbreviation, while strictly speaking those RFCs require the use of "GMT" in that case. In general RFC1123Z should be used instead of RFC1123 for servers that insist on that format, and RFC3339 should be preferred for new protocols. RFC3339, RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; when used with time.Parse they do not accept all the time formats permitted by the RFCs and they do accept time formats not formally defined. The RFC3339Nano format removes trailing zeros from the seconds field and thus may not sort correctly once formatted. Most programs can use one of the defined constants as the layout passed to Format or Parse. The rest of this comment can be ignored unless you are creating a custom layout string. To define your own format, write down what the reference time would look like formatted your way; see the values of constants like ANSIC, StampMicro or Kitchen for examples. The model is to demonstrate what the reference time looks like so that the Format and Parse methods can apply the same transformation to a general time value. Here is a summary of the components of a layout string. Each element shows by example the formatting of an element of the reference time. Only these values are recognized. Text in the layout string that is not recognized as part of the reference time is echoed verbatim during Format and expected to appear verbatim in the input to Parse. Year: "2006" "06" Month: "Jan" "January" "01" "1" Day of the week: "Mon" "Monday" Day of the month: "2" "_2" "02" Day of the year: "__2" "002" Hour: "15" "3" "03" (PM or AM) Minute: "4" "04" Second: "5" "05" AM/PM mark: "PM" Numeric time zone offsets format as follows: "-0700" ±hhmm "-07:00" ±hh:mm "-07" ±hh "-070000" ±hhmmss "-07:00:00" ±hh:mm:ss Replacing the sign in the format with a Z triggers the ISO 8601 behavior of printing Z instead of an offset for the UTC zone. Thus: "Z0700" Z or ±hhmm "Z07:00" Z or ±hh:mm "Z07" Z or ±hh "Z070000" Z or ±hhmmss "Z07:00:00" Z or ±hh:mm:ss Within the format string, the underscores in "_2" and "__2" represent spaces that may be replaced by digits if the following number has multiple digits, for compatibility with fixed-width Unix time formats. A leading zero represents a zero-padded value. The formats __2 and 002 are space-padded and zero-padded three-character day of year; there is no unpadded day of year format. A comma or decimal point followed by one or more zeros represents a fractional second, printed to the given number of decimal places. A comma or decimal point followed by one or more nines represents a fractional second, printed to the given number of decimal places, with trailing zeros removed. For example "15:04:05,000" or "15:04:05.000" formats or parses with millisecond precision. Some valid layouts are invalid time values for time.Parse, due to formats such as _ for space padding and Z for zone information. const ( Layout = "01/02 03:04:05PM '06 -0700" // The reference time, in numerical order. ANSIC = "Mon Jan _2 15:04:05 2006" UnixDate = "Mon Jan _2 15:04:05 MST 2006" RubyDate = "Mon Jan 02 15:04:05 -0700 2006" RFC822 = "02 Jan 06 15:04 MST" RFC822Z = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone RFC850 = "Monday, 02-Jan-06 15:04:05 MST" RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST" RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone RFC3339 = "2006-01-02T15:04:05Z07:00" RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00" Kitchen = "3:04PM" // Handy time stamps. Stamp = "Jan _2 15:04:05" StampMilli = "Jan _2 15:04:05.000" StampMicro = "Jan _2 15:04:05.000000" StampNano = "Jan _2 15:04:05.000000000" ) Common durations. There is no definition for units of Day or larger to avoid confusion across daylight savings time zone transitions. To count the number of units in a Duration, divide: second := time.Second fmt.Print(int64(second/time.Millisecond)) // prints 1000 To convert an integer number of units to a Duration, multiply: seconds := 10 fmt.Print(time.Duration(seconds)*time.Second) // prints 10s const ( Nanosecond Duration = 1 Microsecond = 1000 * Nanosecond Millisecond = 1000 * Microsecond Second = 1000 * Millisecond Minute = 60 * Second Hour = 60 * Minute ) func After func After(d Duration) <-chan Time After waits for the duration to elapse and then sends the current time on the returned channel. It is equivalent to NewTimer(d).C. The underlying Timer is not recovered by the garbage collector until the timer fires. If efficiency is a concern, use NewTimer instead and call Timer.Stop if the timer is no longer needed. Example Code: select { case m := <-c: handle(m) case <-time.After(10 * time.Second): fmt.Println("timed out") } func Sleep func Sleep(d Duration) Sleep pauses the current goroutine for at least the duration d. A negative or zero duration causes Sleep to return immediately. Example Code: time.Sleep(100 * time.Millisecond) func Tick func Tick(d Duration) <-chan Time Tick is a convenience wrapper for NewTicker providing access to the ticking channel only. While Tick is useful for clients that have no need to shut down the Ticker, be aware that without a way to shut it down the underlying Ticker cannot be recovered by the garbage collector; it "leaks". Unlike NewTicker, Tick will return nil if d <= 0. Example Code: c := time.Tick(5 * time.Second) for next := range c { fmt.Printf("%v %s\n", next, statusUpdate()) } type Duration A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years. type Duration int64 Example Code: t0 := time.Now() expensiveCall() t1 := time.Now() fmt.Printf("The call took %v to run.\n", t1.Sub(t0)) func ParseDuration func ParseDuration(s string) (Duration, error) ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". Example Code: hours, _ := time.ParseDuration("10h") complex, _ := time.ParseDuration("1h10m10s") micro, _ := time.ParseDuration("1µs") // The package also accepts the incorrect but common prefix u for micro. micro2, _ := time.ParseDuration("1us") fmt.Println(hours) fmt.Println(complex) fmt.Printf("There are %.0f seconds in %v.\n", complex.Seconds(), complex) fmt.Printf("There are %d nanoseconds in %v.\n", micro.Nanoseconds(), micro) fmt.Printf("There are %6.2e seconds in %v.\n", micro2.Seconds(), micro) Output: 10h0m0s 1h10m10s There are 4210 seconds in 1h10m10s. There are 1000 nanoseconds in 1µs. There are 1.00e-06 seconds in 1µs. func Since func Since(t Time) Duration Since returns the time elapsed since t. It is shorthand for time.Now().Sub(t). func Until 1.8 func Until(t Time) Duration Until returns the duration until t. It is shorthand for t.Sub(time.Now()). func (Duration) Abs 1.19 func (d Duration) Abs() Duration Abs returns the absolute value of d. As a special case, math.MinInt64 is converted to math.MaxInt64. func (Duration) Hours func (d Duration) Hours() float64 Hours returns the duration as a floating point number of hours. Example Code: h, _ := time.ParseDuration("4h30m") fmt.Printf("I've got %.1f hours of work left.", h.Hours()) Output: I've got 4.5 hours of work left. func (Duration) Microseconds 1.13 func (d Duration) Microseconds() int64 Microseconds returns the duration as an integer microsecond count. Example Code: u, _ := time.ParseDuration("1s") fmt.Printf("One second is %d microseconds.\n", u.Microseconds()) Output: One second is 1000000 microseconds. func (Duration) Milliseconds 1.13 func (d Duration) Milliseconds() int64 Milliseconds returns the duration as an integer millisecond count. Example Code: u, _ := time.ParseDuration("1s") fmt.Printf("One second is %d milliseconds.\n", u.Milliseconds()) Output: One second is 1000 milliseconds. func (Duration) Minutes func (d Duration) Minutes() float64 Minutes returns the duration as a floating point number of minutes. Example Code: m, _ := time.ParseDuration("1h30m") fmt.Printf("The movie is %.0f minutes long.", m.Minutes()) Output: The movie is 90 minutes long. func (Duration) Nanoseconds func (d Duration) Nanoseconds() int64 Nanoseconds returns the duration as an integer nanosecond count. Example Code: u, _ := time.ParseDuration("1µs") fmt.Printf("One microsecond is %d nanoseconds.\n", u.Nanoseconds()) Output: One microsecond is 1000 nanoseconds. func (Duration) Round 1.9 func (d Duration) Round(m Duration) Duration Round returns the result of rounding d to the nearest multiple of m. The rounding behavior for halfway values is to round away from zero. If the result exceeds the maximum (or minimum) value that can be stored in a Duration, Round returns the maximum (or minimum) duration. If m <= 0, Round returns d unchanged. Example Code: d, err := time.ParseDuration("1h15m30.918273645s") if err != nil { panic(err) } round := []time.Duration{ time.Nanosecond, time.Microsecond, time.Millisecond, time.Second, 2 * time.Second, time.Minute, 10 * time.Minute, time.Hour, } for _, r := range round { fmt.Printf("d.Round(%6s) = %s\n", r, d.Round(r).String()) } Output: d.Round( 1ns) = 1h15m30.918273645s d.Round( 1µs) = 1h15m30.918274s d.Round( 1ms) = 1h15m30.918s d.Round( 1s) = 1h15m31s d.Round( 2s) = 1h15m30s d.Round( 1m0s) = 1h16m0s d.Round( 10m0s) = 1h20m0s d.Round(1h0m0s) = 1h0m0s func (Duration) Seconds func (d Duration) Seconds() float64 Seconds returns the duration as a floating point number of seconds. Example Code: m, _ := time.ParseDuration("1m30s") fmt.Printf("Take off in t-%.0f seconds.", m.Seconds()) Output: Take off in t-90 seconds. func (Duration) String func (d Duration) String() string String returns a string representing the duration in the form "72h3m0.5s". Leading zero units are omitted. As a special case, durations less than one second format use a smaller unit (milli-, micro-, or nanoseconds) to ensure that the leading digit is non-zero. The zero duration formats as 0s. Example Code: fmt.Println(1*time.Hour + 2*time.Minute + 300*time.Millisecond) fmt.Println(300 * time.Millisecond) Output: 1h2m0.3s 300ms func (Duration) Truncate 1.9 func (d Duration) Truncate(m Duration) Duration Truncate returns the result of rounding d toward zero to a multiple of m. If m <= 0, Truncate returns d unchanged. Example Code: d, err := time.ParseDuration("1h15m30.918273645s") if err != nil { panic(err) } trunc := []time.Duration{ time.Nanosecond, time.Microsecond, time.Millisecond, time.Second, 2 * time.Second, time.Minute, 10 * time.Minute, time.Hour, } for _, t := range trunc { fmt.Printf("d.Truncate(%6s) = %s\n", t, d.Truncate(t).String()) } Output: d.Truncate( 1ns) = 1h15m30.918273645s d.Truncate( 1µs) = 1h15m30.918273s d.Truncate( 1ms) = 1h15m30.918s d.Truncate( 1s) = 1h15m30s d.Truncate( 2s) = 1h15m30s d.Truncate( 1m0s) = 1h15m0s d.Truncate( 10m0s) = 1h10m0s d.Truncate(1h0m0s) = 1h0m0s type Location A Location maps time instants to the zone in use at that time. Typically, the Location represents the collection of time offsets in use in a geographical area. For many Locations the time offset varies depending on whether daylight savings time is in use at the time instant. type Location struct { // contains filtered or unexported fields } Local represents the system's local time zone. On Unix systems, Local consults the TZ environment variable to find the time zone to use. No TZ means use the system default /etc/localtime. TZ="" means use UTC. TZ="foo" means use file foo in the system timezone directory. var Local *Location = &localLoc UTC represents Universal Coordinated Time (UTC). var UTC *Location = &utcLoc Example Code: // China doesn't have daylight saving. It uses a fixed 8 hour offset from UTC. secondsEastOfUTC := int((8 * time.Hour).Seconds()) beijing := time.FixedZone("Beijing Time", secondsEastOfUTC) // If the system has a timezone database present, it's possible to load a location // from that, e.g.: // newYork, err := time.LoadLocation("America/New_York") // Creating a time requires a location. Common locations are time.Local and time.UTC. timeInUTC := time.Date(2009, 1, 1, 12, 0, 0, 0, time.UTC) sameTimeInBeijing := time.Date(2009, 1, 1, 20, 0, 0, 0, beijing) // Although the UTC clock time is 1200 and the Beijing clock time is 2000, Beijing is // 8 hours ahead so the two dates actually represent the same instant. timesAreEqual := timeInUTC.Equal(sameTimeInBeijing) fmt.Println(timesAreEqual) Output: true func FixedZone func FixedZone(name string, offset int) *Location FixedZone returns a Location that always uses the given zone name and offset (seconds east of UTC). Example Code: loc := time.FixedZone("UTC-8", -8*60*60) t := time.Date(2009, time.November, 10, 23, 0, 0, 0, loc) fmt.Println("The time is:", t.Format(time.RFC822)) Output: The time is: 10 Nov 09 23:00 UTC-8 func LoadLocation func LoadLocation(name string) (*Location, error) LoadLocation returns the Location with the given name. If the name is "" or "UTC", LoadLocation returns UTC. If the name is "Local", LoadLocation returns Local. Otherwise, the name is taken to be a location name corresponding to a file in the IANA Time Zone database, such as "America/New_York". LoadLocation looks for the IANA Time Zone database in the following locations in order: - the directory or uncompressed zip file named by the ZONEINFO environment variable - on a Unix system, the system standard installation location - $GOROOT/lib/time/zoneinfo.zip - the time/tzdata package, if it was imported Example Code: location, err := time.LoadLocation("America/Los_Angeles") if err != nil { panic(err) } timeInUTC := time.Date(2018, 8, 30, 12, 0, 0, 0, time.UTC) fmt.Println(timeInUTC.In(location)) Output: 2018-08-30 05:00:00 -0700 PDT func LoadLocationFromTZData 1.10 func LoadLocationFromTZData(name string, data []byte) (*Location, error) LoadLocationFromTZData returns a Location with the given name initialized from the IANA Time Zone database-formatted data. The data should be in the format of a standard IANA time zone file (for example, the content of /etc/localtime on Unix systems). func (*Location) String func (l *Location) String() string String returns a descriptive name for the time zone information, corresponding to the name argument to LoadLocation or FixedZone. type Month A Month specifies a month of the year (January = 1, ...). type Month int const ( January Month = 1 + iota February March April May June July August September October November December ) Example Code: _, month, day := time.Now().Date() if month == time.November && day == 10 { fmt.Println("Happy Go day!") } func (Month) String func (m Month) String() string String returns the English name of the month ("January", "February", ...). type ParseError ParseError describes a problem parsing a time string. type ParseError struct { Layout string Value string LayoutElem string ValueElem string Message string } func (*ParseError) Error func (e *ParseError) Error() string Error returns the string representation of a ParseError. type Ticker A Ticker holds a channel that delivers “ticks” of a [email protected]. type Ticker struct { C <-chan Time // The channel on which the ticks are delivered. // contains filtered or unexported fields } func NewTicker func NewTicker(d Duration) *Ticker NewTicker returns a new Ticker containing a channel that will send the current time on the channel after each tick. The period of the ticks is specified by the duration argument. The ticker will adjust the time interval or drop ticks to make up for slow receivers. The duration d must be greater than zero; if not, NewTicker will panic. Stop the ticker to release associated resources. Example Code: ticker := time.NewTicker(time.Second) defer ticker.Stop() done := make(chan bool) go func() { time.Sleep(10 * time.Second) done <- true }() for { select { case <-done: fmt.Println("Done!") return case t := <-ticker.C: fmt.Println("Current time: ", t) } } func (*Ticker) Reset 1.15 func (t *Ticker) Reset(d Duration) Reset stops a ticker and resets its period to the specified duration. The next tick will arrive after the new period elapses. The duration d must be greater than zero; if not, Reset will panic. func (*Ticker) Stop func (t *Ticker) Stop() Stop turns off a ticker. After Stop, no more ticks will be sent. Stop does not close the channel, to prevent a concurrent goroutine reading from the channel from seeing an erroneous "tick". type Time A Time represents an instant in time with nanosecond precision. Programs using times should typically store and pass them as values, not pointers. That is, time variables and struct fields should be of type time.Time, not *time.Time. A Time value can be used by multiple goroutines simultaneously except that the methods GobDecode, UnmarshalBinary, UnmarshalJSON and UnmarshalText are not concurrency-safe. Time instants can be compared using the Before, After, and Equal methods. The Sub method subtracts two instants, producing a Duration. The Add method adds a Time and a Duration, producing a Time. The zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC. As this time is unlikely to come up in practice, the IsZero method gives a simple way of detecting a time that has not been initialized explicitly. Each Time has associated with it a Location, consulted when computing the presentation form of the time, such as in the Format, Hour, and Year methods. The methods Local, UTC, and In return a Time with a specific location. Changing the location in this way changes only the presentation; it does not change the instant in time being denoted and therefore does not affect the computations described in earlier paragraphs. Representations of a Time value saved by the GobEncode, MarshalBinary, MarshalJSON, and MarshalText methods store the Time.Location's offset, but not the location name. They therefore lose information about Daylight Saving Time. In addition to the required “wall clock” reading, a Time may contain an optional reading of the current process's monotonic clock, to provide additional precision for comparison or subtraction. See the “Monotonic Clocks” section in the package documentation for details. Note that the Go == operator compares not just the time instant but also the Location and the monotonic clock reading. Therefore, Time values should not be used as map or database keys without first guaranteeing that the identical Location has been set for all values, which can be achieved through use of the UTC or Local method, and that the monotonic clock reading has been stripped by setting t = t.Round(0). In general, prefer t.Equal(u) to t == u, since t.Equal uses the most accurate comparison available and correctly handles the case when only one of its arguments has a monotonic clock reading. type Time struct { // contains filtered or unexported fields } func Date func Date(year int, month Month, day, hour, min, sec, nsec int, loc *Location) Time Date returns the Time corresponding to yyyy-mm-dd hh:mm:ss + nsec nanoseconds in the appropriate zone for that time in the given location. The month, day, hour, min, sec, and nsec values may be outside their usual ranges and will be normalized during the conversion. For example, October 32 converts to November 1. A daylight savings time transition skips or repeats times. For example, in the United States, March 13, 2011 2:15am never occurred, while November 6, 2011 1:15am occurred twice. In such cases, the choice of time zone, and therefore the time, is not well-defined. Date returns a time that is correct in one of the two zones involved in the transition, but it does not guarantee which. Date panics if loc is nil. Example Code: t := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) fmt.Printf("Go launched at %s\n", t.Local()) Output: Go launched at 2009-11-10 15:00:00 -0800 PST func Now func Now() Time Now returns the current local time. func Parse func Parse(layout, value string) (Time, error) Parse parses a formatted string and returns the time value it represents. See the documentation for the constant called Layout to see how to represent the format. The second argument must be parseable using the format string (layout) provided as the first argument. The example for Time.Format demonstrates the working of the layout string in detail and is a good reference. When parsing (only), the input may contain a fractional second field immediately after the seconds field, even if the layout does not signify its presence. In that case either a comma or a decimal point followed by a maximal series of digits is parsed as a fractional second. Fractional seconds are truncated to nanosecond precision. Elements omitted from the layout are assumed to be zero or, when zero is impossible, one, so parsing "3:04pm" returns the time corresponding to Jan 1, year 0, 15:04:00 UTC (note that because the year is 0, this time is before the zero Time). Years must be in the range 0000..9999. The day of the week is checked for syntax but it is otherwise ignored. For layouts specifying the two-digit year 06, a value NN >= 69 will be treated as 19NN and a value NN < 69 will be treated as 20NN. The remainder of this comment describes the handling of time zones. In the absence of a time zone indicator, Parse returns a time in UTC. When parsing a time with a zone offset like -0700, if the offset corresponds to a time zone used by the current location (Local), then Parse uses that location and zone in the returned time. Otherwise it records the time as being in a fabricated location with time fixed at the given zone offset. When parsing a time with a zone abbreviation like MST, if the zone abbreviation has a defined offset in the current location, then that offset is used. The zone abbreviation "UTC" is recognized as UTC regardless of location. If the zone abbreviation is unknown, Parse records the time as being in a fabricated location with the given zone abbreviation and a zero offset. This choice means that such a time can be parsed and reformatted with the same layout losslessly, but the exact instant used in the representation will differ by the actual zone offset. To avoid such problems, prefer time layouts that use a numeric zone offset, or use ParseInLocation. Example Code: // See the example for Time.Format for a thorough description of how // to define the layout string to parse a time.Time value; Parse and // Format use the same model to describe their input and output. // longForm shows by example how the reference time would be represented in // the desired layout. const longForm = "Jan 2, 2006 at 3:04pm (MST)" t, _ := time.Parse(longForm, "Feb 3, 2013 at 7:54pm (PST)") fmt.Println(t) // shortForm is another way the reference time would be represented // in the desired layout; it has no time zone present. // Note: without explicit zone, returns time in UTC. const shortForm = "2006-Jan-02" t, _ = time.Parse(shortForm, "2013-Feb-03") fmt.Println(t) // Some valid layouts are invalid time values, due to format specifiers // such as _ for space padding and Z for zone information. // For example the RFC3339 layout 2006-01-02T15:04:05Z07:00 // contains both Z and a time zone offset in order to handle both valid options: // 2006-01-02T15:04:05Z // 2006-01-02T15:04:05+07:00 t, _ = time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") fmt.Println(t) t, _ = time.Parse(time.RFC3339, "2006-01-02T15:04:05+07:00") fmt.Println(t) _, err := time.Parse(time.RFC3339, time.RFC3339) fmt.Println("error", err) // Returns an error as the layout is not a valid time value Output: 2013-02-03 19:54:00 -0800 PST 2013-02-03 00:00:00 +0000 UTC 2006-01-02 15:04:05 +0000 UTC 2006-01-02 15:04:05 +0700 +0700 error parsing time "2006-01-02T15:04:05Z07:00": extra text: "07:00" func ParseInLocation 1.1 func ParseInLocation(layout, value string, loc *Location) (Time, error) ParseInLocation is like Parse but differs in two important ways. First, in the absence of time zone information, Parse interprets a time as UTC; ParseInLocation interprets the time as in the given location. Second, when given a zone offset or abbreviation, Parse tries to match it against the Local location; ParseInLocation uses the given location. Example Code: loc, _ := time.LoadLocation("Europe/Berlin") // This will look for the name CEST in the Europe/Berlin time zone. const longForm = "Jan 2, 2006 at 3:04pm (MST)" t, _ := time.ParseInLocation(longForm, "Jul 9, 2012 at 5:02am (CEST)", loc) fmt.Println(t) // Note: without explicit zone, returns time in given location. const shortForm = "2006-Jan-02" t, _ = time.ParseInLocation(shortForm, "2012-Jul-09", loc) fmt.Println(t) Output: 2012-07-09 05:02:00 +0200 CEST 2012-07-09 00:00:00 +0200 CEST func Unix func Unix(sec int64, nsec int64) Time Unix returns the local Time corresponding to the given Unix time, sec seconds and nsec nanoseconds since January 1, 1970 UTC. It is valid to pass nsec outside the range [0, 999999999]. Not all sec values have a corresponding time value. One such value is 1<<63-1 (the largest int64 value). Example Code: unixTime := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) fmt.Println(unixTime.Unix()) t := time.Unix(unixTime.Unix(), 0).UTC() fmt.Println(t) Output: 1257894000 2009-11-10 23:00:00 +0000 UTC func UnixMicro 1.17 func UnixMicro(usec int64) Time UnixMicro returns the local Time corresponding to the given Unix time, usec microseconds since January 1, 1970 UTC. Example Code: umt := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) fmt.Println(umt.UnixMicro()) t := time.UnixMicro(umt.UnixMicro()).UTC() fmt.Println(t) Output: 1257894000000000 2009-11-10 23:00:00 +0000 UTC func UnixMilli 1.17 func UnixMilli(msec int64) Time UnixMilli returns the local Time corresponding to the given Unix time, msec milliseconds since January 1, 1970 UTC. Example Code: umt := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) fmt.Println(umt.UnixMilli()) t := time.UnixMilli(umt.UnixMilli()).UTC() fmt.Println(t) Output: 1257894000000 2009-11-10 23:00:00 +0000 UTC func (Time) Add func (t Time) Add(d Duration) Time Add returns the time t+d. Example Code: start := time.Date(2009, 1, 1, 12, 0, 0, 0, time.UTC) afterTenSeconds := start.Add(time.Second * 10) afterTenMinutes := start.Add(time.Minute * 10) afterTenHours := start.Add(time.Hour * 10) afterTenDays := start.Add(time.Hour * 24 * 10) fmt.Printf("start = %v\n", start) fmt.Printf("start.Add(time.Second * 10) = %v\n", afterTenSeconds) fmt.Printf("start.Add(time.Minute * 10) = %v\n", afterTenMinutes) fmt.Printf("start.Add(time.Hour * 10) = %v\n", afterTenHours) fmt.Printf("start.Add(time.Hour * 24 * 10) = %v\n", afterTenDays) Output: start = 2009-01-01 12:00:00 +0000 UTC start.Add(time.Second * 10) = 2009-01-01 12:00:10 +0000 UTC start.Add(time.Minute * 10) = 2009-01-01 12:10:00 +0000 UTC start.Add(time.Hour * 10) = 2009-01-01 22:00:00 +0000 UTC start.Add(time.Hour * 24 * 10) = 2009-01-11 12:00:00 +0000 UTC func (Time) AddDate func (t Time) AddDate(years int, months int, days int) Time AddDate returns the time corresponding to adding the given number of years, months, and days to t. For example, AddDate(-1, 2, 3) applied to January 1, 2011 returns March 4, 2010. AddDate normalizes its result in the same way that Date does, so, for example, adding one month to October 31 yields December 1, the normalized form for November 31. Example Code: start := time.Date(2009, 1, 1, 0, 0, 0, 0, time.UTC) oneDayLater := start.AddDate(0, 0, 1) oneMonthLater := start.AddDate(0, 1, 0) oneYearLater := start.AddDate(1, 0, 0) fmt.Printf("oneDayLater: start.AddDate(0, 0, 1) = %v\n", oneDayLater) fmt.Printf("oneMonthLater: start.AddDate(0, 1, 0) = %v\n", oneMonthLater) fmt.Printf("oneYearLater: start.AddDate(1, 0, 0) = %v\n", oneYearLater) Output: oneDayLater: start.AddDate(0, 0, 1) = 2009-01-02 00:00:00 +0000 UTC oneMonthLater: start.AddDate(0, 1, 0) = 2009-02-01 00:00:00 +0000 UTC oneYearLater: start.AddDate(1, 0, 0) = 2010-01-01 00:00:00 +0000 UTC func (Time) After func (t Time) After(u Time) bool After reports whether the time instant t is after u. Example Code: year2000 := time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC) year3000 := time.Date(3000, 1, 1, 0, 0, 0, 0, time.UTC) isYear3000AfterYear2000 := year3000.After(year2000) // True isYear2000AfterYear3000 := year2000.After(year3000) // False fmt.Printf("year3000.After(year2000) = %v\n", isYear3000AfterYear2000) fmt.Printf("year2000.After(year3000) = %v\n", isYear2000AfterYear3000) Output: year3000.After(year2000) = true year2000.After(year3000) = false func (Time) AppendFormat 1.5 func (t Time) AppendFormat(b []byte, layout string) []byte AppendFormat is like Format but appends the textual representation to b and returns the extended buffer. Example Code: t := time.Date(2017, time.November, 4, 11, 0, 0, 0, time.UTC) text := []byte("Time: ") text = t.AppendFormat(text, time.Kitchen) fmt.Println(string(text)) Output: Time: 11:00AM func (Time) Before func (t Time) Before(u Time) bool Before reports whether the time instant t is before u. Example Code: year2000 := time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC) year3000 := time.Date(3000, 1, 1, 0, 0, 0, 0, time.UTC) isYear2000BeforeYear3000 := year2000.Before(year3000) // True isYear3000BeforeYear2000 := year3000.Before(year2000) // False fmt.Printf("year2000.Before(year3000) = %v\n", isYear2000BeforeYear3000) fmt.Printf("year3000.Before(year2000) = %v\n", isYear3000BeforeYear2000) Output: year2000.Before(year3000) = true year3000.Before(year2000) = false func (Time) Clock func (t Time) Clock() (hour, min, sec int) Clock returns the hour, minute, and second within the day specified by t. func (Time) Date func (t Time) Date() (year int, month Month, day int) Date returns the year, month, and day in which t occurs. Example Code: d := time.Date(2000, 2, 1, 12, 30, 0, 0, time.UTC) year, month, day := d.Date() fmt.Printf("year = %v\n", year) fmt.Printf("month = %v\n", month) fmt.Printf("day = %v\n", day) Output: year = 2000 month = February day = 1 func (Time) Day func (t Time) Day() int Day returns the day of the month specified by t. Example Code: d := time.Date(2000, 2, 1, 12, 30, 0, 0, time.UTC) day := d.Day() fmt.Printf("day = %v\n", day) Output: day = 1 func (Time) Equal func (t Time) Equal(u Time) bool Equal reports whether t and u represent the same time instant. Two times can be equal even if they are in different locations. For example, 6:00 +0200 and 4:00 UTC are Equal. See the documentation on the Time type for the pitfalls of using == with Time values; most code should use Equal instead. Example Code: secondsEastOfUTC := int((8 * time.Hour).Seconds()) beijing := time.FixedZone("Beijing Time", secondsEastOfUTC) // Unlike the equal operator, Equal is aware that d1 and d2 are the // same instant but in different time zones. d1 := time.Date(2000, 2, 1, 12, 30, 0, 0, time.UTC) d2 := time.Date(2000, 2, 1, 20, 30, 0, 0, beijing) datesEqualUsingEqualOperator := d1 == d2 datesEqualUsingFunction := d1.Equal(d2) fmt.Printf("datesEqualUsingEqualOperator = %v\n", datesEqualUsingEqualOperator) fmt.Printf("datesEqualUsingFunction = %v\n", datesEqualUsingFunction) Output: datesEqualUsingEqualOperator = false datesEqualUsingFunction = true func (Time) Format func (t Time) Format(layout string) string Format returns a textual representation of the time value formatted according to the layout defined by the argument. See the documentation for the constant called Layout to see how to represent the layout format. The executable example for Time.Format demonstrates the working of the layout string in detail and is a good reference. Example Code: // Parse a time value from a string in the standard Unix format. t, err := time.Parse(time.UnixDate, "Wed Feb 25 11:06:39 PST 2015") if err != nil { // Always check errors even if they should not happen. panic(err) } tz, err := time.LoadLocation("Asia/Shanghai") if err != nil { // Always check errors even if they should not happen. panic(err) } // time.Time's Stringer method is useful without any format. fmt.Println("default format:", t) // Predefined constants in the package implement common layouts. fmt.Println("Unix format:", t.Format(time.UnixDate)) // The time zone attached to the time value affects its output. fmt.Println("Same, in UTC:", t.UTC().Format(time.UnixDate)) fmt.Println("in Shanghai with seconds:", t.In(tz).Format("2006-01-02T15:04:05 -070000")) fmt.Println("in Shanghai with colon seconds:", t.In(tz).Format("2006-01-02T15:04:05 -07:00:00")) // The rest of this function demonstrates the properties of the // layout string used in the format. // The layout string used by the Parse function and Format method // shows by example how the reference time should be represented. // We stress that one must show how the reference time is formatted, // not a time of the user's choosing. Thus each layout string is a // representation of the time stamp, // Jan 2 15:04:05 2006 MST // An easy way to remember this value is that it holds, when presented // in this order, the values (lined up with the elements above): // 1 2 3 4 5 6 -7 // There are some wrinkles illustrated below. // Most uses of Format and Parse use constant layout strings such as // the ones defined in this package, but the interface is flexible, // as these examples show. // Define a helper function to make the examples' output look nice. do := func(name, layout, want string) { got := t.Format(layout) if want != got { fmt.Printf("error: for %q got %q; expected %q\n", layout, got, want) return } fmt.Printf("%-16s %q gives %q\n", name, layout, got) } // Print a header in our output. fmt.Printf("\nFormats:\n\n") // Simple starter examples. do("Basic full date", "Mon Jan 2 15:04:05 MST 2006", "Wed Feb 25 11:06:39 PST 2015") do("Basic short date", "2006/01/02", "2015/02/25") // The hour of the reference time is 15, or 3PM. The layout can express // it either way, and since our value is the morning we should see it as // an AM time. We show both in one format string. Lower case too. do("AM/PM", "3PM==3pm==15h", "11AM==11am==11h") // When parsing, if the seconds value is followed by a decimal point // and some digits, that is taken as a fraction of a second even if // the layout string does not represent the fractional second. // Here we add a fractional second to our time value used above. t, err = time.Parse(time.UnixDate, "Wed Feb 25 11:06:39.1234 PST 2015") if err != nil { panic(err) } // It does not appear in the output if the layout string does not contain // a representation of the fractional second. do("No fraction", time.UnixDate, "Wed Feb 25 11:06:39 PST 2015") // Fractional seconds can be printed by adding a run of 0s or 9s after // a decimal point in the seconds value in the layout string. // If the layout digits are 0s, the fractional second is of the specified // width. Note that the output has a trailing zero. do("0s for fraction", "15:04:05.00000", "11:06:39.12340") // If the fraction in the layout is 9s, trailing zeros are dropped. do("9s for fraction", "15:04:05.99999999", "11:06:39.1234") Output: default format: 2015-02-25 11:06:39 -0800 PST Unix format: Wed Feb 25 11:06:39 PST 2015 Same, in UTC: Wed Feb 25 19:06:39 UTC 2015 in Shanghai with seconds: 2015-02-26T03:06:39 +080000 in Shanghai with colon seconds: 2015-02-26T03:06:39 +08:00:00 Formats: Basic full date "Mon Jan 2 15:04:05 MST 2006" gives "Wed Feb 25 11:06:39 PST 2015" Basic short date "2006/01/02" gives "2015/02/25" AM/PM "3PM==3pm==15h" gives "11AM==11am==11h" No fraction "Mon Jan _2 15:04:05 MST 2006" gives "Wed Feb 25 11:06:39 PST 2015" 0s for fraction "15:04:05.00000" gives "11:06:39.12340" 9s for fraction "15:04:05.99999999" gives "11:06:39.1234" Example (Pad) Code: // Parse a time value from a string in the standard Unix format. t, err := time.Parse(time.UnixDate, "Sat Mar 7 11:06:39 PST 2015") if err != nil { // Always check errors even if they should not happen. panic(err) } // Define a helper function to make the examples' output look nice. do := func(name, layout, want string) { got := t.Format(layout) if want != got { fmt.Printf("error: for %q got %q; expected %q\n", layout, got, want) return } fmt.Printf("%-16s %q gives %q\n", name, layout, got) } // The predefined constant Unix uses an underscore to pad the day. do("Unix", time.UnixDate, "Sat Mar 7 11:06:39 PST 2015") // For fixed-width printing of values, such as the date, that may be one or // two characters (7 vs. 07), use an _ instead of a space in the layout string. // Here we print just the day, which is 2 in our layout string and 7 in our // value. do("No pad", "<2>", "<7>") // An underscore represents a space pad, if the date only has one digit. do("Spaces", "<_2>", "< 7>") // A "0" indicates zero padding for single-digit values. do("Zeros", "<02>", "<07>") // If the value is already the right width, padding is not used. // For instance, the second (05 in the reference time) in our value is 39, // so it doesn't need padding, but the minutes (04, 06) does. do("Suppressed pad", "04:05", "06:39") Output: Unix "Mon Jan _2 15:04:05 MST 2006" gives "Sat Mar 7 11:06:39 PST 2015" No pad "<2>" gives "<7>" Spaces "<_2>" gives "< 7>" Zeros "<02>" gives "<07>" Suppressed pad "04:05" gives "06:39" func (Time) GoString 1.17 func (t Time) GoString() string GoString implements fmt.GoStringer and formats t to be printed in Go source code. Example Code: t := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) fmt.Println(t.GoString()) t = t.Add(1 * time.Minute) fmt.Println(t.GoString()) t = t.AddDate(0, 1, 0) fmt.Println(t.GoString()) t, _ = time.Parse("Jan 2, 2006 at 3:04pm (MST)", "Feb 3, 2013 at 7:54pm (UTC)") fmt.Println(t.GoString()) Output: time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) time.Date(2009, time.November, 10, 23, 1, 0, 0, time.UTC) time.Date(2009, time.December, 10, 23, 1, 0, 0, time.UTC) time.Date(2013, time.February, 3, 19, 54, 0, 0, time.UTC) func (*Time) GobDecode func (t *Time) GobDecode(data []byte) error GobDecode implements the gob.GobDecoder interface. func (Time) GobEncode func (t Time) GobEncode() ([]byte, error) GobEncode implements the gob.GobEncoder interface. func (Time) Hour func (t Time) Hour() int Hour returns the hour within the day specified by t, in the range [0, 23]. func (Time) ISOWeek func (t Time) ISOWeek() (year, week int) ISOWeek returns the ISO 8601 year and week number in which t occurs. Week ranges from 1 to 53. Jan 01 to Jan 03 of year n might belong to week 52 or 53 of year n-1, and Dec 29 to Dec 31 might belong to week 1 of year n+1. func (Time) In func (t Time) In(loc *Location) Time In returns a copy of t representing the same time instant, but with the copy's location information set to loc for display purposes. In panics if loc is nil. func (Time) IsDST 1.17 func (t Time) IsDST() bool IsDST reports whether the time in the configured location is in Daylight Savings Time. func (Time) IsZero func (t Time) IsZero() bool IsZero reports whether t represents the zero time instant, January 1, year 1, 00:00:00 UTC. func (Time) Local func (t Time) Local() Time Local returns t with the location set to local time. func (Time) Location func (t Time) Location() *Location Location returns the time zone information associated with t. func (Time) MarshalBinary 1.2 func (t Time) MarshalBinary() ([]byte, error) MarshalBinary implements the encoding.BinaryMarshaler interface. func (Time) MarshalJSON func (t Time) MarshalJSON() ([]byte, error) MarshalJSON implements the json.Marshaler interface. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. func (Time) MarshalText 1.2 func (t Time) MarshalText() ([]byte, error) MarshalText implements the encoding.TextMarshaler interface. The time is formatted in RFC 3339 format, with sub-second precision added if present. func (Time) Minute func (t Time) Minute() int Minute returns the minute offset within the hour specified by t, in the range [0, 59]. func (Time) Month func (t Time) Month() Month Month returns the month of the year specified by t. func (Time) Nanosecond func (t Time) Nanosecond() int Nanosecond returns the nanosecond offset within the second specified by t, in the range [0, 999999999]. func (Time) Round 1.1 func (t Time) Round(d Duration) Time Round returns the result of rounding t to the nearest multiple of d (since the zero time). The rounding behavior for halfway values is to round up. If d <= 0, Round returns t stripped of any monotonic clock reading but otherwise unchanged. Round operates on the time as an absolute duration since the zero time; it does not operate on the presentation form of the time. Thus, Round(Hour) may return a time with a non-zero minute, depending on the time's Location. Example Code: t := time.Date(0, 0, 0, 12, 15, 30, 918273645, time.UTC) round := []time.Duration{ time.Nanosecond, time.Microsecond, time.Millisecond, time.Second, 2 * time.Second, time.Minute, 10 * time.Minute, time.Hour, } for _, d := range round { fmt.Printf("t.Round(%6s) = %s\n", d, t.Round(d).Format("15:04:05.999999999")) } Output: t.Round( 1ns) = 12:15:30.918273645 t.Round( 1µs) = 12:15:30.918274 t.Round( 1ms) = 12:15:30.918 t.Round( 1s) = 12:15:31 t.Round( 2s) = 12:15:30 t.Round( 1m0s) = 12:16:00 t.Round( 10m0s) = 12:20:00 t.Round(1h0m0s) = 12:00:00 func (Time) Second func (t Time) Second() int Second returns the second offset within the minute specified by t, in the range [0, 59]. func (Time) String func (t Time) String() string String returns the time formatted using the format string "2006-01-02 15:04:05.999999999 -0700 MST" If the time has a monotonic clock reading, the returned string includes a final field "m=±<value>", where value is the monotonic clock reading formatted as a decimal number of seconds. The returned string is meant for debugging; for a stable serialized representation, use t.MarshalText, t.MarshalBinary, or t.Format with an explicit format string. Example Code: timeWithNanoseconds := time.Date(2000, 2, 1, 12, 13, 14, 15, time.UTC) withNanoseconds := timeWithNanoseconds.String() timeWithoutNanoseconds := time.Date(2000, 2, 1, 12, 13, 14, 0, time.UTC) withoutNanoseconds := timeWithoutNanoseconds.String() fmt.Printf("withNanoseconds = %v\n", string(withNanoseconds)) fmt.Printf("withoutNanoseconds = %v\n", string(withoutNanoseconds)) Output: withNanoseconds = 2000-02-01 12:13:14.000000015 +0000 UTC withoutNanoseconds = 2000-02-01 12:13:14 +0000 UTC func (Time) Sub func (t Time) Sub(u Time) Duration Sub returns the duration t-u. If the result exceeds the maximum (or minimum) value that can be stored in a Duration, the maximum (or minimum) duration will be returned. To compute t-d for a duration d, use t.Add(-d). Example Code: start := time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC) end := time.Date(2000, 1, 1, 12, 0, 0, 0, time.UTC) difference := end.Sub(start) fmt.Printf("difference = %v\n", difference) Output: difference = 12h0m0s func (Time) Truncate 1.1 func (t Time) Truncate(d Duration) Time Truncate returns the result of rounding t down to a multiple of d (since the zero time). If d <= 0, Truncate returns t stripped of any monotonic clock reading but otherwise unchanged. Truncate operates on the time as an absolute duration since the zero time; it does not operate on the presentation form of the time. Thus, Truncate(Hour) may return a time with a non-zero minute, depending on the time's Location. Example Code: t, _ := time.Parse("2006 Jan 02 15:04:05", "2012 Dec 07 12:15:30.918273645") trunc := []time.Duration{ time.Nanosecond, time.Microsecond, time.Millisecond, time.Second, 2 * time.Second, time.Minute, 10 * time.Minute, } for _, d := range trunc { fmt.Printf("t.Truncate(%5s) = %s\n", d, t.Truncate(d).Format("15:04:05.999999999")) } // To round to the last midnight in the local timezone, create a new Date. midnight := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.Local) _ = midnight Output: t.Truncate( 1ns) = 12:15:30.918273645 t.Truncate( 1µs) = 12:15:30.918273 t.Truncate( 1ms) = 12:15:30.918 t.Truncate( 1s) = 12:15:30 t.Truncate( 2s) = 12:15:30 t.Truncate( 1m0s) = 12:15:00 t.Truncate(10m0s) = 12:10:00 func (Time) UTC func (t Time) UTC() Time UTC returns t with the location set to UTC. func (Time) Unix func (t Time) Unix() int64 Unix returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC. The result does not depend on the location associated with t. Unix-like operating systems often record time as a 32-bit count of seconds, but since the method here returns a 64-bit value it is valid for billions of years into the past or future. Example Code: // 1 billion seconds of Unix, three ways. fmt.Println(time.Unix(1e9, 0).UTC()) // 1e9 seconds fmt.Println(time.Unix(0, 1e18).UTC()) // 1e18 nanoseconds fmt.Println(time.Unix(2e9, -1e18).UTC()) // 2e9 seconds - 1e18 nanoseconds t := time.Date(2001, time.September, 9, 1, 46, 40, 0, time.UTC) fmt.Println(t.Unix()) // seconds since 1970 fmt.Println(t.UnixNano()) // nanoseconds since 1970 Output: 2001-09-09 01:46:40 +0000 UTC 2001-09-09 01:46:40 +0000 UTC 2001-09-09 01:46:40 +0000 UTC 1000000000 1000000000000000000 func (Time) UnixMicro 1.17 func (t Time) UnixMicro() int64 UnixMicro returns t as a Unix time, the number of microseconds elapsed since January 1, 1970 UTC. The result is undefined if the Unix time in microseconds cannot be represented by an int64 (a date before year -290307 or after year
dart:html closed property bool closed Indicates whether this window has been closed. print(window.closed); // 'false' window.close(); print(window.closed); // 'true' Source @DomName('Window.closed') @DocsEditable() bool get closed => _blink.BlinkWindow.instance.closed_Getter_(this);
maxBy kotlin-stdlib / kotlin.sequences / maxBy Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0) @DeprecatedSinceKotlin("1.4") inline fun <T, R : Comparable<R>> Sequence<T>.maxBy(     selector: (T) -> R ): T? Deprecated: Use maxByOrNull instead.
Symfony\Component\Routing Namespaces Symfony\Component\Routing\AnnotationSymfony\Component\Routing\ExceptionSymfony\Component\Routing\GeneratorSymfony\Component\Routing\LoaderSymfony\Component\Routing\Matcher Classes CompiledRoute CompiledRoutes are returned by the RouteCompiler class. RequestContext Holds information about the current request. Route A Route describes a route and its parameters. RouteCollection A RouteCollection represents a set of Route instances. RouteCompiler RouteCompiler compiles Route instances to CompiledRoute instances. Router The Router class is an example of the integration of all pieces of the routing system for easier use. Interfaces RequestContextAwareInterface RouteCompilerInterface RouteCompilerInterface is the interface that all RouteCompiler classes must implement. RouterInterface RouterInterface is the interface that all Router classes must implement.
QFrameGraphNode Class (Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QFrameGraphNode) Base class of all FrameGraph configuration nodes. More... Header: #include <QFrameGraphNode> qmake: QT += 3drender Since: Qt 5.5 Instantiated By: FrameGraphNode Inherits: Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode Inherited By: Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QBufferCapture, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QCameraSelector, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QClearBuffers, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QDispatchCompute, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QFrustumCulling, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QLayerFilter, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QMemoryBarrier, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QNoDraw, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QRenderCapture, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QRenderPassFilter, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QRenderStateSet, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QRenderSurfaceSelector, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QRenderTargetSelector, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QSortPolicy, Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QTechniqueFilter, and Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QViewport List of all members, including inherited members Public Functions QFrameGraphNode(Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode *parent = nullptr) QFrameGraphNode * parentFrameGraphNode() const 11 public functions inherited from Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode 32 public functions inherited from QObject Protected Functions QFrameGraphNode(QFrameGraphNodePrivate &dd, Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode *parent = nullptr) Reimplemented Protected Functions virtual Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNodeCreatedChangeBasePtr createNodeCreationChange() const 2 protected functions inherited from Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode 9 protected functions inherited from QObject Additional Inherited Members 3 properties inherited from Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode 1 property inherited from QObject 3 public slots inherited from Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode 1 public slot inherited from QObject 4 signals inherited from Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode 2 signals inherited from QObject 11 static public members inherited from QObject Detailed Description Base class of all FrameGraph configuration nodes. This class is rarely instanced directly since it doesn't provide any frame graph specific behavior, although it can be convenient to use for grouping other nodes together in dynamic frame graphs. The actual behavior comes from the subclasses. The subclasses are: class description Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QCameraSelector Select camera from all available cameras in the scene Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QClearBuffers Specify which buffers to clear and to what values Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QDispatchCompute Specify Compute operation kernels Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QFrustumCulling Enable frustum culling Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QLayerFilter Select which layers to draw Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QNoDraw Disable drawing Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QRenderPassFilter Select which render passes to draw Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QRenderStateSet Set render states Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QRenderSurfaceSelector Select which surface to draw to Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QRenderTargetSelector Select which QRenderTarget to draw to Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QSortPolicy Specify how entities are sorted to determine draw order Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QTechniqueFilter Select which techniques to draw Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QViewport Specify viewport Qt3DRender8b7c:f320:99b9:690f:4595:cd17:293a:c069QMemoryBarrier Places a memory barrier Member Function Documentation QFrameGraphNo8b7c:f320:99b9:690f:4595:cd17:293a:c069QFrameGraphNode(Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode *parent = nullptr) Default constructs an instance of QFrameGraphNode. [protected] QFrameGraphNo8b7c:f320:99b9:690f:4595:cd17:293a:c069QFrameGraphNode(QFrameGraphNodePrivate &dd, Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNode *parent = nullptr) Copy constructor. [virtual protected] Qt3DCor8b7c:f320:99b9:690f:4595:cd17:293a:c069QNodeCreatedChangeBasePtr QFrameGraphNo8b7c:f320:99b9:690f:4595:cd17:293a:c069createNodeCreationChange() const QFrameGraphNode *QFrameGraphNo8b7c:f320:99b9:690f:4595:cd17:293a:c069parentFrameGraphNode() const Returns a pointer to the parent.
tf.contrib.training.add_gradients_summaries Add summaries to gradients. tf.contrib.training.add_gradients_summaries( grads_and_vars ) Args grads_and_vars A list of gradient to variable pairs (tuples). Returns The list of created summaries.
WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069display( string $header, bool $markup = true, bool $translate = true ): string|array|false Gets a theme header, formatted and translated for display. Parameters $header string Required Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags. $markup bool Optional Whether to mark up the header. Defaults to true. Default: true $translate bool Optional Whether to translate the header. Defaults to true. Default: true Return string|array|false Processed header. An array for Tags if $markup is false, string otherwise. False on failure. Source File: wp-includes/class-wp-theme.php. View all references public function display( $header, $markup = true, $translate = true ) { $value = $this->get( $header ); if ( false === $value ) { return false; } if ( $translate && ( empty( $value ) || ! $this->load_textdomain() ) ) { $translate = false; } if ( $translate ) { $value = $this->translate_header( $header, $value ); } if ( $markup ) { $value = $this->markup_header( $header, $value, $translate ); } return $value; } Related Uses Uses Description WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069load_textdomain() wp-includes/class-wp-theme.php Loads the theme’s textdomain. WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069translate_header() wp-includes/class-wp-theme.php Translates a theme header. WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069markup_header() wp-includes/class-wp-theme.php Marks up a theme header. WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069get() wp-includes/class-wp-theme.php Gets a raw, unformatted theme header. Used By Used By Description WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069markup_header() wp-includes/class-wp-theme.php Marks up a theme header. WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069__toString() wp-includes/class-wp-theme.php When converting the object to a string, the theme name is returned. WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069__get() wp-includes/class-wp-theme.php __get() magic method for properties formerly returned by current_theme_info() WP_Them8b7c:f320:99b9:690f:4595:cd17:293a:c069offsetGet() wp-includes/class-wp-theme.php Changelog Version Description 3.4.0 Introduced.
1 Introduction The Mnesia application provides a heavy-duty real-time distributed database. 1.1 Scope This User's Guide describes how to build Mnesia-backed applications, and how to integrate and use the Mnesia database management system with OTP. Programming constructs are described, and numerous programming examples are included to illustrate the use of Mnesia. This User's Guide is organized as follows: Mnesia provides an introduction to Mnesia. Getting Started introduces Mnesia with an example database. Examples are included on how to start an Erlang session, specify a Mnesia database directory, initialize a database schema, start Mnesia, and create tables. Initial prototyping of record definitions is also discussed. Build a Mnesia Database more formally describes the steps introduced in the previous section, namely the Mnesia functions that define a database schema, start Mnesia, and create the required tables. Transactions and Other Access Contexts describes the transactions properties that make Mnesia into a fault-tolerant, real-time distributed database management system. This section also describes the concept of locking to ensure consistency in tables, and "dirty operations", or shortcuts, which bypass the transaction system to improve speed and reduce overheads. Miscellaneous Mnesia Features describes features that enable the construction of more complex database applications. These features include indexing, checkpoints, distribution and fault tolerance, disc-less nodes, replica manipulation, local content tables, concurrency, and object-based programming in Mnesia. Mnesia System Information describes the files contained in the Mnesia database directory, database configuration data, core and table dumps, as well as the functions used for backup, restore, fallback, and disaster recovery. Combine Mnesia with SNMP is a short section that outlines the integration between Mnesia and SNMP. Appendix A: Backup Callback Interface is a program listing of the default implementation of this facility. Appendix B: Activity Access Callback Interface is a program outlining one possible implementation of this facility. Appendix C: Fragmented Table Hashing Callback Interface is a program outlining one possible implementation of this facility. 1.2 Prerequisites It is assumed that the reader is familiar with the Erlang programming language, system development principles, and database management systems. Copyright © 1997-2022 Ericsson AB. All Rights Reserved.
Dockerize an ASP.NET Core application Introduction This example demonstrates how to dockerize an ASP.NET Core application. Why build ASP.NET Core? Open-source Develop and run your ASP.NET Core apps cross-platform on Windows, MacOS, and Linux Great for modern cloud-based apps, such as web apps, IoT apps, and mobile backends ASP.NET Core apps can run on .NET Core or on the full .NET Framework Designed to provide an optimized development framework for apps that are deployed to the cloud or run on-premises Modular components with minimal overhead retain flexibility while constructing your solutions Prerequisites This example assumes you already have an ASP.NET Core app on your machine. If you are new to ASP.NET you can follow a simple tutorial to initialize a project or clone our ASP.NET Docker Sample. Create a Dockerfile for an ASP.NET Core application Create a Dockerfile in your project folder. Add the text below to your Dockerfile for either Linux or Windows Containers. The tags below are multi-arch meaning they pull either Windows or Linux containers depending on what mode is set in Docker Desktop for Windows. Read more on switching containers. The Dockerfile assumes that your application is called aspnetapp. Change the Dockerfile to use the DLL file of your project. FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env WORKDIR /app # Copy csproj and restore as distinct layers COPY *.csproj ./ RUN dotnet restore # Copy everything else and build COPY . ./ RUN dotnet publish -c Release -o out # Build runtime image FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 WORKDIR /app COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "aspnetapp.dll"] To make your build context as small as possible add a .dockerignore file to your project folder and copy the following into it. bin\ obj\ Build and run the Docker image Open a command prompt and navigate to your project folder. Use the following commands to build and run your Docker image: $ docker build -t aspnetapp . $ docker run -d -p 8080:80 --name myapp aspnetapp View the web page running from a container Go to localhost:8080 to access your app in a web browser. If you are using the Nano Windows Container and have not updated to the Windows Creator Update there is a bug affecting how Windows 10 talks to Containers via “NAT” (Network Address Translation). You must hit the IP of the container directly. You can get the IP address of your container with the following steps: Run docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" myapp Copy the container IP address and paste into your browser. (For example, 718.936.5029) Further reading ASP.NET Core Microsoft ASP.NET Core on Docker Hub Building Docker Docker Images for ASP.NET Core Docker Tools for Visual Studio dockerize, dockerizing, dotnet, .NET, Core, article, example, platform, installation, containers, images, image, dockerfile, build, asp.net, asp.net core