Wat Language Manual
Table of Contents
- Description
- Lexical Structure
- Built-in Types
- Pattern Matching
- Combiners
- Bindings
def <lhs> <rhs> → rhs
[operative]define <lhs> <rhs> → result
[operative]define-syntax <lhs> <rhs> → result
[operative]let <bindings> . <body> → result
[operative]let* <bindings> . <body> → result
[operative]set! <env> <lhs> <rhs> → rhs
[operative]defined? <sym> <env> → boolean
[applicative]provide <names> . <exprs> → result
[operative]make-environment [<parent>] → environment
[applicative]current-environment → environment
[applicative]
- Evaluation
- First-order Control
begin . <exprs> → result
[operative]if <test> <then> <else> → result
[operative]when <test> . <forms> → result
[operative]unless <test> . <forms> → result
[operative]cond . <clauses> → result
[operative]loop . <forms> → |
[operative]while <test> . <forms> → |
[operative]until <test> . <forms> → |
[operative]block <name> . <body> → result
[operative]return-from <cont> [<val>] → |
[operative]unwind-protect <protected> . <cleanup> → result
[operative]
- Dynamic Binding
- Exception Handling
handle <body> . <handlers> → result
[operative] NIYcatch <body> . <handlers> → result
[operative] NIYthrow <exc> . <handlers> → result
[operative] NIYdefault-handler <exc> → result
[generic] NIYrestart-bind <body> . <handlers> → result
[operative] NIYinvoke-restart <restart> → result
[applicative] NIYassociated-exception <restart> → option
[generic] NIY
- Higher-order Control
- Types
make-type → (type tagger untagger)
[applicative]type-of <val> → type
[applicative]Void
,Ign
,Boolean
,Nil
,Pair
,Symbol
,String
,Number
,Applicative
,Operative
,Environment
,Vector
,Type
[variables]void?
,ign?
,boolean?
,null?
,pair?
,symbol?
,string?
,number?
,applicative?
,operative?
,environment?
,vector?
,type?
[applicatives]
- Record Types
- Generic Functions and Methods
- Common Generic Functionality
- Booleans
- Numbers
- Strings
- Pairs and Lists
- Vectors
- Hashtables
Hashtable
[variable],hashtable?
[applicative] NIYmake-hashtable <hashfn> <eqfn> → hashtable
[applicative] NIYmake-identity-hashtable → hashtable
[applicative]make-string-hashtable → hashtable
[applicative]make-generic-hashtable → hashtable
[applicative] NIYhashtable-put! <hashtable> <key> <val> → val
[applicative] NIYhashtable-get <hashtable> <key> <default> → val
[applicative] NIY
- Options
- System
- JavaScript Bridge
js-global <string> → result
[applicative]js-set-global! <string> <val> → val
[applicative]js-prop <object> <string> → result
[applicative]js-set-prop! <object> <string> <val> → val
[applicative]js-function <jsfun> → applicative
[applicative]js-method <string> → cmb
[applicative]to-js <obj> → jsobj
[applicative]from-js <js-obj> → obj
[applicative]js-null
[constant]js-callback <cmb> → jsfun
[applicative]define-js-method <name>
[operative]
- Examples
Description
Wat is an ultra-lightweight, advanced, and practical Lisp for JavaScript, in which everything is first-class: syntax, control, and data. Syntax is based on lexically-scoped fexprs and first-class environments, subsuming ordinary procedures and hygienic macros. Control is based on delimited continuations, subsuming all computational effects such as lightweight threads and monads. Data uses first-class types that allow generic programming over built-in as well as user-defined types. The language is rounded out with Common Lisp features such as generic functions, restartable exceptions, dynamically-bound variables, a numerical tower, and common data structures such as hashtables. The Wat runtime is implemented in only 500 lines of JavaScript and evaluates the prelude and a REPL written in Wat in under 50ms in common JavaScript interpreters.
Wat is hosted at https://github.com/manuel/wat-js.
This manual assumes familiarity with Kernel, Scheme, and Common Lisp.
Sections marked with NIY are not implemented yet.
Lexical Structure
Wat has a mostly Scheme-like lexical structure, incompletely described by the following table:
| ; … | line comment |
| . + - [0-9]+ | number |
| #t #f | logical constants |
| #void #ign | void and ignore constants |
| " … " | string |
| \\ \" \n \r \t | escape character in string |
| ( … ) | list |
| ( a b . c ) | dotted list |
| () | nil |
| a-z A-Z 0-9 - & ! : = > < % + ? / * # $ _ ' . | symbol characters |
| '<expr> | short for (quote <expr>) |
Wat identifiers are case-sensitive.
Built-in Types
- Void
-
The constant
#void
is used when there is no interesting value to return, or when a value is unspecified. - Ignore
-
The constant
#ign
is used in parameter lists to indicate that an argument is ignored and should not be bound in the combiner's environment. - Boolean
-
The
#t
constant represents logical truth and the#f
constant represents logical falsity. - Nil and Pair
- Lists are built from immutable pairs and nil. Notably, lists often contain not only symbols and literals (as is usual in Lisp) but also first-class objects such as combiners.
- Symbol
- Symbols are used as identifiers for variable bindings. It is not guaranteed that symbols with the same name are pointer identical.
- String
- Wat currently only supports UTF-16 encoded Unicode strings.
- Number
- Wat supports a full Scheme-style numeric tower with arbitrary precision numbers.
- Vector
- An array of objects.
- Hashtable
- Wat currently only supports identity hashtables.
- Operative
- A combiner that operates directly on its operands.
- Applicative
- A combiner that evaluates its operands, yielding an arguments list, which it passes to an underlying combiner.
- Environment
- An environment maps symbols to values. It may have a parent environment in which symbols are looked up if they are not found in this environment.
- Type
- A first-class type tag or just type is associated with every object.
- Continuation
- Continuations are first-class objects, not wrapped in an applicative.
Pattern Matching
As in Kernel, parameters and left-hand sides of definitions may not only be symbols, but parameter trees: a parameter tree is either a symbol, a cons, nil, or ignore. A symbol binds the right hand to its name, a cons recursively matches its car and cdr, nil matches only nil, and ignore simply ignores the right-hand side.
Examples:
| Left-hand side | Right-hand side | Match results |
|---|---|---|
| a | (1 (2) 3) | a → (1 (2) 3) |
| (a . b) | (1 (2) 3) | a → 1, b → ((2) 3) |
| (a b c) | (1 (2) 3) | a → 1, b → (2), c → 3 |
| (a (b) . #ign) | (1 (2) 3) | a → 1, b → 2 |
Combiners
All computations in Wat are carried out by combiners, of which there
are two different kinds: operative and applicative. An operative
combiner or just operative is a fexpr that receives the current
lexical environment and acts on its operand tree unevaluated. An
applicative combiner or just applicative is a procedure that first
evaluates its operand tree and then passes the obtained arguments list
to an underlying combiner. vau
is the constructor of user-defined
operatives, called compound operatives. wrap
creates an applicative
around an underlying combiner.
Examples:
| Combiner | Operand Tree | Result |
|---|---|---|
(vau x #ign x) | (1 (+ 2 3) 4) | (1 (+ 2 3) 4) |
(vau #ign e e) | (1 (+ 2 3) 4) | <the current environment> |
(wrap (vau x #ign x)) | (1 (+ 2 3) 4) | (1 5 4) |
Bindings
def <lhs> <rhs> → rhs
[operative]
Evaluates the right-hand side, matches the left-hand side against it in the current environment, and returns it.
def
is the fundamental binding operator, others such as define
and
define-syntax
are defined in terms of it.
def
allows binding multiple values, as well as destructuring.
Examples
(def x 1) (assert (= x 1)) (def x 2) (assert (= x 2)) (def (a b c) (list 1 (list 2) 3)) (assert (= a 1)) (assert (= b '(2))) (assert (= c 3)) (def (a (b) c) (list 1 (list 2) 3)) (assert (= a 1)) (assert (= b 2)) (assert (= c 3)) (def (a . rest) (list 1 (list 2) 3)) (assert (= a 1)) (assert (= rest '((2) 3)))
define <lhs> <rhs> → result
[operative]
Scheme-like define
with two cases:
-
(define <name> <value>)
simply binds name to value, returning value. -
(define (<name> . <params>) . <body>)
binds name to an applicative with the given parameters and body expressions, returning the applicative.
Examples
(define foo 1) (assert (= foo 1)) (define foo 2) (assert (= foo 2)) (define (bar) 12) (assert (= (bar) 12)) (define (bar x y) (+ x y)) (assert (= (bar 1 2) 3)) (define (times number . rest) (map (lambda (x) (* number x)) rest)) (assert (= (times 3 1 2 3 4) '(3 6 9 12)))
define-syntax <lhs> <rhs> → result
[operative]
Scheme-like define-syntax
with two cases:
-
(define-syntax <name> <value>)
simply binds name to value, returning value. -
(define-syntax (<name> . <params>) <envparam> . <body>)
binds name to an operative with the given parameters, environment parameter, and body expressions, returning the operative.
Examples
(define-syntax my-quote (vau (x) #ign x)) (assert (= (my-quote foo) 'foo)) (define-syntax (my-when test . exprs) env (if (eval test env) (eval (list* begin exprs) env) #void)) (assert (= (my-when #t 1 2 3) 3)) (assert (= (my-when #f 1 2 3) #void))
let <bindings> . <body> → result
[operative]
Usual Scheme let
.
Examples
(assert (= 3 (let ((x 1) (y 2)) (+ x y))))
let* <bindings> . <body> → result
[operative]
Usual Scheme let*
.
letrec
and letrec*
are not provided because their effect can be
obtained with a sequence of define
expressions.
Examples
(assert (= 3 (let* ((x 1) (y (+ x 1))) (+ x y))))
set! <env> <lhs> <rhs> → rhs
[operative]
Updates the left-hand side by matching it against the right-hand side in the given environment.
Examples
(define x 1) (define x 2) (set! (current-environment) x 3) (set! (current-environment) y 4) (assert (= x 3)) (assert (= y 4)) (set! (current-environment) (x y) (list y x)) (assert (= x 4)) (assert (= y 3))
defined? <sym> <env> → boolean
[applicative]
Returns true if a symbol is bound in the environment, false otherwise.
Examples
(define x 1) (assert (defined? 'x (current-environment))) (assert (not (defined? 'y (current-environment))))
provide <names> . <exprs> → result
[operative]
Performs expressions in a new environment and exports only listed names to the outer environment.
Examples
(provide (foo bar) (define foo 1) (define bar 2) (define quux 3) ) (assert (= 1 foo)) (assert (= 2 bar)) (assert (not (defined? 'quux (current-environment))))
make-environment [<parent>] → environment
[applicative]
Creates a new empty environment with the given optional parent.
Examples
(define e (make-environment)) (eval (list define 'x 1) e) (assert (= 1 (eval 'x e))) (define f (make-environment e)) (assert (= 1 (eval 'x f))) (eval (list define 'x 2) f) (assert (= 1 (eval 'x e))) (assert (= 2 (eval 'x f)))
current-environment → environment
[applicative]
Returns the current environment.
Examples
(define x 1) (assert (= 1 (eval 'x (current-environment)))) (define (foo) (let ((y 2)) (current-environment))) (assert (= 2 (eval 'y (foo))))
Evaluation
vau <ptree> <envp> . <body> → operative
[operative]
Constructs a new compound operative that closes over the current environment with the given parameter tree, environment parameter, and body expression.
Examples
(define foo (vau (x) #ign x)) (assert (= '(+ 1 2) (foo (+ 1 2)))) (define bar (vau (x) env (eval x env))) (assert (= 3 (bar (+ 1 2))))
lambda <ptree> . <exprs> → applicative
[operative]
Creates an applicative combiner, as in Scheme.
Examples
(define foo (lambda (x) (+ x 1))) (assert (= 2 (foo 1))) (define quux (lambda args args)) (assert (= '(1 2) (quux 1 (+ 1 1))))
eval <expr> <env> → result
[applicative]
Evaluates the expression in the given environment.
Examples
(assert (= 4 (eval (list + 2 2) (current-environment))))
apply <apv> <args> → result
[applicative]
Applies an applicative to an arguments list.
Examples
(assert (= 4 (apply + (list 2 2))))
wrap <cmb> → applicative
[applicative]
Returns an applicative around an underlying combiner.
Examples
(define id (vau (x) #ign x)) (assert (= '(+ 1 2) (id (+ 1 2)))) (assert (= 3 ((wrap id) (+ 1 2))))
unwrap <cmb> → combiner
[applicative]
Returns the underlying combiner of an applicative.
Examples
(define foo (lambda (a b) (+ a b))) (assert (= 7 ((unwrap foo) 3 4)))
quote <form> → form
[operative]
Returns form unevaluated.
Examples
(assert (= '+ (car (quote (+ 2 2)))))
First-order Control
begin . <exprs> → result
[operative]
Evaluates expressions from left to right, returning the value of the
last. As a special case, (begin)
returns void.
Examples
(assert (= #void (begin))) (assert (= 1 (begin 1))) (assert (= 2 (begin 1 2))) (assert (= 3 (begin 1 2 3)))
if <test> <then> <else> → result
[operative]
Evaluates the test, and if it is false evaluates the else branch, otherwise evaluates the then branch.
Examples
(assert (= 1 (if #t 1 2))) (assert (= 2 (if #f 1 2))) (assert (= 1 (if 'foo 1 2)))
when <test> . <forms> → result
[operative]
Evaluates forms if test is true, returns void otherwise.
Examples
(assert (= 2 (when #t 1 2))) (assert (= #void (when #f 1 2))) (assert (= 2 (when 'foo 1 2)))
unless <test> . <forms> → result
[operative]
Evaluates forms if test is false, returns void otherwise.
Examples
(assert (= #void (unless #t 1 2))) (assert (= 2 (unless #f 1 2))) (assert (= #void (unless 'foo 1 2)))
cond . <clauses> → result
[operative]
Performs multiple tests. Each clause is of the form (<test> . <body>)
. Clauses are performed from left to right by evaluating
each clause's test expression until one is not false. This clause's
body forms are then evaluated and returned. There is no else
as in
Scheme, instead #t
should be used for a default clause. As a
special case, (cond)
returns void.
Examples
(define (my-number-type x) (cond ((< x 0) 'negative) ((> x 0) 'positive) (#t 'zero))) (assert (= 'negative (my-number-type -1))) (assert (= 'positive (my-number-type 1))) (assert (= 'zero (my-number-type 0)))
loop . <forms> → |
[operative]
Infinite loop.
Examples
(assert (= 11 (block exit (define x 0) (loop (set! (current-environment) x (+ x 1)) (when (> x 10) (return-from exit x))))))
while <test> . <forms> → |
[operative]
Performs forms while test is true.
Examples
(define x 0) (while (<= x 10) (set! (current-environment) x (+ x 1))) (assert (= x 11))
until <test> . <forms> → |
[operative]
Performs forms until test is true.
Examples
(define x 0) (until (> x 10) (set! (current-environment) x (+ x 1))) (assert (= x 11))
block <name> . <body> → result
[operative]
Performs body forms with name bound to a one-shot escape continuation
that can be invoked with return-from
.
Examples
(assert (= #void (block foo))) (assert (= 1 (block foo 1))) (assert (= 2 (block foo 1 2))) (assert (= 3 (block foo 1 (return-from foo 3) 2))) (assert (= 3 (block ret (for-each (lambda (x) (when (= 1 (/ x 3)) (return-from ret x))) '(1 2 3 4 5)))))
return-from <cont> [<val>] → |
[operative]
Invokes a one-shot escape continuation bound by block
, passing it
the given value, or void if no value is given.
An error is signalled if the continuation's extent has ended.
Examples
(assert (= #void (block foo (return-from foo)))) (assert (= 33 (block foo (return-from foo 33)))) (assert (= 33 (block foo (return-from foo 33) 1 2 3)))
unwind-protect <protected> . <cleanup> → result
[operative]
Executes and returns the value of the protected form. When control exits the protected form, either normally by a return, or abnormally through an escape continuation, the cleanup forms are executed. The cleanup forms are not executed when the protected form is aborted by higher-order control.
Examples
(assert (= 1 (unwind-protect 1))) (assert (= 1 (unwind-protect 1 2))) (assert (= 1 (unwind-protect 1 2 3))) (define env (current-environment)) (define x #f) (assert (= 1 (unwind-protect 1 (set! env x #t)))) (assert (= #t x))
Dynamic Binding
dnew <val> → dynamic
[applicative]
Creates a new dynamically-bound variable with the given global value, which will be used when there is no dynamic binding.
dlet <dynamic> <value> . <exprs> → result
[operative]
Performs expressions with the dynamic variable bound to the value.
dref <dynamic> → value
[applicative]
Retrieves the value of a dynamic variable.
Exception Handling
Wat's exception handling is based on the condition system of Common Lisp. Foremost is the ability to continue at the point of an exception by invoking a restart handler.
handle <body> . <handlers> → result
[operative] NIY
handle
establishes exception handlers for the duration of the
evaluation of the body form. When one of the handlers matches a
thrown exception, it will be called on the stack - i.e. the stack is
not unwound.
Each handler is of the form (<type> (<var>) . <handler-body>)
.
Handlers are matched against a thrown exception from left to right.
If a thrown exception is of the given type, then the <handler-body>
expressions will be executed with the variable <var>
bound to the
exception.
A handler may handle the exception by performing a nonlocal transfer
of control explicitly with return-from
, or implicitly with
e.g. invoke-restart
. If the handler normally returns, the search
for a handler continues up the stack to the next outer handle
or
catch
. If one of the handlers of a handle
form matches an
exception, no other handler of that form will be tried if it returns
normally. If no handler is found, the default-handler
generic
function is called on the exception.
While a handler body is executed, the current handlers are those that
were established at the time handle
was called. In other words,
while the call stack is not unwound when a handler is called, the
handler stack is unwound. This is analogous to Common Lisp's
condition firewall.
catch <body> . <handlers> → result
[operative] NIY
Like handle
, but unwinds the stack before executing handler, and
simply returns the result of evaluating the handler body. The handler
may rethrow the exception.
throw <exc> . <handlers> → result
[operative] NIY
Throws an exception and optionally binds restart handlers that an
exception handler may use to continue computation. Restart handlers
are installed as if by catch
, i.e. when a restart is invoked, the
stack is unwound and the result of the restart handler is returned.
throw
only returns normally if one of its restart handlers is
invoked, otherwise it always invokes the debugger. The restart
handlers are associated with the thrown exception, and only match
invoked restarts whose associated-exception
is the thrown exception.
default-handler <exc> → result
[generic] NIY
Called on an exception when no handler is found, or when all found
handlers returned normally. Different exception types may define
different methods. The default is to do nothing, which will cause
throw
to invoke the debugger.
restart-bind <body> . <handlers> → result
[operative] NIY
Executes a body form with restart handlers in effect. Restart
handlers are installed as if by catch
, i.e. when a restart is
invoked, the stack is unwound and the result of the restart handler is
returned. If any condition happens during evaluation of the body, the
restart handlers will be effective. This is unlike the restart
handlers bound by a throw
, which are associated with the thrown
exception. Restart handlers bound by restart-bind
are not
associated with any exception, and are therefore effective during
handling of any exception during the restart-bind
-form dynamic
extent.
invoke-restart <restart> → result
[applicative] NIY
Searches the stack for a restart handler established by a throw
or
restart-bind
that matches the restart, unwinds, and evaluates the
handler body. If no restart handler is found, an exception is thrown.
associated-exception <restart> → option
[generic] NIY
A restart intended for a restart handler established by throw
must
have the thrown exception as associated exception. Its type should
implement a method for this generic function that returns the
restart's associated exception. The associated exception is an option
type; it is none
if there is no associated exception, and (some <exc>)
for an associated exception.
Examples
This contrived example is commented because the exception handling system isn't implemented yet.
It shows how the function my-compute-something
handles the case of a
division by zero. If the divisor
argument is zero, it throws a
Div-by-Zero-Exception
, and associates a Use-Value-Restart
with it.

Note that capturing a continuation whose stack includes alien code that is not specially written to cooperate with Wat's suspension and resumption system will lead to undefined behavior.
make-prompt → prompt
[applicative]
Creates a fresh prompt.
push-prompt <prompt> . <forms> → result
[operative]
Pushes the continuation-delimiting prompt and executes forms in the new continuation.
take-subcont <prompt> <cont> . <forms> → result
[operative]
Aborts up to and including the prompt, and performs the forms with
<cont>
bound to the delimited continuation from the call to
take-subcont
up to but not including the prompt.
push-subcont <cont> . <forms> → result
[operative]
Prepends the delimited continuation to the current continuation, and performs forms in the new continuation.
Examples
(assert (= (let ((p (make-prompt))) (+ 2 (push-prompt p (if (take-subcont p k (+ (push-subcont k #f) (push-subcont k #t))) 3 4)))) 9))
shift <prompt> <cont> . <forms> → result
[operative]
Wrapper around take-subcont
with these differences:
- The continuation is represented as an applicative, not a first-class continuation.
- Immediately restores prompt around body forms.
- When continuation is invoked, it first pushes the prompt.
Types
make-type → (type tagger untagger)
[applicative]
Returns a list containing:
- a fresh first-class type;
- an applicative, the tagger, that takes a value and tags it with the type;
- an applicative, the untagger, that takes a tagged object created by the tagger and returns its value.
The untagger only untags objects created by the tagger.
type-of <val> → type
[applicative]
Returns an object's type. Every object has a type, whether built-in objects or tagged objects.
Void
, Ign
, Boolean
, Nil
, Pair
, Symbol
, String
, Number
, Applicative
, Operative
, Environment
, Vector
, Type
[variables]
Type constants for built-in types.
void?
, ign?
, boolean?
, null?
, pair?
, symbol?
, string?
, number?
, applicative?
, operative?
, environment?
, vector?
, type?
[applicatives]
Type predicates for built-in types.
Record Types
define-record-type <name> <ctor> <pred> . <fields> → type
[operative]
Defines a new record type with the given name.
ctor
is of the form (ctor-name . ctor-args)
. ctor-name
is bound
to a function that takes ctor-args
, which must be record field
names, as arguments, and creates a new instance of the record type
with the given fields initialized to the arguments.
pred
is bound to a function of one argument that returns true iff an
object is an instance of the record type.
Each element of fields
is of the form:
-
(name accessor-name)
, or -
(name accessor-name modifier-name)
.
Accessors and modifiers are generic functions.
Examples
(define-record-type Point (make-point x y) point? (x get-x set-x!) (y get-y set-y!)) (define p1 (make-point 1 2)) (assert (point? p1)) (assert (= 1 (get-x p1))) (assert (= 2 (get-y p1))) (set-x! p1 3) (set-y! p1 4) (assert (= 3 (get-x p1))) (assert (= 4 (get-y p1)))
Generic Functions and Methods
define-generic (<name> . <args>) . [<body>] → generic
[operative]
Defines a new generic function. If the optional body expressions are supplied, a default method is installed that will be used when no type-specific method is found.
define-method (<name> (<self> <type>) . <args>) . <body> → method
[operative]
Adds a method to a generic function.
Examples
(define-generic (->number obj)) (define-method (->number (self Number)) self) (define-method (->number (self String)) (string->number self)) (define-method (->number (self Symbol)) (string->number (symbol->string self)))
Common Generic Functionality
= <a> <b> → boolean
[generic]
Generic equality predicate. Different types may attach different
methods to this generic function. If no method is defined for a type,
falls back to eq?
.
Methods for the following types are predefined:
- Two symbols are equal if they have the same string name.
- Two numbers are equal if they are the same numerically.
- Two strings are equal if they contain the same code points.
/= <a> <b> → boolean
[applicative]
Inequality predicate, defined in terms of =
.
< <a> <b> → boolean
[generic]
Generic binary comparison function. A method is defined for numbers.
>
, <=
, >=
[applicatives]
Binary comparison functions defined in terms of <
and =
.
hash-code <obj> → number
[generic]
Generic hash function. Different types may attach different methods
to this generic function. If no method is defined for a type, falls
back to identity-hash-code
.
If two objects are generically equal by =
, their
generic hash codes must be equal, too. Conversely, if two objects
have different generic hash codes, they cannot be generically equal.
Booleans
and
, or
[operatives]
Short-circuiting binary logical connectives.
not
[applicative]
Unary logical connective.
Numbers
+
, -
, *
, /
, %
[applicatives]
The binary applicatives for addition, subtraction, multiplication, division, and modulo.
->number <obj> → number
[generic]
Turns some objects into a number. Methods are defined for strings and symbols, which are parsed as numbers.
Examples
(assert (= 3.55 (->number 3.55))) (assert (= 3.55 (->number "3.55")))
Strings
->string <obj> → string
[generic]
Turns any object into a string. Methods are defined for all built-in types.
Pairs and Lists
cons <car> <cdr> → cons
[applicative]
Creates a new cons with the given car and cdr.
car <pair> → value
[applicative]
Contents of the Address part of Register.
cdr <pair> → value
[applicative]
Contents of the Decrement part of Register.
caar
, cadr
, cdar
, cddr
[applicatives]
Combinations of car
and cdr
, e.g. (cadr x)
=== (car (cdr x))
.
list . <vals> → list
[applicative]
Constructs a nil-terminated list containing the values.
list* . <vals> → list
[applicative]
Constructs a list of the values, terminated by the last value.
Vectors
vector . <elements> → vector
[applicative]
Creates a new vector with the given elements.
vector-ref <vector> <index> → element
[applicative]
Returns the vector's element at the given index.
vector-set! <vector> <index> <element> → element
[applicative]
Updates the vector's element at the given index and returns it.
vector-length <vector> → number
[applicative]
Returns the number of elements in the vector.
Hashtables
Hashtable
[variable], hashtable?
[applicative] NIY
Hashtable type and type predicate.
make-hashtable <hashfn> <eqfn> → hashtable
[applicative] NIY
Creates a new hashtable with the given hash function and equality function.
make-identity-hashtable → hashtable
[applicative]
Creates a new hashtable with identity-hash-code
as hash function and eq?
as
equality function.
make-string-hashtable → hashtable
[applicative]
Creates a new hashtable that only supports strings as keys.
make-generic-hashtable → hashtable
[applicative] NIY
Creates a new hashtable with hash-code
as hash function and
=
as equality function.
hashtable-put! <hashtable> <key> <val> → val
[applicative] NIY
Associates key with value in hashtable.
hashtable-get <hashtable> <key> <default> → val
[applicative] NIY
Returns value associated with key from hash, or default value if not found.
Options
some <value> → option
[applicative]
none
[variable]
if-option (<name> <option>) <then> [<else>] → result
[operative]
Examples
(define x-opt (some 12)) (assert (= 12 (if-option (x x-opt) x 0))) (define x-opt none) (assert (= 0 (if-option (x x-opt) x 0)))
System
eq? <a> <b> → boolean
[applicative]
Returns true if the two values are pointer identical, false otherwise.
Note: it is advised against using eq?
except in special
circumstances. Because not even symbols or small numbers that "are
the same" are guaranteed to be eq?
, it can be confusing. The
generic equality predicate =
should almost always be
used instead.
identity-hash-code <obj> → number
[applicative]
Returns the system-determined identity hash code of the object, which
is equal if two objects are eq?
. It is unlikely that two different
objects have the same identity hash code.
read → form
[applicative]
Reads a form from the console and returns it.
display <msg> → msg
[applicative]
Prints a message string to the console and returns it.
fail <reason> → |
[applicative]
Halts evaluation with an object describing the reason (typically an error).
current-milliseconds → number
[applicative]
Returns the current milliseconds, for some implementation-specific value of "current milliseconds".
time . exprs → number
[operative]
Performs expressions and returns their result, displaying implementation-specific timing information.
JavaScript Bridge
The JavaScript object system is treacherous, so we don't even attempt
to somehow integrate it with Wat's. It is urged to convert JavaScript
objects to Wat objects as early as possible with from-js
, and
convert Wat objects to JavaScript objects as late as possible with
to-js
. JavaScript objects may not implement all Wat object
functionality, such as identity hash codes.
js-global <string> → result
[applicative]
Returns value of JavaScript global variable with given name.
js-set-global! <string> <val> → val
[applicative]
Updates value of JavaScript global variable with given name and returns it.
js-prop <object> <string> → result
[applicative]
Returns value of JavaScript member variable with given name of object.
js-set-prop! <object> <string> <val> → val
[applicative]
Updates value of JavaScript member variable with given name of object and returns it.
js-function <jsfun> → applicative
[applicative]
Creates an applicative that when called will call the given JavaScript function with the arguments it received.
js-method <string> → cmb
[applicative]
Creates an applicative that when called on an object and zero or more arguments will invoke the method with the given string name of the object with the given arguments.
to-js <obj> → jsobj
[applicative]
Tries to convert a Wat object, such as a string, to a similar JavaScript object.
from-js <js-obj> → obj
[applicative]
Tries to convert a JavaScript object, such as a string, to a similar Wat object.
js-null
[constant]
The JavaScript null value.
js-callback <cmb> → jsfun
[applicative]
Returns a JS function that, when called, will apply the provided combiner with the arguments the callback received.
define-js-method <name>
[operative]
Defines name as an applicative that when called on an object and
arguments will invoke the named JavaScript method of the object with
the arguments and return the result. Arguments are transformed to JS
with to-js
and the result is transformed to Wat with from-js
.
Examples
(define-js-method toString) (assert (= "foo" (toString "foo"))) (assert (= "12" (toString 12))) (assert (= "true" (toString #t))) (assert (= "false" (toString #f)))
Examples
Error Monad
Error monad from Filinski's Representing Monads. This shows that delimited continuations allow us to write monadic code - in direct style.
(define *default-prompt* (make-prompt)) (define (reflect m) (shift *default-prompt* k (ext k m))) (define (reify t) (push-prompt *default-prompt* (unit (t)))) (define-record-type Success (make-success a) success? (a get-success)) (define-record-type Error (make-error a) error? (a get-error)) (define (unit a) (make-success a)) (define (ext f m) (cond ((success? m) (f (get-success m))) ((error? m) m) (#t (fail "type error")))) (define (myraise e) (reflect (make-error e))) (define (myhandle t h) (let ((m (reify t))) (cond ((success? m) (get-success m)) ((error? m) (h (get-error m))) (#t (fail "type error"))))) (define (monadic* t) (myhandle (lambda () (t)) (lambda (s) s))) (define-syntax (monadic . exprs) env (eval (list monadic* (list* lambda () exprs)) env)) ;; Monadic code in direct style: (assert (= 3 (monadic (+ 1 2)))) (assert (= #f (monadic (+ 1 (+ 3 (myraise #f))))))
Date: 2012-09-16 17:29:12 CEST


public class TraceVehicleDataSource extends ContextualVehicleDataSource implements java.lang.Runnable
BaseVehicleDataSource.setCallback(SourceCallback)
function.| Constructor and Description |
|---|
TraceVehicleDataSource(Context context,
java.lang.String filename) |
TraceVehicleDataSource(Context context,
java.net.URI filename) |
TraceVehicleDataSource(Context context,
java.net.URI filename,
boolean loop) |
TraceVehicleDataSource(SourceCallback callback,
Context context,
java.net.URI filename)
Construct a trace data source with the given context, callback and
trace file resource URI.
|
TraceVehicleDataSource(SourceCallback callback,
Context context,
java.net.URI filename,
boolean loop) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
getTag()
Return a string suitable as a tag for logging.
|
boolean |
isConnected()
Consider the trace source "connected" if it's running and at least 1
measurement was parsed successfully from the file.
|
void |
run()
While running, continuously read from the trace file and send messages
to the callback.
|
boolean |
sameFilename(java.lang.String filename) |
void |
stop()
Stop trace file playback and the playback thread.
|
java.lang.String |
toString() |
static boolean |
validatePath(java.lang.String path) |
getContext
connected, disconnected, handleMessage, onPipelineActivated, onPipelineDeactivated, setCallback, waitForCallback
public TraceVehicleDataSource(SourceCallback callback, Context context, java.net.URI filename) throws DataSourceException
context
- the Activity or Service context, used to access the raw
trace file resource via Android.callback
- An object implementing the SourceCallback interface that
should receive data as it is received and parsed.filename
- a raw file resource URI of the format
"resource://resource_id"DataSourceException
- if no filename is specifiedpublic TraceVehicleDataSource(SourceCallback callback, Context context, java.net.URI filename, boolean loop) throws DataSourceException
DataSourceException
public TraceVehicleDataSource(Context context, java.net.URI filename) throws DataSourceException
DataSourceException
public TraceVehicleDataSource(Context context, java.lang.String filename) throws DataSourceException
DataSourceException
public TraceVehicleDataSource(Context context, java.net.URI filename, boolean loop) throws DataSourceException
DataSourceException
public boolean isConnected()
isConnected
in interface VehicleDataSource
isConnected
in class BaseVehicleDataSource
public void stop()
stop
in interface VehicleDataSource
stop
in class BaseVehicleDataSource
public void run()
run
in interface java.lang.Runnable
public static boolean validatePath(java.lang.String path)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean sameFilename(java.lang.String filename)
protected java.lang.String getTag()
BaseVehicleDataSource
getTag
in class BaseVehicleDataSource


Appetizers
Cucumber Salad
Simple fresh cucumber salad with rice vinegar, salt, pepper
Seaweed Salad
vinegar, soy sauce, sesame oil, sugar, pepper flakes, ginger, and garlic
Sashimi Salad
With micro greens and fresh fish of the day
Tofu Salad
With peppers and bean curds
Fried Oyster
With a lemony sauce on the side
Shrimp Shumai
Steamed Chinese dumplings
Soft Shell Crab
Deep Fried
Shishedo Peppers
Served with ponzu
Veggie Gyoza
Delicious vegetarian dumplings
Pork Gyoza
Juicy pork dumplings
Jalapeno Bomb
Deep fried japalenu stuffed with spicy tuna
Crispy Rice
Spicy tuna on deep fried rice
Egg roll
Vegetable egg roll


Keep up with the latest technology trends with our open source radar.
Check out our complete Radar and find out what you should consider in your projects.
Choose a strategic technology and start using it right away.
Rings are a sign of success. The closer to the center, the better the technology.


{% from 'button/macro.njk' import button %} {% extends '../layout.html' %} {% block pageTitle %} NHS Blood and Transplant {% endblock %} {% block beforeContent %} {% endblock %} {% block content %}
Thank you for volunteering to have the antibody levels in your blood plasma tested to see if you would be a suitable candidate to donate convalescent blood plasma.


const name = 'Simplilearn';
const greet = Hello, {name};
JSX is a syntax extension to JavaScript. It is used with React to describe what the user interface should look like. By using JSX, we can write HTML structures in the same file that contains JavaScript code. This makes the code easier to understand and debug, as it avoids the usage of complex JavaScript DOM structures.
React keeps a lightweight representation of the “real” DOM in the memory, and that is known as the “virtual” DOM (VDOM). Manipulating real DOM is much slower than manipulating VDOM because nothing gets drawn on the screen. When the state of an object changes, VDOM changes only that object in the real DOM instead of updating all of the objects.
React uses VDOM, which makes the web applications run much faster than those developed with alternate front-end frameworks. React breaks a complex user interface into individual components, allowing multiple users to work on each component simultaneously, thereby speeding up the development time.
React goes beyond simple UI design and has many extensions that offer complete application architecture support. It provides server-side rendering, which entails rendering a normally client-side only web application on the server, and then sends a fully rendered page to the client. It also employs Flux and Redux extensively in web application development. Finally, there is React Native, a popular framework derived from React, used to create cross-compatible mobile applications.
React’s one-way data binding keeps everything modular and fast. A unidirectional data flow means that when a developer designs a React app, they often nest child components within parent components. This way, a developer knows where and when an error occurs, giving them better control of the whole web application.
React applications are easy to test due to a large developer community. Facebook even provides a small browser extension that makes React debugging faster and easier.
Components are the building blocks of any React application, and a single app usually consists of multiple components.
function Greeting(props) {
return Welcome to {props.name}
;
}
class Greeting extends React.Component {
render() {
return Welcome to {this.props.name}
;
}
}
The state is a built-in React object that is used to contain data or information about the component. A component’s state can change over time; whenever it changes, the component re-renders. The change in state can happen as a response to user action or system-generated events, and these changes determine the behavior of the component and how it will rende
class Greetings extends React.Component {
state = { name: "World" };
updateName() {
this.setState({ name: "Simplilearn" });
}
render() {
return (
{this.state.name}
)
}
}
Props are short for properties. It is a React built-in object which stores the value of a tag’s attributes and works similar to the HTML attributes. It provides a way to pass data from one component to other components in the same way as arguments are passed in a function.
class Car extends React.Component {
render() {
return I am a {this.props.brand.model}!
;
}
}
class Garage extends React.Component {
render() {
const carinfo = {name: "Ford", model: "Mustang"};
return (
Who lives in my garage?
);
}
}
ReactDOM.render( , document.getElementById('root'));


Start
Start Show
Stop Show
Select Information Type:
None
Architect
Description
Year
Display Information
Next
Previous
Close


Helping you with dementia
Hello Linda.
You are visiting this page because you have been diagnosed with dementia by your doctor.
You will find services that you might find useful on this page.
You can also talk to a support worker if you need to.
You can use this service on your own, or you can ask a friend or family member to help you.
Services
There are a number of services which people with dementia often find useful. You can find them in the list below.
Not everyone will dementia will need to use all of these services.
- Lasting Power of Attorney
- Court of Protection
- Personal Independence Payment
- Carer's Allowance
Talk to a support worker
If you need to talk to a support worker, you do this through this page.
We will need to ask you some questions first, so that we can find the right person to speak to you.


"If you need the database to be fast, we recommend not putting too much data in it." https://github.com/gfredericks/quinedb
9/13/2016, 9:19:55 PM
Favs: 7
Retweets: 2
link--- layout: tweet ---
"If you need the database to be fast, we recommend not putting too much data in it." https://github.com/gfredericks/quinedb
9/13/2016, 9:19:55 PM
Favs: 7
Retweets: 2
link


Welcome
Welcome to participate in this experiment! In this experiment, we'll give you information (including elevation, slope, etc.) about 20 land areas one by one.
Your task is to predict what type of forest is most likely to grow/cover on each land.
The correct answer will be one out of the five types, 1. Spruce/Fir , 2. Lodgepole Pine , 3. Ponderosa pine , 4. Douglas-fir , and 5. Krummholz .
The whole process will take you about 10-20 minutes. And we will pay a 1 USD bonus if your prediction accuracy >= 95% in the 20 tasks.
We will conduct an attention check. If you fail the attention check, we may not pay you.
Before the actual task, let's first go through a tutorial, which can help you perform better in the formal experiment.
Let's start with a tutorial!
Page 1/2
Finally, we are willing to get some feedback about your experience and perceptions. Thank you.
Next Page
Forest Cover Type Classification
1/20
Elevation (m)
2473
Aspect (degree)
287
Slope (degree)
18
Horizontal Distance To Hydrology (m)
212
Vertical Distance To Hydrology (m)
54
Horizontal Distance To Roadways (m)
488
Hillshade_9am (degree)
168
Hillshade_Noon (degree)
236
Hillshade_3pm (degree)
208
Horizontal Distance To Fire Points (m)
1762
If you don't remember the meaning of a feature, or if you don't remember the characteristics of a type of forest, you can hover on the feature name or forest name to view its meaning.
Your prediction is AAA!
AI's suggestion: XXXXXXXXXXX
Below are AI's explanations. Orange bars
are evidence
for AI's prediction and
Blue bars
are evidence
against AI's prediction.
If you don't remember the meaning of a feature, or if you don't remember the characteristics of a type of forest, you can hover on the feature name or forest name to view its meaning.
1/20
Elevation (m)
2473
Aspect (degree)
287
Slope (degree)
18
Horizontal Distance To Hydrology (m)
212
Vertical Distance To Hydrology (m)
54
Horizontal Distance To Roadways (m)
488
Hillshade_9am (degree)
168
Hillshade_Noon (degree)
236
Hillshade_3pm (degree)
208
Horizontal Distance To Fire Points (m)
1762
Spruce/Fir
Lodgepole Pine
Ponderosa Pine
Douglas-fir
Krummholz
The importance of a feature is encoded by the length of the bar where a longer bar means greater impact and vice versa
The importance of a feature is encoded by the length of the bar where a longer bar means greater impact and vice versa
The importance of a feature is encoded by the length of the bar where a longer bar means greater impact and vice versa
The importance of a feature is encoded by the length of the bar where a longer bar means greater impact and vice versa
The importance of a feature is encoded by the length of the bar where a longer bar means greater impact and vice versa
Here is a brief introduction to five species of trees:
Spruce/Fir
Lodgepole Pine
Ponderosa pine
Douglas-fir
Krummholz
Shape
Pyramidal
Rounded
Irregular
Pyramidal
-
Growth Speed
Slow to Medium
Slow to Medium
Medium
Medium
-
Mature Height
30' - 60'
70' - 80'
25' - 30'
40' - 70'
-
Sun Preference
Full Sun
Full Sun, Partial Sun/Shade
Full Sun
Full Sun, Partial Sun/Shad
-
Soil Preference
Acidic, Drought, Loamy, Moist, Sandy, Well Drained
Acidic, Clay, Loamy, Moist, Rich, Sandy, Silty Loam, Well Drained
Alkaline, Drought, Loamy, Moist, Well Drained
Acidic, Moist, Well Drained
-
Habitat
High altitudes on the slopes of mountains and at high latitudes towards the north, south of the arctic tundra
Areas with cold, wet winters and warm, dry summers. In the southern part of its range, Sierra lodgepole pine grows under very dry conditions. The seasonal distribution of precipitation seems to be an important factor for determining its range. Snow melt in the spring supplies critical soil water which is used by the tree for rapid growth in early summer.
Deep, moist, well drained soil, but will adapt to a wide range of soil and growing conditions including alkaline, dry, low humidity, wind,and high elevation. It is highly drought tolerant once established. It is damaged by late frosts and is intolerant of shade. The thick bark makes it very resistant to wild fires.
Douglas fir forests can be found throughout the western United States. Their range is generally divided into two components — inland, mountainous regions where the Rocky Mountain variety of Douglas fir can be found and coastal areas where the coast Douglas fir variety thrives.
It's not a specific species of tree. The term "Krummholz" is applied to the bush-like growth-forms of Pinus mugo prostrata, Alnus viridis, and some species which are genetically determined. The term has also long been used by English-speaking botanists to refer to the clima stunted and distorted trees in the forest-tundra ecotone. They are usually grown in forest-tundra ecotone on the mountains in the European Alps, the Carpathians, and some other by which it is replaced und European mountain areas.
Picture
Feature name
Example
Meaning
Elevation (meter)
2473
Elevation in meters.
Aspect (degree)
287
Aspect is the orientation of slope, measured clockwise
in degrees from 0 to 360, where 0 is north-facing, 90
is east-facing, 180 is south-facing, and 270 is west-facing.
Slope (degree)
18
Slope (from 0 to 90) is the steepness or slope of the ground surface on which the plant grows. The higher the number, the steeper it is.
Horizontal_Distance_To_Hydrology (meter)
212
Horizontal distance to nearest surface water.
Vertical_Distance_To_Hydrology (meter)
54
Vertical distance to nearest surface water.
Horizontal_Distance_To_Roadways (meter)
488
Horizontal distance to nearest roadway.
Hillshade_9am
168
Hill shade index at 9am, summer solstice. The hillshade index ranges from 0 (complete shadow) to 255
(complete sun).
Hillshade_Noon
236
Hill shade index at noon, summer solstice. The hillshade index ranges from 0 (complete shadow) to 255
(complete sun).
Hillshade_3pm
208
Hill shade index at 3pm, summer solstice. The hillshade index ranges from 0 (complete shadow) to 255
(complete sun).
Horizontal_Distance_To_Fire_Point (meter)
1762
Horizontal distance to nearest wildfire ignition points.
1. Spruce/Fir
Growth Speed
Slow to Medium
Soil Preference
Acidic, Drought, Loamy, Moist, Sandy, Well Drained
Habitat
High altitudes on the slopes of mountains and at high latitudes towards the north, south of the arctic tundra
Picture
2. Lodgepole Pine
Growth Speed
Slow to Medium
Sun Preference
Full Sun, Partial Sun/Shade
Soil Preference
Acidic, Clay, Loamy, Moist, Rich, Sandy, Silty Loam, Well Drained
Habitat
Areas with cold, wet winters and warm, dry summers. In the southern part of its range, Sierra lodgepole pine
grows under very dry conditions. The seasonal distribution of precipitation seems to be an important factor for
determining its range. Snow melt in the spring supplies critical soil water which is used by the tree for rapid
growth in early summer.
Picture
3. Ponderosa pine
Soil Preference
Alkaline, Drought, Loamy, Moist, Well Drained
Habitat
Deep, moist, well drained soil, but will adapt to a wide range of soil and growing conditions including
alkaline, dry, low humidity, wind,and high elevation. It is highly drought tolerant once established. It is
damaged by late frosts and is intolerant of shade.
Complementary attributes
The thick bark makes it very resistant to wild fires.
Picture
4. Douglas-fir
Sun Preference
Full Sun, Partial Sun/Shad
Soil Preference
Acidic, Moist, Well Drained
Habitat
Douglas fir forests can be found throughout the western United States. Their range is generally divided into two
components — inland, mountainous regions where the Rocky Mountain variety of Douglas fir can be found and
coastal areas where the coast Douglas fir variety thrives.
Picture
5. Krummholz
Description
It's not a specific species of tree. The term "Krummholz" is applied to the bush-like growth-forms of Pinus mugo
prostrata, Alnus viridis, and some species
which are genetically determined. The term has also long been used by English-speaking botanists to refer to the
clima
stunted and distorted trees in the forest-tundra ecotone. They are usually grown in forest-tundra ecotone on the
mountains in the European Alps, the Carpathians, and some other by which it is replaced und European mountain
areas.
Picture
And here's the explanation for features of the species of tree:
1. Elevation: Elevation in meters.
2. Aspect: Aspect is the orientation of slope, measured clockwise
in degrees from 0 to 360, where 0 is north-facing, 90
is east-facing, 180 is south-facing, and 270 is west-facing.
3. Slope: Slope (from 0 to 90) is the steepness or slope of the ground surface on which the plant grows. The higher the number, the steeper it is.
4. Horizontal_Distance_To_Hydrology: Horizontal distance to nearest surface water.
5. Vertical_Distance_To_Hydrology: Vertical distance to nearest surface water.
6. Horizontal_Distance_To_Roadways: Horizontal distance to nearest roadway.
7. Hillshade_9am: Hill shade index at 9am, summer solstice. The hillshade index ranges from 0 (complete shadow) to 255
(complete sun).
8. Hillshade_Noon: Hill shade index at noon, summer solstice. The hillshade index ranges from 0 (complete shadow) to 255
(complete sun).
9. Hillshade_3pm: Hill shade index at 3pm, summer solstice. The hillshade index ranges from 0 (complete shadow) to 255
(complete sun).
10. Horizontal_Distance_To_Fire_Point: Horizontal distance to nearest wildfire ignition points.
Let's go through the three steps to finish one task!
First, you will be shown a table showing some characteristics of an area. You need to predict what types of trees grow in this area based on the characteristics of this land area.
If you don't remember the meaning of a feature, or if you don't remember the characteristics of a type of forest, you can hover on the feature name or forest name to view its meaning.
Elevation (m)
2473
Aspect (degree)
287
Slope (degree)
18
Horizontal Distance To Hydrology (m)
212
Vertical Distance To Hydrology (m)
54
Horizontal Distance To Roadways (m)
488
Hillshade_9am (degree)
168
Hillshade_Noon (degree)
236
Hillshade_3pm (degree)
208
Horizontal Distance To Fire Points (m)
1762
Second, an AI will give its suggestion and its explanations about why the AI makes this prediction. The explanation includes the contribution of each attribute to AI's prediction. Each attribute's contribution is plotted via a bar with color.
Orange bars
are evidence
for AI's prediction and
Blue bars
are evidence
against AI's prediction.
If you don't remember the meaning of a feature, or if you don't remember the characteristics of a type of forest, you can hover on the feature name or forest name to view its meaning.
Your prediction is AAA!
AI disagrees with you. AI's suggestion: TECHNOLOGY
Elevation (m)
3188
Aspect (degree)
24
Slope (degree)
15
Horizontal Distance To Hydrology (m)
335
Vertical Distance To Hydrology (m)
46
Horizontal Distance To Roadways (m)
2943
Hillshade_9am (degree)
211
Hillshade_Noon (degree)
207
Hillshade_3pm (degree)
129
Horizontal Distance To Fire Points (m)
4520
Spruce/Fir
Lodgepole Pine
Ponderosa Pine
Douglas-fir
Krummholz
The importance of a feature is encoded by the length of the bar where a longer bar means greater impact and vice versa
The importance of a feature is encoded by the length of the bar where a longer bar means greater impact and vice versa
The importance of a feature is encoded by the length of the bar where a longer bar means greater impact and vice versa
The importance of a feature is encoded by the length of the bar where a longer bar means greater impact and vice versa
The importance of a feature is encoded by the length of the bar where a longer bar means greater impact and vice versa
Finally, after seeing AI's assistance, you need to make your final prediction.
Now you have finished the tutorial. Let's move to the actual tasks!
Next Task
For any questions, please contact us .
Please copy the following Completion code to finish the process in Prolific. (Please wait for a minute as the server is processing your upload.)
Thanks for your time and efforts. You can close this window right now.
Thank you. You can close this window now.


We offer services based on different kinds of cancer and the stages entailed to them.Here are the types we deal with.
Kindly contact us on the following.
We are always available and ready to attend to you with care.Contact us when need be.
This treatment is delivered by a linear accelerator.It mainly controls or kills the cancer cells reducing the chances of cancer coming back to help reduce symptoms.
It uses high energy rays to destroy cancer cells.It is issued in two different ways.
A machine directs beams of radiation at the cancer.
A radioactive implant is placed inside your body near the cancer or it is swallowed or injected.
The type of treatment uses one or more anti-cancer drugs as part of standardized chemotherapy regimen.It can be given with a curative intentor aim to reduce sypmtoms.
It mainly focuses on the physical exercise of the muscles.This helps in strenghening the muscles and improving the function,preventing pain and injury.
The treatment boosts the body's natural defenses to fight cancer.It activates or suppresses the immune system.
The treatment slows or stops the growth of cancer that uses hormones to grow mainly Prostate and breast cancer.


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.
Page No.# 1/3 GAHC010264402019 THE GAUHATI HIGH COURT (HIGH COURT OF ASSAM, NAGALAND, MIZORAM AND ARUNACHAL PRADESH) Case No. : WA 6/2020 1:M/S T. G. ENTERPRISE, REP. BY ITS DIRECTOR P. TOHEVI AWOMI, AIKO BUILDING 5TH FLOOR, OPPOSITE- TOWN HALL, BANK COLONY, DIMAPUR, NAGALAND. VERSUS 1:NEW SOCUNOMA VILLAGE AND 6 ORS. REP. BY SHRI SALEW SEYIE, CHAIRMAN, NEW SOCUNOMA VILLAGE COUNCIL, P.O. MEDZIPHEMA, DIMAPUR, NAGALAND. 2:THE STATE OF NAGALAND REP. THROUGH THE CHIEF SECRETARY TO THE GOVT. OF NAGALAND KOHIMA. 3:THE PRINCIPAL SECRETARY DEPARTMENT OF ENVIRONMENT FORESTS AND CLIMATE CHANGE NAGALAND KOHIMA. 4:THE DEPUTY COMMISSIONER DIMAPUR NAGALAND. 5:THE ADDITIONAL DEPUTY COMMISSIONER MEDZIPHEMA DIMAPUR NAGALAND. 6:THE NAGALAND POLLUTION CONTROL BOARD REP. BY ITS MEMBER SECRETARY SIGNAL POINT DIMAPUR NAGALAND. 7:SHRI MHIESISATO VUPRU NEW SOCUNOMA VILLAGE P.O. MEDZIPHEMA DIMAPUR NAGALAND Advocate for the Petitioner : MR SISHIR DUTTA Advocate for the Respondent : GA, NAGALAND -BEFORE- HON'BLE THE CHIEF JUSTICE MR. AJAI LAMBA HON'BLE MR. JUSTICE SOUMITRA SAIKIA Page No.# 2/3 ORDER
Date : 09-01-2020 (Ajai Lamba, C.J.) M/s T.G. Enterprise has preferred this writ appeal challenging judgment dated 27.09.2019 rendered in WP(C) No.43/2019 (New Socunoma Village -Vs- State of Nagaland & Ors.).
2. Gist of the issue appears to be that the writ appellant wanted to set up a Stone Crusher Unit. The appellant was given to understand that consent from New Socunoma Village Council is required. The said consent was given by Head Gaon Burah. Subsequently, even the Nagaland Pollution Control Board gave consent to set up the Stone Crusher Unit. New Socunoma Village through Chairman of the Council preferred the writ petition pleading therein that Village Council is duly constituted under Section 3 of the Village Council Act, 1978. Only the Chairman can give consent, and not Head Gaon Burah.
3. Accepting the contention, the Writ Court allowed the writ petition and the concerned orders/inspection report were quashed.
4. Contention of learned counsel for the appellant is that the relevant provisions of Water (Prevention & Control of Pollution) Act, 1974 and other related laws do not inhere any such consent from the Council. In this regard, learned counsel has referred to the documents required to be enclosed at the time of applying for consent before the Board.
In the alternative, learned counsel has argued that Head Gaon Burah would be the authorised person to grant approval. The Chairman is indulging in arm twisting measures.
5. We hereby specifically call upon the Nagaland Pollution Control Board to file its reply as to whether consent of the Council, in such cases, is required or not.
6. We hereby direct the State of Nagaland to file reply as to who would be the competent authority on behalf of the Council to grant consent, in case such a consent is required.
7. We have taken notice of the fact that although caveat has been filed, however, despite best efforts, the caveator could not be contacted. The counsel could not be contacted on the mobile number given.
Page No.# 3/3
8. In such circumstances, we deem it appropriate to direct the appellant to serve all the respondents through ordinary process and dasti process also.
9. List on 3rd February, 2020.
10. Issue of stay would be considered on the next date of listing.
JUDGE CHIEF JUSTICE Comparing Assistant


Competitive analysis, technology training, and market research: tools and support for the Spokane regional business community.
A valid library card is all you need to get started.
Supported by Spokane County Library District and Spokane Public Library, the resources on this page are available at no cost to residents and organizations in Spokane County service area and the City of Spokane. Additional resources are available to the general public through Eastern Washington University Libraries.
The Spokane Business Library is a collaboration between Spokane County Library District and Spokane Public Library.
In developing a single county-wide platform featuring combined business resources, our goal is to provide all Spokane County residents with greater access to the business resources currently offered by the Spokane County Library District and Spokane Public Library.
To access these services you will need a valid library card.
Company profiles, industry reports, case studies, access to nearly 2,000 peer-reviewed business journals.
A scholarly business database providing a collection of bibliographic and full text content in all disciplines of business, including marketing, management, MIS, POM, accounting, finance and economics.
Updated monthly, Business Source Complete offers comprehensive full-text coverage plus indexing and abstracts for the most important scholarly business journals, dating back as far as 1886.
Additional full text, non-journal content includes financial data, books, monographs, major reference works, book digests, conference proceedings, case studies, investment research reports, industry reports, market research reports, country reports, company profiles, and SWOT analyses.
Demographics, consumer expenditures, interactive maps, and more.
“Who are my customers?” “Where do they live?” “What do they do?” And perhaps most importantly, “Who are my competitors?”
Access demographic information, such as: Population, Income, Housing, Age, Education, Businesses, Retail sales, Consumer expenditures.
Demographics Now includes the Dun & Bradstreet business database.
The only resource you need to search for the foundations most likely to give you grants.
Foundation Directory Online is a thorough database, comprising more than 140,000 grantmakers, that is updated weekly so you can count on the accuracy of results.
Multiple filters and an assessment tool help you quickly identify your best potential funding sources. You will also find grantmaker profiles, insights into previously awarded grants, maps and charts, lists of key decision makers and leaders, and a 990-PF tax form search.
Foundation Directory Online is only available on site at certain locations:
Hundreds of instructor-led online courses.
Gale Courses offer a wide range of highly interactive courses taught entirely online by college instructors and experts in the field, ensuring a high-quality, high-impact educational experience.
Courses run for six weeks and new sessions begin every month.
Industry research reports and risk ratings on every U.S. industry.
IBISWorld employs a team of dedicated expert analysts to research economic, demographic and government data to provide valuable insight into America’s 700+ industries, so you can make better business decisions, faster.
Each report consists of 30 to 40 pages of key statistics and analysis on market characteristics, operating conditions, current and forecast performance, major industry participants and more.
Whether your company requires a better understanding of market conditions and forecasts; whether you need a clearer picture of a supply chain, or whether you need to keep abreast of competitor activity in your industry, IBISWorld’s comprehensive reports will keep you informed.
IBISWorld is only available on site at the Downtown Library.
Everyone is welcome to use IBISWorld at the Downtown Library. You do not need a library card. Just bring your computer (or use one of ours).
On-demand technology, creative, and business training taught by industry experts.
With nearly 4,000 online courses all taught by industry experts, lynda.com offers on-demand training to help members achieve their personal and professional goals.
Every lynda.com course includes free video tutorials and is designed for users to set their own pace. Lessons and tutorials can be watched from your preferred browser on a computer, tablet, or mobile device. Course categories include developer, design, web, photography, business, education, 3D+ animation, video, and audio. Instructor and practice files are provided with each course to aid in the learning process.
Lynda.com provides tools for anyone—from entry to executive level—to advance in their career. Whether you’re an accomplished graphic designer interested in starting your own firm or a new teacher looking to master classroom technologies, you’ll find countless resources on lynda.com.
Online courseware for Microsoft technology training.
Courses cover a variety of Microsoft products and skill levels – ranging from beginner users to advanced technical courses that qualify for Microsoft Certification testing.
Courses include:
Provided freely by Microsoft and the Washington State Library.
Full-text access to Wall Street Journal issues going back to 1984, and the Spokesman Review going back to 1991.
Great for local research! Proquest provides full-text access to the Spokesman Review going back to 1991.
Full-text access to thousands of other newspapers and other publications is available as well.
Market research, competitive analysis, and sales lead list generation.
ReferenceUSA is the leading provider in business and consumer research! Offering a full-service platform, ReferenceUSA helps users create marketing plans, conduct competitive analysis, raise funds and locate people.
Reference USA database selections and real-time access to more than 20 Million Businesses, 222 Million Consumers, U.S. New Businesses, U.S. New Homeowners and Movers, make research easy and fast!
The Statistics Portal for Market Data, Market Research and Market Studies.
Statista is one of the world's largest statistics portals, bringing together statistics and market reports on over 80,000 topics arranged by business sector.
Statista is only available on site at library locations (SCLD or SPL).
Everyone is welcome to use Statista. You do not need a library card. Just bring your computer (or use one of ours).
Washington State and federal legal forms covering many important business use cases.
The Washington State Legal Forms Library offers access to hundreds of legal forms in several document formats, such as MS Word and Adobe PDF.
Some examples of the forms available include:
EWU Libraries offer several resources not available through Spokane Public Library or Spokane County Library District.
These resources are available to the general public by visiting the EWU Riverpoint Campus Library (map).
Full-text articles from over 100 scholarly business and economics journals, from the first issue up to 3-5 years ago.
Indexes articles on economics issues from over 750 journals and magazines, as well as dissertations, books, and working papers.
Summary of statistics on the social, political, and economic organization of the United States. Offers 1400+ individually indexed tables (with attached spreadsheets), both searchable and browsable.
U.S. and international company financial information, market research, industry reports, & SEC filings.
Offers industry sector analysis and research, industry trends and industry statistics for market research, vertical industry marketing data, or industry trends analysis.
Comprehensive database for communication and mass media issues, covering over 800 journals, of which around 350 are available in full text. Selected core titles are indexed back to the first issue.
Find data for over 800,000 privately-held companies. Data includes company financials, detailed business descriptions, funding histories, acquisitions, competitors, IPO activity, and bankruptcy/restructuring info.
Full text market research reports on all business sectors. Also includes marketing reports on current trends (e-commerce, green, social media, etc.) and by demographic groups. Reports include detailed analysis and data and are segmented to make it easier to jump to the section you care about. Can download sections as PDFs, MS Word, Excel, or use the Export function to download as RTF files.
NOTE: On the initial screen, you must agree to abide by their Conditions of Use before proceeding to the reports.
Offers business and financial information on global, publicly listed companies.Included are SEC financial statements.
We welcome all inquiries.
Please contact the library where you are a cardholder. Thanks!
We can help. Schedule one-on-one training with a Business Librarian.
What if I don't have a library card? How do I identify my library card?


Earth Hour
问题描述 :
Earth Hour is an annual international event created by the WWF (World Wide Fund for Nature/World Wildlife Fund), held on the last Saturday of March, that asks households and businesses to turn off their non-essential lights and electrical appliances for one hour to raise awareness towards the need to take action on climate change.
To respond to the event of this year, the manager of Hunan University campus decides to turn off some street lights at night. Each street light can be viewed as a point in a plane, which casts flash in a circular area with certain radius.
What’s more, if two illuminated circles share one intersection or a point, they can be regarded as connected.
Now the manager wants to turn off as many lights as possible, guaranteeing that the illuminated area of the library, the study room and the dormitory are still connected(directly or indirectly). So, at least the lights in these three places will not be turned off.
To respond to the event of this year, the manager of Hunan University campus decides to turn off some street lights at night. Each street light can be viewed as a point in a plane, which casts flash in a circular area with certain radius.
What’s more, if two illuminated circles share one intersection or a point, they can be regarded as connected.
Now the manager wants to turn off as many lights as possible, guaranteeing that the illuminated area of the library, the study room and the dormitory are still connected(directly or indirectly). So, at least the lights in these three places will not be turned off.
输入:
The first line contains a single integer T, which tells you there are T cases followed.
In each case:
The first line is an integer N( 3<=N<=200 ), means there are N street lights at total.
Then there are N lines: each line contain 3 integers, X,Y,R,( 1<=X,Y,R<=1000 ), means the light in position(X,Y) can illuminate a circle area with the radius of R. Note that the 1st of the N lines is corresponding to the library, the 2nd line is corresponding to the study room, and the 3rd line is corresponding to the dorm.
In each case:
The first line is an integer N( 3<=N<=200 ), means there are N street lights at total.
Then there are N lines: each line contain 3 integers, X,Y,R,( 1<=X,Y,R<=1000 ), means the light in position(X,Y) can illuminate a circle area with the radius of R. Note that the 1st of the N lines is corresponding to the library, the 2nd line is corresponding to the study room, and the 3rd line is corresponding to the dorm.
输出:
The first line contains a single integer T, which tells you there are T cases followed.
In each case:
The first line is an integer N( 3<=N<=200 ), means there are N street lights at total.
Then there are N lines: each line contain 3 integers, X,Y,R,( 1<=X,Y,R<=1000 ), means the light in position(X,Y) can illuminate a circle area with the radius of R. Note that the 1st of the N lines is corresponding to the library, the 2nd line is corresponding to the study room, and the 3rd line is corresponding to the dorm.
In each case:
The first line is an integer N( 3<=N<=200 ), means there are N street lights at total.
Then there are N lines: each line contain 3 integers, X,Y,R,( 1<=X,Y,R<=1000 ), means the light in position(X,Y) can illuminate a circle area with the radius of R. Note that the 1st of the N lines is corresponding to the library, the 2nd line is corresponding to the study room, and the 3rd line is corresponding to the dorm.

实在不明白，为什么这样能ac。比如：这样得出的
点10作为中心是最合适的，那么如果1到10的路径上有边
与2到10的路径上的边重合的话，那么这方法坑定的不对
啊~！
2012-07-25
*/
#include"stdio.h" #include"math.h" #include"string.h" int queue[5555]; struct A { int x,y; int r; int total; int mem[222]; }E[222]; int n; int dis[222]; int dis_1[222]; int dis_2[222]; int dis_3[222]; int MIN(int a,int b) { return a>b?b:a; } void SPFA(int s) { int key,k; int i; int hash[222]; int temp; for(i=1;i<=n;i++) dis[i]=1111111; dis[s]=0; memset(hash,0,sizeof(hash)); k=0; key=1; queue[0]=s; hash[s]=1; while(k<key) { for(i=0;i<E[queue[k]].total;i++) { temp=dis[queue[k]]+1; if(temp<dis[E[queue[k]].mem[i]]) { dis[E[queue[k]].mem[i]]=temp; if(!hash[E[queue[k]].mem[i]]) { hash[E[queue[k]].mem[i]]=1; queue[key++]=E[queue[k]].mem[i]; } } } hash[queue[k]]=0; k++; } } int main() { int T; int i,l; int t1,t2; int min; scanf("%d",&T); while(T--) { scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d%d%d",&E[i].x,&E[i].y,&E[i].r); for(i=1;i<=n;i++) { E[i].total=0; for(l=1;l<=n;l++) { if(i==l) continue; t1=abs(E[i].x-E[l].x)*abs(E[i].x-E[l].x)+abs(E[i].y-E[l].y)*abs(E[i].y-E[l].y); t2=(E[i].r+E[l].r)*(E[i].r+E[l].r); if(t2>=t1) E[i].mem[E[i].total++]=l; } } SPFA(1); for(i=1;i<=n;i++) dis_1[i]=dis[i]; SPFA(2); for(i=1;i<=n;i++) dis_2[i]=dis[i]; SPFA(3); for(i=1;i<=n;i++) dis_3[i]=dis[i]; min=111111; for(i=1;i<=n;i++) min=MIN(min,dis_1[i]+dis_2[i]+dis_3[i]); if(min==111111) printf("-1\n"); else printf("%d\n",n-min-1); } return 0; }
版权声明：本文为博主原创文章，未经博主允许不得转载。
参考：http://blog.csdn.net/ice_crazy/article/details/7783959
(adsbygoogle = window.adsbygoogle || []).push({});
已经出去了吧
已经出去了吧
已经出去了吧
已经出去了吧
已经出去了吧
已经出去了吧
已经出去了吧
已经出去了吧
刚开始学习，为啥会报错了
好网站，肯定会火的
5.1处，反了；“上一个操作符的优先级比操作符ch的优先级大，或栈是空的就入栈。”如代码所述，应为“上一个操作符的优先级比操作符ch的优先级小，或栈是空的就入栈。”
有没有C++语言的代码？
没错的，再乘以m的就多余了
great!
有意思，有难度
第二个是python代码啊。。
无需用转移方程也可以解决，哈哈
这种题解就相当于直接贴代码了，，想看的是思路
不错，现在就缺少新的资料
不错，再多来的CF上面的题
printf这个函数在计算的时候是从右到左，打印是从左到右。
第二个方法挺不错。NewHead代表新的头节点，通过递归找到最后一个节点之后，就把这个节点赋给NewHead，然后一直返回返回，中途这个值是没有变化的，一边返回一边把相应的指针方向颠倒，最后结束时返回新的头节点到主函数。


Stuff (that is, THREE.Material) that things in scapes can be made out of.
Members
-
<static> concrete
-
concrete in a sort of mid-grey
-
<static> dirt
-
dirt for general use
-
<static> dirt[0-9]
-
dirt at varying moisture levels: dirt0 is dry and light in colour, dirt9 is moist and dark.
-
<static> foliage
-
a generic greenish leaf material
-
<static> foliage
-
a generic greenish leaf material
-
<static> generic
-
generic stuff, for if nothing else is specified
-
<static> glossBlack
-
gloss black, for shiny black painted surfaces
-
<static> leaflitter
-
leaf litter, which in reality is usually brownish, but this has a greenish tone to distinguish it from plain dirt.
-
<static> lightwood
-
light wood for gumtrees etc. Maybe it's a bit too light?
-
<static> metal
-
silvery metal
-
<static> plastic
-
plastic, a generic whitish plastic with a bit of shininess
-
<static> pointFoliage
-
a foliage material for use in point cloud objects
-
<static> water
-
water is blue and a bit transparent
-
<static> wood
-
generic brown wood


"""
Covariance estimators using shrinkage.
Shrinkage corresponds to regularising `cov` using a convex combination:
shrunk_cov = (1-shrinkage)*cov + shrinkage*structured_estimate.
"""
# Author: Alexandre Gramfort<EMAIL_ADDRESS># Gael Varoquaux<EMAIL_ADDRESS># Virgile Fritsch<EMAIL_ADDRESS>#
# License: BSD 3 clause
# avoid division truncation
from __future__ import division
import warnings
import numpy as np
from .empirical_covariance_ import empirical_covariance, EmpiricalCovariance
from ..externals.six.moves import xrange
from ..utils import check_array
# ShrunkCovariance estimator
def shrunk_covariance(emp_cov, shrinkage=0.1):
"""Calculates a covariance matrix shrunk on the diagonal
Read more in the :ref:`User Guide <shrunk_covariance>`.
Parameters
----------
emp_cov : array-like, shape (n_features, n_features)
Covariance matrix to be shrunk
shrinkage : float, 0 <= shrinkage <= 1
Coefficient in the convex combination used for the computation
of the shrunk estimate.
Returns
-------
shrunk_cov : array-like
Shrunk covariance.
Notes
-----
The regularized (shrunk) covariance is given by
(1 - shrinkage)*cov
+ shrinkage*mu*np.identity(n_features)
where mu = trace(cov) / n_features
"""
emp_cov = check_array(emp_cov)
n_features = emp_cov.shape[0]
mu = np.trace(emp_cov) / n_features
shrunk_cov = (1. - shrinkage) * emp_cov
shrunk_cov.flat[::n_features + 1] += shrinkage * mu
return shrunk_cov
class ShrunkCovariance(EmpiricalCovariance):
"""Covariance estimator with shrinkage
Read more in the :ref:`User Guide <shrunk_covariance>`.
Parameters
----------
store_precision : boolean, default True
Specify if the estimated precision is stored
assume_centered : boolean, default False
If True, data are not centered before computation.
Useful when working with data whose mean is almost, but not exactly
zero.
If False, data are centered before computation.
shrinkage : float, 0 <= shrinkage <= 1, default 0.1
Coefficient in the convex combination used for the computation
of the shrunk estimate.
Attributes
----------
covariance_ : array-like, shape (n_features, n_features)
Estimated covariance matrix
precision_ : array-like, shape (n_features, n_features)
Estimated pseudo inverse matrix.
(stored only if store_precision is True)
shrinkage : float, 0 <= shrinkage <= 1
Coefficient in the convex combination used for the computation
of the shrunk estimate.
Notes
-----
The regularized covariance is given by
(1 - shrinkage)*cov
+ shrinkage*mu*np.identity(n_features)
where mu = trace(cov) / n_features
"""
def __init__(self, store_precision=True, assume_centered=False,
shrinkage=0.1):
super(ShrunkCovariance, self).__init__(store_precision=store_precision,
assume_centered=assume_centered)
self.shrinkage = shrinkage
[docs] def fit(self, X, y=None):
""" Fits the shrunk covariance model
according to the given training data and parameters.
Parameters
----------
X : array-like, shape = [n_samples, n_features]
Training data, where n_samples is the number of samples
and n_features is the number of features.
y : not used, present for API consistence purpose.
Returns
-------
self : object
Returns self.
"""
X = check_array(X)
# Not calling the parent object to fit, to avoid a potential
# matrix inversion when setting the precision
if self.assume_centered:
self.location_ = np.zeros(X.shape[1])
else:
self.location_ = X.mean(0)
covariance = empirical_covariance(
X, assume_centered=self.assume_centered)
covariance = shrunk_covariance(covariance, self.shrinkage)
self._set_covariance(covariance)
return self
# Ledoit-Wolf estimator
def ledoit_wolf_shrinkage(X, assume_centered=False, block_size=1000):
"""Estimates the shrunk Ledoit-Wolf covariance matrix.
Read more in the :ref:`User Guide <shrunk_covariance>`.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Data from which to compute the Ledoit-Wolf shrunk covariance shrinkage.
assume_centered : Boolean
If True, data are not centered before computation.
Useful to work with data whose mean is significantly equal to
zero but is not exactly zero.
If False, data are centered before computation.
block_size : int
Size of the blocks into which the covariance matrix will be split.
Returns
-------
shrinkage : float
Coefficient in the convex combination used for the computation
of the shrunk estimate.
Notes
-----
The regularized (shrunk) covariance is:
(1 - shrinkage)*cov
+ shrinkage * mu * np.identity(n_features)
where mu = trace(cov) / n_features
"""
X = np.asarray(X)
# for only one feature, the result is the same whatever the shrinkage
if len(X.shape) == 2 and X.shape[1] == 1:
return 0.
if X.ndim == 1:
X = np.reshape(X, (1, -1))
if X.shape[0] == 1:
warnings.warn("Only one sample available. "
"You may want to reshape your data array")
n_samples, n_features = X.shape
# optionally center data
if not assume_centered:
X = X - X.mean(0)
# A non-blocked version of the computation is present in the tests
# in tests/test_covariance.py
# number of blocks to split the covariance matrix into
n_splits = int(n_features / block_size)
X2 = X ** 2
emp_cov_trace = np.sum(X2, axis=0) / n_samples
mu = np.sum(emp_cov_trace) / n_features
beta_ = 0. # sum of the coefficients of <X2.T, X2>
delta_ = 0. # sum of the *squared* coefficients of <X.T, X>
# starting block computation
for i in xrange(n_splits):
for j in xrange(n_splits):
rows = slice(block_size * i, block_size * (i + 1))
cols = slice(block_size * j, block_size * (j + 1))
beta_ += np.sum(np.dot(X2.T[rows], X2[:, cols]))
delta_ += np.sum(np.dot(X.T[rows], X[:, cols]) ** 2)
rows = slice(block_size * i, block_size * (i + 1))
beta_ += np.sum(np.dot(X2.T[rows], X2[:, block_size * n_splits:]))
delta_ += np.sum(
np.dot(X.T[rows], X[:, block_size * n_splits:]) ** 2)
for j in xrange(n_splits):
cols = slice(block_size * j, block_size * (j + 1))
beta_ += np.sum(np.dot(X2.T[block_size * n_splits:], X2[:, cols]))
delta_ += np.sum(
np.dot(X.T[block_size * n_splits:], X[:, cols]) ** 2)
delta_ += np.sum(np.dot(X.T[block_size * n_splits:],
X[:, block_size * n_splits:]) ** 2)
delta_ /= n_samples ** 2
beta_ += np.sum(np.dot(X2.T[block_size * n_splits:],
X2[:, block_size * n_splits:]))
# use delta_ to compute beta
beta = 1. / (n_features * n_samples) * (beta_ / n_samples - delta_)
# delta is the sum of the squared coefficients of (<X.T,X> - mu*Id) / p
delta = delta_ - 2. * mu * emp_cov_trace.sum() + n_features * mu ** 2
delta /= n_features
# get final beta as the min between beta and delta
# We do this to prevent shrinking more than "1", which whould invert
# the value of covariances
beta = min(beta, delta)
# finally get shrinkage
shrinkage = 0 if beta == 0 else beta / delta
return shrinkage
def ledoit_wolf(X, assume_centered=False, block_size=1000):
"""Estimates the shrunk Ledoit-Wolf covariance matrix.
Read more in the :ref:`User Guide <shrunk_covariance>`.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Data from which to compute the covariance estimate
assume_centered : boolean, default=False
If True, data are not centered before computation.
Useful to work with data whose mean is significantly equal to
zero but is not exactly zero.
If False, data are centered before computation.
block_size : int, default=1000
Size of the blocks into which the covariance matrix will be split.
This is purely a memory optimization and does not affect results.
Returns
-------
shrunk_cov : array-like, shape (n_features, n_features)
Shrunk covariance.
shrinkage : float
Coefficient in the convex combination used for the computation
of the shrunk estimate.
Notes
-----
The regularized (shrunk) covariance is:
(1 - shrinkage)*cov
+ shrinkage * mu * np.identity(n_features)
where mu = trace(cov) / n_features
"""
X = np.asarray(X)
# for only one feature, the result is the same whatever the shrinkage
if len(X.shape) == 2 and X.shape[1] == 1:
if not assume_centered:
X = X - X.mean()
return np.atleast_2d((X ** 2).mean()), 0.
if X.ndim == 1:
X = np.reshape(X, (1, -1))
warnings.warn("Only one sample available. "
"You may want to reshape your data array")
n_samples = 1
n_features = X.size
else:
n_samples, n_features = X.shape
# get Ledoit-Wolf shrinkage
shrinkage = ledoit_wolf_shrinkage(
X, assume_centered=assume_centered, block_size=block_size)
emp_cov = empirical_covariance(X, assume_centered=assume_centered)
mu = np.sum(np.trace(emp_cov)) / n_features
shrunk_cov = (1. - shrinkage) * emp_cov
shrunk_cov.flat[::n_features + 1] += shrinkage * mu
return shrunk_cov, shrinkage
class LedoitWolf(EmpiricalCovariance):
"""LedoitWolf Estimator
Ledoit-Wolf is a particular form of shrinkage, where the shrinkage
coefficient is computed using O. Ledoit and M. Wolf's formula as
described in "A Well-Conditioned Estimator for Large-Dimensional
Covariance Matrices", Ledoit and Wolf, Journal of Multivariate
Analysis, Volume 88, Issue 2, February 2004, pages 365-411.
Read more in the :ref:`User Guide <shrunk_covariance>`.
Parameters
----------
store_precision : bool, default=True
Specify if the estimated precision is stored.
assume_centered : bool, default=False
If True, data are not centered before computation.
Useful when working with data whose mean is almost, but not exactly
zero.
If False (default), data are centered before computation.
block_size : int, default=1000
Size of the blocks into which the covariance matrix will be split
during its Ledoit-Wolf estimation. This is purely a memory
optimization and does not affect results.
Attributes
----------
covariance_ : array-like, shape (n_features, n_features)
Estimated covariance matrix
precision_ : array-like, shape (n_features, n_features)
Estimated pseudo inverse matrix.
(stored only if store_precision is True)
shrinkage_ : float, 0 <= shrinkage <= 1
Coefficient in the convex combination used for the computation
of the shrunk estimate.
Notes
-----
The regularised covariance is::
(1 - shrinkage)*cov
+ shrinkage*mu*np.identity(n_features)
where mu = trace(cov) / n_features
and shrinkage is given by the Ledoit and Wolf formula (see References)
References
----------
"A Well-Conditioned Estimator for Large-Dimensional Covariance Matrices",
Ledoit and Wolf, Journal of Multivariate Analysis, Volume 88, Issue 2,
February 2004, pages 365-411.
"""
def __init__(self, store_precision=True, assume_centered=False,
block_size=1000):
super(LedoitWolf, self).__init__(store_precision=store_precision,
assume_centered=assume_centered)
self.block_size = block_size
[docs] def fit(self, X, y=None):
""" Fits the Ledoit-Wolf shrunk covariance model
according to the given training data and parameters.
Parameters
----------
X : array-like, shape = [n_samples, n_features]
Training data, where n_samples is the number of samples
and n_features is the number of features.
y : not used, present for API consistence purpose.
Returns
-------
self : object
Returns self.
"""
# Not calling the parent object to fit, to avoid computing the
# covariance matrix (and potentially the precision)
X = check_array(X)
if self.assume_centered:
self.location_ = np.zeros(X.shape[1])
else:
self.location_ = X.mean(0)
covariance, shrinkage = ledoit_wolf(X - self.location_,
assume_centered=True,
block_size=self.block_size)
self.shrinkage_ = shrinkage
self._set_covariance(covariance)
return self
# OAS estimator
def oas(X, assume_centered=False):
"""Estimate covariance with the Oracle Approximating Shrinkage algorithm.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Data from which to compute the covariance estimate.
assume_centered : boolean
If True, data are not centered before computation.
Useful to work with data whose mean is significantly equal to
zero but is not exactly zero.
If False, data are centered before computation.
Returns
-------
shrunk_cov : array-like, shape (n_features, n_features)
Shrunk covariance.
shrinkage : float
Coefficient in the convex combination used for the computation
of the shrunk estimate.
Notes
-----
The regularised (shrunk) covariance is:
(1 - shrinkage)*cov
+ shrinkage * mu * np.identity(n_features)
where mu = trace(cov) / n_features
The formula we used to implement the OAS
does not correspond to the one given in the article. It has been taken
from the MATLAB program available from the author's webpage
(http://tbayes.eecs.umich.edu/yilun/covestimation).
"""
X = np.asarray(X)
# for only one feature, the result is the same whatever the shrinkage
if len(X.shape) == 2 and X.shape[1] == 1:
if not assume_centered:
X = X - X.mean()
return np.atleast_2d((X ** 2).mean()), 0.
if X.ndim == 1:
X = np.reshape(X, (1, -1))
warnings.warn("Only one sample available. "
"You may want to reshape your data array")
n_samples = 1
n_features = X.size
else:
n_samples, n_features = X.shape
emp_cov = empirical_covariance(X, assume_centered=assume_centered)
mu = np.trace(emp_cov) / n_features
# formula from Chen et al.'s **implementation**
alpha = np.mean(emp_cov ** 2)
num = alpha + mu ** 2
den = (n_samples + 1.) * (alpha - (mu ** 2) / n_features)
shrinkage = 1. if den == 0 else min(num / den, 1.)
shrunk_cov = (1. - shrinkage) * emp_cov
shrunk_cov.flat[::n_features + 1] += shrinkage * mu
return shrunk_cov, shrinkage
class OAS(EmpiricalCovariance):
"""Oracle Approximating Shrinkage Estimator
Read more in the :ref:`User Guide <shrunk_covariance>`.
OAS is a particular form of shrinkage described in
"Shrinkage Algorithms for MMSE Covariance Estimation"
Chen et al., IEEE Trans. on Sign. Proc., Volume 58, Issue 10, October 2010.
The formula used here does not correspond to the one given in the
article. It has been taken from the Matlab program available from the
authors' webpage (http://tbayes.eecs.umich.edu/yilun/covestimation).
In the original article, formula (23) states that 2/p is multiplied by
Trace(cov*cov) in both the numerator and denominator, this operation is omitted
in the author's MATLAB program because for a large p, the value of 2/p is so
small that it doesn't affect the value of the estimator.
Parameters
----------
store_precision : bool, default=True
Specify if the estimated precision is stored.
assume_centered : bool, default=False
If True, data are not centered before computation.
Useful when working with data whose mean is almost, but not exactly
zero.
If False (default), data are centered before computation.
Attributes
----------
covariance_ : array-like, shape (n_features, n_features)
Estimated covariance matrix.
precision_ : array-like, shape (n_features, n_features)
Estimated pseudo inverse matrix.
(stored only if store_precision is True)
shrinkage_ : float, 0 <= shrinkage <= 1
coefficient in the convex combination used for the computation
of the shrunk estimate.
Notes
-----
The regularised covariance is::
(1 - shrinkage)*cov
+ shrinkage*mu*np.identity(n_features)
where mu = trace(cov) / n_features
and shrinkage is given by the OAS formula (see References)
References
----------
"Shrinkage Algorithms for MMSE Covariance Estimation"
Chen et al., IEEE Trans. on Sign. Proc., Volume 58, Issue 10, October 2010.
"""
[docs] def fit(self, X, y=None):
""" Fits the Oracle Approximating Shrinkage covariance model
according to the given training data and parameters.
Parameters
----------
X : array-like, shape = [n_samples, n_features]
Training data, where n_samples is the number of samples
and n_features is the number of features.
y : not used, present for API consistence purpose.
Returns
-------
self : object
Returns self.
"""
X = check_array(X)
# Not calling the parent object to fit, to avoid computing the
# covariance matrix (and potentially the precision)
if self.assume_centered:
self.location_ = np.zeros(X.shape[1])
else:
self.location_ = X.mean(0)
covariance, shrinkage = oas(X - self.location_, assume_centered=True)
self.shrinkage_ = shrinkage
self._set_covariance(covariance)
return self


Iran vows to punish ‘mercenaries’ behind street violence
CAIRO: One of the armed groups fighting for control of Libya’s capital says it is imposing a “no-fly zone” there.
The self-styled Libyan National Army’s announcement comes after two unmanned drone aircraft — one American and one Italian — were lost near the capital last week.
The LNA has said it shot down the Italian drone, while the US military hasn’t given a reason for its drone’s loss.
Ahmed Al-Mosmari, an LNA spokesman, said late Saturday that all flights over Tripoli and nearby towns are “prohibited without prior coordination.”
Oil-rich Libya is split between rival governments. A UN-supported but weak administration holds the capital, Tripoli. The LNA is allied with the government based in the country’s east.
The LNA has been trying to capture Tripoli since April.


I got this implant hoping it would be the best decision of my life.
Instead, I think this is the most miserable I've ever been.
SENT2
I've been spotting for an entire month, and it looks like it's not stopping anytime soon. I called the doctor 2 weeks into the spotting, and they told me if it continued to call them the next week. I called them the next week, they brought me in to test for anemia. They find out I don't have it, and the doctor tells me they want me to wait until the 3 month adjustment period is over (May 25) before they decide to give me medication. I get more and more frustrated everyday. I don't know if it's worth waiting till May so I can get medication or if I should just get it out soon and be done with this.


My name is Joel and I'm a UK based freelance web and mobile application developer, specializing in building performant, scalable server and client apps, that look and feel great on any device and screen, from iOS/Android to the Browser.
I can help you no matter where you are, having huge experience working with companies and development teams from all over the world.
Find Out More About JoelFully responsive web apps that look and work amazing any any device, and perform brilliantly from the server to the client.
Architecture, Infrastructure, Databases, SysAdmin, Best Practices, Code Reviews, DevOps, Lead Developer. From startups to SMEs.
A polyglot software engineer, manager and CTO for nearly two decades. I can complement your existing team, or simply be your team!
Passion makes amazing things happen, and I have it in spades! From the server to the browser, I'm an expert!
Looking for a Mobile App or Web App developer? iOS or Android App development. DevOps, SysAdmin, AWS expert. Working from Manchester, Lancashire, North-West UK.


To try out this demo, click the settings button (to the right with the gear symbol) and select some data to draw.
If you have a compatible device, you can display this visualization in virtual reality by scrolling down (or clicking on the button to the right with the eye icon) and clicking the grey goggles button.
In a standard web browser this button will open a full-screen version of the data visualization. However this view has a more limited range of interaction options, so I recommend just clicking the eye button
to center the visualization in your web browser.
Have fun! If you have questions or just want to talk about data visualization in VR, feel free to contact me!
This will all make a lot more sense if you read one of the associated papers (pre-prints forthcoming),
but the basic idea is that this visualization allows us to quickly get a sense of the aggregate effect
of the long sequence of small events that make up the process of evolution. Each one of the paths that
you can draw on the landscape represents the entire chain of ancestry for a single evolved individual. Each
individual is an x,y coordinate pair. The populations are evolving on 2-input real-valued functions (represented
by the curved surface). Fitness is evaluated by plugging an individual's x and y coordinates into the function.
Individuals are then plotted on the surface, with fitness being the z coordinate.
The individuals in this data set were all the fittest member of the population at the end of their respective
runs of the algorithm. By drawing paths from their coordinates, to their parents' coordinates, to their grandparents'
coordinates and so on, we can see how evolution traverses this fitness landscape.
If you've looked at the settings panel, you'll notice there are a lot of options. That's because this data represents
a large number of runs of evolution in a wide variety of conditions. The settings panel lets you choose subsets to look at.
Probably because you haven't told it to draw anything!
Go to settings (gear icon), check the boxes for the annotations you want
(e.g. spheres for start and end points, paths for full lineages), and
then click the "Draw" button. It might take a bit to render, but data should
show up.
Note that at low mutations rates lineages are often very short and can be hard to see.
If there is still nothing, send me an issue on GitHub - this is all still pretty
experimental.
Try setting "Selection Scheme" to Eco-EA, "Mutation rate" to .01, and checking the "Draw lineage paths" box. Leave everything else as the default. This should show you a single lineage traversing the landscape. If you want to try looking at multiple lineages, try setting "Number of lineage paths to draw" to 2 and increasing the Z-separation slider about halfway. From there, feel free to change things and see what happens! In general, mutation rates lower than .01 tend to stay fixed in a pretty small part of the landscape, and Eco-EA tends to travel farther than other selection schemes.
Check out webvr.rocks for more thorough information. In general, most browsers
will at least render it in WebGL. In this mode, you can use your mouse to click and drag to rotate the visualization
and see it from different angles.
To use virtual reality, you need something more advanced.
If you have a phone-mount headset, such as Google Cardboard, and a phone that is
compatible with it, you should be able to use that. Navigate to this website on your phone,
select and draw the data you want to see, and tap the goggles icon in the lower right corner.
This should open it in VR mode (in which your phone displays two images, one for each eye). You can
then put the phone in the headset and look at the visualization in three dimensions.
If you have a more advanced VR system, such as an Oculus Rift or HTC Vive, you can open this webpage
on the computer connected to the VR system. Clicking the gray goggles icon in the lower right corner should
bring up the visualization on your headset. You can then put on the headset and walk around the visualization.
If you have two hand controllers, you can use them to zoom in and out with pinch and spread gestures (like
you would use on a touch screen). Note that this has been tested on a Rift, but not yet on a Vive. If you try
it on a Vive (or something else, like Windows Mixed Reality) I'd love to hear how it goes.
Tournament selection: [TOURNAMENT_SIZE] individuals are chosen randomly from the population and the fittest reproduces.
Increasing tournament size essentially increases the strength of selection.
Roulette selection: Individuals are chosen to reproduce with probability proportional to their fitness.
Eco-EA: Like tournament selection, except that individuals receive fitness bonuses for occupying rare niches (in these problems,
that entails being in a part of the landscape where there aren't many other individuals). For more detail, see
(Goings and Ofria, 2010).
Drift: Individuals are selected to reproduce entirely at random.
The GECCO Niching competition.
Me too! There's still a lot for everyone to learn about how to most effectively take advantage of virtual reality for data visualization. The Knight Foundation has been doing some really great work to figure all of this out. I found this article particularly helpful, and this article has a bunch of really cool examples. Their work is all aimed at journalism, though. I'm planning on writing a blog post soon, detailing what this project has taught me specifically about using VR for data visualization in the context of evolution.
For full details, see the GitHub repo for this site. In summary, though, I used:
I'm very grateful to Alex Lalejini, Charles Ofria, and the rest of the MSU Digital Evolution Lab for their input on this project. I also thank the MSU Institute for Cyber-Enabled Research for the computational resources to generate this data in the first place, and the MSU Digital Scholarship Lab for giving me access to (and helping me configure!) an Oculus Rift on which to develop and use this visualization.
I'm a PhD student at Michigan State University studying evolution, ecology, and computer science. To learn more about my research, see my website.


About Me
I was born at an early age in Pittsburgh, PA, a place that no matter where life takes me will always be home. I'm a die-hard Pirates fan, and also a Penguins & Steelers fan. I live in Sacramento, California with my wife Sarah, our dog Francisco, and cat Oreo.
Professionally, I'm an AEM Technical Architect with Adobe, where I'm primarily focused on Adobe AEM based projects.
My hobbies include programming, but more generally technology of all kinds, baseball, board games, cooking, and golf.
You can follow me on Twitter @shsteimer
About This Blog
I've started blogs a few times in the past, including at this domain, but for whatever reason the habit of posting on a regular basis has never stuck. I think this is a pretty common theme, but it's one I'm trying to break (Narrator: "He didn't").
Under the covers, what you're reading is driven by Jekyll and Github Pages. I like this setup because it's static & lightweight, simple to maintain, and everything is in version control. Plus there's no php involved.


Return-Path<EMAIL_ADDRESS>X-UIDL: 828428055.000
From<EMAIL_ADDRESS>X-Sender<EMAIL_ADDRESS>(Unverified)
Date: Mon, 01 Apr 1996 21:33:00 -0800
To<EMAIL_ADDRESS>Subject: Beausejour Sailor
X-Attachments: C:\DOCS\BEAUSEJR.DOC;
Content-Length: 14878
Hi there,
I thought you might be interested in a Beausejour local who's recently done
some offshore sailing. You're welcome to post it in on one of your areas
like recreation, etc. (wherever you think it's appropriate)
Regards
Chris Watts
Attachment Converted:
D:\INTERNET\EUDORA\MAILIN\ATTACH\BEAUSEJR.DOC
\\\\\\\\\\\///////////
<EMAIL_ADDRESS>///////////\\\\\\\\\\\
Back to Mail from the edge!