The CLOS Specification describes the standard Programmer Interface for the Common Lisp Object System (CLOS). This document extends that specification by defining a metaobject protocol for CLOS---that is, a description of CLOS itself as an extensible CLOS program. In this description, the fundamental elements of CLOS programs (classes, slot definitions, generic functions, methods, specializers and method combinations) are represented by first-class objects. The behavior of CLOS is provided by these objects, or, more precisely, by methods specialized to the classes of these objects.
Because these objects represent pieces of CLOS programs, and because their behavior provides the behavior of the CLOS language itself, they are considered meta-level objects or metaobjects. The protocol followed by the metaobjects to provide the behavior of CLOS is called the CLOS Metaobject Protocol (MOP).
For each kind of program element there is a corresponding basic metaobject class. These are the classes: class, slot-definition, generic-function, method and method-combination. A metaobject class is a subclass of exactly one of these classes. The results are undefined if an attempt is made to define a class that is a subclass of more than one basic metaobject class. A metaobject is an instance of a metaobject class.
Each metaobject represents one program element. Associated with each metaobject is the information required to serve its role. This includes information that might be provided directly in a user interface macro such as defclass or defmethod. It also includes information computed indirectly from other metaobjects such as that computed from class inheritance or the full set of methods associated with a generic function.
Much of the information associated with a metaobject is in the form of connections to other metaobjects. This interconnection means that the role of a metaobject is always based on that of other metaobjects. As an introduction to this interconnected structure, this section presents a partial enumeration of the kinds of information associated with each kind of metaobject. More detailed information is presented later.
A class metaobject determines the structure and the default behavior of its instances. The following information is associated with class metaobjects:
A slot definition metaobject contains information about the definition of a slot. There are two kinds of slot definition metaobjects. A direct slot definition metaobject is used to represent the direct definition of a slot in a class. This corresponds roughly to the slot specifiers found in defclass forms. An effective slot definition metaobject is used to represent information, including inherited information, about a slot which is accessible in instances of a particular class.
Associated with each class metaobject is a list of direct slot definition metaobjects representing the slots defined directly in the class. Also associated with each class metaobject is a list of effective slot definition metaobjects representing the set of slots accessible in instances of that class.
The following information is associated with both direct and effective slot definitions metaobjects:
Certain other information is only associated with direct slot definition metaobjects. This information applies only to the direct definition of the slot in the class (it is not inherited).
Information, including inherited information, which applies to the definition of a slot in a particular class in which it is accessible is associated only with effective slot definition metaobjects.
A generic function metaobject contains information about a generic function over and above the information associated with each of the generic function's methods.
Terminology Note: There is some ambiguity in Common Lisp about the terms used to identify the various parts of declare special forms. In this document, the term declaration is used to refer to an object that could be an argument to a declare special form. For example, in the special form (declare (special *g1*)), the list (special *g1*) is a declaration.
A method metaobject contains information about a specific method.
A specializer metaobject represents the specializers of a method. Class metaobjects are themselves specializer metaobjects. A special kind of specializer metaobject is used for eql specializers.
A method combination metaobject represents the information about the method combination being used by a generic function.
Note: This document does not specify the structure of method combination metaobjects.
The inheritance structure of the specified metaobject classes is shown in the Table: MOP CLASSES.
| Metaobject Class | Direct Superclasses | |
|---|---|---|
| standard-object | (t) | |
| funcallable-standard-object | (standard-object function) | |
| * | metaobject | (standard-object) |
| * | generic-function | (metaobject funcallable-standard-object) |
| standard-generic-function | (generic-function) | |
| * | method | (metaobject) |
| standard-method | (method) | |
| * | standard-accessor-method | (standard-method) |
| standard-reader-method | (standard-accessor-method) | |
| standard-writer-method | (standard-accessor-method) | |
| * | method-combination | (metaobject) |
| * | slot-definition | (metaobject) |
| * | direct-slot-definition | (slot-definition) |
| * | effective-slot-definition | (slot-definition) |
| * | standard-slot-definition | (slot-definition) |
| standard-direct-slot-definition | (standard-slot-definition direct-slot-definition) | |
| standard-effective-slot-definition | (standard-slot-definition effective-slot-definition) | |
| * | specializer | (metaobject) |
| eql-specializer | (specializer) | |
| * | class | (specializer) |
| built-in-class | (class) | |
| forward-referenced-class | (class) | |
| standard-class | (class) | |
| funcallable-standard-class | (class) |
Each class marked with a ``*'' is an abstract class and is not intended to be instantiated. The results are undefined if an attempt is made to make an instance of one of these classes with make-instance.
The classes standard-class, standard-direct-slot-definition, standard-effective-slot-definition, standard-method, standard-reader-method, standard-writer-method and standard-generic-function are called standard metaobject classes. For each kind of metaobject, this is the class the user interface macros presented in the CLOS Specification use by default. These are also the classes on which user specializations are normally based.
The classes built-in-class, funcallable-standard-class and forward-referenced-class are special-purpose class metaobject classes. Built-in classes are instances of the class built-in-class. The class funcallable-standard-class provides a special kind of instances described in the section called ``Funcallable Instances.'' When the definition of a class references another class which has not yet been defined, an instance of forward-referenced-class is used as a stand-in until the class is actually defined.
The class standard-object is the default direct superclass of the class standard-class. When an instance of the class standard-class is created, and no direct superclasses are explicitly specified, it defaults to the class standard-object. In this way, any behavior associated with the class standard-object will be inherited, directly or indirectly, by all instances of the class standard-class. A subclass of standard-class may have a different class as its default direct superclass, but that class must be a subclass of the class standard-object.
The same is true for funcallable-standard-class and funcallable-standard-object.
The class specializer captures only the most basic behavior of method specializers, and is not itself intended to be instantiated. The class class is a direct subclass of specializer reflecting the property that classes by themselves can be used as method specializers. The class eql-specializer is used for eql specializers.
The purpose of the Metaobject Protocol is to provide users with a powerful mechanism for extending and customizing the basic behavior of the Common Lisp Object System. As an object-oriented description of the basic CLOS behavior, the Metaobject Protocol makes it possible to create these extensions by defining specialized subclasses of existing metaobject classes.
The Metaobject Protocol provides this capability without interfering with the implementor's ability to develop high-performance implementations. This balance between user extensibility and implementor freedom is mediated by placing explicit restrictions on each. Some of these restrictions are general---they apply to the entire class graph and the applicability of all methods. These are presented in this section.
The following additional terminology is used to present these restrictions:
Implementations are allowed latitude to modify the structure of specified classes and methods. This includes: the interposition of implementation-specific classes; the promotion of specified methods; and the consolidation of two or more specified methods into a single method specialized to interposed classes.
Any such modifications are permitted only so long as for any portable class Cp that is a subclass of one or more specified classes C0 ... Ci, the following conditions are met:
Portable programs are allowed to define subclasses of specified classes, and are permitted to define methods on specified generic functions, with the following restrictions. The results are undefined if any of these restrictions is violated.
An example of this is the specified methods on the generic functions add-dependent, remove-dependent and map-dependents. Overriding a specified method on one of these generic functions requires that the corresponding method on the other two generic functions be overridden as well.
Implementation Note: The purpose of this last restriction is to permit implementations to provide performance optimizations by analyzing, at the time the first instance of a metaobject class is initialized, what portable methods will be applicable to it. This can make it possible to optimize calls to those specified generic functions which would have no applicable portable methods.
Note: The specification technology used in this document needs further development. The concepts of object-oriented protocols and subclass specialization are intuitively familiar to programmers of object-oriented systems; the protocols presented here fit quite naturally into this framework. Nonetheless, in preparing this document, we have found it difficult to give specification-quality descriptions of the protocols in a way that makes it clear what extensions users can and cannot write. Object-oriented protocol specification is inherently about specifying leeway, and this seems difficult using current technology.
A list in which the first element is one of the symbols defclass, defmethod, defgeneric, or define-method-combination, and which has proper syntax for that macro is called a user interface macro form. This document provides an extended specification of the defclass, defmethod and defgeneric macros.
The user interface macros defclass, defgeneric and defmethod can be used not only to define metaobjects that are instances of the corresponding standard metaobject class, but also to define metaobjects that are instances of appropriate portable metaobject classes. To make it possible for portable metaobject classes to properly process the information appearing in the macro form, this document provides a limited specification of the processing of these macro forms.
User interface macro forms can be evaluated or compiled and later executed. The effect of evaluating or executing a user interface macro form is specified in terms of calls to specified functions and generic functions which provide the actual behavior of the macro. The arguments received by these functions and generic functions are derived in a specified way from the macro form.
Converting a user interface macro form into the arguments to the appropriate functions and generic functions has two major aspects: the conversion of the macro argument syntax into a form more suitable for later processing, and the processing of macro arguments which are forms to be evaluated (including method bodies).
In the syntax of the defclass macro, the initform and default-initarg-initial-value-form arguments are forms which will be evaluated one or more times after the macro form is evaluated or executed. Special processing must be done on these arguments to ensure that the lexical scope of the forms is captured properly. This is done by building a function of zero arguments which, when called, returns the result of evaluating the form in the proper lexical environment.
In the syntax of the defmethod macro the form* argument is a list of forms that comprise the body of the method definition. This list of forms must be processed specially to capture the lexical scope of the macro form. In addition, the lexical functions available only in the body of methods must be introduced. To allow this and any other special processing (such as slot access optimization), a specializable protocol is used for processing the body of methods. This is discussed in the section ``Processing Method Bodies.''
It is common practice for Common Lisp compilers, while processing a file or set of files, to maintain information about the definitions that have been compiled so far. Among other things, this makes it possible to ensure that a global macro definition (defmacro form) which appears in a file will affect uses of the macro later in that file. This information about the state of the compilation is called the compile-file environment.
When compiling files containing CLOS definitions, it is useful to maintain certain additional information in the compile-file environment. This can make it possible to issue various kinds of warnings (e.g., lambda list congruence) and to do various performance optimizations that would not otherwise be possible.
At this time, there is such significant variance in the way existing Common Lisp implementations handle compile-file environments that it would be premature to specify this mechanism. Consequently, this document specifies only the behavior of evaluating or executing user interface macro forms. What functions and generic functions are called during compile-file processing of a user interface macro form is not specified. Implementations are free to define and document their own behavior. Users may need to check implementation-specific behavior before attempting to compile certain portable programs.
(defclass plane (moving-object graphics-object) ((altitude :initform 0 :accessor plane-altitude) (speed)) (:default-initargs :engine *jet*)) |
(defclass sst (plane) ((mach mag-step 2 locator sst-mach locator mach-location :reader mach-speed :reader mach)) (:metaclass faster-class) (another-option foo bar)) |
The evaluation or execution of a defclass form results in a call to the ensure-class function. The arguments received by ensure-class are derived from the defclass form in a defined way. The exact macro-expansion of the defclass form is not defined, only the relationship between the arguments to the defclass macro and the arguments received by the ensure-class function. Examples of typical defclass forms and sample expansions are shown in Figure 1 and Figure 2.
Canonicalized slot specifications are later used as the keyword arguments to a generic function which will, in turn, pass them to make-instance for use as a set of initialization arguments. Each canonicalized slot specification is formed from the corresponding slot specification as follows:
If the :initform slot option is not present in the slot specification, then either the :initfunction property will not appear, or its value will be false. In such cases, the value of the :initform property, or whether it appears, is unspecified.
Returning to the correspondence between arguments to the defclass macro and the arguments received by the ensure-class function:
A canonicalized default initarg is a list of three elements. The first element is the name; the second is the actual form itself; and the third is a function of zero arguments which, when called, returns the result of evaluating the default value form in its proper lexical environment.
In the call to ensure-class, every element of its arguments appears in the same left-to-right order as the corresponding element of the defclass form, except that the order of the properties of canonicalized slot specifications is unspecified. The values of properties in canonicalized slot specifications do follow this ordering requirement. Other ordering relationships in the keyword arguments to ensure-class are unspecified.
The result of the call to ensure-class is returned as the result of evaluating or executing the defclass form.
The evaluation or execution of a defmethod form requires first that the body of the method be converted to a method function. This process is described in the next section. The result of this process is a method function and a set of additional initialization arguments to be used when creating the new method. Given these two values, the evaluation or execution of a defmethod form proceeds in three steps.
The first step ensures the existence of a generic function with the specified name. This is done by calling the function ensure-generic-function. The first argument in this call is the generic function name specified in the defmethod form.
The second step is the creation of the new method metaobject by calling make-instance. The class of the new method metaobject is determined by calling generic-function-method-class on the result of the call to ensure-generic-function from the first step.
The initialization arguments received by the call to make-instance are as follows:
In the third step, add-method is called to add the newly created method to the set of methods associated with the generic function metaobject.
The result of the call to add-method is returned as the result of evaluating or executing the defmethod form.
(defmethod move :before ((p position) (l (eql 0)) &optional (visiblyp t) &key color) (set-to-origin p) (when visiblyp (show-move p 0 color))) |
An example showing a typical defmethod form and a sample expansion is shown in Figure 3. The processing of the method body for this method is shown in Figure 4.
Before a method can be created, the list of forms comprising the method body must be converted to a method function. This conversion is a two step process.
Note: The body of methods can also appear in the :initial-methods option of defgeneric forms. Initial methods are not considered by any of the protocols specified in this document.
(let ((gf (ensure-generic-function 'move))) (make-method-lambda gf (class-prototype (generic-function-method-class gf)) '(lambda (p l &optional (visiblyp t) &key color) (set-to-origin p) (when visiblyp (show-move p 0 color))) environment)) |
The first step occurs during macro-expansion of the macro form. In this step, the method lambda list, declarations and body are converted to a lambda expression called a method lambda. This conversion is based on information associated with the generic function definition in effect at the time the macro form is expanded.
The generic function definition is obtained by calling ensure-generic-function with a first argument of the generic function name specified in the macro form. The :lambda-list keyword argument is not passed in this call.
Given the generic function, production of the method lambda proceeds by calling make-method-lambda. The first argument in this call is the generic function obtained as described above. The second argument is the result of calling class-prototype on the result of calling generic-function-method-class on the generic function. The third argument is a lambda expression formed from the method lambda list, declarations and body. The fourth argument is the macro-expansion environment of the macro form; this is the value of the &environment argument to the defmethod macro.
The generic function make-method-lambda returns two values. The first is the method lambda itself. The second is a list of initialization arguments and values. These are included in the initialization arguments when the method is created.
In the second step, the method lambda is converted to a function which properly captures the lexical scope of the macro form. This is done by having the method lambda appear in the macro-expansion as the argument of the function special form. During the subsequent evaluation of the macro-expansion, the result of the function special form is the method function.
The evaluation or execution of a defgeneric form results in a call to the ensure-generic-function function. The arguments received by ensure-generic-function are derived from the defgeneric form in a defined way. As with defclass and defmethod, the exact macro-expansion of the defgeneric form is not defined, only the relationship between the arguments to the macro and the arguments received by ensure-generic-function.
The result of the call to ensure-generic-function is returned as the result of evaluating or executing the defgeneric form.
This section provides an overview of the Metaobject Protocols. The detailed behavior of each function, generic function and macro in the Metaobject Protocol is presented in the Generic Functions and Methods Dictionary. The remainder of this chapter is intended to emphasize connections among the parts of the Metaobject Protocol, and to provide some examples of the kinds of specializations and extensions the protocols are designed to support.
Like other objects, metaobjects can be created by calling make-instance. The initialization arguments passed to make-instance are used to initialize the metaobject in the usual way. The set of legal initialization arguments, and their interpretation, depends on the kind of metaobject being created. Implementations and portable programs are free to extend the set of legal initialization arguments. Detailed information about the initialization of each kind of metaobject are provided in Generic Functions and Methods Dictionary; this section provides an overview and examples of this behavior.
Class metaobjects created with make-instance are usually anonymous; that is, they have no proper name. An anonymous class metaobject can be given a proper name using setf find-class and setf class-name.
When a class metaobject is created with make-instance, it is initialized in the usual way. The initialization arguments passed to make-instance are use to establish the definition of the class. Each initialization argument is checked for errors and associated with the class metaobject. The initialization arguments correspond roughly to the arguments accepted by the defclass macro, and more closely to the arguments accepted by the ensure-class function.
Some class metaobject classes allow their instances to be redefined. When permissible, this is done by calling reinitialize-instance. This is discussed in the next section.
An example of creating an anonymous class directly using make-instance follows:
(flet ((zero () 0) (propellor () *propellor*)) (make-instance 'standard-class :name '(my-class foo) :direct-superclasses (list (find-class 'plane) another-anonymous-class) :direct-slots `((:name x :initform 0 :initfunction ,#'zero :initargs (:x) :readers (position-x) :writers ((setf position-x))) (:name y :initform 0 :initfunction ,#'zero :initargs (:y) :readers (position-y) :writers ((setf position-y)))) :direct-default-initargs `((:engine *propellor* ,#'propellor))))
Some class metaobject classes allow their instances to be reinitialized. This is done by calling reinitialize-instance. The initialization arguments have the same interpretation as in class initialization.
If the class metaobject was finalized before the call to reinitialize-instance, finalize-inheritance will be called again once all the initialization arguments have been processed and associated with the class metaobject. In addition, once finalization is complete, any dependents of the class metaobject will be updated by calling update-dependent.
An example of creating a generic function and a method metaobject, and then adding the method to the generic function is shown below. This example is comparable to the method definition shown in Figure 3.
(let* ((gf (make-instance 'standard-generic-function :lambda-list '(p l &optional visiblyp &key))) (method-class (generic-function-method-class gf))) (multiple-value-bind (lambda initargs) (make-method-lambda gf (class-prototype method-class) '(lambda (p l &optional (visiblyp t) &key color) (set-to-origin p) (when visiblyp (show-move p 0 color))) nil) (add-method gf (apply #'make-instance method-class :function (compile nil lambda) :specializers (list (find-class 'position) (intern-eql-specializer 0)) :qualifiers () :lambda-list '(p l &optional (visiblyp t) &key color) initargs))))
Class finalization is the process of computing the information a class inherits from its superclasses and preparing to actually allocate instances of the class. The class finalization process includes computing the class's class precedence list, the full set of slots accessible in instances of the class and the full set of default initialization arguments for the class. These values are associated with the class metaobject and can be accessed by calling the appropriate reader. In addition, the class finalization process makes decisions about how instances of the class will be implemented.
To support forward-referenced superclasses, and to account for the fact that not all classes are actually instantiated, class finalization is not done as part of the initialization of the class metaobject. Instead, finalization is done as a separate protocol, invoked by calling the generic function finalize-inheritance. The exact point at which finalize-inheritance is called depends on the class of the class metaobject; for standard-class it is called sometime after all the classes superclasses are defined, but no later than when the first instance of the class is allocated (by allocate-instance).
The first step of class finalization is computing the class precedence list. Doing this first allows subsequent steps to access the class precedence list. This step is performed by calling the generic function compute-class-precedence-list. The value returned from this call is associated with the class metaobject and can be accessed by calling the class-precedence-list generic function.
The second step is computing the full set of slots that will be accessible in instances of the class. This step is performed by calling the generic function compute-slots. The result of this call is a list of effective slot definition metaobjects. This value is associated with the class metaobject and can be accessed by calling the class-slots generic function.
The behavior of compute-slots is itself layered, consisting of calls to effective-slot-definition-class and compute-effective-slot-definition.
The final step of class finalization is computing the full set of initialization arguments for the class. This is done by calling the generic function compute-default-initargs. The value returned by this generic function is associated with the class metaobject and can be accessed by calling class-default-initargs.
If the class was previously finalized, finalize-inheritance may call make-instances-obsolete. The circumstances under which this happens are describe in the section of the CLOS specification called ``Redefining Classes.''
Forward-referenced classes, which provide a temporary definition for a class which has been referenced but not yet defined, can never be finalized. An error is signalled if finalize-inheritance is called on a forward-referenced class.
The instance structure protocol is responsible for implementing the behavior of the slot access functions like slot-value and (setf slot-value).
For each CLOS slot access function other than slot-exists-p, there is a corresponding generic function which actually provides the behavior of the function. When called, the slot access function finds the pertinent effective slot definition metaobject, calls the corresponding generic function and returns its result. The arguments passed on to the generic function include one additional value, the class of the object argument, which always immediately precedes the object argument
The correspondences between slot access function and underlying slot access generic function are as follows:
| Slot Access Function | Corresponding Slot Access Generic Function |
|---|---|
| slot-boundp | slot-boundp-using-class |
| slot-makunbound | slot-makunbound-using-class |
| slot-value | slot-value-using-class |
| (setf slot-value) | (setf slot-value-using-class) |
At the lowest level, the instance structure protocol provides only limited mechanisms for portable programs to control the implementation of instances and to directly access the storage associated with instances without going through the indirection of slot access. This is done to allow portable programs to perform certain commonly requested slot access optimizations.
In particular, portable programs can control the implementation of, and obtain direct access to, slots with allocation :instance and type t. These are called directly accessible slots.
The relevant specified around-method on compute-slots determines the implementation of instances by deciding how each slot in the instance will be stored. For each directly accessible slot, this method allocates a location and associates it with the effective slot definition metaobject. The location can be accessed by calling the slot-definition-location generic function. Locations are non-negative integers. For a given class, the locations increase consecutively, in the order that the directly accessible slots appear in the list of effective slots. (Note that here, the next paragraph, and the specification of this around-method are the only places where the value returned by compute-slots is described as a list rather than a set.)
Given the location of a directly accessible slot, the value of that slot in an instance can be accessed with the appropriate accessor. For standard-class, this accessor is the function standard-instance-access. For funcallable-standard-class, this accessor is the function funcallable-standard-instance-access. In each case, the arguments to the accessor are the instance and the slot location, in that order. See the definition of each accessor in Chapter for additional restrictions on the use of these function.
Portable programs are permitted to affect and rely on the allocation of locations only in the following limited way: By first defining a portable primary method on compute-slots which orders the returned value in a predictable way, and then relying on the defined behavior of the specified around-method to assign locations to all directly accessible slots. Portable programs may compile-in calls to low-level accessors which take advantage of the resulting predictable allocation of slot locations.
The following example shows the use of this mechanism to implement a new class metaobject class, ordered-class and class option :slot-order. This option provides control over the allocation of slot locations. In this simple example implementation, the :slot-order option is not inherited by subclasses; it controls only instances of the class itself.
(defclass ordered-class (standard-class) ((slot-order :initform () :initarg :slot-order :reader class-slot-order)))(defmethod compute-slots ((class ordered-class)) (let ((order (class-slot-order class))) (sort (copy-list (call-next-method)) #'(lambda (a b) (< (position (slot-definition-name a) order) (position (slot-definition-name b) order))))))
Following is the source code the user of this extension would write. Note that because the code above doesn't implement inheritance of the :slot-order option, the function distance must not be called on instances of subclasses of point; it can only be called on instances of point itself.
(defclass point () ((x :initform 0) (y :initform 0)) (:metaclass ordered-class) (:slot-order x y))(defun distance (point) (sqrt (/ (+ (expt (standard-instance-access point 0) 2) (expt (standard-instance-access point 1) 2)) 2.0)))
In more realistic uses of this mechanism, the calls to the low-level instance structure accessors would not actually appear textually in the source program, but rather would be generated by a meta-level analysis program run during the process of compiling the source program.
Instances of classes which are themselves instances of funcallable-standard-class or one of its subclasses are called funcallable instances. Funcallable instances can only be created by allocate-instance (funcallable-standard-class).
Like standard instances, funcallable instances have slots with the normal behavior. They differ from standard instances in that they can be used as functions as well; that is, they can be passed to funcall and apply, and they can be stored as the definition of a function name. Associated with each funcallable instance is the function which it runs when it is called. This function can be changed with set-funcallable-instance-function.
The following simple example shows the use of funcallable instances to create a simple, defstruct-like facility. (Funcallable instances are useful when a program needs to construct and maintain a set of functions and information about those functions. They make it possible to maintain both as the same object rather than two separate objects linked, for example, by hash tables.)
(defclass constructor () ((name :initarg :name :accessor constructor-name) (fields :initarg :fields :accessor constructor-fields)) (:metaclass funcallable-standard-class))(defmethod initialize-instance :after ((c constructor) &key) (with-slots (name fields) c (set-funcallable-instance-function c #'(lambda () (let ((new (make-array (1+ (length fields))))) (setf (aref new 0) name) new)))))
(setq c1 (make-instance 'constructor :name 'position :fields '(x y))) #<CONSTRUCTOR 262437>
(setq p1 (funcall c1)) #<ARRAY 3 263674>
Associated with each generic function is its discriminating function. Each time the generic function is called, the discriminating function is called to provide the behavior of the generic function. The discriminating function receives the full set of arguments received by the generic function. It must lookup and execute the appropriate methods, and return the appropriate values.
The discriminating function is computed by the highest layer of the generic function invocation protocol, compute-discriminating-function. Whenever a generic function metaobject is initialized, reinitialized, or a method is added or removed, the discriminating function is recomputed. The new discriminating function is then stored with set-funcallable-instance-function.
Discriminating functions call compute-applicable-methods and compute-applicable-methods-using-classes to compute the methods applicable to the generic functions arguments. Applicable methods are combined by compute-effective-method to produce an effective method. Provisions are made to allow memoization of the method applicability and effective methods computations. (See the description of compute-discriminating-function for details.)
The body of method definitions are processed by make-method-lambda. The result of this generic function is a lambda expression which is processed by either compile or the file compiler to produce a method function. The arguments received by the method function are controlled by the call-method forms appearing in the effective methods. By default, method functions accept two arguments: a list of arguments to the generic function, and a list of next methods. The list of next methods corresponds to the next methods argument to call-method. If call-method appears with additional arguments, these will be passed to the method functions as well; in these cases, make-method-lambda must have created the method lambdas to expect additional arguments.
It is convenient for portable metaobjects to be able to memoize information about other metaobjects, portable or otherwise. Because class and generic function metaobjects can be reinitialized, and generic function metaobjects can be modified by adding and removing methods, a means must be provided to update this memoized information.
The dependent maintenance protocol supports this by providing a way to register an object which should be notified whenever a class or generic function is modified. An object which has been registered this way is called a dependent of the class or generic function metaobject. The dependents of class and generic function metaobjects are maintained with add-dependent and remove-dependent. The dependents of a class or generic function metaobject can be accessed with map-dependents. Dependents are notified about a modification by calling update-dependent. (See the specification of update-dependent for detailed description of the circumstances under which it is called.)
To prevent conflicts between two portable programs, or between portable programs and the implementation, portable code must not register metaobjects themselves as dependents. Instead, portable programs which need to record a metaobject as a dependent, should encapsulate that metaobject in some other kind of object, and record that object as the dependent. The results are undefined if this restriction is violated.
This example shows a general facility for encapsulating metaobjects before recording them as dependents. The facility defines a basic kind of encapsulating object: an updater. Specializations of the basic class can be defined with appropriate special updating behavior. In this way, information about the updating required is associated with each updater rather than with the metaobject being updated.
Updaters are used to encapsulate any metaobject which requires updating when a given class or generic function is modified. The function record-updater is called to both create an updater and add it to the dependents of the class or generic function. Methods on the generic function update-dependent, specialized to the specific class of updater do the appropriate update work.
(defclass updater () ((dependent :initarg :dependent :reader dependent)))(defun record-updater (class dependee dependent &rest initargs) (let ((updater (apply #'make-instance class :dependent dependent initargs))) (add-dependent dependee updater) updater))
A flush-cache-updater simply flushes the cache of the dependent when it is updated.
(defclass flush-cache-updater (updater) ())(defmethod update-dependent (dependee (updater flush-cache-updater) &rest args) (declare (ignore args)) (flush-cache (dependent updater)))


Maestro Nikola:
Don't you think that it's too soon for you to join us?
(Only characters level 40 and above are permitted to undertake this quest.)


Font used: Roboto Condensed Icon made by Freepik from www.flaticon.com Libraries used: jQuery, Bootstrap, Popper.js, Google Charts


BathySnippet0 (Class)
Namespace: stdlibXtf.SubPackets
Represent the header part of the bathy data attached to a PingHeader packet.
Constructors
| BathySnippet0() | Initializes a new instance of the BathySnippet0 class that has default zero values. |
| BathySnippet0(Byte[]) | Initializes a new instance of the BathySnippet0 class that contain the values extracted from the given byte array. The size of array need to be at least of 74 bytes. |
Properties
| HeaderSize | Gets the size, in bytes, of this header packet. |
| DataSize | Gets the size, in bytes, of the following data packets. |
| PingNumber | Gets the sequential number of the ping. |
| Seconds | Gets the time, in seconds, since 00:00:00 of 1st January 1970. |
| Milliseconds | Gets the milliseconds part of the time. |
| Latency | Gets the time from ping to output in milliseconds. |
| SonarId1 | Gets the least significant four bytes of ethernet address. |
| SonarId2 | Gets the least significant four bytes of ethernet address. |
| SonarModel | Gets the coded model number of sonar. |
| Frequency | Gets the sonar frequency in kHz. |
| SoundSpeed | Gets the programmed sound velocity in m/s |
| SampleRate | Gets the samples per seconds. |
| PingRate | Gets the pings per second, 0.001 Hz steps. |
| Range | Gets the range setting in meters. |
| Power | Gets the power setting. |
| Gain | Gets the gain settings (b15 = auto, b14 = TVG, b6..0 = gain). |
| PulseWidth | Gets the transmit pulse width in microseconds. |
| Spread | Gets the TVG spreading, n*log(R), 0.25dB steps. |
| Absorb | Gets the TVG absorption, dB/km, 1dB steps. |
| ProjectorType | Gets the type of projector (b7 = steering, b4..0 = projector type). |
| ProjectorWidth | Gets the transmit beam width along track, 0.1 degrees steps. |
| SpacingNumerator | Gets the receiver beam spacing, numerator part in degrees. |
| SpacingDenominator | Gets the receiver beam spacing, denominator part in degrees. |
| ProjectorAngle | Gets the projector steering, degrees * Pkt_Steer_Res. |
| MinRange | Gets the range filter settings. |
| MaxRange | Gets the range filter settings. |
| MinDepth | Gets the depth filter settings. |
| MaxDepth | Gets the depth filter settings. |
| Filters | Gets the enabled filters (b1=depth, b0=range). |
| Flags | Gets the settings flags (b0..11=spare, b12..14=snip mode, b15=roll stab, b0=roll stab enabled). |
| HeadTemp | Gets the head temperature, 0.1 celsius steps. |
| BeamCount | Gets the number of beams. |
Examples
example ...
Remarks
remarks ...


public abstract class Ghost extends MovableActor
| Modifier and Type | Field and Description |
|---|---|
protected Location |
oldLocation
The previous cell
|
protected static int |
SCARE_TIME
Time amout of "acts" the Ghost is scared for.
|
protected static int |
scaredTimer
The current timer for the Ghost being scared.
|
| Constructor and Description |
|---|
Ghost(java.awt.Color color)
Creates a new Ghost, sets color to color.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canMove(Location next)
A Ghost can move anywhere except if the next location has a wall or
another Ghost.
|
(package private) abstract void |
clearPath() |
protected void |
clearPath(java.util.ArrayList<Point> path)
Created to protect existing calls
|
protected void |
clearPath(java.util.ArrayList<Point> path,
BoundedGrid grid)
Helper Method to clear the path of a Ghost when it is disrupted (like when pacman hides).
|
static void |
clearScaredTimer()
Clears the timer, sets it to -1.
|
static void |
decScaredTimer()
Decrements the timer
|
static int |
getScaredTimer()
Returjs timer
|
static boolean |
isScared()
A Ghost is scared if its scared timer timer is greater than 0.
|
void |
moveTo(Location newLocation)
Moves the Ghost to the the new Location by
1) deleting this Ghost
2) If the new Location hold no Actor, creates a new Ghost there
2) If there is a pellet in the new Location, deletes the pellet and
puts a pellet in this location
3) Put a new Ghost in the new Location
|
static void |
scare()
Scares the Ghost, restarts its scared timer/
|
protected void |
visualizePath(java.util.ArrayList<Point> path)
Created to protect existing calls
|
protected void |
visualizePath(java.util.ArrayList<Point> path,
BoundedGrid grid)
Helper Method to visualize the path of a Ghost.
|
canMove, getDirection, move, setDirection
act, getColor, getGrid, getLocation, putSelfInGrid, removeSelfFromGrid, setColor, toString
protected static final int SCARE_TIME
protected static int scaredTimer
protected Location oldLocation
public Ghost(java.awt.Color color)
color
- The Color for Ghost.public static boolean isScared()
public static void scare()
public void moveTo(Location newLocation)
moveTo
in class MovableActor
newLocation
- the new locationpublic boolean canMove(Location next)
next
- The next Locationprotected void visualizePath(java.util.ArrayList<Point> path, BoundedGrid grid)
path
- The path of the Ghost, in points.protected void clearPath(java.util.ArrayList<Point> path)
path
- Path of pointsprotected void clearPath(java.util.ArrayList<Point> path, BoundedGrid grid)
path
- The path of the Ghost, in points.protected void visualizePath(java.util.ArrayList<Point> path)
path
- Path of pointsabstract void clearPath()
public static int getScaredTimer()
public static void decScaredTimer()
public static void clearScaredTimer()


| DECIPHER::ArtOfAlignmentInR | The Art of Multiple Sequence Alignment in R | source | R code | ||
| DECIPHER::ClassifySequences | Classify Sequences | source | R code | ||
| DECIPHER::DECIPHERing | Getting Started DECIPHERing | source | R code | ||
| DECIPHER::DesignMicroarray | Design Microarray Probes | source | R code | ||
| DECIPHER::DesignPrimers | Design Group-Specific Primers | source | R code | ||
| DECIPHER::DesignProbes | Design Group-Specific FISH Probes | source | R code | ||
| DECIPHER::DesignSignatures | Design Primers That Yield Group-Specific Signatures | source | R code | ||
| DECIPHER::FindChimeras | Finding Chimeric Sequences | source | R code | ||
| DECIPHER::FindingGenes | The Magic of Gene Finding | source | R code |


| PWG New Orleans Meeting Details |
IEEE 1284.4 : April 12
1394 Printing : April 13
PWG Plenary : April 14 (8:30 AM - 10:00 AM)
IPP : April 14 (10:30 AM - 5:30 PM), April 15
UPDF : April 16
| Meeting Location: Bourbon Orleans Hotel Bourbon and Orleans Streets New Orleans, LA 70116 Phone: 1-800-521-5338 |
The hotel rate is $159/std, $199/Suite per night.
Ask for the PWG, Printer Working Group or Warp Nine rate at this hotels.
Deadline for reservations is March 19, 1999
All attendees are responsible for making their own hotel reservations.
There will be a meeting charge in the range of $30 - $40; participants are responsible for their own lunch.
YOU MUST RSVP TO Larry Stein WITH THE FOLLOWING INFORMATION:


Models which are combinations of other models are called an ensemble. The simplest way to combine several classifiers is by averaging their predictions.
For example, if you have three models and four classes, you might get predictions like this:
model 1(x1) = [0.1, 0.5, 0.3, 0.1],
model 2(x1) = [0.5, 0.3, 0.1, 0.1],
model 3(x1) = [0.4, 0.4, 0.1, 0.1]
the ensemble predicts
for \(x_1\).
Note that this is different from pluarlity voting (PV) where every model gives only one vote for the most likely class. In the case from above, it would be
model 1(x1) = [0, 1, 0, 0],
model 2(x1) = [1, 0, 0, 0],
model 3(x1) = [1, 0, 0, 0] # tie - lets just take the first
So the plurality voting ensemble would predict class 1, whereas the average probability ensemble predicts class 2. This comes from the fact that everybody might have different first choices, but they might agree on the second choice.
Please note that a tie in the predictions of a classifier with less than 100 classes is unlikely due to the higher precision of floating point numbers. However, a tie in votes can happen.
According to Andrej Karpathy, this gives you about +2 percentage points in accuracy.
Tiny Experiment on CIFAR 100
I've just tried this with three (almost identical) models for CIFAR 100. All of them were trained with Adam with the same training data (the same batches). Model 1 and model 3 only differed in the second-last layer (one uses ReLU, the other tanh), model 1 and model 2 only differed in the border mode for one convolutional layer (valid vs same).
The accuracies of the single models were:
model 1: 57.02
model 2: 61.85
model 3: 48.59
The ensemble accuracy is 62.98%. Hence the ensemble is 1.13 percentage points better than the best single model!
Although I have read things like this before, it is the first time I actually tried it myself.
Ensemble Techniques
There are much more sophisticated ensemble techniques than simple averaging of the output:
- Bagging
- How does it work? Train models on different data
(Learnier is fit, results are mean/median aggregated)
Why is it used? Reduction of variance
Common techniques:- Random subspaces: Take a part of the features (e.g. Random Forests)
- Pasting: Take a part of the training data without replacement
- Boosting
- How does it work? Train one classifier.
Obtain the results. Weight the training data higher if the classifier got
it wrong. Train a new classifier on the weighted training data. Iterate.
Why is it used? Reduction of bias Examples: AdaBoost, Gradient boosting - Stacking
- How does it work? Train $n$ classifiers on the data. Train
a classifier on the predictions of the $n$ classifiers.
Why is it used? Reduction of bias and reduction of variance
I made some images to make this more clear:
Combiners
Some choices for combiners are:
- Average of predictions of base classifiers
- Plurality vote (sometimes also called majority vote)
- Learning
- Naive Bayes
- Neural Network
See also
- sklearn ensemble user guide
- Scholarpedia
- MIT 6.034 Artificial Intelligence: 17. Learning: Boosting


utils.blocks¶
Block generation utility module for pre-defined block payloads
-
slack_blockkit.utils.blocks.
get_checkmark
(task_completed: bool) → str¶ Returns a check mark emoji indicating the completed task status. If the task is complete, then a white check mark is returned. If not, an empty white square is.
- Parameters
task_completed (bool) – Whether or not the task was complete.
- Returns
A checkmark emoji string based on whether or not the task was completed.
- Return type
str
-
slack_blockkit.utils.blocks.
get_information_block
(link: str, text: str) → dict¶ Returns an information block, which is a section with an info icon followed by linked text.
- Parameters
link (str) – The link the block redirects the user to.
text (str) – The link text.
- Returns
A dict in the format of a context block.
- Return type
dict
-
slack_blockkit.utils.blocks.
get_task_block
(text: str, info_link: str, info_text: str) → list¶ Returns a task block, which is comprised of a paragraph of text followed by an information link at the bottom.
- Parameters
text (str) – Markdown-supported text to display in the paragraph.
info_link (str) – The link associated with the task block.
info_text (str) – The link text.
- Returns
An array of blocks formatted for a block payload.
- Return type
list
-
slack_blockkit.utils.blocks.
get_text_block_with_accessory
(text_object: slack_blockkit.composition_object.TextObject, accessory: slack_blockkit.block_element.BlockElement) → dict¶ Returns a text block with an accessory.
- Parameters
text_object (TextObject) – The text block object.
accessory (LayoutBlock) – The accessory object.
- Returns
The text block with an accessory layout block.
- Return type
dict
-
slack_blockkit.utils.blocks.
get_text_block_with_image
(text: str, image_url: str, alt_text: str) → dict¶ Returns a text block with an image to the right of it.
- Parameters
text (str) – The text in the text block.
image_url (str) – The URL to the image.
alt_text (str) – Alternate text (appears on image hover).
- Returns
The block as a dict.
- Return type
dict


Try out our Premium Member services: Virtual Legal Assistant, Query Alert Service and an ad-free experience. Free for one month and pay only if you like it.
IN THE HIGH COURT OF PUNJAB AND HARYANA AT CHANDIGARH -.- C.W.P. No. 15434 of 2015 Date of Decision:-13.08.2015 M/s Rama Stone Crushing Udyog Samiti ..... Petitioner Versus State of Punjab & Ors. .....Respondents
CORAM :- HON'BLE MR. JUSTICE SATISH KUMAR MITTAL.
HON'BLE MR. JUSTICE MAHAVIR S. CHAUHAN.
Present:- Mr. M.S.Virdi, Advocate, for the petitioner.
Mr. Gourav Garg Dhuriwala, DAG, Punjab.
Ms. Savita Tanwar, Advocate, for respondents No. 1, 3 and 4. SATISH KUMAR MITTAL, J.(Oral) In this writ petition, the petitioner is also seeking stay of implementation of notice dated 15.06.2015 (Annexure P/8), whereby Punjab Pollution Control Board, Amritsar has issued certain directions under Section 33-A of Water (Prevention & Control of Pollution) Act, 1974.
Written statement on behalf of respondents No. 1, 3 and 4 has been filed. The same is taken on record.
In view of the fact that against the impugned order dated 15.06.2015 (Annexure P/8), remedy of appeal has been provided under Section 33B (c) of the Water (Prevention and Control of Pollution) Act, 1974, learned counsel prays that the petitioner may be permitted to withdraw this petition with liberty to avail the aforesaid remedy.
Dismissed as withdrawn with the aforesaid liberty.
( SATISH KUMAR MITTAL) JUDGE (MAHAVIR S.CHAUHAN) August 13, 2015 JUDGE tripti TRIPTI SAINI 2015.08.18 10:31 I attest to the accuracy and integrity of this document


Interface IMouseEvent
The IMouseEvent interface provides specific contextual information associated with Mouse events.
Inherited Members
Namespace: SharpVectors.Dom.Events
Assembly: SharpVectors.Core.dll
Syntax
public interface IMouseEvent : IUiEvent, IEvent
Remarks
In the case of nested elements mouse events are always targeted at the most deeply nested element. Ancestors of the targeted element may use bubbling to obtain notification of mouse events which occur within its descendent elements.
Note: To create an instance of the MouseEvent interface, use the feature string "MouseEvent" as the value of the input parameter used with the DocumentEvent.createEvent method.
Properties
AltGraphKey
true
if the alt-graph (Alt Gr) key modifier is activated.
Declaration
bool AltGraphKey { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Remarks
Note: Some operating systems simulate the alt-graph key modifier with the combinaison of alt and ctrl key modifiers. Implementations are encouraged to use this modifier instead.
AltKey
true
if the alt (alternative) key modifier is activated.
Declaration
bool AltKey { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Button
During mouse events caused by the depression or release of a mouse button, button is used to indicate which mouse button changed state.
Declaration
ushort Button { get; }
Property Value
| Type | Description |
|---|---|
| UInt16 |
Remarks
0
indicates the normal (in general on the left or
the one button on Macintosh mice, used to activate a button or
select text) button of the mouse. 2
indicates the contextual
property (in general on the right, used to display a context menu)
button of the mouse if present. 1
indicates the extra (in
general in the middle and often combined with the mouse wheel)
button. Some mice may provide or simulate more buttons and values
higher than 2
could be used to represent such buttons.
ClientX
The horizontal coordinate at which the event occurred relative to the DOM implementation's client area.
Declaration
long ClientX { get; }
Property Value
| Type | Description |
|---|---|
| Int64 |
ClientY
The vertical coordinate at which the event occurred relative to the DOM implementation's client area.
Declaration
long ClientY { get; }
Property Value
| Type | Description |
|---|---|
| Int64 |
CtrlKey
true
if the control (Ctrl) key modifier is activated.
Declaration
bool CtrlKey { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
MetaKey
true
if the meta (Meta) key modifier is activated.
Declaration
bool MetaKey { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Remarks
Note: The Command key modifier on Macintosh system must be represented using this key modifier.
RelatedTarget
Used to identify a secondary EventTarget related to a UI event.
Declaration
IEventTarget RelatedTarget { get; }
Property Value
| Type | Description |
|---|---|
| IEventTarget |
Remarks
Currently this attribute is used with the mouseover event to indicate the IEventTarget which the pointing device exited and with the mouseout event to indicate the IEventTarget which the pointing device entered.
ScreenX
The horizontal coordinate at which the event occurred relative to the origin of the screen coordinate system.
Declaration
long ScreenX { get; }
Property Value
| Type | Description |
|---|---|
| Int64 |
ScreenY
The vertical coordinate at which the event occurred relative to the origin of the screen coordinate system.
Declaration
long ScreenY { get; }
Property Value
| Type | Description |
|---|---|
| Int64 |
ShiftKey
true
if the shift (Shift) key modifier is activated.
Declaration
bool ShiftKey { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Methods
InitMouseEvent(String, Boolean, Boolean, IAbstractView, Int64, Int64, Int64, Int64, Int64, Boolean, Boolean, Boolean, Boolean, UInt16, IEventTarget)
The InitMouseEvent method is used to initialize the value of a MouseEvent created using the IDocumentEvent.CreateEvent method.
Declaration
void InitMouseEvent(string typeArg, bool canBubbleArg, bool cancelableArg, IAbstractView viewArg, long detailArg, long screenXArg, long screenYArg, long clientXArg, long clientYArg, bool ctrlKeyArg, bool altKeyArg, bool shiftKeyArg, bool metaKeyArg, ushort buttonArg, IEventTarget relatedTargetArg)
Parameters
| Type | Name | Description |
|---|---|---|
| String | typeArg | Specifies the event type. |
| Boolean | canBubbleArg | Specifies whether or not the event can bubble. |
| Boolean | cancelableArg | Specifies whether or not the event's default action can be prevented. |
| IAbstractView | viewArg | Specifies the IEvent's view. |
| Int64 | detailArg | Specifies the IEvent's mouse click count. |
| Int64 | screenXArg | Specifies the IEvent's screen x coordinate. |
| Int64 | screenYArg | Specifies the IEvent's screen y coordinate. |
| Int64 | clientXArg | Specifies the IEvent's client x coordinate. |
| Int64 | clientYArg | Specifies the IEvent's client y coordinate. |
| Boolean | ctrlKeyArg | Specifies whether or not control key was depressed during the IEvent. |
| Boolean | altKeyArg | Specifies whether or not alt key was depressed during the IEvent. |
| Boolean | shiftKeyArg | Specifies whether or not shift key was depressed during the IEvent. |
| Boolean | metaKeyArg | Specifies whether or not meta key was depressed during the IEvent. |
| UInt16 | buttonArg | Specifies the IEvent's mouse button. |
| IEventTarget | relatedTargetArg | Specifies the IEvent's related IEventTarget. |
Remarks
This method may only be called before the IMouseEvent has been dispatched via the IEventTarget.DispatchEvent method, though it may be called multiple times before being dispatched. If called multiple times, the final invocation takes precedence.
InitMouseEventNs(String, String, Boolean, Boolean, IAbstractView, Int64, Int64, Int64, Int64, Int64, Boolean, Boolean, Boolean, Boolean, UInt16, IEventTarget, Boolean)
The InitMouseEventNs method is used to initialize the value of a IMouseEvent created using the IDocumentEvent.CreateEvent interface.
Declaration
void InitMouseEventNs(string namespaceUri, string typeArg, bool canBubbleArg, bool cancelableArg, IAbstractView viewArg, long detailArg, long screenXArg, long screenYArg, long clientXArg, long clientYArg, bool ctrlKeyArg, bool altKeyArg, bool shiftKeyArg, bool metaKeyArg, ushort buttonArg, IEventTarget relatedTargetArg, bool altGraphKeyArg)
Parameters
| Type | Name | Description |
|---|---|---|
| String | namespaceUri | Specifies the namespace URI associated with this event, or null if the application wish to have no namespace. |
| String | typeArg | Specifies the event type. |
| Boolean | canBubbleArg | Specifies whether or not the event can bubble. |
| Boolean | cancelableArg | Specifies whether or not the event's default action can be prevented. |
| IAbstractView | viewArg | Specifies the IEvent's AbstractView. |
| Int64 | detailArg | Specifies the IEvent's mouse click count. |
| Int64 | screenXArg | Specifies the IEvent's screen x coordinate. |
| Int64 | screenYArg | Specifies the IEvent's screen y coordinate. |
| Int64 | clientXArg | Specifies the IEvent's client x coordinate. |
| Int64 | clientYArg | Specifies the IEvent's client y coordinate. |
| Boolean | ctrlKeyArg | Specifies whether or not control key was depressed during the IEvent. |
| Boolean | altKeyArg | Specifies whether or not alt key was depressed during the IEvent. |
| Boolean | shiftKeyArg | Specifies whether or not shift key was depressed during the IEvent. |
| Boolean | metaKeyArg | Specifies whether or not meta key was depressed during the Event. |
| UInt16 | buttonArg | Specifies the IEvent's mouse button. |
| IEventTarget | relatedTargetArg | Specifies the IEvent's related IEventTarget. |
| Boolean | altGraphKeyArg | Specifies whether or not alt graph key was depressed during the IEvent. |
Remarks
This method may only be called before the IMouseEvent has been dispatched via the IEventTarget.DispatchEvent method, though it may be called multiple times during that phase if necessary. If called multiple times, the final invocation takes precedence.


{% extends "layouts/base.html" %} {% import "public_utils.html" as public_utils %} {% block container %}


--- title: Melting a list of columns author: Jeff Walker date: '2020-04-27' slug: melting-a-list-of-columns categories: - data wrangling tags: - data.table - melt keywords: - tech ---
An answer to this tweet “Are there any #Rstats tidy expeRts who’d be interested in improving the efficiency of this code that gathers multiple variables from wide to long?
This works but it’s not pretty. There must be a prettier way…"
Wide data frame has three time points where participants answer two questions on two topics.
#Simmed data
Time1.Topic1.Question1 <- rnorm(500)
data <- data.frame(Time1.Topic1.Question1)
data$Time1.TOpic1.Question2 <- rnorm(500)
data$Time1.Topic2.Question1 <- rnorm(500)
data$Time1.Topic2.Question2 <- rnorm(500)
data$Time2.Topic1.Question1 <- rnorm(500)
data$Time2.Topic1.Question2 <- rnorm(500)
data$Time2.Topic2.Question1 <- rnorm(500)
data$Time2.Topic2.Question2 <- rnorm(500)
data$Time3.Topic1.Question1 <- rnorm(500)
data$Time3.Topic1.Question2 <- rnorm(500)
data$Time3.Topic2.Question1 <- rnorm(500)
data$Time3.Topic2.Question2 <- rnorm(500)
data <- tibble::rowid_to_column(data, "Id")
data$Condition <- sample(x = 1:5, size=500, replace=TRUE)
#Starting data
# View(data)
My code is a data.table solution. Melt is a beutiful function and data.table made it better. I follow the original code (below) and name the columns using “T” for topic (e.g. T1Q1) but the future me might think this stands for “Time” and not “Topic”. I’d probably name the columns something like “topic_1_Q_1”
library(data.table)
dt <- data.table(data)
setnames(dt, "Time1.TOpic1.Question2", "Time1.Topic1.Question2")
T1Q1 <- colnames(dt)[grep("Topic1.Question1", colnames(dt))]
T1Q2 <- colnames(dt)[grep("Topic1.Question2", colnames(dt))]
T2Q1 <- colnames(dt)[grep("Topic2.Question1", colnames(dt))]
T2Q2 <- colnames(dt)[grep("Topic2.Question2", colnames(dt))]
dt_long <- melt(dt,
id.vars = c("Id"),
measure.vars = list(T1Q1, T1Q2, T2Q1, T2Q2),
variable.name = "Time",
value.name = c("T1Q1", "T1Q2", "T2Q1", "T2Q2"))
# View(dt_long)
The grep statements are key. grep("Topic1.Question1", colnames(dt))
finds the columns in which the column name includes the text in the quotes. Then embedding this within colnames(dt)[]
returns the names of the indexed columns. For example, grep("Topic1.Question1", colnames(dt))
returns the vector
## [1] 2 6 10
and colnames(dt)[grep("Topic1.Question1", colnames(dt))]
returns the vector
## [1] "Time1.Topic1.Question1" "Time2.Topic1.Question1"
## [3] "Time3.Topic1.Question1"
#Needs to become a long data frame for time, but independent columnsfor topic and question.
#The clunky way to do this is my solution below. Is there a more efficient solution?
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:data.table':
##
## between, first, last
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(tidyr)
#Simmed data
Time1.Topic1.Question1 <- rnorm(500)
data <- data.frame(Time1.Topic1.Question1)
data$Time1.TOpic1.Question2 <- rnorm(500)
data$Time1.Topic2.Question1 <- rnorm(500)
data$Time1.Topic2.Question2 <- rnorm(500)
data$Time2.Topic1.Question1 <- rnorm(500)
data$Time2.Topic1.Question2 <- rnorm(500)
data$Time2.Topic2.Question1 <- rnorm(500)
data$Time2.Topic2.Question2 <- rnorm(500)
data$Time3.Topic1.Question1 <- rnorm(500)
data$Time3.Topic1.Question2 <- rnorm(500)
data$Time3.Topic2.Question1 <- rnorm(500)
data$Time3.Topic2.Question2 <- rnorm(500)
data <- tibble::rowid_to_column(data, "Id")
data$Condition <- sample(x = 1:5, size=500, replace=TRUE)
#Starting data
# View(data)
#Pull out sections and long-ify Topics
data %>% select(Id, ends_with("Topic1.Question1")) -> T1.Q1.data
T1.Q1.data <- gather(T1.Q1.data, Time, T1Q1, 2:4, factor_key = TRUE)
data %>% select(Id, ends_with("Topic1.Question2")) -> T1.Q2.data
T1.Q2.data <- gather(T1.Q2.data, Time, T1Q2, 2:4, factor_key = TRUE)
data %>% select(Id, ends_with("Topic2.Question1")) -> T2.Q1.data
T2.Q1.data <- gather(T2.Q1.data, Time, T2Q1, 2:4, factor_key = TRUE)
data %>% select(Id, ends_with("Topic2.Question2")) -> T2.Q2.data
T2.Q2.data <- gather(T2.Q2.data, Time, T2Q2, 2:4, factor_key = TRUE)
#Create a time coded variable that doesn't contain mess of column title names
data %>% select(Id) -> time.data
time.data$Baseline <- 0
time.data$TimeOne <- 1
time.data$Timetwo <- 2
time.data <- gather(time.data, Time, Timepoint, 2:4, factor_key = TRUE)
#Drop uneededs
time.data %>% select(-(Time)) -> time.data
T1.Q1.data %>% select(-(Time)) -> T1.Q1.data
T1.Q2.data %>% select(-(Time)) -> T1.Q2.data
T2.Q1.data %>% select(-(Time)) -> T2.Q1.data
T2.Q2.data %>% select(-(Time)) -> T2.Q2.data
#Merge
data %>% select(Id, Condition) -> idcond.data
longdata <- merge(idcond.data,time.data,by="Id")
longdata <- merge(longdata,T1.Q1.data,by="Id")
longdata <- merge(longdata,T1.Q2.data,by="Id")
longdata <- merge(longdata,T2.Q1.data,by="Id")
longdata <- merge(longdata,T2.Q2.data,by="Id")
#View
# View(longdata)


Realtime Stocks (explanation) |
|
| Description | Similar to the JavaScript Seashore example, this example demonstrates how generative music can be used in a very methodal and informing way. |
| How it Works | In this hypothetical scenario, realtime stock information is streamed in and sonified without relying on any precomposed music. The player is instantiated with a tiny stub file and, from there on, all music you hear is generated from scripted algorithms. |
| Methods Used | noteOn, setController, setMonophonic, stubEmbed |
| Skill Level | Advanced |
| Start... |


respiratory (%) function (.) lung children viral patients symptoms pulmonary chemotherapy survivors {border-style RVIs px;} study #ffffff;} childhood infections Respiratory values control long‐term viruses Pediatr acute detected differences health studies treated (.‐.) Sydney public results testing (n = ) Children's abnormalities asthma forced group used using (., DLCO FEV Pulmonary Respir Study cancer clinical groups groups. leukemia lymphoblastic morbidity px; significant study, type virus years {font-family Lung Table abnormal adjusted age analysis available data font-size greater late proven research statistical wheeze z‐score . ± . Australia Cancer Childhood John [], article associated breathing capacity cell cohort common considered control) defined double; follow‐up impact pediatric predicted primary pulmonary‐toxic questionnaire reactance reported resistance response. static suggest survivors, survivors. therapy "viral" (C) COVID- Central Eur Hospital Liverpool Long‐term Oncol. PhD Wiley acknowledgement border-color border-width child cough cough, demonstrated documented duration emergency emergency. evaluate evaluated form freely frequency important including leukaemia life mean means nearly original oscillation parainfluenza re-use reference risk significance. solid; source, symptom test tests time unrestricted viral, years. {font-style {font-weight (.‐) Cancer. Cough HRV Infect Ltd., Med. Note: O/L/s P = .), P = .). RVI Sons, Symptom and/or assessed bold cancer. cause chest classified clinically cm H courier; determined did domain early em; exercise findings future hematopoietic however, included increased infection median microbiological months outcomes performed plethysmography, posttherapy. prevalence pt;} retained retrospective score significance standard subsequent technique tested treatment undergoing value volume ‐year


Welcome to Pizza Palace!
ORDER HERE
Size:
small
medium
large
Crust:
Crispy
Stuffed
Gluten-free
Toppings:
Pepperoni
Sausage
Bacon
Mushrooms
Black Olives
Cheese
Pineapple
How many:
Pick-up or Delivery?
Pick-up
Delivery
Checkout
Here is your order
Place order


--- status: publish layout: page title: Uintah Basin (UBUG) author: display_name: Zach Beck email<EMAIL_ADDRESS>tags: [] categories: [] published: false date: 2011-09-19 10:43:47 -0600 ---
Unitah Basin User Group: UBUG consists of Geo-spatial technicians and specialists from State and Federal agencies, private organizations, Uintah, Daggett, Duchesne, and Wasatch Counties. It is open to anyone that would like to attend. This user group conducts quarterly meetings featuring trainings, discussions on GIS and other Geo-spatial applications and/or problems that those attending might need help with. For more information....


Cards
Card Title
Card subtitle or description goes here.
Card Title
Card subtitle or description goes here.
Card Title
Card subtitle or description goes here.
Card Title
Card subtitle or description goes here.
Card Title
Card subtitle or description goes here.
Card Title
Card subtitle or description goes here.
Card Title
Card subtitle or description goes here.
Card Title
Card subtitle or description goes here.


Problem 1. Increase array members
Write a script that allocates array of 20 integers and initializes each element by its index multiplied by 5. Print the obtained array on the console.
Write a script that allocates array of 20 integers and initializes each element by its index multiplied by 5. Print the obtained array on the console.
Write a script that compares two char arrays lexicographically (letter by letter).
Write a script that finds the maximal sequence of equal elements in an array. Example:
Write a script that finds the maximal increasing sequence in an array. Example:
Sorting an array means to arrange its elements in increasing order. Write a script to sort an array. Use the selection sort algorithm: Find the smallest element, move it at the first position, find the smallest from the rest, move it at the second position, etc. Hint: Use a second array
Write a script that finds the most frequent number in an array. Example:
Write a script that finds the index of given element in a sorted array of integers by using the binary search algorithm.


{% extends "playground/base.html" %} {% block content %}
Resulting SQL:
{{ sql }}{% elif error %}
There was an error evaluating your request:
{{ error }}{% endif %}
Try the following as an example:
Models:
from django.db import models class Foo(models.Model): from django.db import models bar = models.CharField(max_length=255)
Query:
Foo.objects.filter(bar="bar").order_by("bar")


{% for t,v in prediction.items() %} {{t,v}} {% endfor %}
WARNING The prediction results are only used for reference.


Victoria Coren Mitchell's panel show appearances
Victoria Coren Mitchell (born 1972-08-18[ref]) has appeared in 85 episodes between 2004-2019. Victoria Coren Mitchell on IMDB. Victoria Coren Mitchell on Wikipedia.
- 2019-10-18 / Have I Got News For You
- 2019-05-24 / Have I Got News For You
- 2018-11-02 / Have I Got News For You
- 2018-10-08 / QI
- 2018-08-24 / 8 Out of 10 Cats Does Countdown
- 2018-04-06 / Have I Got News For You
- 2018-02-02 / QI
- 2018-01-26 / 8 Out of 10 Cats Does Countdown
- 2017-11-10 / Have I Got News For You
- 2017-10-12 / Duck Quacks Don't Echo
- 2017-06-29 / 8 Out of 10 Cats Does Countdown
- 2017-06-02 / Have I Got News For You
- 2017-02-17 / The Last Leg
- 2016-11-25 / QI
- 2016-11-04 / Have I Got News For You
- 2016-10-15 / 8 Out of 10 Cats Does Countdown
- 2016-08-05 / 8 Out of 10 Cats Does Countdown
- 2016-06-29 / Heresy
- 2016-06-16 / Alan Davies: As Yet Untitled
- 2016-06-15 / Heresy
- 2016-06-08 / Heresy
- 2016-06-01 / Heresy
- 2016-05-25 / Heresy
- 2016-05-18 / Heresy
- 2016-04-22 / Have I Got News For You
- 2015-11-20 / Have I Got News For You
- 2015-11-05 / Question Time
- 2015-09-28 / The Unbelievable Truth
- 2015-09-14 / The Unbelievable Truth
- 2015-04-17 / Have I Got News For You
- 2014-10-24 / Have I Got News For You
- 2014-10-17 / QI
- 2014-05-30 / Have I Got News For You
- 2014-02-03 / The Unbelievable Truth
- 2014-01-13 / The Unbelievable Truth
- 2013-12-06 / QI
- 2013-11-08 / Have I Got News For You
- 2013-06-20 / Heresy
- 2013-06-13 / Heresy
- 2013-06-06 / Heresy
- 2013-05-30 / Heresy
- 2013-05-23 / Heresy
- 2013-05-16 / Heresy
- 2013-05-02 / Question Time
- 2013-03-01 / 8 Out of 10 Cats
- 2012-10-26 / Have I Got News For You
- 2012-09-14 / QI
- 2012-06-08 / Have I Got News For You
- 2012-05-31 / Question Time
- 2012-01-04 / Heresy
- 2011-12-28 / Heresy
- 2011-12-21 / Heresy
- 2011-12-14 / Heresy
- 2011-12-07 / Heresy
- 2011-11-30 / Heresy
- 2011-10-21 / Would I Lie To You?
- 2011-10-14 / Have I Got News For You
- 2011-05-06 / Have I Got News For You
- 2010-10-14 / Have I Got News For You
- 2010-06-23 / Heresy
- 2010-06-16 / Heresy
- 2010-06-09 / Heresy
- 2010-06-02 / Heresy
- 2010-05-26 / Heresy
- 2010-05-19 / Heresy
- 2010-05-13 / You Have Been Watching
- 2010-04-08 / Have I Got News For You
- 2010-04-01 / Question Time
- 2009-08-25 / You Have Been Watching
- 2009-05-19 / Heresy
- 2009-05-12 / Heresy
- 2009-05-05 / Heresy
- 2009-04-28 / Heresy
- 2009-04-14 / Heresy
- 2009-04-07 / Heresy
- 2008-06-19 / Heresy
- 2008-06-12 / Heresy
- 2008-06-05 / Heresy
- 2008-05-29 / Heresy
- 2008-05-22 / Heresy
- 2008-05-15 / Heresy
- 2007-06-06 / Heresy
- 2005-06-22 / Heresy
- 2004-12-23 / Heresy
- 2004-12-16 / Heresy


Trophic interactions in deep-sea ecosystems
Since September 2017, I'm a research scientist at the Deep Environment Laboratory of Ifremer Brittany, Brest, France. Ongoing projects include ecological plasticity of foundation species in cold seeps ecosystems, food web structure in hydrothermal vents from the Mid-Atlantic Ridge and Pacific back-arc basins, as well as trophic interactions in cold water coral reefs. I'm also building an open database for stable isotope ratios of deep-sea fauna.
More info on this research coming soon!


--- layout: api title: "v3.0.0 JavaScript Library: L.DomUtil" categories: api version: v3.0.0 permalink: /api/v3.0.0/l-domutil/ ---
Utility functions to work with the DOM tree, used by Leaflet internally.
| Method | Returns | Description |
|---|---|---|
get(
|
HTMLElement |
Returns an element with the given id if a string was passed, or just returns the element if it was passed directly. |
getStyle(
|
String |
Returns the value for a certain style attribute on an element, including computed values or values set through CSS. |
getViewportOffset(
|
Point |
Returns the offset to the viewport for the requested element. |
create(
|
HTMLElement |
Creates an element with tagName , sets the className , and optionally appends it to container element. |
disableTextSelection() |
- | Makes sure text cannot be selected, for example during dragging. |
enableTextSelection() |
- | Makes text selection possible again. |
hasClass(
|
Boolean |
Returns true if the element class attribute contains name . |
addClass(
|
- | Adds name to the element's class attribute. |
removeClass(
|
- | Removes name from the element's class attribute. |
setOpacity(
|
- | Set the opacity of an element (including old IE support). Value must be from 0 to 1 . |
testProp(
|
String or false |
Goes through the array of style names and returns the first name that is a valid style name for an element. If no such name is found, it returns false . Useful for vendor-prefixed styles like transform . |
getTranslateString(
|
String |
Returns a CSS transform string to move an element by the offset provided in the given point. Uses 3D translate on WebKit for hardware-accelerated transforms and 2D on other browsers. |
getScaleString(
|
String |
Returns a CSS transform string to scale an element (with the given scale origin). |
setPosition(
|
- | Sets the position of an element to coordinates specified by point , using CSS translate or top/left positioning depending on the browser (used by Leaflet internally to position its layers). Forces top/left positioning if disable3D is true . |
getPosition(
|
Point | Returns the coordinates of an element previously positioned with setPosition . |
| Property | Type | Description |
|---|---|---|
TRANSITION
|
String |
Vendor-prefixed transition style name (e.g. 'webkitTransition' for WebKit). |
TRANSFORM
|
String |
Vendor-prefixed transform style name. |


--- layout: default ---
{{ repository.description }}
Join Us at American Express! Visit us at our Careers website.
Share your views, comments about the content of our website or our open source repositories. Let us know how we can improve our website and code. Mail us!


--- canonical: 404.html layout: html titl: Error 404 --- 404 Something didn't quite go as planned... Back to the homepage
Something didn't quite go as planned...
Back to the homepage


LAST GAME : Leaderboard
#
Team
Stages
1
Neptunes
5/5
2
Wailers
5/5
3
E Street Band
5/5
4
Pharcyde
5/5
Feed
Log out
Start Game


Toggle navigation
SB Admin v2.0
Dashboard
Consumer goods tables
Consumer cheques
Consumer groups recs
Consumer Simplate and Printer recs
Recommendations 'offline' statistics
Blank


The tax rate has been adjusted to
%next_tax_rate%%
. This rate will be effective beginning at midnight tonight.
You may adjust the tax rate up until that time, but once applied it will remain in effect until the following midnight.


- L1NMF - Class in ml.clustering
-
A Java implementation for L1NMF which solves the following
optimization problem:
- L1NMF(Options) - Constructor for class ml.clustering.L1NMF
-
- L1NMF(L1NMFOptions) - Constructor for class ml.clustering.L1NMF
-
- L1NMF() - Constructor for class ml.clustering.L1NMF
-
- L1NMFOptions - Class in ml.options
-
- L1NMFOptions() - Constructor for class ml.options.L1NMFOptions
-
- L1NMFOptions(L1NMFOptions) - Constructor for class ml.options.L1NMFOptions
-
- L1NMFOptions(int) - Constructor for class ml.options.L1NMFOptions
-
- L1NMFOptions(int, boolean, int) - Constructor for class ml.options.L1NMFOptions
-
- L1NMFOptions(ClusteringOptions) - Constructor for class ml.options.L1NMFOptions
-
- l2Distance(Matrix, Matrix) - Static method in class ml.utils.Matlab
-
Compute the l2 distance matrix between row vectors in matrix X
and row vectors in matrix Y.
- l2Distance(Vector, Matrix) - Static method in class ml.utils.Matlab
-
Compute the l2 distance vector between a vector V
and row vectors in matrix Y.
- l2Distance(Vector[], Vector[]) - Static method in class ml.utils.Matlab
-
Compute the l2 distance matrix between two sets of vectors X and Y.
- l2DistanceByColumns(Matrix, Matrix) - Static method in class ml.utils.Matlab
-
Compute the l2 distance matrix between column vectors in matrix X
and column vectors in matrix Y.
- l2DistanceSquare(Matrix, Matrix) - Static method in class ml.utils.Matlab
-
Compute the squared l2 distance matrix between row vectors in matrix X
and row vectors in matrix Y.
- l2DistanceSquare(Vector, Matrix) - Static method in class ml.utils.Matlab
-
Compute the squared l2 distance vector between a vector V
and row vectors in matrix Y.
- l2DistanceSquare(Vector[], Vector[]) - Static method in class ml.utils.Matlab
-
Compute the squared l2 distance matrix between two sets of vectors X and Y.
- l2DistanceSquare0(Matrix, Matrix) - Static method in class ml.utils.Matlab
-
Deprecated.
- l2DistanceSquareByColumns(Matrix, Matrix) - Static method in class ml.utils.Matlab
-
Compute the squared l2 distance matrix between column vectors in matrix X
and column vectors in matrix Y.
- la.decomposition - package la.decomposition
-
- la.io - package la.io
-
- la.matrix - package la.matrix
-
- la.vector - package la.vector
-
- labelIndexArray2LabelMatrix(int[], int) - Static method in class ml.classification.Classifier
-
Convert a label index array to a label matrix.
- labelScoreMatrix2LabelIndexArray(Matrix) - Static method in class ml.classification.Classifier
-
Convert a label matrix to a label index array.
- lambda - Variable in class ml.options.Options
-
- lambda_opt - Variable in class ml.optimization.QPSolution
-
- laplacian(Matrix, String, GraphOptions) - Static method in class ml.manifold.Manifold
-
Calculate the graph Laplacian of the adjacency graph of a data set
represented as rows of a matrix X.
- laplacian(Matrix, String, GraphOptions) - Static method in class ml.manifold.ManifoldByColumns
-
Calculate the graph Laplacian of the adjacency graph of a data set
represented as columns of a matrix X.
- LASSO - Class in ml.regression
-
A Java implementation of LASSO, which solves the following
convex optimization problem:
- LASSO() - Constructor for class ml.regression.LASSO
-
- LASSO(double) - Constructor for class ml.regression.LASSO
-
- LASSO(int, double) - Constructor for class ml.regression.LASSO
-
- LASSO(double, int, double) - Constructor for class ml.regression.LASSO
-
- LASSO(Options) - Constructor for class ml.regression.LASSO
-
- LBFGS - Class in ml.optimization
-
A Java implementation for the limited-memory BFGS algorithm.
- LBFGS() - Constructor for class ml.optimization.LBFGS
-
- LBFGSForVector - Class in ml.optimization
-
A Java implementation for the limited-memory BFGS algorithm.
- LBFGSForVector() - Constructor for class ml.optimization.LBFGSForVector
-
- LBFGSOnSimplex - Class in ml.optimization
-
A Java implementation for the projected limited-memory BFGS algorithm
with simplex constraints.
- LBFGSOnSimplex() - Constructor for class ml.optimization.LBFGSOnSimplex
-
- LDA - Class in ml.topics
-
An interface for the Gibbs sampler implementation of LDA
by Gregor Heinrich.
- LDA(LDAOptions) - Constructor for class ml.topics.LDA
-
- LDA() - Constructor for class ml.topics.LDA
-
- LDA(int) - Constructor for class ml.topics.LDA
-
- LdaGibbsSampler - Class in ml.topics
-
Gibbs sampler for estimating the best assignments of topics for words and
documents in a corpus.
- LdaGibbsSampler(int[][], int) - Constructor for class ml.topics.LdaGibbsSampler
-
Initialize the Gibbs sampler with data.
- LdaGibbsSampler(LDAOptions) - Constructor for class ml.topics.LdaGibbsSampler
-
- LdaGibbsSampler() - Constructor for class ml.topics.LdaGibbsSampler
-
- LDAOptions - Class in ml.options
-
- LDAOptions() - Constructor for class ml.options.LDAOptions
-
- le(Matrix, double) - Static method in class ml.utils.Matlab
-
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
- le(double, Matrix) - Static method in class ml.utils.Matlab
-
Do element by element comparisons between x and X and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
- le(Matrix, Matrix) - Static method in class ml.utils.Matlab
-
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
- LinearBinarySVM - Class in ml.classification
-
A Java implementation of fast linear binary SVM.
- LinearBinarySVM() - Constructor for class ml.classification.LinearBinarySVM
-
- LinearBinarySVM(double, double) - Constructor for class ml.classification.LinearBinarySVM
-
- linearIndexing(int[], int[]) - Static method in class ml.utils.Matlab
-
Linear indexing V by an index array.
- linearIndexing(double[], int[]) - Static method in class ml.utils.Matlab
-
Linear indexing V by an index array.
- linearIndexing(Matrix, int[]) - Static method in class ml.utils.Matlab
-
Linear indexing A by an index array.
- linearIndexingAssignment(Matrix, int[], Matrix) - Static method in class ml.utils.Matlab
-
Matrix assignment by linear indexing for the syntax A(B) = V.
- linearIndexingAssignment(Matrix, int[], double) - Static method in class ml.utils.Matlab
-
Matrix assignment by linear indexing for the syntax A(B) = v.
- LinearMCSVM - Class in ml.classification
-
A Java implementation of fast linear multi-class SVM by
Crammer-Singer formulation.
- LinearMCSVM() - Constructor for class ml.classification.LinearMCSVM
-
- LinearMCSVM(double, double) - Constructor for class ml.classification.LinearMCSVM
-
- LinearRegression - Class in ml.regression
-
A Java implementation of linear regression, which solves the
following convex optimization problem:
- LinearRegression() - Constructor for class ml.regression.LinearRegression
-
- LinearRegression(double) - Constructor for class ml.regression.LinearRegression
-
- LinearRegression(int, double) - Constructor for class ml.regression.LinearRegression
-
- LinearRegression(Options) - Constructor for class ml.regression.LinearRegression
-
- LLE - Class in ml.subspace
-
Locally Linear Embedding (LLE).
- LLE(int) - Constructor for class ml.subspace.LLE
-
Constructor.
- LLE(int, int) - Constructor for class ml.subspace.LLE
-
Constructor.
- loadData(String, int) - Static method in class ml.recommendation.FM
-
- loadData(String, int) - Static method in class ml.recommendation.STSR
-
- loadData(String, String, String, String, int[]) - Static method in class ml.recommendation.util.Utility
-
- loadDenseMatrix(String) - Static method in class la.io.IO
-
Read a dense matrix from a text file.
- loadDenseVector(String) - Static method in class la.io.IO
-
Read a dense vector from a text file.
- loadMap(TreeMap<Integer, Integer>, String) - Static method in class ml.recommendation.util.Utility
-
- loadMatrix(String) - Static method in class la.io.IO
-
Read a matrix from a text file.
- loadMatrixFromDocTermCountFile(String) - Static method in class la.io.IO
-
Load a Matrix
from a doc-term-count file located at
String
docTermCountFilePath.
- loadModel(String) - Method in class ml.classification.AdaBoost
-
- loadModel(String) - Method in class ml.classification.Classifier
-
Load the model for a classifier.
- loadModel(String) - Method in class ml.classification.LinearBinarySVM
-
- loadModel(String) - Method in class ml.classification.LinearMCSVM
-
- loadModel(String) - Method in class ml.classification.LogisticRegression
-
- loadModel(String) - Method in class ml.classification.LogisticRegressionByBoundConstrainedPLBFGS
-
- loadModel(String) - Method in class ml.classification.LogisticRegressionByNonlinearConjugateGradient
-
- loadModel(String) - Method in class ml.classification.LogisticRegressionByNonnegativePLBFGS
-
- loadModel(String) - Method in class ml.classification.MaxEnt
-
- loadModel(String) - Method in class ml.regression.LASSO
-
- loadModel(String) - Method in class ml.regression.LinearRegression
-
- loadModel(String) - Method in class ml.regression.Regression
-
- loadModel(String) - Method in class ml.sequence.CRF
-
Load the model from a file.
- loadModel(String) - Method in class ml.sequence.HMM
-
Load an HMM model from a file.
- loadModel(String) - Method in class ml.temporal.ReflectedLogisticRegression
-
- loadModel(String) - Method in class ml.temporal.SurvivalScoreModel
-
- loadModel(String) - Method in class ml.temporal.TemporalLASSO
-
- loadModel(String) - Method in class ml.temporal.TemporalLogisticRegression
-
- loadSparseMatrix(String) - Static method in class la.io.IO
-
Load a Matrix
from a text file.
- loadSparseVector(String) - Static method in class la.io.IO
-
Read a sparse vector from a text file.
- loadTestUserEventRelation(String, HashMap<Integer, LinkedList<Integer>>) - Static method in class ml.recommendation.util.Utility
-
Build TestUser2EventIndexSetMap and TestUserIndices.
- loadVector(String) - Static method in class la.io.IO
-
Read a vector from a text file.
- log(Matrix, Matrix) - Static method in class ml.utils.InPlaceOperator
-
res = log(A).
- log(double[], double[]) - Static method in class ml.utils.InPlaceOperator
-
res = log(V).
- log(Matrix) - Static method in class ml.utils.Matlab
-
Calculate the element-wise logarithm of a matrix.
- logAssign(double[]) - Static method in class ml.utils.InPlaceOperator
-
res = log(res).
- logAssign(Matrix) - Static method in class ml.utils.InPlaceOperator
-
res = log(res).
- logicalIndexing(Matrix, Matrix) - Static method in class ml.utils.Matlab
-
Logical indexing A by B for the syntax A(B).
- logicalIndexingAssignment(Matrix, Matrix, double) - Static method in class ml.utils.Matlab
-
Matrix assignment by logical indexing for the syntax A(B) = v.
- logicalIndexingAssignment(Matrix, Matrix, Matrix) - Static method in class ml.utils.Matlab
-
Matrix assignment by logical indexing for the syntax A(B) = V.
- LogisticRegression - Class in ml.classification
-
Multi-class logistic regression with regularization.
- LogisticRegression() - Constructor for class ml.classification.LogisticRegression
-
- LogisticRegression(int, double) - Constructor for class ml.classification.LogisticRegression
-
- LogisticRegression(double) - Constructor for class ml.classification.LogisticRegression
-
- LogisticRegressionByBoundConstrainedPLBFGS - Class in ml.classification
-
Multi-class logistic regression by using limited-memory BFGS method.
- LogisticRegressionByBoundConstrainedPLBFGS() - Constructor for class ml.classification.LogisticRegressionByBoundConstrainedPLBFGS
-
- LogisticRegressionByNonlinearConjugateGradient - Class in ml.classification
-
Multi-class logistic regression by nonlinear conjugate gradient method.
- LogisticRegressionByNonlinearConjugateGradient() - Constructor for class ml.classification.LogisticRegressionByNonlinearConjugateGradient
-
- LogisticRegressionByNonnegativePLBFGS - Class in ml.classification
-
Multi-class logistic regression by projected limited-memory BFGS
method.
- LogisticRegressionByNonnegativePLBFGS() - Constructor for class ml.classification.LogisticRegressionByNonnegativePLBFGS
-
- lt(Matrix, double) - Static method in class ml.utils.Matlab
-
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
- lt(double, Matrix) - Static method in class ml.utils.Matlab
-
Do element by element comparisons between x and X and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
- lt(Matrix, Matrix) - Static method in class ml.utils.Matlab
-
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
- LUDecomposition - Class in la.decomposition
-
A Java implementation of LU decomposition using
Gaussian elimination with row pivoting.
- LUDecomposition(Matrix) - Constructor for class la.decomposition.LUDecomposition
-
Construct an LUDecomposition instance from a square real matrix.


A JavaScript idle game about XKCD's Time. Developed by Eternal Density, and open-source on Github. Notorious for having entirely too many years' worth of content. I designed and implemented an end-game content track to kick off version 4.0: Kitty Genocide Simular 2015 (it's a long story).


--- layout: post title: Crafting chaos date: 2010-11-02 10:56:54.000000000 -04:00 categories: [] tags: [] status: publish type: post published: true meta: _edit_last: '1' _wp_old_slug: '' author: login: cint email<EMAIL_ADDRESS>display_name: Jacinta first_name: Jacinta last_name: '' ---
I had hoped to bring you something I have spent this afternoon working on, but at the 11th hour, I realised I didn't have the right elastic to finish the project, hmm! So watch this space tomorrow and hopefully I will have something to show for my efforts!!


process(fn)
Arranges the function fn
to be executed parallely. Return an object that represent the newly started process.
let p = process(^(cp) showln("server says: ", process_receive(cp)))
process_send(p, "hello")
//> server says: hello
process_close(p)


{% extends "base.html" %} {% load i18n %} {% block title %}{% trans "Summaries" %}{% endblock title %} {% block content %}
{% trans "It looks like there haven't been any transactions, so there's nothing to show here." %}
{% endif %} {% endblock content %}


Math Homework
问题描述 :
Alice has a lot of math homework to do today.
All the problems have the same form:
Please find out:
However Alice is not interested at the homework at all. Can you write a program to help
her?(As the answer may be very large,you should only work out the ans mod<PHONE_NUMBER>).
All the problems have the same form:
Please find out:
However Alice is not interested at the homework at all. Can you write a program to help
her?(As the answer may be very large,you should only work out the ans mod<PHONE_NUMBER>).
输入:
The first line of the input contains an integer T which means the number of test cases. Then T lines follow, each line consists of six non-negative integers, a; b; c; n; k; k′.
a, b, c, n ≥ 0 and fit in 32-bit signed number
k + k′≤ 10
a, b, c, n ≥ 0 and fit in 32-bit signed number
k + k′≤ 10
输出:
The first line of the input contains an integer T which means the number of test cases. Then T lines follow, each line consists of six non-negative integers, a; b; c; n; k; k′.
a, b, c, n ≥ 0 and fit in 32-bit signed number
k + k′≤ 10
a, b, c, n ≥ 0 and fit in 32-bit signed number
k + k′≤ 10
样例输入:
1 2 0 1 3 1 1
样例输出:
10HintWe amuse that 0 ^ 0=1
(adsbygoogle = window.adsbygoogle || []).push({});
http://www.xingcaipingtai.net （杏彩平台中国网）
渣渣没看过小说别再这里瞎bb
渣渣没看过小说别再这里瞎bb
渣渣没看过小说别再这里瞎bb
渣渣没看过小说别再这里瞎bb
渣渣没看过小说别再这里瞎bb
渣渣没看过小说别再这里瞎bb
渣渣没看过小说别再这里瞎bb
渣渣没看过小说别再这里瞎bb


In those dark times, astrologer, mathematician and conjuror were accounted the same things, and the vulgar did verily believe [Thomas Allen] to be a conjuror. He had a great many mathematical instruments and glasses in his chamber, which did also confirm the ignorant in their opinion, and his servitor (to impose on freshmen and simple people) would tell them that sometimes he should meet the spirits, coming up his stairs like bees.
from John Aubrey, Brief Lives (1972 edition edited by Oliver Lawson Dick)


{% extends '_base.html' %} {% block head %} {% endblock %} {% block body%}
The KDM API at https://api.kdm-manager.com is a RESTful API for campaign/settlement management in "Monster" by Kingdom Death.
The API is maintained by The Labor in Vain and is neither affiliated with nor authorized by Kingdom Death or Adam Poots Games.
Some parts of the API are free to use. Others require an API key. Endpoints that require an API key to access are indicated below by the key (🔑) icon.


Cafe Townsend's visionary chef leads the way in a culinary revolution. Proclaimed by many to be the best chef in the world today, Chef Bienni blends earthy seasonal flavors and bold ingredients to create exquisite contemporary cuisine.
Cafe Townsend features a magical combination of excellent cuisine and musical entertainment. The finest pasta, seafood, veal and certified Angus steaks are served to you by the most talented waiters anywhere. Nightly entertainment features favorites from Broadway musical theatre, Grand Opera, and Neapolitan folk songs performed by our talented musical staff. Cafe Townsend offers the largest selection of Italian wines in California, and is the proud recipient of numerous awards from Wine Tasting Magazine. We were selected as one of Southern California Magazine's top 200 restaurants for the last 8 years! Cafe Townsend restaurant is music to your ears, be it an intimate dinner for 2 or a banquet for up to 200.


Largest Marathons for 1956
136 Polytechnic 16 Jun Chiswick ENG 72 Kosice 07 Oct Kosice SVK 56 Doncaster to Sheffield 07 Apr Sheffield ENG 33 Olympic Games 01 Dec Melbourne AUS 31 East German Championship 02 Sep Demmin GER 25 Beppu Mainichi 12 Feb Beppu JPN 20 Asahi Shimbun 09 Dec Nagoya JPN 12 French Championships 05 Aug Colombes FRA 12 Australian Championship 08 Sep Melbourne AUS 6 Newfoundland Provincial Championships 08 Oct Saint John's NF CAN 10 4 Pike's Peak 10 Aug Manitou Springs CO USA 1 Southland Jan Invercargill NZLLast Updated on
07 Jan 2016


Model class for DiscreteSlider
More...
|
| IReadOnlyReactiveProperty< float > | Value [get] |
| | The current value of the discrete slider More...
|
| |
| ReactiveProperty< int > | Index [get, protected set] |
| | The currently selected index More...
|
| |
Model class for DiscreteSlider
◆ DiscreteSliderModel()
| DiscreteSliderModel.DiscreteSliderModel |
( |
float[] |
_values, |
|
|
int |
_initialIndex |
|
) |
| |
|
inline |
◆ setClosestValue()
| void DiscreteSliderModel.setClosestValue |
( |
float |
newValue | ) |
|
|
inline |
Sets the closest discrete value
- Parameters
-
◆ values
| float [] DiscreteSliderModel.values |
|
private |
◆ Index
| ReactiveProperty<int> DiscreteSliderModel.Index |
|
getprotected set |
The currently selected index
◆ Value
| IReadOnlyReactiveProperty<float> DiscreteSliderModel.Value |
|
get |
The current value of the discrete slider
The documentation for this class was generated from the following file:


io.sbk.*
-
"-"
"class"
"-class"
"Storage Benchmark Kit"
public static final boolean
true
"help"
"-help"
"sbk"
"sbk.appHome"
"sbk.applicationName"
"sbk.className"
"\nPlease report issues at https://github.com/kmgowda/SBK"
"io.sbk"
"https://github.com/kmgowda/SBK"
-
io.sbp.*
-
public static final int
-1
-
public static final int
1
-
public static final int
2
public static final int
7
public static final int
6
public static final int
5
public static final int
4
public static final int
1
public static final int
3
-
public static final int
5
public static final int
4
public static final int
1
public static final int
3
public static final int
2
public static final int
0
-
public static final int
1
public static final int
0
public static final int
2
-
public static final int
1
public static final int
14
public static final int
15
public static final int
20
public static final int
13
public static final int
19
public static final int
6
public static final int
5
public static final int
18
public static final int
4
public static final int
9
public static final int
10
public static final int
2
public static final int
16
public static final int
17
public static final int
11
public static final int
12
public static final int
7
public static final int
8
public static final int
3
-
-
public static final int
1
public static final int
2


Hi, My name is
Morten Christensen
I work for Umbraco HQ here in Copenhagen
Refit
The automatic type-safe REST library for Xamarin and .NET
By Paul Betts (github): https://github.com/paulcbetts/refit
Why?
- Fast and easy to start using
- Flexible
- Strongly Typed
- Removes all the plumbing of
using HttpClient
- Supports multiple platforms
- Good documentation
- Attribute all the things!
When?
Consuming REST services
When you want to consume REST services in a type-safe way.
Refit currently supports the following platforms:
- Xamarin.Android
- Xamarin.Mac
- Desktop .NET 4.5
- Windows Phone 8
- Silverlight 5
- In the works: Xamarin.iOS
DEMO
Consuming the Kudu REST API