text:
// predicate defines logical predicates used in relation's restrict

package rel

import (
	"fmt"
	"reflect"
	"strings"
)

// Predicate is the type of func that takes a tuple and returns bool and is
// used for restrict.  It should always be a func with input of a subdomain
// of the relation, with one bool output.
type Predicate interface {
	// EvalFunc returns a function which can evalutes a predicate on an input
	// tuple
	EvalFunc(e reflect.Type) func(t interface{}) bool

	// Domain is the type of input that is required to evalute the predicate
	// this might have to be a recursive type instead of reflect.Type?
	Domain() []Attribute

	// And two predicates
	And(p2 Predicate) AndPred

	// Or two predicates
	Or(p2 Predicate) OrPred

	// Xor two predicates
	Xor(p2 Predicate) XorPred

	String() string
}

// unionAttributes produces a union of two sets of attributes, without dups
// assuming that the input attributes are already unique. This returns a copy
// and does not modify the inputs.
func unionAttributes(att1 []Attribute, att2 []Attribute) []Attribute {
	// For small sets of attributes (which should be typical!) this should be
	// faster than a map.
	att := make([]Attribute, len(att1))
	copy(att, att1)
Found:
	for _, v2 := range att2 {
		for _, v1 := range att1 {
			if v1 == v2 {
				continue Found
			}
		}
		att = append(att, v2)
	}
	return att
}

// Not predicate
func Not(p Predicate) NotPred {
	// Prefix not is a lot more comprehensible than postfix!  To that end, it
	// is not a part of the interface because that would require postfix.
	return NotPred{p}
}

// NotPred represents a logical not of a predicate
type NotPred struct {
	P Predicate
}

// String representation of Not
func (p NotPred) String() string {
	return fmt.Sprintf("!(%v)", p.P)
}

// Domain is the type of input that is required to evalute the predicate
func (p NotPred) Domain() []Attribute {
	return p.P.Domain()
}

// Eval evalutes a predicate on an input tuple
func (p NotPred) EvalFunc(e reflect.Type) func(t interface{}) bool {
	f := p.P.EvalFunc(e)
	return func(t interface{}) bool { return !f(t) }
}

// And predicate
func (p1 NotPred) And(p2 Predicate) AndPred {
	return AndPred{p1, p2}
}

// Or predicate
func (p1 NotPred) Or(p2 Predicate) OrPred {
	return OrPred{p1, p2}
}

// Xor predicate
func (p1 NotPred) Xor(p2 Predicate) XorPred {
	return XorPred{p1, p2}
}

// AndPred represents a logical and predicate
type AndPred struct {
	P1 Predicate
	P2 Predicate
}

// String representation of And
func (p AndPred) String() string {
	return fmt.Sprintf("(%v) && (%v)", p.P1, p.P2)
}

// Domain is the type of input that is required to evalute the predicate
func (p AndPred) Domain() []Attribute {
	return unionAttributes(p.P1.Domain(), p.P2.Domain())
}

// Eval evalutes a predicate on an input tuple
func (p AndPred) EvalFunc(e reflect.Type) func(t interface{}) bool {
	f1 := p.P1.EvalFunc(e)
	f2 := p.P2.EvalFunc(e)
	return func(t interface{}) bool { return f1(t) && f2(t) }
}

// And predicate
func (p1 AndPred) And(p2 Predicate) AndPred {
	return AndPred{p1, p2}
}

// Or predicate
func (p1 AndPred) Or(p2 Predicate) OrPred {
	return OrPred{p1, p2}
}

// Xor predicate
func (p1 AndPred) Xor(p2 Predicate) XorPred {
	return XorPred{p1, p2}
}

// OrPred represents a logical or predicate
type OrPred struct {
	P1 Predicate
	P2 Predicate
}

// String representation of Or
func (p OrPred) String() string {
	return fmt.Sprintf("(%v) || (%v)", p.P1, p.P2)
}

// Domain is the type of input that is required to evalute the predicate
func (p OrPred) Domain() []Attribute {
	return unionAttributes(p.P1.Domain(), p.P2.Domain())
}

// Eval evalutes a predicate on an input tuple
func (p OrPred) EvalFunc(e reflect.Type) func(t interface{}) bool {

	f1 := p.P1.EvalFunc(e)
	f2 := p.P2.EvalFunc(e)
	return func(t interface{}) bool { return f1(t) || f2(t) }
}

// And predicate
func (p1 OrPred) And(p2 Predicate) AndPred {
	return AndPred{p1, p2}
}

// Or predicate
func (p1 OrPred) Or(p2 Predicate) OrPred {
	return OrPred{p1, p2}
}

// Xor predicate
func (p1 OrPred) Xor(p2 Predicate) XorPred {
	return XorPred{p1, p2}
}

// XorPred represents a logical xor predicate
type XorPred struct {
	P1 Predicate
	P2 Predicate
}

// String representation of Xor
func (p XorPred) String() string {
	return fmt.Sprintf("(%v) != (%v)", p.P1, p.P2)
}

// Domain is the type of input that is required to evalute the predicate
func (p XorPred) Domain() []Attribute {
	return unionAttributes(p.P1.Domain(), p.P2.Domain())
}

// Eval evalutes a predicate on an input tuple
func (p XorPred) EvalFunc(e reflect.Type) func(t interface{}) bool {
	f1 := p.P1.EvalFunc(e)
	f2 := p.P2.EvalFunc(e)
	return func(t interface{}) bool {
		return f1(t) != f2(t)
	}
}

// And predicate
func (p1 XorPred) And(p2 Predicate) AndPred {
	return AndPred{p1, p2}
}

// Or predicate
func (p1 XorPred) Or(p2 Predicate) OrPred {
	return OrPred{p1, p2}
}

// Xor predicate
func (p1 XorPred) Xor(p2 Predicate) XorPred {
	return XorPred{p1, p2}
}

// AdHoc is a Predicate that can implement any function on a tuple.
// The rewrite engine will be able to infer which attributes it requires to be
// evaluated, but nothing beyond that, which will prevent it from being moved
// into source queries in e.g. sql.  For those kind of predicates, non AdHoc
// predicates will be required.
// I expect that this will typically be constructed with anonymous functions.
type AdHoc struct {
	// f is the function which takes a tuple and returns a boolean indicating
	// that the tuple passes the predicate
	F interface{}
}

// String representation of AdHoc
func (p AdHoc) String() string {
	dom := p.Domain()
	s := make([]string, len(dom))
	for i, v := range dom {
		s[i] = string(v)
	}
	return fmt.Sprintf("func({%s})", strings.Join(s, ", "))
	// Note we could use
	// f := runtime.FuncForPC(reflect.ValueOf(p.f).Pointer()).Name()
	// for named functions, but the name would require more manipulation to get
	// to a useful brevity, and also would require some work to distinguish
	// between named and anonymous functions.

}

// Domain is the type of input that is required to evalute the predicate
func (p AdHoc) Domain() []Attribute {
	return FieldNames(reflect.TypeOf(p.F).In(0))
}

// Eval evalutes a predicate on an input tuple
func (p AdHoc) EvalFunc(e1 reflect.Type) func(t interface{}) bool {

	e2 := reflect.TypeOf(p.F).In(0)

	// figure out which fields stay, and where they are in each of the tuple
	// types.
	// TODO(jonlawlor): error if fields in e2 are not in r1's tuples.
	fMap := FieldMap(e1, e2)
	pf := reflect.ValueOf(p.F)

	return func(tup1 interface{}) bool {
		tup2 := reflect.Indirect(reflect.New(e2))
		rtup1 := reflect.ValueOf(tup1)
		for _, fm := range fMap {
			tupf2 := tup2.Field(fm.J)
			tupf2.Set(rtup1.Field(fm.I))
		}

		parm := make([]reflect.Value, 1)
		parm[0] = tup2
		b := pf.Call(parm)
		return b[0].Interface().(bool)
	}
}

// And predicate
func (p1 AdHoc) And(p2 Predicate) AndPred {
	return AndPred{p1, p2}
}

// Or predicate
func (p1 AdHoc) Or(p2 Predicate) OrPred {
	return OrPred{p1, p2}
}

// Xor predicate
func (p1 AdHoc) Xor(p2 Predicate) XorPred {
	return XorPred{p1, p2}
}

// Normal go style does not include abbreviations or all caps.  However, in
// this case I believe the shortness of the function name is paramount.  I've
// chosen the MIPS assembly condition names as a guide for the names of the
// comparisons.  I would have used x86 but it has a lot of single character
// names and that would be a bit too short for me.  Look at
// http://logos.cs.uic.edu/366/notes/mips%20quick%20tutorial.htm for a
// reference.
//
// The v param is an interface because it might be a literal, or another
// attribute.
// Note that you can have a runtime error if the predicate's literal has the
// wrong type, which is particularly important with ints and floats.

type EQPred struct {
	att []Attribute
	lit interface{}
}

// String representation of EQ
func (p EQPred) String() string {
	if len(p.att) == 2 {
		return fmt.Sprintf("%v == %v", p.att[0], p.att[1])
	} else {
		return fmt.Sprintf("%v == %v", p.att[0], p.lit)
	}
}

// Equal to (==)
func (att1 Attribute) EQ(v interface{}) EQPred {
	if att2, ok := v.(Attribute); ok {
		att := make([]Attribute, 2)
		att[0] = att1
		att[1] = att2
		return EQPred{att, reflect.Value{}}
	} else { // v is a literal, we'll need runtime reflection
		att := make([]Attribute, 1)
		att[0] = att1
		return EQPred{att, v}
	}
}

// Domain is the type of input that is required to evalute the predicate
func (p EQPred) Domain() []Attribute {
	return p.att
}

// Eval evalutes a predicate on an input tuple
func (p EQPred) EvalFunc(e1 reflect.Type) func(t interface{}) bool {

	// The only method defined on all interfaces is equal & not equal.

	if len(p.att) == 2 {
		att1 := string(p.att[0])
		att2 := string(p.att[1])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			return rtup1.FieldByName(att1).Interface() == rtup1.FieldByName(att2).Interface()
		}
	} else { // the second element is a literal
		att1 := string(p.att[0])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			return rtup1.FieldByName(att1).Interface() == p.lit
		}
	}
}

// And predicate
func (p1 EQPred) And(p2 Predicate) AndPred {
	return AndPred{p1, p2}
}

// Or predicate
func (p1 EQPred) Or(p2 Predicate) OrPred {
	return OrPred{p1, p2}
}

// Xor predicate
func (p1 EQPred) Xor(p2 Predicate) XorPred {
	return XorPred{p1, p2}
}

type LTPred struct {
	att []Attribute
	lit interface{}
}

// String representation of LT
func (p LTPred) String() string {
	if len(p.att) == 2 {
		return fmt.Sprintf("%v < %v", p.att[0], p.att[1])
	} else {
		return fmt.Sprintf("%v < %v", p.att[0], p.lit)
	}
}

// Less than (<)
func (att1 Attribute) LT(v interface{}) LTPred {
	if att2, ok := v.(Attribute); ok {
		att := make([]Attribute, 2)
		att[0] = att1
		att[1] = att2
		return LTPred{att, reflect.Value{}}
	} else { // v is a literal, we'll need runtime reflection
		att := make([]Attribute, 1)
		att[0] = att1
		return LTPred{att, v}
	}
}

// Domain is the type of input that is required to evalute the predicate
func (p LTPred) Domain() []Attribute {
	return p.att
}

// Eval evalutes a predicate on an input tuple
func (p LTPred) EvalFunc(e1 reflect.Type) func(t interface{}) bool {
	// e1 is currently unused

	// Less than is only defined on numeric and string types
	// TODO(jonlawlor): this is hideous!
	if len(p.att) == 2 {
		att1 := string(p.att[0])
		att2 := string(p.att[1])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			f1 := rtup1.FieldByName(att1).Interface()
			f2 := rtup1.FieldByName(att2).Interface()
			switch f1.(type) {
			default:
				// I am _REALLY_ unsure this is the desired behavior
				return false
			case int:
				return f1.(int) < f2.(int)
			case string:
				return f1.(string) < f2.(string)
			case uint8:
				return f1.(uint8) < f2.(uint8)
			case uint16:
				return f1.(uint16) < f2.(uint16)
			case uint32:
				return f1.(uint32) < f2.(uint32)
			case uint64:
				return f1.(uint64) < f2.(uint64)
			case int8:
				return f1.(int8) < f2.(int8)
			case int16:
				return f1.(int16) < f2.(int16)
			case int32:
				return f1.(int32) < f2.(int32)
			case int64:
				return f1.(int64) < f2.(int64)
			case float32:
				return f1.(float32) < f2.(float32)
			case float64:
				return f1.(float64) < f2.(float64)
			}
		}
	} else { // the second element is a literal
		att1 := string(p.att[0])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			f1 := rtup1.FieldByName(att1).Interface()
			switch f1.(type) {
			default:
				// I am _REALLY_ unsure this is the desired behavior
				return false
			case int:
				return f1.(int) < p.lit.(int)
			case string:
				return f1.(string) < p.lit.(string)
			case uint8:
				return f1.(uint8) < p.lit.(uint8)
			case uint16:
				return f1.(uint16) < p.lit.(uint16)
			case uint32:
				return f1.(uint32) < p.lit.(uint32)
			case uint64:
				return f1.(uint64) < p.lit.(uint64)
			case int8:
				return f1.(int8) < p.lit.(int8)
			case int16:
				return f1.(int16) < p.lit.(int16)
			case int32:
				return f1.(int32) < p.lit.(int32)
			case int64:
				return f1.(int64) < p.lit.(int64)
			case float32:
				return f1.(float32) < p.lit.(float32)
			case float64:
				return f1.(float64) < p.lit.(float64)
			}
		}
	}
}

// And predicate
func (p1 LTPred) And(p2 Predicate) AndPred {
	return AndPred{p1, p2}
}

// Or predicate
func (p1 LTPred) Or(p2 Predicate) OrPred {
	return OrPred{p1, p2}
}

// Xor predicate
func (p1 LTPred) Xor(p2 Predicate) XorPred {
	return XorPred{p1, p2}
}

type LEPred struct {
	att []Attribute
	lit interface{}
}

// Less than or equal to (<=)
func (att1 Attribute) LE(v interface{}) LEPred {
	if att2, ok := v.(Attribute); ok {
		att := make([]Attribute, 2)
		att[0] = att1
		att[1] = att2
		return LEPred{att, reflect.Value{}}
	} else { // v is a literal, we'll need runtime reflection
		att := make([]Attribute, 1)
		att[0] = att1
		return LEPred{att, v}
	}
}

// String representation of LE
func (p LEPred) String() string {
	if len(p.att) == 2 {
		return fmt.Sprintf("%v <= %v", p.att[0], p.att[1])
	} else {
		return fmt.Sprintf("%v <= %v", p.att[0], p.lit)
	}
}

// Domain is the type of input that is required to evalute the predicate
func (p LEPred) Domain() []Attribute {
	return p.att
}

// Eval evalutes a predicate on an input tuple
func (p LEPred) EvalFunc(e1 reflect.Type) func(t interface{}) bool {
	// e1 is currently unused

	// Less than is only defined on numeric and string types
	// TODO(jonlawlor): this is hideous!
	if len(p.att) == 2 {
		att1 := string(p.att[0])
		att2 := string(p.att[1])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			f1 := rtup1.FieldByName(att1).Interface()
			f2 := rtup1.FieldByName(att2).Interface()
			switch f1.(type) {
			default:
				// I am _REALLY_ unsure this is the desired behavior
				return false
			case int:
				return f1.(int) <= f2.(int)
			case string:
				return f1.(string) <= f2.(string)
			case uint8:
				return f1.(uint8) <= f2.(uint8)
			case uint16:
				return f1.(uint16) <= f2.(uint16)
			case uint32:
				return f1.(uint32) <= f2.(uint32)
			case uint64:
				return f1.(uint64) <= f2.(uint64)
			case int8:
				return f1.(int8) <= f2.(int8)
			case int16:
				return f1.(int16) <= f2.(int16)
			case int32:
				return f1.(int32) <= f2.(int32)
			case int64:
				return f1.(int64) <= f2.(int64)
			case float32:
				return f1.(float32) <= f2.(float32)
			case float64:
				return f1.(float64) <= f2.(float64)
			}
		}
	} else { // the second element is a literal
		att1 := string(p.att[0])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			f1 := rtup1.FieldByName(att1).Interface()
			switch f1.(type) {
			default:
				// I am _REALLY_ unsure this is the desired behavior
				return false
			case int:
				return f1.(int) <= p.lit.(int)
			case string:
				return f1.(string) <= p.lit.(string)
			case uint8:
				return f1.(uint8) <= p.lit.(uint8)
			case uint16:
				return f1.(uint16) <= p.lit.(uint16)
			case uint32:
				return f1.(uint32) <= p.lit.(uint32)
			case uint64:
				return f1.(uint64) <= p.lit.(uint64)
			case int8:
				return f1.(int8) <= p.lit.(int8)
			case int16:
				return f1.(int16) <= p.lit.(int16)
			case int32:
				return f1.(int32) <= p.lit.(int32)
			case int64:
				return f1.(int64) <= p.lit.(int64)
			case float32:
				return f1.(float32) <= p.lit.(float32)
			case float64:
				return f1.(float64) <= p.lit.(float64)
			}
		}
	}
}

// And predicate
func (p1 LEPred) And(p2 Predicate) AndPred {
	return AndPred{p1, p2}
}

// Or predicate
func (p1 LEPred) Or(p2 Predicate) OrPred {
	return OrPred{p1, p2}
}

// Xor predicate
func (p1 LEPred) Xor(p2 Predicate) XorPred {
	return XorPred{p1, p2}
}

type GTPred struct {
	att []Attribute
	lit interface{}
}

// String representation of GT
func (p GTPred) String() string {
	if len(p.att) == 2 {
		return fmt.Sprintf("%v > %v", p.att[0], p.att[1])
	} else {
		return fmt.Sprintf("%v > %v", p.att[0], p.lit)
	}
}

// Greater than (>)
func (att1 Attribute) GT(v interface{}) GTPred {
	if att2, ok := v.(Attribute); ok {
		att := make([]Attribute, 2)
		att[0] = att1
		att[1] = att2
		return GTPred{att, reflect.Value{}}
	} else { // v is a literal, we'll need runtime reflection
		att := make([]Attribute, 1)
		att[0] = att1
		return GTPred{att, v}
	}
}

// Domain is the type of input that is required to evalute the predicate
func (p GTPred) Domain() []Attribute {
	return p.att
}

// Eval evalutes a predicate on an input tuple
func (p GTPred) EvalFunc(e1 reflect.Type) func(t interface{}) bool {
	// e1 is currently unused

	// Less than is only defined on numeric and string types
	// TODO(jonlawlor): this is hideous!
	if len(p.att) == 2 {
		att1 := string(p.att[0])
		att2 := string(p.att[1])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			f1 := rtup1.FieldByName(att1).Interface()
			f2 := rtup1.FieldByName(att2).Interface()
			switch f1.(type) {
			default:
				// I am _REALLY_ unsure this is the desired behavior
				return false
			case int:
				return f1.(int) > f2.(int)
			case string:
				return f1.(string) > f2.(string)
			case uint8:
				return f1.(uint8) > f2.(uint8)
			case uint16:
				return f1.(uint16) > f2.(uint16)
			case uint32:
				return f1.(uint32) > f2.(uint32)
			case uint64:
				return f1.(uint64) > f2.(uint64)
			case int8:
				return f1.(int8) > f2.(int8)
			case int16:
				return f1.(int16) > f2.(int16)
			case int32:
				return f1.(int32) > f2.(int32)
			case int64:
				return f1.(int64) > f2.(int64)
			case float32:
				return f1.(float32) > f2.(float32)
			case float64:
				return f1.(float64) > f2.(float64)
			}
		}
	} else { // the second element is a literal
		att1 := string(p.att[0])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			f1 := rtup1.FieldByName(att1).Interface()
			switch f1.(type) {
			default:
				// I am _REALLY_ unsure this is the desired behavior
				return false
			case int:
				return f1.(int) > p.lit.(int)
			case string:
				return f1.(string) > p.lit.(string)
			case uint8:
				return f1.(uint8) > p.lit.(uint8)
			case uint16:
				return f1.(uint16) > p.lit.(uint16)
			case uint32:
				return f1.(uint32) > p.lit.(uint32)
			case uint64:
				return f1.(uint64) > p.lit.(uint64)
			case int8:
				return f1.(int8) > p.lit.(int8)
			case int16:
				return f1.(int16) > p.lit.(int16)
			case int32:
				return f1.(int32) > p.lit.(int32)
			case int64:
				return f1.(int64) > p.lit.(int64)
			case float32:
				return f1.(float32) > p.lit.(float32)
			case float64:
				return f1.(float64) > p.lit.(float64)
			}
		}
	}
}

// And predicate
func (p1 GTPred) And(p2 Predicate) AndPred {
	return AndPred{p1, p2}
}

// Or predicate
func (p1 GTPred) Or(p2 Predicate) OrPred {
	return OrPred{p1, p2}
}

// Xor predicate
func (p1 GTPred) Xor(p2 Predicate) XorPred {
	return XorPred{p1, p2}
}

type GEPred struct {
	att []Attribute
	lit interface{}
}

// String representation of EQ
func (p GEPred) String() string {
	if len(p.att) == 2 {
		return fmt.Sprintf("%v >= %v", p.att[0], p.att[1])
	} else {
		return fmt.Sprintf("%v >= %v", p.att[0], p.lit)
	}
}

// Greater than or equal to (>=)
func (att1 Attribute) GE(v interface{}) GEPred {
	if att2, ok := v.(Attribute); ok {
		att := make([]Attribute, 2)
		att[0] = att1
		att[1] = att2
		return GEPred{att, reflect.Value{}}
	} else { // v is a literal, we'll need runtime reflection
		att := make([]Attribute, 1)
		att[0] = att1
		return GEPred{att, v}
	}
}

// Domain is the type of input that is required to evalute the predicate
func (p GEPred) Domain() []Attribute {
	return p.att
}

// Eval evalutes a predicate on an input tuple
func (p GEPred) EvalFunc(e1 reflect.Type) func(t interface{}) bool {
	// e1 is currently unused

	// Less than is only defined on numeric and string types
	// TODO(jonlawlor): this is hideous!
	if len(p.att) == 2 {
		att1 := string(p.att[0])
		att2 := string(p.att[1])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			f1 := rtup1.FieldByName(att1).Interface()
			f2 := rtup1.FieldByName(att2).Interface()
			switch f1.(type) {
			default:
				// I am _REALLY_ unsure this is the desired behavior
				return false
			case int:
				return f1.(int) >= f2.(int)
			case string:
				return f1.(string) >= f2.(string)
			case uint8:
				return f1.(uint8) >= f2.(uint8)
			case uint16:
				return f1.(uint16) >= f2.(uint16)
			case uint32:
				return f1.(uint32) >= f2.(uint32)
			case uint64:
				return f1.(uint64) >= f2.(uint64)
			case int8:
				return f1.(int8) >= f2.(int8)
			case int16:
				return f1.(int16) >= f2.(int16)
			case int32:
				return f1.(int32) >= f2.(int32)
			case int64:
				return f1.(int64) >= f2.(int64)
			case float32:
				return f1.(float32) >= f2.(float32)
			case float64:
				return f1.(float64) >= f2.(float64)
			}
		}
	} else { // the second element is a literal
		att1 := string(p.att[0])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			f1 := rtup1.FieldByName(att1).Interface()
			switch f1.(type) {
			default:
				// I am _REALLY_ unsure this is the desired behavior
				return false
			case int:
				return f1.(int) >= p.lit.(int)
			case string:
				return f1.(string) >= p.lit.(string)
			case uint8:
				return f1.(uint8) >= p.lit.(uint8)
			case uint16:
				return f1.(uint16) >= p.lit.(uint16)
			case uint32:
				return f1.(uint32) >= p.lit.(uint32)
			case uint64:
				return f1.(uint64) >= p.lit.(uint64)
			case int8:
				return f1.(int8) >= p.lit.(int8)
			case int16:
				return f1.(int16) >= p.lit.(int16)
			case int32:
				return f1.(int32) >= p.lit.(int32)
			case int64:
				return f1.(int64) >= p.lit.(int64)
			case float32:
				return f1.(float32) >= p.lit.(float32)
			case float64:
				return f1.(float64) >= p.lit.(float64)
			}
		}
	}
}

// And predicate
func (p1 GEPred) And(p2 Predicate) AndPred {
	return AndPred{p1, p2}
}

// Or predicate
func (p1 GEPred) Or(p2 Predicate) OrPred {
	return OrPred{p1, p2}
}

// Xor predicate
func (p1 GEPred) Xor(p2 Predicate) XorPred {
	return XorPred{p1, p2}
}

type NEPred struct {
	att []Attribute
	lit interface{}
}

// String representation of EQ
func (p NEPred) String() string {
	if len(p.att) == 2 {
		return fmt.Sprintf("%v != %v", p.att[0], p.att[1])
	} else {
		return fmt.Sprintf("%v != %v", p.att[0], p.lit)
	}
}

// Not equal to (!=)
func (att1 Attribute) NE(v interface{}) NEPred {
	if att2, ok := v.(Attribute); ok {
		att := make([]Attribute, 2)
		att[0] = att1
		att[1] = att2
		return NEPred{att, reflect.Value{}}
	} else { // v is a literal, we'll need runtime reflection
		att := make([]Attribute, 1)
		att[0] = att1
		return NEPred{att, v}
	}
}

// Domain is the type of input that is required to evalute the predicate
func (p NEPred) Domain() []Attribute {
	return p.att
}

// Eval evalutes a predicate on an input tuple
func (p NEPred) EvalFunc(e1 reflect.Type) func(t interface{}) bool {

	// The only method defined on all interfaces is equal & not equal.

	if len(p.att) == 2 {
		att1 := string(p.att[0])
		att2 := string(p.att[1])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			return rtup1.FieldByName(att1).Interface() != rtup1.FieldByName(att2).Interface()
		}
	} else { // the second element is a literal
		att1 := string(p.att[0])
		return func(tup1 interface{}) bool {
			rtup1 := reflect.ValueOf(tup1)
			return rtup1.FieldByName(att1).Interface() != p.lit
		}
	}
}

// And predicate
func (p1 NEPred) And(p2 Predicate) AndPred {
	return AndPred{p1, p2}
}

// Or predicate
func (p1 NEPred) Or(p2 Predicate) OrPred {
	return OrPred{p1, p2}
}

// Xor predicate
func (p1 NEPred) Xor(p2 Predicate) XorPred {
	return XorPred{p1, p2}
}

/*
// TODO(jonlawlor): other common comparisons
func (att Attribute) IN(v interface{}) INPred {
return
}
*/


text:
package org.politaktiv.map.infrastructure.model;

import com.liferay.portal.model.PersistedModel;

/**
 * The extended model interface for the Marker service. Represents a row in the "politaktivmap_Marker" database table, with each column mapped to a property of this class.
 *
 * @author eichi
 * @see MarkerModel
 * @see org.politaktiv.map.infrastructure.model.impl.MarkerImpl
 * @see org.politaktiv.map.infrastructure.model.impl.MarkerModelImpl
 * @generated
 */
public interface Marker extends MarkerModel, PersistedModel {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify this interface directly. Add methods to {@link org.politaktiv.map.infrastructure.model.impl.MarkerImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
	 */
	public void validate() throws javax.portlet.ValidatorException;

	public java.lang.String toHTMLFormatedString()
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException;
}

redpajama_set_name: RedPajamaGithub


text:
package go_kafka_client

import (
	"crypto/md5"
	"encoding/hex"
	"fmt"
	"io"
	"math"
	"reflect"
	"sort"
	"strconv"
	"strings"
)

const (
	/* Range partitioning works on a per-topic basis. For each topic, we lay out the available partitions in numeric order
	and the consumer threads in lexicographic order. We then divide the number of partitions by the total number of
	consumer streams (threads) to determine the number of partitions to assign to each consumer. If it does not evenly
	divide, then the first few consumers will have one extra partition. For example, suppose there are two consumers C1
	and C2 with two streams each, and there are five available partitions (p0, p1, p2, p3, p4). So each consumer thread
	will get at least one partition and the first consumer thread will get one extra partition. So the assignment will be:
	p0 -> C1-0, p1 -> C1-0, p2 -> C1-1, p3 -> C2-0, p4 -> C2-1 */
	RangeStrategy = "range"

	/* The round-robin partition assignor lays out all the available partitions and all the available consumer threads. It
	then proceeds to do a round-robin assignment from partition to consumer thread. If the subscriptions of all consumer
	instances are identical, then the partitions will be uniformly distributed. (i.e., the partition ownership counts
	will be within a delta of exactly one across all consumer threads.)

	(For simplicity of implementation) the assignor is allowed to assign a given topic-partition to any consumer instance
	and thread-id within that instance. Therefore, round-robin assignment is allowed only if:
	a) Every topic has the same number of streams within a consumer instance
	b) The set of subscribed topics is identical for every consumer instance within the group. */
	RoundRobinStrategy = "roundrobin"
)

type assignStrategy func(*assignmentContext) map[TopicAndPartition]ConsumerThreadId

func newPartitionAssignor(strategy string) assignStrategy {
	switch strategy {
	case RoundRobinStrategy:
		return roundRobinAssignor
	case RangeStrategy:
		return rangeAssignor
	default:
		panic(fmt.Sprintf("Invalid partition assignment strategy: %s", strategy))
	}
}

func roundRobinAssignor(context *assignmentContext) map[TopicAndPartition]ConsumerThreadId {
	ownershipDecision := make(map[TopicAndPartition]ConsumerThreadId)

	if len(context.ConsumersForTopic) > 0 {
		var headThreadIds []ConsumerThreadId
		for _, headThreadIds = range context.ConsumersForTopic {
			break
		}
		for _, threadIds := range context.ConsumersForTopic {
			if !reflect.DeepEqual(threadIds, headThreadIds) {
				panic("Round-robin assignor works only if all consumers in group subscribed to the same topics AND if the stream counts across topics are identical for a given consumer instance.")
			}
		}

		topicsAndPartitions := make([]*TopicAndPartition, 0)
		for topic, partitions := range context.PartitionsForTopic {
			for _, partition := range partitions {
				topicsAndPartitions = append(topicsAndPartitions, &TopicAndPartition{
					Topic:     topic,
					Partition: partition,
				})
			}
		}

		fmt.Printf("%v\n", topicsAndPartitions)

		sort.Sort(hashArray(topicsAndPartitions))
		threadIdsIterator := circularIterator(&headThreadIds)

		for _, topicPartition := range topicsAndPartitions {
			consumerThreadId := threadIdsIterator.Value.(ConsumerThreadId)
			if consumerThreadId.Consumer == context.ConsumerId {
				ownershipDecision[*topicPartition] = consumerThreadId
			}
			threadIdsIterator = threadIdsIterator.Next()
		}
	}

	return ownershipDecision
}

func rangeAssignor(context *assignmentContext) map[TopicAndPartition]ConsumerThreadId {
	ownershipDecision := make(map[TopicAndPartition]ConsumerThreadId)

	for topic, consumerThreadIds := range context.MyTopicThreadIds {
		consumersForTopic := context.ConsumersForTopic[topic]
		partitionsForTopic := context.PartitionsForTopic[topic]

		Debug(context.ConsumerId, partitionsForTopic)

		Tracef(context.ConsumerId, "partitionsForTopic: %d, consumersForTopic: %d", len(partitionsForTopic), len(consumersForTopic))

		nPartsPerConsumer := len(partitionsForTopic) / len(consumersForTopic)
		nConsumersWithExtraPart := len(partitionsForTopic) % len(consumersForTopic)

		Tracef(context.ConsumerId, "nPartsPerConsumer: %d, nConsumersWithExtraPart: %d", nPartsPerConsumer, nConsumersWithExtraPart)

		for _, consumerThreadId := range consumerThreadIds {
			myConsumerPosition := position(&consumersForTopic, consumerThreadId)
			Tracef(context.ConsumerId, "myConsumerPosition: %d", myConsumerPosition)
			if myConsumerPosition < 0 {
				panic(fmt.Sprintf("There is no %s in consumers for topic %s", consumerThreadId, topic))
			}
			startPart := nPartsPerConsumer*myConsumerPosition + int(math.Min(float64(myConsumerPosition), float64(nConsumersWithExtraPart)))
			nParts := nPartsPerConsumer
			if myConsumerPosition+1 <= nConsumersWithExtraPart {
				nParts = nPartsPerConsumer + 1
			}
			Tracef(context.ConsumerId, "startPart: %d, nParts: %d", startPart, nParts)

			if nParts <= 0 {
				Warnf(context.ConsumerId, "No broker partitions consumed by consumer thread %s for topic %s", consumerThreadId, topic)
			} else {
				for i := startPart; i < startPart+nParts; i++ {
					partition := partitionsForTopic[i]
					Infof(context.ConsumerId, "%s attempting to claim %s", consumerThreadId, &TopicAndPartition{Topic: topic, Partition: partition})
					ownershipDecision[TopicAndPartition{Topic: topic, Partition: partition}] = consumerThreadId
				}
			}
		}
	}

	return ownershipDecision
}

type assignmentContext struct {
	ConsumerId          string
	Group               string
	MyTopicThreadIds    map[string][]ConsumerThreadId
	MyTopicToNumStreams TopicsToNumStreams
	PartitionsForTopic  map[string][]int32
	ConsumersForTopic   map[string][]ConsumerThreadId
	Consumers           []string
	Brokers             []*BrokerInfo
	AllTopics           []string
}

func (context *assignmentContext) hash() string {
	hash := md5.New()
	sort.Sort(byId(context.Brokers))
	for _, broker := range context.Brokers {
		io.WriteString(hash, strconv.Itoa(int(broker.Id)))
	}

	sort.Strings(context.Consumers)
	io.WriteString(hash, strings.Join(context.Consumers, ""))
	sort.Strings(context.AllTopics)
	for _, topic := range context.AllTopics {
		io.WriteString(hash, topic)
		if _, exists := context.PartitionsForTopic[topic]; !exists {
			continue
		}
		for _, partition := range context.PartitionsForTopic[topic] {
			io.WriteString(hash, strconv.Itoa(int(partition)))
		}
	}

	return hex.EncodeToString(hash.Sum(nil))
}

func newAssignmentContext(group string, consumerId string, excludeInternalTopics bool, coordinator ConsumerCoordinator) (*assignmentContext, error) {
	brokers, err := coordinator.GetAllBrokers()
	if err != nil {
		panic(fmt.Sprintf("Failed to obtain broker list: %s", err))
	}
	allTopics, err := coordinator.GetAllTopics()
	if err != nil {
		panic(fmt.Sprintf("Failed to obtain topic list: %s", err))
	}

	topicCount, err := NewTopicsToNumStreams(group, consumerId, coordinator, excludeInternalTopics)
	if err != nil {
		panic(fmt.Sprintf("Failed to obtain topicCount: %s, group: %s, consumerID: %s, excludeInternalTopics: %t", err, group, consumerId, excludeInternalTopics))
	}
	myTopicThreadIds := topicCount.GetConsumerThreadIdsPerTopic()
	myTopics := make([]string, 0)
	for topic, _ := range myTopicThreadIds {
		myTopics = append(myTopics, topic)
	}
	partitionsForTopic, err := coordinator.GetPartitionsForTopics(myTopics)
	if err != nil {
		panic(fmt.Sprintf("Failed to obtain partitions for topics: %s, topics: %v", err, myTopics))
	}
	consumersForTopic, err := coordinator.GetConsumersPerTopic(group, excludeInternalTopics)
	if err != nil {
		panic(fmt.Sprintf("Failed to obtain consumers for this topic: %s, group: %s, excludeInternalTopics: %t", err, group, excludeInternalTopics))
	}
	consumers, err := coordinator.GetConsumersInGroup(group)
	if err != nil {
		panic(fmt.Sprintf("Failed to obtain consumers: %s, group: %s", err, group))
	}

	return &assignmentContext{
		ConsumerId:          consumerId,
		Group:               group,
		MyTopicThreadIds:    myTopicThreadIds,
		MyTopicToNumStreams: topicCount,
		PartitionsForTopic:  partitionsForTopic,
		ConsumersForTopic:   consumersForTopic,
		Consumers:           consumers,
		Brokers:             brokers,
		AllTopics:           allTopics,
	}, nil
}

func newStaticAssignmentContext(group string, consumerId string, consumersInGroup []string, allTopics []string, brokers []*BrokerInfo,
	topicCount TopicsToNumStreams, topicPartitionMap map[string][]int32) *assignmentContext {
	myTopicThreadIds := topicCount.GetConsumerThreadIdsPerTopic()
	consumersForTopic := make(map[string][]ConsumerThreadId)
	for topic := range topicPartitionMap {
		for _, consumer := range consumersInGroup {
			threadIdsPerTopic := makeConsumerThreadIdsPerTopic(consumer, topicCount.GetTopicsToNumStreamsMap())
			var threadIds []ConsumerThreadId
			for _, threadIds = range threadIdsPerTopic {
				break
			}
			consumersForTopic[topic] = append(consumersForTopic[topic], threadIds...)
		}
	}

	return &assignmentContext{
		ConsumerId:          consumerId,
		Group:               group,
		MyTopicThreadIds:    myTopicThreadIds,
		MyTopicToNumStreams: topicCount,
		PartitionsForTopic:  topicPartitionMap,
		ConsumersForTopic:   consumersForTopic,
		Consumers:           consumersInGroup,
		Brokers:             brokers,
		AllTopics:           allTopics,
	}
}


text:
package org.apache.harmony.beans.tests.support.mock;

import java.beans.BeanDescriptor;
import java.beans.IntrospectionException;
import java.beans.MethodDescriptor;
import java.beans.PropertyDescriptor;
import java.beans.SimpleBeanInfo;
import java.lang.reflect.Method;

/**
 * The series of FakeFox classes are used to test
 * Introspector.getBeanInfo(Class, int)
 */
public class FakeFox01BeanInfo extends SimpleBeanInfo {

    Class<FakeFox01> clazz = FakeFox01.class;

    String suffix = "." + clazz.getName();

    @Override
    public BeanDescriptor getBeanDescriptor() {
        BeanDescriptor beanDesc = new BeanDescriptor(clazz);
        beanDesc.setDisplayName(beanDesc.getDisplayName() + suffix);
        return beanDesc;
    }

    @Override
    public MethodDescriptor[] getMethodDescriptors() {
        Method get = null;
        Method set = null;
        try {
            get = clazz.getMethod("getFox01", (Class[]) null);
            set = clazz.getMethod("setFox01", new Class[] { String.class });
        } catch (SecurityException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }

        MethodDescriptor getDesc = new MethodDescriptor(get);
        getDesc.setDisplayName(getDesc.getDisplayName() + suffix);
        MethodDescriptor setDesc = new MethodDescriptor(set);
        setDesc.setDisplayName(setDesc.getDisplayName() + suffix);
        return new MethodDescriptor[] { setDesc, getDesc };
    }

    @Override
    public PropertyDescriptor[] getPropertyDescriptors() {
        PropertyDescriptor propertyDesc = null;
        try {
            propertyDesc = new PropertyDescriptor("fox01", clazz);
            propertyDesc.setDisplayName(propertyDesc.getDisplayName() + suffix);
        } catch (IntrospectionException e) {
            e.printStackTrace();
        }
        return new PropertyDescriptor[] { propertyDesc };
    }

    /*
     * (non-Javadoc)
     *
     * @see java.beans.BeanInfo#getDefaultEventIndex()
     */
    @Override
    public int getDefaultEventIndex() {
        return -1;
    }

    /*
     * (non-Javadoc)
     *
     * @see java.beans.BeanInfo#getDefaultPropertyIndex()
     */
    @Override
    public int getDefaultPropertyIndex() {
        // TODO Auto-generated method stub
        return 0;
    }
}


text:
<!DOCTYPE HTML>

	<title>NuBot Logs</title>
	<link rel="stylesheet" type="text/css" href="../../res/logs_assets/css/style.css">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

NuBot logs Mon Mar 09 21:43:11 GMT 2015

					Filter

						Show:

						<input class="css-checkbox lrg" rel="info" type="checkbox" value="info" id="chkb01" checked="checked">
							Info

						<input id="chkb02" class="css-checkbox lrg"rel="trades" type="checkbox" value="trades" checked="checked">
							Warnings

						<input id="chkb03" class="css-checkbox lrg"rel="errors" type="checkbox" value="errors" checked="checked">
							Errors

				Message
				Class
				Method
				Time

Setting up  NuBot version : 0.1.5b
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.128 UTC

Init logging system
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.146 UTC

Set up SSL certificates
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.147 UTC

Load options from 1 files : /tmp/tmp_najQk
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.148 UTC

Wrap the keys into a new ApiKeys object
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.149 UTC

Creating an Exchange object
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.150 UTC

Create e ExchangeLiveData object to accomodate liveData from the exchange
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.164 UTC

Create a new TradeInterface object
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.165 UTC

Swapped pair mode : false
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.166 UTC

CCEDK uses global TX fee, currency pair not supported.now calling getTxFee()
com.nubits.nubot.trading.wrappers.CcedkWrapper
getTxFee
Mar 09 2015 21:43:11.167 UTC

Create a TaskManager
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.168 UTC

Starting task : Check connection with exchange
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.176 UTC

Waiting  a for the connectionThreads to detect connection
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:11.177 UTC

Configuring NuBot for Dual-Side strategy
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:14.184 UTC

Start trading Strategy specific for nbtbtc
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:14.192 UTC

Options : {
dualSide=true
 submitLiquidity=false
 executeOrders=true
 verbose=false
 sendHipchat=false
 apiKey=2CQ4QB8AHNKT96QE0G6Y51YI7WOG0H6L2955KWR86TPU4R0KCVJY4LYWHGWLPE74
 nubitAddress=
 rpcUser=
 nudIp=127.0.0.1
 nudPort=9091
 priceIncrement=3.0E-4
 txFee=0.2
 exchangeName=ccedk
 pair=nbtbtc
 executeStrategyInterval=41
 sendLiquidityInterval=130
 sendMails=false
 mailRecipient=null
 emergencyTimeoutMinutes 60
 keepProceeds=0.0
 aggregate=false

SecondaryPegOptionsJSON :
backupFeedNames [blockchain, coinbase, bitstamp]
distanceThreshold 10.0
mainFeed bitfinex
spread 0.0
wallchangeThreshold 0.3}
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:14.193 UTC

Updated Froozen Balances file (res/frozen/nbt_btc-ccedk-frozen.json) : 0 BTC
com.nubits.nubot.utils.FrozenBalancesManager
updateFrozenFilesystem
Mar 09 2015 21:43:14.235 UTC

Forcing a 0.9% minimum spread to protect from collisions
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:14.241 UTC

NuBot will be start running in 106 seconds, to sync with remote NTP and place walls during next wall shift window.
com.nubits.nubot.launch.NuBot
execute
Mar 09 2015 21:43:14.330 UTC

Liquidity is not being sent : orders are not yet initialized
com.nubits.nubot.tasks.SubmitLiquidityinfoTask
checkOrders
Mar 09 2015 21:43:53.184 UTC

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
com.nubits.nubot.pricefeeds.CoinbasePriceFeed
getLastPrice
Mar 09 2015 21:45:01.064 UTC

Error while updating BTC price from coinbase
com.nubits.nubot.pricefeeds.PriceFeedManager
getLastPrices
Mar 09 2015 21:45:01.065 UTC

CCEDK uses global TX fee, currency pair not supported.now calling getTxFee()
com.nubits.nubot.trading.wrappers.CcedkWrapper
getTxFee
Mar 09 2015 21:45:01.235 UTC

Computing USD prices with spread 0.9%  : sell @ 1.0065 buy @ 0.9935
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
initStrategy
Mar 09 2015 21:45:01.237 UTC

Converted price (using 1 BTC = 287.93 USD) : sell @ 0.00349564 BTC; buy @ 0.00345049 BTC
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
initStrategy
Mar 09 2015 21:45:01.238 UTC

Initializing strategy
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
run
Mar 09 2015 21:45:01.239 UTC

Frozen funds already in balance (not proceeds) updated : 0.0 Currency{fiat=false, code=BTC, extendedName=Bitcoin}
com.nubits.nubot.utils.FrozenBalancesManager
setBalanceAlreadyThere
Mar 09 2015 21:45:04.036 UTC

CCEDK uses global TX fee, currency pair not supported.now calling getTxFee()
com.nubits.nubot.trading.wrappers.CcedkWrapper
getTxFee
Mar 09 2015 21:45:04.806 UTC

Strategy - Submit order : SELL side order :  SELL 1.5 NBT @ 0.00349564 BTC
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:45:04.808 UTC

Strategy - SELL Response1 = 3186824
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:45:05.746 UTC

Strategy - Submit order : SELL side order :  SELL 1.5 NBT @ 0.00349564 BTC
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:45:11.157 UTC

Strategy : SELL Response2 = 3186827
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:45:11.577 UTC

Initial walls placed
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
placeInitialWalls
Mar 09 2015 21:45:11.994 UTC

com.nubits.nubot.tasks.SubmitLiquidityinfoTask
checkOrders
Mar 09 2015 21:46:04.390 UTC

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
com.nubits.nubot.pricefeeds.CoinbasePriceFeed
getLastPrice
Mar 09 2015 21:48:00.756 UTC

Error while updating BTC price from coinbase
com.nubits.nubot.pricefeeds.PriceFeedManager
getLastPrices
Mar 09 2015 21:48:00.757 UTC

Walls needs to be shifted
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
verifyPegPrices
Mar 09 2015 21:48:00.884 UTC

Sell Price 0.00349795  | Buy Price  0.00345277
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
computeNewPrices
Mar 09 2015 21:48:00.885 UTC

Strategy received a price change notification.
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:48:00.886 UTC

Shift needed on ccedk
Reason : 3 minutes elapsed since last shift
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:48:00.887 UTC

Immediately try to cancel all orders
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
shiftWalls
Mar 09 2015 21:48:00.888 UTC

Order 3186827 deleted succesfully
com.nubits.nubot.trading.wrappers.CcedkWrapper
clearOrders
Mar 09 2015 21:48:01.822 UTC

Order 3186824 deleted succesfully
com.nubits.nubot.trading.wrappers.CcedkWrapper
clearOrders
Mar 09 2015 21:48:02.887 UTC

CCEDK uses global TX fee, currency pair not supported.now calling getTxFee()
com.nubits.nubot.trading.wrappers.CcedkWrapper
getTxFee
Mar 09 2015 21:48:03.802 UTC

Strategy - Submit order : SELL side order :  SELL 1.5 NBT @ 0.00349795 BTC
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:48:03.803 UTC

Strategy - SELL Response1 = 3186855
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:48:04.607 UTC

Strategy - Submit order : SELL side order :  SELL 1.5 NBT @ 0.00349795 BTC
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:48:10.272 UTC

Strategy : SELL Response2 = 3186858
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:48:10.876 UTC

Liquidity is not being sent, a wall shift is happening. Will send on next execution.
com.nubits.nubot.tasks.SubmitLiquidityinfoTask
checkOrders
Mar 09 2015 21:48:13.185 UTC

Wall shift successful
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:48:17.415 UTC

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
com.nubits.nubot.pricefeeds.CoinbasePriceFeed
getLastPrice
Mar 09 2015 21:48:17.512 UTC

Error while updating BTC price from coinbase
com.nubits.nubot.pricefeeds.PriceFeedManager
getLastPrices
Mar 09 2015 21:48:17.513 UTC

Mon Mar 09 21:48:17 GMT 2015,blockchain,BTC,287.74,USD,0.00349795,0.00345277,
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
computeNewPrices
Mar 09 2015 21:48:17.514 UTC

com.nubits.nubot.tasks.SubmitLiquidityinfoTask
checkOrders
Mar 09 2015 21:50:24.069 UTC

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
com.nubits.nubot.pricefeeds.CoinbasePriceFeed
getLastPrice
Mar 09 2015 21:51:01.008 UTC

Error while updating BTC price from coinbase
com.nubits.nubot.pricefeeds.PriceFeedManager
getLastPrices
Mar 09 2015 21:51:01.009 UTC

Walls needs to be shifted
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
verifyPegPrices
Mar 09 2015 21:51:01.172 UTC

Sell Price 0.00349856  | Buy Price  0.00345337
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
computeNewPrices
Mar 09 2015 21:51:01.175 UTC

Strategy received a price change notification.
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:51:01.176 UTC

Shift needed on ccedk
Reason : 3 minutes elapsed since last shift
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:51:01.177 UTC

Immediately try to cancel all orders
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
shiftWalls
Mar 09 2015 21:51:01.178 UTC

Order 3186858 deleted succesfully
com.nubits.nubot.trading.wrappers.CcedkWrapper
clearOrders
Mar 09 2015 21:51:02.163 UTC

Order 3186855 deleted succesfully
com.nubits.nubot.trading.wrappers.CcedkWrapper
clearOrders
Mar 09 2015 21:51:03.187 UTC

CCEDK uses global TX fee, currency pair not supported.now calling getTxFee()
com.nubits.nubot.trading.wrappers.CcedkWrapper
getTxFee
Mar 09 2015 21:51:04.169 UTC

Strategy - Submit order : SELL side order :  SELL 1.5 NBT @ 0.00349856 BTC
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:51:04.170 UTC

Strategy - SELL Response1 = 3186885
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:51:04.618 UTC

Strategy - Submit order : SELL side order :  SELL 1.5 NBT @ 0.00349856 BTC
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:51:10.008 UTC

Strategy : SELL Response2 = 3186888
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:51:10.439 UTC

Wall shift successful
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:51:16.873 UTC

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
com.nubits.nubot.pricefeeds.CoinbasePriceFeed
getLastPrice
Mar 09 2015 21:51:16.976 UTC

Error while updating BTC price from coinbase
com.nubits.nubot.pricefeeds.PriceFeedManager
getLastPrices
Mar 09 2015 21:51:16.977 UTC

Mon Mar 09 21:51:16 GMT 2015,blockchain,BTC,287.69,USD,0.00349856,0.00345337,
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
computeNewPrices
Mar 09 2015 21:51:16.978 UTC

com.nubits.nubot.tasks.SubmitLiquidityinfoTask
checkOrders
Mar 09 2015 21:52:34.021 UTC

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
com.nubits.nubot.pricefeeds.CoinbasePriceFeed
getLastPrice
Mar 09 2015 21:54:00.882 UTC

Error while updating BTC price from coinbase
com.nubits.nubot.pricefeeds.PriceFeedManager
getLastPrices
Mar 09 2015 21:54:00.883 UTC

Walls needs to be shifted
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
verifyPegPrices
Mar 09 2015 21:54:01.013 UTC

Sell Price 0.00351003  | Buy Price  0.00346469
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
computeNewPrices
Mar 09 2015 21:54:01.014 UTC

Strategy received a price change notification.
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:54:01.014 UTC

Shift needed on ccedk
Reason : 3 minutes elapsed since last shift
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:54:01.015 UTC

Immediately try to cancel all orders
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
shiftWalls
Mar 09 2015 21:54:01.015 UTC

Order 3186888 deleted succesfully
com.nubits.nubot.trading.wrappers.CcedkWrapper
clearOrders
Mar 09 2015 21:54:01.836 UTC

Order 3186885 deleted succesfully
com.nubits.nubot.trading.wrappers.CcedkWrapper
clearOrders
Mar 09 2015 21:54:02.813 UTC

CCEDK uses global TX fee, currency pair not supported.now calling getTxFee()
com.nubits.nubot.trading.wrappers.CcedkWrapper
getTxFee
Mar 09 2015 21:54:08.859 UTC

Strategy - Submit order : SELL side order :  SELL 1.5 NBT @ 0.00351003 BTC
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:54:08.861 UTC

Strategy - SELL Response1 = 3186916
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:54:09.270 UTC

Strategy - Submit order : SELL side order :  SELL 1.5 NBT @ 0.00351003 BTC
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:54:14.675 UTC

Strategy : SELL Response2 = 3186926
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:54:15.065 UTC

Wall shift successful
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:54:21.515 UTC

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
com.nubits.nubot.pricefeeds.CoinbasePriceFeed
getLastPrice
Mar 09 2015 21:54:21.604 UTC

Error while updating BTC price from coinbase
com.nubits.nubot.pricefeeds.PriceFeedManager
getLastPrices
Mar 09 2015 21:54:21.605 UTC

Mon Mar 09 21:54:21 GMT 2015,blockchain,BTC,286.75,USD,0.00351003,0.00346469,
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
computeNewPrices
Mar 09 2015 21:54:21.606 UTC

com.nubits.nubot.tasks.SubmitLiquidityinfoTask
checkOrders
Mar 09 2015 21:54:44.056 UTC

com.nubits.nubot.tasks.SubmitLiquidityinfoTask
checkOrders
Mar 09 2015 21:56:54.045 UTC

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
com.nubits.nubot.pricefeeds.CoinbasePriceFeed
getLastPrice
Mar 09 2015 21:57:00.893 UTC

Error while updating BTC price from coinbase
com.nubits.nubot.pricefeeds.PriceFeedManager
getLastPrices
Mar 09 2015 21:57:00.894 UTC

Walls needs to be shifted
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
verifyPegPrices
Mar 09 2015 21:57:01.067 UTC

Sell Price 0.00349686  | Buy Price  0.00345169
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
computeNewPrices
Mar 09 2015 21:57:01.069 UTC

Strategy received a price change notification.
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:57:01.069 UTC

Shift needed on ccedk
Reason : 3 minutes elapsed since last shift
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:57:01.070 UTC

Immediately try to cancel all orders
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
shiftWalls
Mar 09 2015 21:57:01.071 UTC

Order 3186926 deleted succesfully
com.nubits.nubot.trading.wrappers.CcedkWrapper
clearOrders
Mar 09 2015 21:57:01.885 UTC

Order 3186916 deleted succesfully
com.nubits.nubot.trading.wrappers.CcedkWrapper
clearOrders
Mar 09 2015 21:57:02.815 UTC

CCEDK uses global TX fee, currency pair not supported.now calling getTxFee()
com.nubits.nubot.trading.wrappers.CcedkWrapper
getTxFee
Mar 09 2015 21:57:08.221 UTC

Strategy - Submit order : SELL side order :  SELL 1.5 NBT @ 0.00349686 BTC
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:57:08.223 UTC

Strategy - SELL Response1 = 3186947
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:57:08.651 UTC

Strategy - Submit order : SELL side order :  SELL 1.5 NBT @ 0.00349686 BTC
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:57:14.098 UTC

Strategy : SELL Response2 = 3186955
com.nubits.nubot.tasks.strategy.StrategySecondaryPegUtils
initOrders
Mar 09 2015 21:57:14.571 UTC

Wall shift successful
com.nubits.nubot.tasks.strategy.StrategySecondaryPegTask
notifyPriceChanged
Mar 09 2015 21:57:20.572 UTC

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
com.nubits.nubot.pricefeeds.CoinbasePriceFeed
getLastPrice
Mar 09 2015 21:57:20.655 UTC

Error while updating BTC price from coinbase
com.nubits.nubot.pricefeeds.PriceFeedManager
getLastPrices
Mar 09 2015 21:57:20.656 UTC

Mon Mar 09 21:57:20 GMT 2015,blockchain,BTC,287.83,USD,0.00349686,0.00345169,
com.nubits.nubot.tasks.strategy.PriceMonitorTriggerTask
computeNewPrices
Mar 09 2015 21:57:20.657 UTC

Bot shutting down..
com.nubits.nubot.launch.NuBot
run
Mar 09 2015 21:58:30.707 UTC

Clearing out active orders ...
com.nubits.nubot.launch.NuBot
run
Mar 09 2015 21:58:30.708 UTC


text:
layout: page
title: Ready Hero Chemical Seminar
date: 2016-05-24
author: Susan Haas
tags: weekly links, java
status: published
summary: Aliquam auctor urna nec velit porttitor.
banner: images/banner/leisure-01.jpg
booking:
  startDate: 04/22/2018
  endDate: 04/26/2018
  ctyhocn: HOTARHX
  groupCode: RHCS
published: true
---
In vel tincidunt ex. Vestibulum id orci rutrum, maximus ligula bibendum, viverra tellus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Maecenas id nisl vitae orci volutpat auctor a eget arcu. Cras non leo ultricies, maximus justo vel, posuere nibh. Etiam vulputate purus erat, ac tempor nunc interdum tristique. Quisque quis libero et eros mattis mattis eu ut lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nec tortor in quam consectetur vulputate eu eu ipsum. Quisque vestibulum eros sit amet tempor sodales.
Fusce non tellus at metus varius fringilla nec bibendum nisi. Maecenas vel pretium tellus. Cras sodales ex non metus interdum, eu elementum tellus bibendum. Aliquam consequat ultricies enim, vitae tempor purus dignissim at. Sed a orci quis lacus vestibulum imperdiet. Vivamus nibh justo, accumsan quis ex vel, commodo pharetra leo. Suspendisse volutpat nisl sit amet dui dapibus, ut consectetur velit hendrerit.

* Sed ullamcorper tortor vel nunc dictum dignissim
* Sed aliquet ex vel pellentesque porta.

Sed vestibulum nunc hendrerit augue maximus ornare. Proin dolor nisl, rhoncus eu leo at, semper euismod velit. Curabitur ullamcorper libero lorem, vitae efficitur sem venenatis non. Morbi a ante erat. Pellentesque fringilla pellentesque ex in efficitur. Aliquam et bibendum leo. Etiam non nibh tristique, vehicula mi id, auctor ligula. Nullam fermentum sem ex, a condimentum nisi fermentum id. Nunc euismod placerat erat at vestibulum. Proin rutrum eleifend tellus, a vestibulum leo consectetur ullamcorper. Phasellus vitae viverra metus. Vivamus erat felis, tincidunt sit amet auctor eu, elementum a erat.


text:
namespace blink {

using EditContextInputPanelPolicy = V8EditContextInputPanelPolicy::Enum;

class DOMRect;
class EditContext;
class EditContextInit;
class Element;
class ExceptionState;
class InputMethodController;
class V8EditContextEnterKeyHint;
class V8EditContextInputMode;

// The goal of the EditContext is to expose the lower-level APIs provided by
// modern operating systems to facilitate various input modalities to unlock
// advanced editing scenarios. For more information please refer
// https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/EditContext/explainer.md.

class CORE_EXPORT EditContext final : public EventTargetWithInlineData,
                                      public ActiveScriptWrappable<EditContext>,
                                      public ExecutionContextClient,
                                      public WebInputMethodController {
  DEFINE_WRAPPERTYPEINFO();

 public:
  EditContext(ScriptState* script_state, const EditContextInit* dict);
  static EditContext* Create(ScriptState* script_state,
                             const EditContextInit* dict);
  ~EditContext() override;

  // Event listeners for an EditContext.
  DEFINE_ATTRIBUTE_EVENT_LISTENER(textupdate, kTextupdate)
  DEFINE_ATTRIBUTE_EVENT_LISTENER(textformatupdate, kTextformatupdate)
  DEFINE_ATTRIBUTE_EVENT_LISTENER(characterboundsupdate, kCharacterboundsupdate)
  DEFINE_ATTRIBUTE_EVENT_LISTENER(compositionstart, kCompositionstart)
  DEFINE_ATTRIBUTE_EVENT_LISTENER(compositionend, kCompositionend)

  // Public APIs for an EditContext (called from JS).

  // This API should be called when the selection has changed.
  // It takes as parameters a start and end character offsets, which are based
  // on the text held by the EditContext. This may be called by the web app when
  // a combination of control keys (e.g. Shift + Arrow) or mouse events result
  // in a change to the selection on the edited document.
  void updateSelection(uint32_t start,
                       uint32_t end,
                       ExceptionState& exception_state);

  // This API must be called whenever the client coordinates (i.e. relative to
  // the origin of the viewport) of the view of the EditContext have changed.
  // This includes if the viewport is scrolled or the position of the editable
  // contents changes in response to other updates to the view. The argument
  // describes a bounding box in client coordinates for the editable region.
  void updateControlBounds(DOMRect* control_bounds);

  // This API must be called whenever the client coordinates of the view of
  // the EditContext have changed. The argument describes a bounding box in
  // client coordinates for the current selection (or the caret if the
  // selection is collapsed.)
  void updateSelectionBounds(DOMRect* selection_bounds);

  // This API should be called when the consumer of the EditContext receives
  // CharacterBoundsUpdateEvent. The arguments to this method describe a
  // sequence of bounding boxes that are requested by
  // CharacterBoundsUpdateEvent.
  void updateCharacterBounds(unsigned long range_start,
                             HeapVector<Member<DOMRect>>& character_bounds);

  // Updates to the text driven by the webpage/javascript are performed
  // by calling this API on the EditContext. It accepts a range (start and end
  // offsets over the text) and the characters to insert at that
  // range. This should be called anytime the editable contents have been
  // updated. However, in general this should be avoided during the firing of
  // textupdate as it will result in a canceled composition.
  // Also, after calling this API, update the selection by calling
  // updateSelection.
  void updateText(uint32_t start,
                  uint32_t end,
                  const String& new_text,
                  ExceptionState& exception_state);

  // Get elements that are associated with this EditContext.
  const HeapVector<Member<Element>>& attachedElements();

  // Returns the text of the EditContext.
  String text() const;

  // Returns the current selectionStart of the EditContext.
  uint32_t selectionStart() const;

  // Returns the current selectionEnd of the EditContext.
  uint32_t selectionEnd() const;

  // Returns the start position of the range of the current cached character
  // bounds.
  uint32_t characterBoundsRangeStart() const;

  // Returns the current cached character bounds.
  const HeapVector<Member<DOMRect>> characterBounds();

  // Returns the InputMode of the EditContext.
  V8EditContextInputMode inputMode() const;

  // Returns the EnterKeyHint of the EditContext.
  V8EditContextEnterKeyHint enterKeyHint() const;

  // Returns the InputPanelPolicy of the EditContext.
  V8EditContextInputPanelPolicy inputPanelPolicy() const;

  // Sets the text of the EditContext which is used to display suggestions.
  void setText(const String& text);

  // Sets the selectionStart of the EditContext.
  void setSelectionStart(uint32_t selection_start,
                         ExceptionState& exception_state);

  // Sets the selectionEnd of the EditContext.
  void setSelectionEnd(uint32_t selection_end, ExceptionState& exception_state);

  // Sets an input mode defined in EditContextInputMode.
  // This relates to the inputMode attribute defined for input element:
  // https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute.
  void setInputMode(const V8EditContextInputMode& input_mode);

  // Sets a specific action related to Enter key defined in
  // https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-enterkeyhint-attribute.
  void setEnterKeyHint(const V8EditContextEnterKeyHint& enter_key_hint);

  // Sets a policy that determines whether the VK should be raised or dismissed.
  // Auto raises the VK automatically, Manual suppresses it.
  void setInputPanelPolicy(const V8EditContextInputPanelPolicy& input_policy);

  // Internal APIs (called from Blink).

  // EventTarget overrides
  const AtomicString& InterfaceName() const override;
  ExecutionContext* GetExecutionContext() const override;

  // ActiveScriptWrappable overrides.
  bool HasPendingActivity() const override;

  void Trace(Visitor*) const override;

  // WebInputMethodController overrides.
  bool SetComposition(const WebString& text,
                      const WebVector<ui::ImeTextSpan>& ime_text_spans,
                      const WebRange& replacement_range,
                      int selection_start,
                      int selection_end) override;
  bool CommitText(const WebString& text,
                  const WebVector<ui::ImeTextSpan>& ime_text_spans,
                  const WebRange& replacement_range,
                  int relative_caret_position) override;
  bool FinishComposingText(
      ConfirmCompositionBehavior selection_behavior) override;
  WebTextInputInfo TextInputInfo() override;
  int ComputeWebTextInputNextPreviousFlags() override { return 0; }
  WebTextInputType TextInputType() override;
  int TextInputFlags() const;
  WebRange CompositionRange() override;
  bool GetCompositionCharacterBounds(WebVector<gfx::Rect>& bounds) override;
  WebRange GetSelectionOffsets() const override;

  // When focus is called on an EditContext, it sets the active EditContext in
  // the document so it can use the text input state to send info about the
  // EditContext to text input clients in the browser process which will also
  // set focus of the text input clients on the corresponding context document.
  void Focus();

  // This API sets the active EditContext to null in the document that results
  // in a focus change event to the text input clients in the browser process
  // which will also remove focus from the corresponding context document.
  void Blur();

  // Populate |control_bounds| and |selection_bounds| with the bounds fetched
  // from the active EditContext.
  void GetLayoutBounds(gfx::Rect* control_bounds,
                       gfx::Rect* selection_bounds) override;

  // Sets the composition range from the already existing text
  // This is used for reconversion scenarios in JPN IME.
  bool SetCompositionFromExistingText(
      int composition_start,
      int composition_end,
      const WebVector<ui::ImeTextSpan>& ime_text_spans);

  // For English typing.
  bool InsertText(const WebString& text);

  void DeleteBackward();
  void DeleteForward();
  void DeleteWordBackward();
  void DeleteWordForward();

  bool IsVirtualKeyboardPolicyManual() const override;
  bool IsEditContextActive() const override;
  // Returns whether show()/hide() API is called from virtualkeyboard or not.
  ui::mojom::VirtualKeyboardVisibilityRequest
  GetLastVirtualKeyboardVisibilityRequest() const override;
  // Sets the VirtualKeyboard visibility request(show/hide/none).
  void SetVirtualKeyboardVisibilityRequest(
      ui::mojom::VirtualKeyboardVisibilityRequest vk_visibility_request)
      override;
  // Called from WebLocalFrame for English compositions
  // such as shape-writing, handwriting panels etc.
  // Extends the current selection range and removes the
  // characters from the buffer.
  void ExtendSelectionAndDelete(int before, int after);

  void AttachElement(Element* element_to_attach);
  void DetachElement(Element* element_to_detach);

 private:
  // Returns the enter key action attribute set in the EditContext.
  ui::TextInputAction GetEditContextEnterKeyHint() const;

  // Returns the inputMode of the EditContext from enterKeyHint property.
  WebTextInputMode GetInputModeOfEditContext() const;

  InputMethodController& GetInputMethodController() const;

  void DeleteCurrentSelection();

  // Events fired to JS.
  // Fires compositionstart event to JS whenever user starts a composition.
  bool DispatchCompositionStartEvent(const String& text);

  // Fires compositionend event to JS whenever composition is terminated by the
  // user.
  void DispatchCompositionEndEvent(const String& text);

  // The textformatupdate event is fired when the input method desires a
  // specific region to be styled in a certain fashion, limited to the style
  // properties that correspond with the properties that are exposed on
  // TextFormatUpdateEvent (e.g. backgroundColor, textDecoration, etc.). The
  // consumer of the EditContext should update their view accordingly to provide
  // the user with visual feedback as prescribed by the software keyboard.
  void DispatchTextFormatEvent(
      const WebVector<ui::ImeTextSpan>& ime_text_spans);

  // The textupdate event will be fired on the EditContext when user input has
  // resulted in characters being applied to the editable region. The event
  // signals the fact that the software keyboard or IME updated the text (and as
  // such that state is reflected in the shared buffer at the time the event is
  // fired). This can be a single character update, in the case of typical
  // typing scenarios, or multiple-character insertion based on the user
  // changing composition candidates. Even though text updates are the results
  // of the software keyboard modifying the buffer, the creator of the
  // EditContext is ultimately responsible for keeping its underlying model
  // up-to-date with the content that is being edited as well as telling the
  // EditContext about such changes. These could get out of sync, for example,
  // when updates to the editable content come in through other means (the
  // backspace key is a canonical example — no textupdate is fired in this case,
  // and the consumer of the EditContext should detect the keydown event and
  // remove characters as appropriate).
  void DispatchTextUpdateEvent(const String& text,
                               uint32_t update_range_start,
                               uint32_t update_range_end,
                               uint32_t new_selection_start,
                               uint32_t new_selection_end);

  // The characterboundsupdate event is fired when the range of the composition
  // is changed. The arguments indicates the range of the composition
  // where the character bounds are needed by Text Input Service. The consumer
  // of the EditContext should call updateCharacterBounds() to provide the
  // requested bounding boxes when receiving this event.
  void DispatchCharacterBoundsUpdateEvent(uint32_t range_start,
                                          uint32_t range_end);

  // EditContext member variables.
  String text_;
  uint32_t selection_start_ = 0;
  uint32_t selection_end_ = 0;
  WebTextInputMode input_mode_ = WebTextInputMode::kWebTextInputModeText;
  ui::TextInputAction enter_key_hint_ = ui::TextInputAction::kEnter;
  EditContextInputPanelPolicy input_panel_policy_ =
      EditContextInputPanelPolicy::kManual;
  gfx::Rect control_bounds_;
  gfx::Rect selection_bounds_;
  WebVector<gfx::Rect> character_bounds_;
  uint32_t character_bounds_range_start_ = 0;

  // This flag is set when the input method controller receives a
  // composition event from the IME. It keeps track of the start and
  // end composition events and fires JS events accordingly.
  bool has_composition_ = false;
  // This is used to keep track of the active composition text range.
  // It is reset once the composition ends.
  uint32_t composition_range_start_ = 0;
  uint32_t composition_range_end_ = 0;
  // Elements that are associated with this EditContext.
  HeapVector<Member<Element>> attached_elements_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_IME_EDIT_CONTEXT_H_


text:
angular.module('zigfo')
.controller('policyController', ['$scope', function($scope){
  $scope.faqs = [
    { 'opened': false,
      'q': 'What is an Order made Garments (tailor made Clothing)?',
      'a': 'An \'Order Made Garments\' simply means that you can design your shirt, Trousers, Suits or blouses right from scratch by using our own in-house developed "Zigfo-3D tool". From selecting your choice of well-known Branded fabric to choosing your shirt style from limitless options to the sizing of the shirt which will be made exactly to your size, specially for you.'
    },
    { 'opened': false,
      'q': 'How are you able to offer such affordable prices for order made shirts?',
      'a': 'We are able to offer such prices because we have streamline the entire process and bring custom made garments direct to the customers without involving any middle men. We are keeping the quality very high and have the right infrastructure in place to support tailor-made shirts, Trousers, Suits and Blouses for all gender. Our aim is to put our product out there for everyone to experience the exclusivity of ordering tailor-made garments (Tailor made Shirt, Tailor made Trousers, Tailor made Suits and Tailor made Blouses) at a reasonable price. We have a narrow and reasonable profit margin as we enjoy the satisfaction of our customers get from experiencing our top quality and high class garments.'
    },
    { 'opened': false,
      'q': 'What kind of fabric is used for the shirts?',
      'a': 'We believe in using the best always, so we use high quality fabrics from world best Mills and branded fabric which includes 100% pure Cotton, Linen, Wool and Silk etc. or some time best blended fabric with clearly mention on our online portal. Our price is unbeatable when compared to other vendors in the online market, who use the similar kind of fabric. This is guaranteed!'
    },
    { 'opened': false,
      'q': 'Am I able to order Standard Sized garments?',
      'a': 'Yes. We have an option for you to select a size from our standard size chart. We do have an opting of customising the measurement from standard size chart as well. Our fit is second to none, so rest assured you will enjoy the feel of a tailor-made fit even if you choose a standard size!'
    },
    { 'opened': false,
      'q': 'How long do I have to wait for my shirts?',
      'a': 'Having the best production facilities seamless operational team, we are most likely able to deliver within 6 weeks.'
    },
    { 'opened': false,
      'q': 'Is there an extra charge for monograms (initials)?',
      'a': 'We are yet to have this option on our facilities; every option offered on our website is included in the price. All styles, including your personal monogram is complimentary, until unless stated otherwise.'
    },
    { 'opened': false,
      'q': 'Is it difficult to take your own size?',
      'a': 'Taking your own size is very simple! For your convenience, we have included easy guidelines which include pictures and a VDO to assist you in measuring.'
    },
    { 'opened': false,
      'q': 'I have trouble paying with credit card. Once I enter my details it does not process, what do I do?',
      'a': 'Please empty cache and clear cookies in your browser, start designing again and this time the process will go through.'
    },
    { 'opened': false,
      'q': 'Which browser is best to view your site?',
      'a': 'Please use Internet explorer, Firefox or Chrome for best performance. However, Safari should also work fine.'
    },
    { 'opened': false,
      'q': 'Will you be offering any other tailor made products in the near future?',
      'a': 'Yes, there are many items on the way. Add us on Facebook to stay updated!'
    },
    { 'opened': false,
      'q': 'Do you have your own facility?',
      'a': 'Yes, we do have our own in-house facilities, we have in-house developer to bring best of online experience while using the in-house developed 3D tool to customise and bring your own designs. We have in-house team of designers to assist you for best occasions like party or marriage and provide you with designer wears. We are in process of setting many other facilities to become words largest tailor-made garments provider.'
    },
    { 'opened': false,
      'q': 'I wish to sell Zigfo's Tailor Made Garments in my country, what is the procedure?',
      'a': 'Please write us at info@zigfo.com for more details.'
    },
    { 'opened': false,
      'q': 'What are your terms and conditions?',
      'a': 'Please read Terms and Conditions listed on the Menu and at Check Out page.'
    },
    { 'opened': false,
      'q': 'How long have you been in this Tailor Made Business?',
      'a': 'We are the first Generation Business in Tailor Made clothing, but promise you to bring all the advantage of new generation technology at each stage of custom made tailoring. No one can match our cutting edge technology and customer centric approach to provide you with second to-the-none experiences. We are here to revolutionised the tailor made business so that everyone can order High quality Tailor Made products at very affordable prices!'
    },
    { 'opened': false,
      'q': 'I\'d like to purchase uniforms for my company, are you able to provide such services?',
      'a': 'Yes, we have a lot of experience in uniform business. For more details, please contact us at info@zigfo.com .'
    },
    { 'opened': false,
      'q': 'Do you have a local partner who can take my measurements?',
      'a': 'It is really simple to take your own measurements with the help of your friends or family. We have very clear pictures catalogue to guide you and there is a VDO guide in our 3D Designer. You will find this thoroughly enjoyable and very special!'
    },
    { 'opened': false,
      'q': 'Do you have customer service or support?',
      'a': 'Yes, Please go to Contact us for details. As our customers, we give importance to your queries/support and will always serve you with priority.'
    },
    { 'opened': false,
      'q': 'When I receive my shirts, the colours are Slightly different from the 3D Designer. Is this normal?',
      'a': 'Yes. Each screen resolution is different and there are chances that the colour may vary. However, we have been selling tailor made clothing and the feedback about the quality from the 3D Designer has been amazing, it is very close to the actual shirts.'
    }
  ]
}])


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>mp-game</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>ws demo</name>
    <description>Multiplayer game</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.3.RELEASE</version>
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <jetty.version>9.2.11.v20150529</jetty.version>
        <reactor.version>2.5.0.M2</reactor.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty.websocket</groupId>
            <artifactId>javax-websocket-server-impl</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty.websocket</groupId>
            <artifactId>websocket-server</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty.websocket</groupId>
            <artifactId>javax-websocket-client-impl</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty.websocket</groupId>
            <artifactId>websocket-client</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>19.0</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${project.parent.version}</version>
                <configuration>
                    <mainClass>com.example.DemoApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${jetty.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals><goal>copy-dependencies</goal></goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>spring-libs</id>
            <name>Spring Snapshots</name>
            <url>http://repo.spring.io/libs-snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

</project>


text:
intellijcoder
=============

IntelliJ IDEA plugin for TopCoder

Installation
-------------------------
Just like any other IntelliJ IDEA plugin:
* Windows: `File -> Settings -> Plugins -> Browse repositories... -> IntelliJCoder -> Download and install`
* Mac OS: `IntelliJ IDEA -> Preferences -> Plugins -> Browse repositories... -> IntelliJCoder -> Download and install`

Usage
-------------------------
* Create new or open existing project in IntelliJ IDEA.
* Make sure you have JDK configured for your project (`File -> Project Structure -> Project -> SDK`)
* Make sure the Main Toolbar is shown! This is a toolbar where TopCoder icon is located and it's hidden by default, Click `View -> Appearance -> Toolbar` to enable it
* Press TopCoder button ![TopCoder icon](https://raw.github.com/fadeyev/intellijcoder/master/intellijcoder-idea/src/intellijcoder/idea/topcoder-icon.png) on the main toolbar to launch Arena applet
* Login to Arena, then select a contest and open a problem
* IntelliJCoder will automatically create a new module with a solution stub and a test class and run tests
* After you finished editing your code, use Compile and Sumbit buttons in Arena to submit your code to TopCoder servers
* Thanks to the contributors you can now setup your favorite imports and method templates in Settings:
    * Windows: `File -> Settings -> IntelliJCoder`
    * Mac OS: `IntelliJ IDEA -> Preferences -> IntelliJCoder`

Screenshot
-------------------------
![Screeshot](/screenshot.png)

Support
-------------------------
New features are developed by contributors now (thanks a lot to all of them). I don't actively develop this project - only critical bug fixes.
However, contributions are always welcome. I'll do my best to merge your changes and deploy a new version to JetBrains website.

How to build (for contributors)
-------------------------
* Check out project

    ```
    git clone https://github.com/fadeyev/intellijcoder.git
    ```
* Repository contains `.idea` project files, so just open the project in IDEA:
`File -> Open`
* Configure the project:
    * Open project settings: `File -> Project Structure (Ctrl+Alt+Shift+S)`
    * Set up IntelliJ IDEA Plugin SDK:
    `Project -> Project SDK -> New... ->IntelliJ Platform Plugin SDK -> <Pick your IDEA directory> -> OK`
    * Set this SDK as SDK for modules:
    `Modules -> intellijcoder -> Dependencies -> Module SDK -> <Pick your SDK here>`
    `Modules -> intellijcoder-idea -> Dependencies -> Module SDK -> <Pick your SDK here>`
    * You also need to set up IDEA Junit plugin library location, since IntelliJCoder depends on it:
    `Libraries -> JUnit IDEA Plugin -> <If idea-junit.jar location is incorrect, please set up the correct one>`
    * Check that there are no errors at the bottom of the dialog. Press OK to close Project Settings.
* To be able to debug the plugin you may want to check out fresh IntelliJ IDEA sources: http://www.jetbrains.org/pages/viewpage.action?pageId=983225

    ```
    git clone https://github.com/JetBrains/intellij-community.git
    ```
    and then attach them to IntelliJ IDEA Plugin SDK:
`File -> Project Structure -> SDKs -> IDEA IC-*** -> Sourcepath -> Add -> <Point to the checked out folder>`
* To build a jar file, right-click on **intellijcoder-idea** module, select the option "Prepare Plugin Module intellijcoder-idea for Deployment"


text:
from __future__ import unicode_literals
from ..minc import BBox

def test_BBox_inputs():
    input_map = dict(args=dict(argstr='%s',
    ),
    environ=dict(nohash=True,
    usedefault=True,
    ),
    format_minccrop=dict(argstr='-minccrop',
    ),
    format_mincresample=dict(argstr='-mincresample',
    ),
    format_mincreshape=dict(argstr='-mincreshape',
    ),
    ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    input_file=dict(argstr='%s',
    mandatory=True,
    position=-2,
    ),
    one_line=dict(argstr='-one_line',
    xor=('one_line', 'two_lines'),
    ),
    out_file=dict(argstr='> %s',
    genfile=True,
    position=-1,
    ),
    output_file=dict(hash_files=False,
    keep_extension=False,
    name_source=['input_file'],
    name_template='%s_bbox.txt',
    position=-1,
    ),
    terminal_output=dict(deprecated='1.0.0',
    nohash=True,
    ),
    threshold=dict(argstr='-threshold',
    ),
    two_lines=dict(argstr='-two_lines',
    xor=('one_line', 'two_lines'),
    ),
    )
    inputs = BBox.input_spec()

    for key, metadata in list(input_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(inputs.traits()[key], metakey) == value

def test_BBox_outputs():
    output_map = dict(output_file=dict(),
    )
    outputs = BBox.output_spec()

    for key, metadata in list(output_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(outputs.traits()[key], metakey) == value


text:
package org.destinationsol.game.item;

import com.badlogic.gdx.utils.JsonValue;
import org.destinationsol.files.HullConfigManager;
import org.destinationsol.game.ShipConfig;
import org.destinationsol.game.ship.hulls.HullConfig;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class TradeConfig {
    public final List<ItemConfig> items = new ArrayList<>();
    public final ItemContainer hulls = new ItemContainer();
    public final ItemContainer mercs = new ItemContainer();

    public void load(JsonValue tradeNode, HullConfigManager hullConfigs, ItemManager itemManager) {
        if (tradeNode == null) {
            return;
        }

        String itemStr = tradeNode.getString("items");
        List<ItemConfig> itemList = itemManager.parseItems(itemStr);
        Collections.reverse(itemList); // TODO: Examine why this is required.
        items.addAll(itemList);

        String shipStr = tradeNode.getString("ships", "");
        String[] split = shipStr.split(" ");
        for (int i = split.length - 1; i >= 0; i--) {
            String hullName = split[i];
            HullConfig hull = hullConfigs.getConfig(hullName);
            hulls.add(new ShipItem(hull));
        }

        ArrayList<ShipConfig> loadList = ShipConfig.loadList(tradeNode.get("mercenaries"), hullConfigs, itemManager);
        for (int i = loadList.size() - 1; i >= 0; i--) {
            ShipConfig merc = loadList.get(i);
            mercs.add(new MercItem(merc));
        }
    }

}


text:
package io.hawt.git;

import java.io.File;
import java.io.IOException;

import io.hawt.util.Files;
import org.eclipse.jgit.api.AddCommand;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.PersonIdent;

import static io.hawt.git.GitFacadeSupport.getFilePattern;

/**
 * The context when performing reads and writes within git
 */
public class WriteContext {
    private final Git git;
    private final File rootDir;
    private final File file;
    private boolean requiresCommit;
    private PersonIdent author;
    private String message;

    public WriteContext(Git git, File rootDir, File file) {
        this.git = git;
        this.rootDir = rootDir;
        this.file = file;
    }

    /**
     * Adds the given file to git
     */
    public void addFile(File file) throws IOException, GitAPIException {
        String path = Files.getRelativePath(rootDir, file);
        String filePattern = getFilePattern(path);
        AddCommand add = git.add().addFilepattern(filePattern).addFilepattern(".");
        add.call();
        requiresCommit = true;
    }

    // Properties
    //-------------------------------------------------------------------------

    public Git getGit() {
        return git;
    }

    public File getRootDir() {
        return rootDir;
    }

    public File getFile() {
        return file;
    }

    public boolean isRequiresCommit() {
        return requiresCommit;
    }

    public void setRequiresCommit(boolean requiresCommit) {
        this.requiresCommit = requiresCommit;
    }

    public PersonIdent getAuthor() {
        return author;
    }

    public void setAuthor(PersonIdent author) {
        this.author = author;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}


text:
#ifndef _DECAF_LANG_THREADBENCHMARK_H_
#define _DECAF_LANG_THREADBENCHMARK_H_

#include <benchmark/BenchmarkBase.h>
#include <decaf/lang/Thread.h>

namespace decaf {
namespace lang {

    class ThreadBenchmark : public benchmark::BenchmarkBase< decaf::lang::ThreadBenchmark, Thread >{
    public:

        ThreadBenchmark();
        virtual ~ThreadBenchmark();

        virtual void run();

    };

}}

#endif /* _DECAF_LANG_THREADBENCHMARK_H_ */


text:
<?xml version="1.0" ?>
<Simulation verbosity="silent">
  <TestInfo>
    <name>framework/OutStreams.colorbar_plot</name>
    <author>maljdan</author>
    <created>2016-04-27</created>
    <classesTested>OutStreams.Plot</classesTested>
    <description>
       Test to check the functionalities of OutStreams system in RAVEN of type Plot, when a colorbar is used (colorMap)
    </description>
    <revisions>
      <revision author="maljdan" date="2016-05-04">Fixing the test for the compare executable to test the gold image against itself, if this returns a non-zero code, then the version of imageMagick cannot be used to get a valid difference. Also, I am removing the difference image and instead doing null: to remove the output file when using compare.</revision>
      <revision author="chenj" date="2016-07-07">edit docstring</revision>
      <revision author="alfoa" date="2017-01-21">Adding this test description.</revision>
    </revisions>
  </TestInfo>
  <RunInfo>
    <WorkingDir>plot</WorkingDir>
    <Sequence>sample,plot</Sequence>
    <batchSize>1</batchSize>
  </RunInfo>

  <ExternalXML node="Models" xmlToLoad="sharedModel.xml"/>
  <ExternalXML node="Distributions" xmlToLoad="sharedDistributions.xml"/>
  <ExternalXML node="Samplers" xmlToLoad="sharedSamplers.xml"/>

  <OutStreams>
    <Plot name='test'   interactive='True' overwrite='True'>
      <filename>colorbarTest</filename>
      <actions>
        <how>png</how>
        <figureProperties>
          <frameon>false</frameon>
          <figsize>1,1</figsize>
        </figureProperties>
        <title>
          <text> </text>
        </title>
        <axis>off</axis>
        <grid>off</grid>
        <axesBox>off</axesBox>
      </actions>
      <plotSettings>
        <plot>
          <type>scatter</type>
            <x>PointSet|Input|X</x>
            <y>PointSet|Input|Y</y>
            <colorMap>PointSet|Output|Z</colorMap>
            <!-- Testing default behavior if a cmap is not specified -->
         </plot>
        <xlabel>X</xlabel>
        <ylabel>Y</ylabel>
      </plotSettings>
    </Plot>
  </OutStreams>

  <ExternalXML node="Steps" xmlToLoad="sharedSteps.xml"/>
  <ExternalXML node="DataObjects" xmlToLoad="sharedDataObjects.xml"/>

</Simulation>


text:
<?php if (!defined("BASEPATH")) die("No direct Access to Script Files!");
class ControllerManager{

	public function __construct() {

	}

}