text:
// Generated by scalaxb.
package xmlschema

import masked.scalaxb

/**
    Part 1 version: Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp
    Part 2 version: Id: datatypes.xsd,v 1.3 2004/01/23 18:11:13 ht Exp

*/

/**
       This type is extended by almost all schema types
       to allow attributes from other namespaces to be
       added to user schemas.

*/
trait XOpenAttrsable {
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

/**
       This type is extended by almost all schema types
       to allow attributes from other namespaces to be
       added to user schemas.

*/
case class XOpenAttrs(attributes: Map[String, scalaxb.DataRecord[Any]]) extends XOpenAttrsable

/**
       This type is extended by all types which allow annotation
       other than <schema> itself

*/
trait XAnnotatedable extends XOpenAttrsable {
  val annotation: Option[xmlschema.XAnnotation]
  val id: Option[String]
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

/**
       This type is extended by all types which allow annotation
       other than <schema> itself

*/
case class XAnnotated(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotatedable

trait XFormChoice

object XFormChoice {
  def fromString(value: String, scope: scala.xml.NamespaceBinding): XFormChoice = value match {
    case "qualified" => XQualified
    case "unqualified" => XUnqualified

  }
}

case object XQualified extends XFormChoice { override def toString = "qualified" }
case object XUnqualified extends XFormChoice { override def toString = "unqualified" }

trait XReducedDerivationControl

object XReducedDerivationControl {
  def fromString(value: String, scope: scala.xml.NamespaceBinding): XReducedDerivationControl = value match {
    case "extension" => XExtensionValue2
    case "restriction" => XRestrictionValue3

  }
}

case object XExtensionValue2 extends XReducedDerivationControl { override def toString = "extension" }
case object XRestrictionValue3 extends XReducedDerivationControl { override def toString = "restriction" }

trait XTypeDerivationControl

object XTypeDerivationControl {
  def fromString(value: String, scope: scala.xml.NamespaceBinding): XTypeDerivationControl = value match {
    case "extension" => XExtensionValue
    case "restriction" => XRestrictionValue2
    case "list" => XListValue2
    case "union" => XUnionValue2

  }
}

case object XExtensionValue extends XTypeDerivationControl { override def toString = "extension" }
case object XRestrictionValue2 extends XTypeDerivationControl { override def toString = "restriction" }
case object XListValue2 extends XTypeDerivationControl { override def toString = "list" }
case object XUnionValue2 extends XTypeDerivationControl { override def toString = "union" }

case class XSchema(xschemaoption: Seq[scalaxb.DataRecord[xmlschema.XSchemaOption]] = Nil,
  xschemasequence1: Seq[xmlschema.XSchemaSequence1] = Nil,
  targetNamespace: Option[java.net.URI] = None,
  version: Option[String] = None,
  finalDefault: String,
  blockDefault: String,
  attributeFormDefault: xmlschema.XFormChoice,
  elementFormDefault: xmlschema.XFormChoice,
  id: Option[String] = None,
  xmllang: Option[String] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XOpenAttrsable

trait XSchemaOption
case class XSchemaSequence1(xSchemaTopOption1: scalaxb.DataRecord[Any],
  annotation: Seq[xmlschema.XAnnotation] = Nil)

trait XUse

object XUse {
  def fromString(value: String, scope: scala.xml.NamespaceBinding): XUse = value match {
    case "prohibited" => XProhibited
    case "optional" => XOptional
    case "required" => XRequired

  }
}

case object XProhibited extends XUse { override def toString = "prohibited" }
case object XOptional extends XUse { override def toString = "optional" }
case object XRequired extends XUse { override def toString = "required" }

trait XAttributable extends XAnnotatedable with XAttrDeclsOption1 {
  val annotation: Option[xmlschema.XAnnotation]
  val simpleType: Option[xmlschema.XLocalSimpleType]
  val id: Option[String]
  val name: Option[String]
  val ref: Option[javax.xml.namespace.QName]
  val typeValue: Option[javax.xml.namespace.QName]
  val use: xmlschema.XUse
  val default: Option[String]
  val fixed: Option[String]
  val form: Option[xmlschema.XFormChoice]
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XAttribute(annotation: Option[xmlschema.XAnnotation] = None,
  simpleType: Option[xmlschema.XLocalSimpleType] = None,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  typeValue: Option[javax.xml.namespace.QName] = None,
  use: xmlschema.XUse,
  default: Option[String] = None,
  fixed: Option[String] = None,
  form: Option[xmlschema.XFormChoice] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAttributable

case class XTopLevelAttribute(annotation: Option[xmlschema.XAnnotation] = None,
  simpleType: Option[xmlschema.XLocalSimpleType] = None,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  typeValue: Option[javax.xml.namespace.QName] = None,
  use: xmlschema.XUse,
  default: Option[String] = None,
  fixed: Option[String] = None,
  form: Option[xmlschema.XFormChoice] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAttributable with XSchemaTopOption

trait XComplexType extends XAnnotatedable {
  val annotation: Option[xmlschema.XAnnotation]
  val xComplexTypeModelOption3: scalaxb.DataRecord[xmlschema.XComplexTypeModelOption]
  val id: Option[String]
  val name: Option[String]
  val mixed: Boolean
  val abstractValue: Boolean
  val finalValue: Option[String]
  val block: Option[String]
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XTopLevelComplexType(annotation: Option[xmlschema.XAnnotation] = None,
  xComplexTypeModelOption3: scalaxb.DataRecord[xmlschema.XComplexTypeModelOption],
  id: Option[String] = None,
  name: Option[String] = None,
  mixed: Boolean,
  abstractValue: Boolean,
  finalValue: Option[String] = None,
  block: Option[String] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XComplexType with XRedefinableOption

case class XLocalComplexType(annotation: Option[xmlschema.XAnnotation] = None,
  xComplexTypeModelOption3: scalaxb.DataRecord[xmlschema.XComplexTypeModelOption],
  id: Option[String] = None,
  name: Option[String] = None,
  mixed: Boolean,
  abstractValue: Boolean,
  finalValue: Option[String] = None,
  block: Option[String] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XComplexType with XElementOption with XTopLevelElementOption with XLocalElementableOption with XNarrowMaxMinOption

trait XRestrictionTypable extends XAnnotatedable {
  val annotation: Option[xmlschema.XAnnotation]
  val xrestrictiontypableoption: Option[scalaxb.DataRecord[Any]]
  val xAttrDeclsSequence4: xmlschema.XAttrDeclsSequence
  val id: Option[String]
  val base: javax.xml.namespace.QName
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XRestrictionType(annotation: Option[xmlschema.XAnnotation] = None,
  xrestrictiontypableoption: Option[scalaxb.DataRecord[Any]] = None,
  xAttrDeclsSequence4: xmlschema.XAttrDeclsSequence,
  id: Option[String] = None,
  base: javax.xml.namespace.QName,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XRestrictionTypable

trait XRestrictionTypableOption

case class XComplexRestrictionType(annotation: Option[xmlschema.XAnnotation] = None,
  xrestrictiontypableoption: Option[scalaxb.DataRecord[Any]] = None,
  xAttrDeclsSequence4: xmlschema.XAttrDeclsSequence,
  id: Option[String] = None,
  base: javax.xml.namespace.QName,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XRestrictionTypable with XComplexContentOption

trait XComplexRestrictionTypeOption

trait XExtensionTypable extends XAnnotatedable with XComplexContentOption {
  val annotation: Option[xmlschema.XAnnotation]
  val xTypeDefParticleOption3: Option[scalaxb.DataRecord[xmlschema.XTypeDefParticleOption]]
  val xAttrDeclsSequence4: xmlschema.XAttrDeclsSequence
  val id: Option[String]
  val base: javax.xml.namespace.QName
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XExtensionType(annotation: Option[xmlschema.XAnnotation] = None,
  xTypeDefParticleOption3: Option[scalaxb.DataRecord[xmlschema.XTypeDefParticleOption]] = None,
  xAttrDeclsSequence4: xmlschema.XAttrDeclsSequence,
  id: Option[String] = None,
  base: javax.xml.namespace.QName,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XExtensionTypable

case class XComplexContent(annotation: Option[xmlschema.XAnnotation] = None,
  xcomplexcontentoption: scalaxb.DataRecord[xmlschema.XComplexContentOption],
  id: Option[String] = None,
  mixed: Option[Boolean] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotatedable with XComplexTypeModelOption

trait XComplexContentOption

case class XSimpleRestrictionType(annotation: Option[xmlschema.XAnnotation] = None,
  xrestrictiontypableoption: Option[scalaxb.DataRecord[Any]] = None,
  xAttrDeclsSequence4: xmlschema.XAttrDeclsSequence,
  id: Option[String] = None,
  base: javax.xml.namespace.QName,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XRestrictionTypable with XSimpleContentOption

trait XSimpleRestrictionTypeOption

case class XSimpleExtensionType(annotation: Option[xmlschema.XAnnotation] = None,
  xTypeDefParticleOption3: Option[scalaxb.DataRecord[xmlschema.XTypeDefParticleOption]] = None,
  xAttrDeclsSequence4: xmlschema.XAttrDeclsSequence,
  id: Option[String] = None,
  base: javax.xml.namespace.QName,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XExtensionTypable with XSimpleContentOption

case class XSimpleContent(annotation: Option[xmlschema.XAnnotation] = None,
  xsimplecontentoption: scalaxb.DataRecord[xmlschema.XSimpleContentOption],
  id: Option[String] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotatedable with XComplexTypeModelOption

trait XSimpleContentOption

/**
   The element element can be used either
   at the top level to define an element-type binding globally,
   or within a content model to either reference a globally-defined
   element or type or declare an element-type binding locally.
   The ref form is not allowed at the top level.
*/
trait XElement extends XAnnotatedable {
  val annotation: Option[xmlschema.XAnnotation]
  val xelementoption: Option[scalaxb.DataRecord[xmlschema.XElementOption]]
  val xIdentityConstraintOption4: Seq[scalaxb.DataRecord[xmlschema.XIdentityConstraintOption]]
  val id: Option[String]
  val name: Option[String]
  val ref: Option[javax.xml.namespace.QName]
  val typeValue: Option[javax.xml.namespace.QName]
  val substitutionGroup: Option[javax.xml.namespace.QName]
  val minOccurs: BigInt
  val maxOccurs: String
  val default: Option[String]
  val fixed: Option[String]
  val nillable: Boolean
  val abstractValue: Boolean
  val finalValue: Option[String]
  val block: Option[String]
  val form: Option[xmlschema.XFormChoice]
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

trait XElementOption

case class XTopLevelElement(annotation: Option[xmlschema.XAnnotation] = None,
  xelementoption: Option[scalaxb.DataRecord[xmlschema.XElementOption]] = None,
  xIdentityConstraintOption4: Seq[scalaxb.DataRecord[xmlschema.XIdentityConstraintOption]] = Nil,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  typeValue: Option[javax.xml.namespace.QName] = None,
  substitutionGroup: Option[javax.xml.namespace.QName] = None,
  minOccurs: BigInt,
  maxOccurs: String,
  default: Option[String] = None,
  fixed: Option[String] = None,
  nillable: Boolean,
  abstractValue: Boolean,
  finalValue: Option[String] = None,
  block: Option[String] = None,
  form: Option[xmlschema.XFormChoice] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XElement with XSchemaTopOption

trait XTopLevelElementOption

trait XLocalElementable extends XElement with XNestedParticleOption with XParticleOption {
  val annotation: Option[xmlschema.XAnnotation]
  val xelementoption: Option[scalaxb.DataRecord[xmlschema.XElementOption]]
  val xIdentityConstraintOption4: Seq[scalaxb.DataRecord[xmlschema.XIdentityConstraintOption]]
  val id: Option[String]
  val name: Option[String]
  val ref: Option[javax.xml.namespace.QName]
  val typeValue: Option[javax.xml.namespace.QName]
  val substitutionGroup: Option[javax.xml.namespace.QName]
  val minOccurs: BigInt
  val maxOccurs: String
  val default: Option[String]
  val fixed: Option[String]
  val nillable: Boolean
  val abstractValue: Boolean
  val finalValue: Option[String]
  val block: Option[String]
  val form: Option[xmlschema.XFormChoice]
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XLocalElement(annotation: Option[xmlschema.XAnnotation] = None,
  xelementoption: Option[scalaxb.DataRecord[xmlschema.XElementOption]] = None,
  xIdentityConstraintOption4: Seq[scalaxb.DataRecord[xmlschema.XIdentityConstraintOption]] = Nil,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  typeValue: Option[javax.xml.namespace.QName] = None,
  substitutionGroup: Option[javax.xml.namespace.QName] = None,
  minOccurs: BigInt,
  maxOccurs: String,
  default: Option[String] = None,
  fixed: Option[String] = None,
  nillable: Boolean,
  abstractValue: Boolean,
  finalValue: Option[String] = None,
  block: Option[String] = None,
  form: Option[xmlschema.XFormChoice] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XLocalElementable

trait XLocalElementableOption

/**
   group type for explicit groups, named top-level groups and
   group references
*/
trait XGroup extends XAnnotatedable {
  val annotation: Option[xmlschema.XAnnotation]
  val xParticleOption3: Seq[scalaxb.DataRecord[xmlschema.XParticleOption]]
  val id: Option[String]
  val name: Option[String]
  val ref: Option[javax.xml.namespace.QName]
  val minOccurs: BigInt
  val maxOccurs: String
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

trait XRealGroupable extends XGroup {
  val annotation: Option[xmlschema.XAnnotation]
  val xParticleOption3: Seq[scalaxb.DataRecord[xmlschema.XParticleOption]]
  val id: Option[String]
  val name: Option[String]
  val ref: Option[javax.xml.namespace.QName]
  val minOccurs: BigInt
  val maxOccurs: String
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XRealGroup(annotation: Option[xmlschema.XAnnotation] = None,
  xParticleOption3: Seq[scalaxb.DataRecord[xmlschema.XParticleOption]] = Nil,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  minOccurs: BigInt,
  maxOccurs: String,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XRealGroupable

trait XRealGroupableOption

case class XAll(annotation: Option[xmlschema.XAnnotation] = None,
  xParticleOption3: Seq[scalaxb.DataRecord[xmlschema.XParticleOption]] = Nil,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  minOccurs: BigInt,
  maxOccurs: String,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAllable with XNamedGroupOption

case class XNamedGroup(annotation: Option[xmlschema.XAnnotation] = None,
  xParticleOption3: Seq[scalaxb.DataRecord[xmlschema.XParticleOption]] = Nil,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  minOccurs: BigInt,
  maxOccurs: String,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XRealGroupable with XRedefinableOption

trait XNamedGroupOption

case class XGroupRef(annotation: Option[xmlschema.XAnnotation] = None,
  xParticleOption3: Seq[scalaxb.DataRecord[xmlschema.XParticleOption]] = Nil,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  minOccurs: BigInt,
  maxOccurs: String,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XRealGroupable with XTypeDefParticleOption with XNestedParticleOption with XParticleOption

/**
   group type for the three kinds of group
*/
trait XExplicitGroupable extends XGroup with XTypeDefParticleOption with XNestedParticleOption with XParticleOption with XRealGroupableOption {
  val annotation: Option[xmlschema.XAnnotation]
  val xParticleOption3: Seq[scalaxb.DataRecord[xmlschema.XParticleOption]]
  val id: Option[String]
  val name: Option[String]
  val ref: Option[javax.xml.namespace.QName]
  val minOccurs: BigInt
  val maxOccurs: String
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

/**
   group type for the three kinds of group
*/
case class XExplicitGroup(annotation: Option[xmlschema.XAnnotation] = None,
  xParticleOption3: Seq[scalaxb.DataRecord[xmlschema.XParticleOption]] = Nil,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  minOccurs: BigInt,
  maxOccurs: String,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XExplicitGroupable

case class XSimpleExplicitGroup(annotation: Option[xmlschema.XAnnotation] = None,
  xParticleOption3: Seq[scalaxb.DataRecord[xmlschema.XParticleOption]] = Nil,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  minOccurs: BigInt,
  maxOccurs: String,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XExplicitGroupable with XNamedGroupOption

trait XMinOccurs

object XMinOccurs {
  def fromString(value: String, scope: scala.xml.NamespaceBinding): XMinOccurs = value match {
    case "0" => X0
    case "1" => X1

  }
}

case object X0 extends XMinOccurs { override def toString = "0" }
case object X1 extends XMinOccurs { override def toString = "1" }

trait XMaxOccurs

object XMaxOccurs {
  def fromString(value: String, scope: scala.xml.NamespaceBinding): XMaxOccurs = value match {
    case "0" => X0Value
    case "1" => X1Value

  }
}

case object X0Value extends XMaxOccurs { override def toString = "0" }
case object X1Value extends XMaxOccurs { override def toString = "1" }

/** restricted max/min
*/
case class XNarrowMaxMin(annotation: Option[xmlschema.XAnnotation] = None,
  xelementoption: Option[scalaxb.DataRecord[xmlschema.XElementOption]] = None,
  xIdentityConstraintOption4: Seq[scalaxb.DataRecord[xmlschema.XIdentityConstraintOption]] = Nil,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  typeValue: Option[javax.xml.namespace.QName] = None,
  substitutionGroup: Option[javax.xml.namespace.QName] = None,
  minOccurs: BigInt,
  maxOccurs: String,
  default: Option[String] = None,
  fixed: Option[String] = None,
  nillable: Boolean,
  abstractValue: Boolean,
  finalValue: Option[String] = None,
  block: Option[String] = None,
  form: Option[xmlschema.XFormChoice] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XLocalElementable with XAllModelOption1

trait XNarrowMaxMinOption
trait XMinOccursType

object XMinOccursType {
  def fromString(value: String, scope: scala.xml.NamespaceBinding): XMinOccursType = value match {
    case "0" => X0Value2
    case "1" => X1Value2

  }
}

case object X0Value2 extends XMinOccursType { override def toString = "0" }
case object X1Value2 extends XMinOccursType { override def toString = "1" }

trait XMaxOccursType

object XMaxOccursType {
  def fromString(value: String, scope: scala.xml.NamespaceBinding): XMaxOccursType = value match {
    case "1" => X1Value3

  }
}

case object X1Value3 extends XMaxOccursType { override def toString = "1" }

/**
   Only elements allowed inside
*/
trait XAllable extends XExplicitGroupable with XTypeDefParticleOption with XParticleOption with XRealGroupableOption {
  val annotation: Option[xmlschema.XAnnotation]
  val xParticleOption3: Seq[scalaxb.DataRecord[xmlschema.XParticleOption]]
  val id: Option[String]
  val name: Option[String]
  val ref: Option[javax.xml.namespace.QName]
  val minOccurs: BigInt
  val maxOccurs: String
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

/**
   Only elements allowed inside
*/
case class XAllType(annotation: Option[xmlschema.XAnnotation] = None,
  xParticleOption3: Seq[scalaxb.DataRecord[xmlschema.XParticleOption]] = Nil,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  minOccurs: BigInt,
  maxOccurs: String,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAllable

trait XProcessContents

object XProcessContents {
  def fromString(value: String, scope: scala.xml.NamespaceBinding): XProcessContents = value match {
    case "skip" => XSkip
    case "lax" => XLax
    case "strict" => XStrict

  }
}

case object XSkip extends XProcessContents { override def toString = "skip" }
case object XLax extends XProcessContents { override def toString = "lax" }
case object XStrict extends XProcessContents { override def toString = "strict" }

trait XWildcardable extends XAnnotatedable {
  val annotation: Option[xmlschema.XAnnotation]
  val id: Option[String]
  val namespace: String
  val processContents: xmlschema.XProcessContents
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XWildcard(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  namespace: String,
  processContents: xmlschema.XProcessContents,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XWildcardable

case class XAny(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  namespace: String,
  processContents: xmlschema.XProcessContents,
  minOccurs: BigInt,
  maxOccurs: String,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XWildcardable with XNestedParticleOption with XParticleOption

trait XAttributeGroup extends XAnnotatedable {
  val annotation: Option[xmlschema.XAnnotation]
  val xAttrDeclsSequence3: xmlschema.XAttrDeclsSequence
  val id: Option[String]
  val name: Option[String]
  val ref: Option[javax.xml.namespace.QName]
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XNamedAttributeGroup(annotation: Option[xmlschema.XAnnotation] = None,
  xAttrDeclsSequence3: xmlschema.XAttrDeclsSequence,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAttributeGroup with XRedefinableOption

case class XAttributeGroupRef(annotation: Option[xmlschema.XAnnotation] = None,
  xAttrDeclsSequence3: xmlschema.XAttrDeclsSequence,
  id: Option[String] = None,
  name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAttributeGroup with XAttrDeclsOption1

case class XInclude(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  schemaLocation: java.net.URI,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotatedable with XSchemaOption

case class XRedefine(xredefineoption: Seq[scalaxb.DataRecord[Any]] = Nil,
  schemaLocation: java.net.URI,
  id: Option[String] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XOpenAttrsable with XSchemaOption

trait XRedefineOption

case class XImport(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  namespace: Option[java.net.URI] = None,
  schemaLocation: Option[java.net.URI] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotatedable with XSchemaOption

case class XSelector(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  xpath: String,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotatedable

case class XField(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  xpath: String,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotatedable

trait XKeybasable extends XAnnotatedable with XIdentityConstraintOption {
  val annotation: Option[xmlschema.XAnnotation]
  val selector: xmlschema.XSelector
  val field: Seq[xmlschema.XField]
  val id: Option[String]
  val name: String
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XKeybase(annotation: Option[xmlschema.XAnnotation] = None,
  selector: xmlschema.XSelector,
  field: Seq[xmlschema.XField] = Nil,
  id: Option[String] = None,
  name: String,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XKeybasable

case class XKeyref(annotation: Option[xmlschema.XAnnotation] = None,
  selector: xmlschema.XSelector,
  field: Seq[xmlschema.XField] = Nil,
  id: Option[String] = None,
  name: String,
  refer: javax.xml.namespace.QName,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XKeybasable with XIdentityConstraintOption

case class XNotation(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  name: String,
  public: Option[String] = None,
  system: Option[java.net.URI] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotatedable with XSchemaTopOption

case class XAppinfo(mixed: Seq[scalaxb.DataRecord[Any]] = Nil,
  source: Option[java.net.URI] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotationOption

case class XDocumentation(mixed: Seq[scalaxb.DataRecord[Any]] = Nil,
  source: Option[java.net.URI] = None,
  xmllang: Option[String] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotationOption

case class XAnnotation(xannotationoption: Seq[scalaxb.DataRecord[xmlschema.XAnnotationOption]] = Nil,
  id: Option[String] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XOpenAttrsable with XSchemaOption with XRedefineOption

trait XAnnotationOption

/**
   Not the real urType, but as close an approximation as we can
   get in the XML representation
*/
case class XAnyType(mixed: Seq[scalaxb.DataRecord[Any]] = Nil,
  attributes: Map[String, scalaxb.DataRecord[Any]])

trait XDerivationControl

object XDerivationControl {
  def fromString(value: String, scope: scala.xml.NamespaceBinding): XDerivationControl = value match {
    case "substitution" => XSubstitution
    case "extension" => XExtension
    case "restriction" => XRestrictionValue
    case "list" => XListValue
    case "union" => XUnionValue

  }
}

case object XSubstitution extends XDerivationControl { override def toString = "substitution" }
case object XExtension extends XDerivationControl { override def toString = "extension" }
case object XRestrictionValue extends XDerivationControl { override def toString = "restriction" }
case object XListValue extends XDerivationControl { override def toString = "list" }
case object XUnionValue extends XDerivationControl { override def toString = "union" }

trait XSimpleType extends XAnnotatedable {
  val annotation: Option[xmlschema.XAnnotation]
  val xSimpleDerivationOption3: scalaxb.DataRecord[xmlschema.XSimpleDerivationOption]
  val id: Option[String]
  val finalValue: Option[String]
  val name: Option[String]
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XTopLevelSimpleType(annotation: Option[xmlschema.XAnnotation] = None,
  xSimpleDerivationOption3: scalaxb.DataRecord[xmlschema.XSimpleDerivationOption],
  id: Option[String] = None,
  finalValue: Option[String] = None,
  name: Option[String] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XSimpleType with XRedefinableOption

case class XLocalSimpleType(annotation: Option[xmlschema.XAnnotation] = None,
  xSimpleDerivationOption3: scalaxb.DataRecord[xmlschema.XSimpleDerivationOption],
  id: Option[String] = None,
  finalValue: Option[String] = None,
  name: Option[String] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XSimpleType with XElementOption with XTopLevelElementOption with XLocalElementableOption with XNarrowMaxMinOption

/**
          base attribute and simpleType child are mutually
          exclusive, but one or other is required

*/
case class XRestriction(annotation: Option[xmlschema.XAnnotation] = None,
  xSimpleRestrictionModelSequence3: xmlschema.XSimpleRestrictionModelSequence,
  id: Option[String] = None,
  base: Option[javax.xml.namespace.QName] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotatedable with XSimpleDerivationOption

/**
          itemType attribute and simpleType child are mutually
          exclusive, but one or other is required

*/
case class XList(annotation: Option[xmlschema.XAnnotation] = None,
  simpleType: Option[xmlschema.XLocalSimpleType] = None,
  id: Option[String] = None,
  itemType: Option[javax.xml.namespace.QName] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotatedable with XSimpleDerivationOption

/**
          memberTypes attribute must be non-empty or there must be
          at least one simpleType child

*/
case class XUnion(annotation: Option[xmlschema.XAnnotation] = None,
  simpleType: Seq[xmlschema.XLocalSimpleType] = Nil,
  id: Option[String] = None,
  memberTypes: Option[Seq[javax.xml.namespace.QName]] = None,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XAnnotatedable with XSimpleDerivationOption

trait XFacetable extends XAnnotatedable with XFacetsOption {
  val annotation: Option[xmlschema.XAnnotation]
  val id: Option[String]
  val value: String
  val fixed: Boolean
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XFacet(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  value: String,
  fixed: Boolean,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XFacetable

trait XNoFixedFacetable extends XFacetable with XFacetsOption {
  val annotation: Option[xmlschema.XAnnotation]
  val id: Option[String]
  val value: String
  val fixed: Boolean
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XNoFixedFacet(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  value: String,
  fixed: Boolean,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XNoFixedFacetable

trait XNumFacetable extends XFacetable with XFacetsOption {
  val annotation: Option[xmlschema.XAnnotation]
  val id: Option[String]
  val value: String
  val fixed: Boolean
  val attributes: Map[String, scalaxb.DataRecord[Any]]
}

case class XNumFacet(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  value: String,
  fixed: Boolean,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XNumFacetable

case class XTotalDigits(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  value: String,
  fixed: Boolean,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XNumFacetable with XFacetsOption

trait XValue

object XValue {
  def fromString(value: String, scope: scala.xml.NamespaceBinding): XValue = value match {
    case "preserve" => XPreserve
    case "replace" => XReplace
    case "collapse" => XCollapse

  }
}

case object XPreserve extends XValue { override def toString = "preserve" }
case object XReplace extends XValue { override def toString = "replace" }
case object XCollapse extends XValue { override def toString = "collapse" }

case class XWhiteSpace(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  value: String,
  fixed: Boolean,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XFacetable with XFacetsOption

case class XPattern(annotation: Option[xmlschema.XAnnotation] = None,
  id: Option[String] = None,
  value: String,
  fixed: Boolean,
  attributes: Map[String, scalaxb.DataRecord[Any]]) extends XNoFixedFacetable with XFacetsOption

case class XSimpleRestrictionModelSequence(simpleType: Option[xmlschema.XLocalSimpleType] = None,
  xFacetsOption2: Seq[scalaxb.DataRecord[xmlschema.XFacetsOption]] = Nil)

trait XFacetsOption
trait XSimpleDerivationOption
trait XIdentityConstraintOption
case class XAllModelSequence(annotation: Option[xmlschema.XAnnotation] = None,
  xallmodeloption1: Seq[scalaxb.DataRecord[xmlschema.XNarrowMaxMin]] = Nil)

trait XAllModelOption1
trait XComplexTypeModelOption
case class XComplexTypeModelSequence1(xTypeDefParticleOption1: Option[scalaxb.DataRecord[xmlschema.XTypeDefParticleOption]] = None,
  xAttrDeclsSequence2: xmlschema.XAttrDeclsSequence) extends XComplexTypeModelOption

case class XAttrDeclsSequence(xattrdeclsoption1: Seq[scalaxb.DataRecord[xmlschema.XAttrDeclsOption1]] = Nil,
  anyAttribute: Option[xmlschema.XWildcardable] = None)

trait XAttrDeclsOption1
trait XParticleOption
trait XNestedParticleOption
trait XTypeDefParticleOption
trait XRedefinableOption
trait XSchemaTopOption

/**
   for element, group and attributeGroup,
   which both define and reference
*/
case class XDefRef(name: Option[String] = None,
  ref: Option[javax.xml.namespace.QName] = None)

/**
   for all particles
*/
case class XOccurs(minOccurs: BigInt,
  maxOccurs: String)


text:
/*
 * AbstractModelPiece.h
 *
 *  Created on: 22 Dec 2013
 *      Author: bert
 */

#ifndef ABSTRACTMODELPIECE_H_
#define ABSTRACTMODELPIECE_H_

#include <GL/glew.h> // include GLEW and new version of GL on Windows
#include <GLFW/glfw3.h> // GLFW helper library

#define GLM_MESSAGES
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>	// TODO Auto-generated destructor stub

#include "../Tetris/Piece.h"
#include "../OpenGL/OpenGLProgram.h"
#include "../Logger.h"

namespace Tetris3D {

struct VertexStructure {
	float coord3d[3];
	float normal[3];
	float colour[3];
};

class AbstractModelPiece {
public:
	AbstractModelPiece(OpenGLProgram* program);
	virtual ~AbstractModelPiece();

	virtual void Render(bool isGenerateBuffers = true);

	void SetIsWireFrame(bool isWireFrame) {
		this->isWireFrame = isWireFrame;
	}

protected:
	OpenGLProgram* program;
	log4cpp::Category* logger;
	bool isWireFrame;
	float sideLength;
	GLint attribute_coord3d, attribute_colour, attribute_normal;
	GLint uniform_model;
	float xOffset, yOffset;

	virtual void GenerateBuffers()=0;
	virtual void InitBuffers();
	virtual void DrawBuffers()=0;
	void PushIntoVector(std::vector<float> &cs, float* coord, float *normal, float* colour);
	void GenerateArrayBuffer(GLuint& vbo, std::vector<float>& vertices);
	void GenerateElementBuffer(GLuint& ibo, std::vector<unsigned short>& elements);

};

} /* namespace Tetris3D */

#endif /* ABSTRACTMODELPIECE_H_ */

redpajama_set_name: RedPajamaGithub


text:
// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Collections.ObjectModel;
using Microsoft.TeamFoundation.Migration.Toolkit;
using Microsoft.TeamFoundation.Migration.Toolkit.Services;

namespace Microsoft.TeamFoundation.Migration.SubversionAdapter
{
    internal class SubversionVCAnalysisProvider : IAnalysisProvider
    {
        #region Private Members

        Dictionary<Guid, ChangeActionHandler> m_supportedChangeActions;
        Collection<ContentType> m_supportedContentTypes;

        ICollection<Guid> m_supportedChangeActionsOther;
        Collection<ContentType> m_supportedContentTypesOther;

        IServiceContainer m_analysisServiceContainer;

        ChangeActionRegistrationService m_changeActionRegistrationService;
        ChangeGroupService m_changeGroupService;
        ConfigurationService m_configurationService;

        ConflictManager m_conflictManagementService;

        HighWaterMark<long> m_hwmDelta;

        #endregion

        #region IAnalysisProvider implementation

        /// <summary>
        /// List of change actions supported by the analysis provider.
        /// </summary>
        public Dictionary<Guid, ChangeActionHandler> SupportedChangeActions
        {
            get { return m_supportedChangeActions; }
        }

        /// <summary>
        /// List of change actions supported by the other side.
        /// </summary>
        public ICollection<Guid> SupportedChangeActionsOther
        {
            set { m_supportedChangeActionsOther = value; }
        }

        /// <summary>
        /// List of content types supported by this provider
        /// </summary>
        public Collection<ContentType> SupportedContentTypes
        {
            get { return m_supportedContentTypes; }
        }

        /// <summary>
        /// List of content types supported by the other side
        /// </summary>
        public Collection<ContentType> SupportedContentTypesOther
        {
            set { m_supportedContentTypesOther = value; }
        }

        /// <summary>
        /// Initialize method of the analysis provider - acquire references to the services provided by the platform and register the HighWaterMark/>
        /// </summary>
        public void InitializeServices(IServiceContainer analysisServiceContainer)
        {
            m_analysisServiceContainer = analysisServiceContainer;

            m_configurationService = (ConfigurationService)m_analysisServiceContainer.GetService(typeof(ConfigurationService));

            m_hwmDelta = new HighWaterMark<long>(Constants.HwmDelta);
            m_configurationService.RegisterHighWaterMarkWithSession(m_hwmDelta);

            m_changeGroupService = (ChangeGroupService)m_analysisServiceContainer.GetService(typeof(ChangeGroupService));
            m_changeGroupService.RegisterDefaultSourceSerializer(new SubversionMigrationItemSerialzier());
        }

        /// <summary>
        /// Initialize method of the analysis provider. Establishes the connection to the subversion server
        /// </summary>
        public void InitializeClient()
        {
            initializeSubversionClient();
            initializeSnapshotTable();
        }

        /// <summary>
        /// Register adapter's supported change actions.
        /// </summary>
        public void RegisterSupportedChangeActions(ChangeActionRegistrationService changeActionRegistrationService)
        {
            if (changeActionRegistrationService == null)
            {
                throw new ArgumentNullException("changeActionRegistrationService");
            }

            initiazlieSupportedChangeActions();

            m_changeActionRegistrationService = changeActionRegistrationService;

            foreach (KeyValuePair<Guid, ChangeActionHandler> supportedChangeAction in m_supportedChangeActions)
            {
                // note: for now, VC adapter uses a single change action handler for all content types
                foreach (ContentType contentType in SupportedContentTypes)
                {
                    m_changeActionRegistrationService.RegisterChangeAction(
                        supportedChangeAction.Key,
                        contentType.ReferenceName,
                        supportedChangeAction.Value);
                }
            }
        }

        /// <summary>
        /// Register adapter's supported content types.
        /// </summary>
        public void RegisterSupportedContentTypes(ContentTypeRegistrationService contentTypeRegistrationService)
        {
            initializeSupportedContentTypes();
        }

        /// <summary>
        /// Register adapter's conflict handlers.
        /// </summary>
        public void RegisterConflictTypes(ConflictManager conflictManager)
        {
            if (conflictManager == null)
            {
                throw new ArgumentNullException("conflictManager");
            }

            m_conflictManagementService = conflictManager;

            //TODO Register conflicts that may occur here
            //m_conflictManagementService.RegisterConflictType(new VCInvalidPathConflictType());
            //...
        }

        /// <summary>
        /// Generate the context info table
        /// </summary>
        public void GenerateContextInfoTable()
        {
        }

        /// <summary>
        /// Generate the delta table
        /// </summary>
        public void GenerateDeltaTable()
        {
            //TODO implement actual analysis logic here
        }

        /// <summary>
        /// Detects adapter-specific conflicts.
        /// </summary>
        /// <param name="changeGroup"></param>
        public void DetectConflicts(ChangeGroup changeGroup)
        {
        }

        /// <summary>
        /// Gets a unique string to identify the endpoint system, from which the migration data is retrieved from and written to
        /// </summary>
        /// <param name="migrationSourceConfig">The configuration data for the current session</param>
        /// <returns>Returns a unique id for the configured subversion repository</returns>
        public string GetNativeId(BusinessModel.MigrationSource migrationSourceConfig)
        {
            throw new NotImplementedException();
        }

        #endregion

        #region IServiceProvider implementation

        /// <summary>
        /// Gets the service object of the specified type.
        /// </summary>
        /// <param name="serviceType"></param>
        /// <returns></returns>
        public Object GetService(Type serviceType)
        {
            return (IServiceProvider)this;
        }

        #endregion

        #region IDisposable

        public void Dispose()
        {
        }

        #endregion

        #region Private Helpers

        /// <summary>
        /// Establishes a connection to the configured subversion server
        /// </summary>
        private void initializeSubversionClient()
        {
        }

        /// <summary>
        /// 1. Read snapshot information from configuration.
        /// 2. Populate the 2 in-memory snapshot table
        /// </summary>
        private void initializeSnapshotTable()
        {
        }

        /// <summary>
        /// Initializes the collection that contains all supported <see cref="ContentType"/>s
        /// </summary>
        private void initializeSupportedContentTypes()
        {
            m_supportedContentTypes = new Collection<ContentType>();
            m_supportedContentTypes.Add(WellKnownContentType.VersionControlChangeGroup);
            m_supportedContentTypes.Add(WellKnownContentType.VersionControlledFile);
            m_supportedContentTypes.Add(WellKnownContentType.VersionControlledFolder);
            m_supportedContentTypes.Add(WellKnownContentType.VersionControlledArtifact);
        }

        /// <summary>
        /// Initialize SupportedChangeActions list.
        /// </summary>
        private void initiazlieSupportedChangeActions()
        {
            var subversionChangeActionHandlers = new SubversionChangeActionHandlers(this);
            m_supportedChangeActions = new Dictionary<Guid, ChangeActionHandler>();

            //TODO Add the supported change actions
            //m_supportedChangeActions.Add(WellKnownChangeActionId.Add, subversionChangeActionHandlers.BasicActionHandler);
            //m_supportedChangeActions.Add(WellKnownChangeActionId.Edit, subversionChangeActionHandlers.BasicActionHandler);
            //m_supportedChangeActions.Add(WellKnownChangeActionId.Delete, subversionChangeActionHandlers.BasicActionHandler);
            //....
        }

        #endregion
    }
}


text:
// This is a generated file. Not intended for manual editing.
package ws.epigraph.url.parser.psi.impl;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.util.PsiTreeUtil;
import static ws.epigraph.url.lexer.UrlElementTypes.*;
import com.intellij.extapi.psi.ASTWrapperPsiElement;
import ws.epigraph.url.parser.psi.*;

public class UrlReqAllImpl extends ASTWrapperPsiElement implements UrlReqAll {

  public UrlReqAllImpl(ASTNode node) {
    super(node);
  }

  public void accept(@NotNull UrlVisitor visitor) {
    visitor.visitReqAll(this);
  }

  public void accept(@NotNull PsiElementVisitor visitor) {
    if (visitor instanceof UrlVisitor) accept((UrlVisitor)visitor);
    else super.accept(visitor);
  }

}


text:
gpsc
====

Gatineau Park Cross Country Skiing Android App


text:
	<title>Tom Gleeson's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Tom Gleeson's panel show appearances

Tom Gleeson (born 1974-06-02[ref]) has appeared in 10 episodes between 2014-2015.  Tom Gleeson on Wikipedia.

2014

2015

2015-11-12 / The Chaser's Media Circus

2015-10-29 / The Chaser's Media Circus

2015-09-17 / The Chaser's Media Circus

2014-11-28 / Spicks and Specks

2014-11-14 / Spicks and Specks

2014-11-12 / The Chaser's Media Circus

2014-10-22 / The Chaser's Media Circus

2014-05-28 / Spicks and Specks

2014-03-05 / Spicks and Specks

2014-02-19 / Spicks and Specks


text:
/*!
	\file RuntimeException.h

	\author Andrew Kerr <arkerr@gatech.edu>

	\brief defines an exception to be thrown at runtime during the emulation or execution of a
		kernel

	\date 29 Jan 2009
*/

#ifndef EXECUTIVE_RUNTIMEEXCEPTION_H_INCLUDED
#define EXECUTIVE_RUNTIMEEXCEPTION_H_INCLUDED

#include <string>
#include <exception>
#include <ocelot/ir/interface/PTXInstruction.h>

namespace executive {

	/*!

	*/
	class RuntimeException : public std::exception {
	public:
		RuntimeException( );
		RuntimeException(std::string);
		RuntimeException(std::string, ir::PTXInstruction);
		RuntimeException(std::string, int, ir::PTXInstruction);
		RuntimeException(std::string, int, int, int, ir::PTXInstruction);
		~RuntimeException() throw();

		std::string toString() const;
		const char* what() const throw();

		/*!
			Human-readable message
		*/
		std::string message;

		/*!
			PC of offending instruction
		*/
		int PC;

		/*! \brief offending thread */
		int thread;

		/*! \brief offending cta */
		int cta;

		/*!
			offending PTX instruction
		*/
		ir::PTXInstruction instruction;
	};

}

#endif


text:
using UnityEngine;
using System.Collections;

public class KillBehavior : MonoBehaviour {

    void OnTriggerEnter2D(Collider2D collider)
    {
        if(collider.tag == "Player")
        {
            var playerScript = collider.gameObject.GetComponentInChildren<PlayerController>();
            playerScript.Kill();
        }
    }
}


text:
<?php

namespace Oro\Bundle\DraftBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Oro\Bundle\DraftBundle\Model\ExtendDraftProject;
use Oro\Bundle\EntityBundle\EntityProperty\DatesAwareInterface;
use Oro\Bundle\EntityBundle\EntityProperty\DatesAwareTrait;
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
use Oro\Bundle\UserBundle\Entity\Ownership\UserAwareTrait;

/**
 * Represents a Project of Drafts
 *
 * @ORM\Entity
 * @ORM\Table(name="oro_draft_project")
 * @Config(
 *      defaultValues={
 *          "ownership"={
 *              "owner_type"="USER",
 *              "owner_field_name"="owner",
 *              "owner_column_name"="user_owner_id",
 *              "organization_field_name"="organization",
 *              "organization_column_name"="organization_id"
 *          },
 *          "security"={
 *              "type"="ACL",
 *              "group_name"="",
 *          },
 *      }
 * )
 */
class DraftProject extends ExtendDraftProject implements DatesAwareInterface
{
    use DatesAwareTrait;
    use UserAwareTrait;

    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var string
     *
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
     */
    protected $title;

    /**
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @param string $title
     *
     * @return DraftProject
     */
    public function setTitle(string $title): DraftProject
    {
        $this->title = $title;

        return $this;
    }

    /**
     * @return string|null
     */
    public function getTitle(): ?string
    {
        return $this->title;
    }
}


text:
Working on HubTurbo involves a number of common tasks.

Most are accessed via Gradle, which we will assume to be the lowest common denominator in terms of ways to do things, and which should work out of the box without any additional setup. Plugins providing graphical interfaces to these tasks in IDEs are generally also available and will be listed.

## Running Tests

```sh
./gradlew clean test -i
```

The `-i` flag enables logging. This command will run all tests, [stable and unstable](testing.md#unstable-tests).

To simulate testing in the CI environment, add the environment variable `CI=true`.

```sh
CI=true ./gradlew clean test -i
```

This will run only the stable tests. To run the unstable tests separately,

```sh
./gradlew clean unstableTests
```

To run only a single test i.e. PanelFocusTest of the unstable tests.

```sh
./gradlew clean -DunstableTests.single=PanelFocus unstableTests -i
```

If you've [set up a project for your IDE](settingUp.md), there are also ways to run tests with the configuration specified in the project.

## Code Coverage

```sh
./gradlew clean jacocoRootReport
```

This will run tests, then generate coverage reports in `build/reports`.

If you've already just run tests,

```sh
./gradlew jacocoRootReport
```

should be sufficient. Adding `CI=true` will generate coverage only for stable tests.

[EclEmma](http://eclemma.org/) is a plugin for Eclipse which allows tests be to selectively run, and coverage measured with more granularity than the default Gradle task.

## Style Violations and Linting

```sh
./gradlew clean check
```

This will run all static analysis tools before running tests. Violations will cause the entire build to fail, so they must be resolved. Reports will be placed in `build/reports` if this happens. Configuration for these tools can be found in `config`.

If you're not sure how to resolve a violation and wish to make an exception for it, please highlight it for discussion in your pull request.

More information on tools can be found [here](staticAnalysis.md).

## Building a JAR

```sh
./gradlew clean shadowJar
```

Eclipse and IntelliJ have built-in ways to export JARs.


text:
package org.javarosa.communication.sms.trigger;

import org.javarosa.core.api.IModule;
import org.javarosa.core.services.PropertyManager;

public class SmsTriggerModule implements IModule {

    public void registerModule() {
        PropertyManager._().addRules(new SmsTriggerProperties());
        SmsTriggerDaemon daemon = new SmsTriggerDaemon();
        JavaRosaServiceProvider.instance().registerDaemon(daemon, daemon.getName());
    }
}


text:
package internal

import (
	"testing"

	"go.chromium.org/luci/scheduler/api/scheduler/v1"

	. "github.com/smartystreets/goconvey/convey"
	. "go.chromium.org/luci/common/testing/assertions"
)

func TestToPublicTriggers(t *testing.T) {
	t.Parallel()

	Convey("ToPublicTriggers", t, func(c C) {
		gitiles := &scheduler.GitilesTrigger{}

		input := &Trigger{
			Id:    "id",
			Title: "deadbeef",
			Url:   "https://example.com",
			Payload: &Trigger_Gitiles{
				Gitiles: gitiles,
			},
		}
		expected := &scheduler.Trigger{
			Id:    "id",
			Title: "deadbeef",
			Url:   "https://example.com",
			Payload: &scheduler.Trigger_Gitiles{
				Gitiles: gitiles,
			},
		}
		actual := ToPublicTrigger(input)
		So(actual, ShouldResembleProto, expected)
	})
}


text:
set -o errexit
set -o nounset
set -o pipefail

function cleanup() {
    popd
}
trap cleanup EXIT

# The cluster name is hardcoded in the kops kustomization yaml
CLUSTER_NAME=aws-external-cloud-provider-example.k8s.local
REPO_ROOT="$(cd "$( dirname "${BASH_SOURCE[0]}" )"/.. &> /dev/null && pwd)"
OUTPUT="${OUTPUT:-${REPO_ROOT}}/kops-example"
pushd ${REPO_ROOT}

function validate() {
    if [[ -z "${KOPS_STATE_STORE:-}" ]]; then
        echo "KOPS_STATE_STORE is empty or unset.  You can use an S3 bucket that you own, for example:"
        echo "export KOPS_STATE_STORE=s3://<your-state-store-bucket>"
        exit 1
    else
        echo "Using KOPS_STATE_STORE=${KOPS_STATE_STORE}"
    fi
}

function install_kustomize() {
    if [[ -z "$(command -v kustomize)" ]]; then
        local temp_kustomize="/tmp/kustomize"
        if [[ ! -f "${temp_kustomize}" ]]; then
            echo "Downloading kustomize to ${temp_kustomize}"
            curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"  | bash
            mv kustomize "${temp_kustomize}"
        else
            echo "Using kustomize found at ${temp_kustomize}"
        fi
        KUSTOMIZE="${temp_kustomize}"
    else
        KUSTOMIZE="$(which kustomize)"
        echo "Using ${KUSTOMIZE}"
    fi
}

function install_kops() {
    if [[ -z "$(command -v kops)" ]]; then
        local temp_kops="/tmp/kops"
        if [[ ! -f "${temp_kops}" ]]; then
            echo "Downloading kops to ${temp_kops}"
            local latest_kops_version=$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)
            curl -Lo kops https://github.com/kubernetes/kops/releases/download/${latest_kops_version}/kops-linux-amd64
            chmod +x ./kops
            mv ./kops "${temp_kops}"
        else
            echo "Using kops found at ${temp_kops}"
        fi
        KOPS=${temp_kops}
    else
        KOPS="$(which kops)"
        echo "Using ${KOPS}"
    fi
}

install_kustomize
install_kops
validate

echo "Generating cluster configuration at ${OUTPUT}/cluster.yaml"
mkdir -p ${OUTPUT}
cluster_yaml="${OUTPUT}/cluster.yaml"

${KUSTOMIZE} build ${REPO_ROOT}/examples/kops-new-cluster/overlays/cloud-controller-manager > ${cluster_yaml}
${KOPS} create -f ${cluster_yaml}
${KOPS} update cluster ${CLUSTER_NAME} --yes --admin

echo "In order to clean up the cluster, run the following:"
echo "  ${KOPS} delete cluster ${CLUSTER_NAME} --yes"


text:
import React from 'react';
import './react-minimal-datetime-range.css';
interface CalendarPickerProps {
    show?: boolean;
    locale?: string;
    allowPageClickToClose?: boolean;
    defaultDate?: string;
    style?: React.CSSProperties;
    defaultTimes?: Array<string>;
    enableTimeSelection?: boolean;
    markedDates?: Array<string>;
    supportDateRange?: Array<string>;
    onClose?: () => void;
    onYearPicked?: (res: object) => void;
    onMonthPicked?: (res: object) => void;
    onDatePicked?: (res: object) => void;
    onResetDate?: (res: object) => void;
    onResetDefaultDate?: (res: object) => void;
    handleChooseHourPick?: (res: Array<string>) => void;
    handleChooseMinutePick?: (res: Array<string>) => void;
}
export declare const CalendarPicker: React.FC<CalendarPickerProps>;
interface RangePickerProps {
    show?: boolean;
    disabled?: boolean;
    locale?: string;
    allowPageClickToClose?: boolean;
    showOnlyTime?: boolean;
    defaultDate?: string;
    placeholder?: Array<string>;
    defaultDates?: Array<string>;
    defaultTimes?: Array<string>;
    initialDates?: Array<string>;
    initialTimes?: Array<string>;
    enableTimeSelection?: boolean;
    markedDates?: Array<string>;
    style?: React.CSSProperties;
    onConfirm?: (res: Array<string>) => void;
    onClear?: () => void;
    onClose?: () => void;
}
export declare const RangePicker: React.FC<RangePickerProps>;
export {};


text:
git clone https://github.com/femoio/jdk7-support.git jdk7-support
cd jdk7-support
mvn install -Dmaven.javadoc.skip=true -DskipTests=true -B -V
cd ..

git clone https://github.com/femoio/dynamic-jdk7.git dynamic
cd dynamic
mvn install -Dmaven.javadoc.skip=true -DskipTests=true -B -V
cd ..

pip install --user gunicorn httpbin
gunicorn httpbin:app > /dev/null &


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Tags on Laam Pui's Blog</title>
    <link>https://lampui.github.io/zh/tags/</link>
    <description>Recent content in Tags on Laam Pui's Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>© 2019 Copyright Text</copyright>

	<atom:link href="https://lampui.github.io/zh/tags/index.xml" rel="self" type="application/rss+xml" />

  </channel>
</rss>


text:
5 day forecast

{{ForecastService.forecast.daily.summary}}

            {{$parent.getWeekDay( ForecastService.forecast.daily.data[ $index ] )}}

            {{ForecastService.forecast.daily.data[ $index ].temperatureMax | number : 0 }}°

            {{ForecastService.forecast.daily.data[ $index ].temperatureMin | number : 0 }}°

             {{ForecastService.forecast.daily.data[ $index ].humidity * 100 | number : 0 }}%


text:
<?php

namespace HKAPI\Devices;

use HKAPI\Interfaces\DeviceInterface;

class AVR implements DeviceInterface
{
    /**
     * Get name for device.
     *
     * @return string
     */
    public function getName()
    {
        return 'AVR';
    }

    /**
     * Get template file for device.
     *
     * @return string
     */
    public function getTemplate()
    {
        return 'avr';
    }

    /**
     * Get default zones for device.
     *
     * @return array|null
     */
    public function getDefaultZones()
    {
        return ['Main Zone', 'Zone 2'];
    }

    /**
     * Get HTTP header for device.
     *
     * @return string
     */
    public function getHeader()
    {
        return "POST AVR HTTP/1.1\r\nHost: :10025\r\nUser-Agent: Harman Kardon AVR Remote Controller /2.0";
    }
}


text:
//
// Worker process: handles sending a file in smallish chunks using
// many xhr requests.
//
// Author: Todd A. Fisher <todd.fisher@gmail.com>
//
/**** proto lite : see http://prototypejs.org/ **/
Object.extend = function(destination, source) {
  for (var property in source)
    destination[property] = source[property];
  return destination;
};
Object.extend(Object, {
  isUndefined: function(object) {
    return typeof object == "undefined";
  }
});

Object.extend(Function.prototype, {
  bind: function() {
    if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
    var __method = this, args = $A(arguments), object = args.shift();
    return function() {
      return __method.apply(object, args.concat($A(arguments)));
    }
  }
});
function $A(iterable) {
  if (!iterable) return [];
  if (iterable.toArray) return iterable.toArray();
  var length = iterable.length, results = new Array(length);
  while (length--) results[length] = iterable[length];
  return results;
}
//********* end proto lite ****/

//
// Worker needs to save some meta data about the file in storage so if the browser is closed during an upload
// it doesn't loose track of the file, that was partially or not uploaded to the server. In the event it's partially
// uploaded, it needs to check with the server and resume sending the file, from where the server reports in it's Range header.
//
// Files are sent using the chunkSize defined below.
//
UploadRequet = function(id, file, pool, workerId) {
  this.id   = id; // identifier for this upload
  this.file = file; // the file to upload
  this.pool = pool; // the worker pool this transaction belongs too
  this.workerId = workerId; // the worker id within the worker pool
  this.chunkSize = 1024 * 1024; // send files in 1 MB chunk size
  this.byteOffset = 0; // track the current byte offset in this.file
  this.totalSize = this.file.blob.length; // total bytes to transfer of this.file
}
UploadRequet.prototype = {
  //
  // begin the file upload transaction
  //
  // Client sends initial handshake:
  //
  // POST /upload HTTP/1.1
  // Host: example.com
  // Content-Length: 0
  // Content-Range: bytes */100
  //
  // this is how we get our upload identifier
  // the server is expected to respond with an Etag identifier such as below:
  //
  // HTTP/1.1 308 Resume Incomplete
  // ETag: "vEpr6barcD"
  // Content-Length: 0
  //
  // if the uploader already hasa this.tagId e.g. the ETag for an existing upload
  // and this is called, it's like doing a status check
  // and will trigger uploadPart from the servers reported offsetByte
  //
  begin: function() {
    // send the initial message to initialize the file upload
    this.request = google.gears.factory.create('beta.httprequest');

    this.request.open("POST", "/upload?filename="+this.file.name);

    // when the request completes call fetchedEtag, to continue the upload flow
    this.request.onreadystatechange = this.trackRequest.bind(this, this.fetchedEtag.bind(this));
    this.request.setRequestHeader("Content-Range", "bytes */" + this.totalSize);
    if( this.tagId ) {
      // set the If-Match: "this.tagId"
      this.request.setRequestHeader("If-Match", this.tagId);
    }
    else {
      this.sendProgress(this.file.name, 0.0);
    }

    this.request.send(); // send no body, to get the initial etag
  },
  sendProgress: function( status, offsetByte )
  {
    var progress = offsetByte / this.totalSize;
    this.pool.sendMessage({type:'progress', id: this.id, status:status, progress:progress, filename: this.file.name}, this.workerId);
  },
  sendComplete: function( response )
  {
    this.pool.sendMessage({type:'complete', id: this.id, response:response, filename: this.file.name}, this.workerId);
  },
  sendError: function( status )
  {
    this.pool.sendMessage({type:'error', id: this.id, status:status, filename: this.file.name}, this.workerId);
  },
  //
  // We received the resume response from the server
  //
  // HTTP/1.1 308 Resume Incomplete
  // ETag: "vEpr6barcD"
  // Content-Length: 0
  //
  // Next we can start uploading bytes to the server
  //
  fetchedEtag: function(status, offsetByte)
  {
    if( status == 308 ) {
      this.tagId = this.request.getResponseHeader("etag");
      this.sendPart(status, offsetByte);
    }
    else if( status == 200 ) {
      this.onError("Server reported file uploaded");
    }
    else {
      this.onError("Unexpected Server Response: " + status);
    }
  },
  //
  // send this.chunkSize bytes to the server
  //
  // slices the file blob into a smaller blob starting at the given offsetByte, to this.chunkSize
  // if this.chunkSize + offsetByte is greater then the end of the blob, the max length of the blob
  // is used as the end of the slice.
  //
  // an XHR request is created with the Content-Range header set to the offsetByte-ByteLength/TotalSize
  //
  // offsetByte: is provided by the server.
  // ByteLength: is computed from the offsetByte, chunkSize, and total size
  // TotalSize: is computed from the the file.blob.length
  //
  // on successful upload, e.g. a server response of 200
  //  this.uploadCompleted is called
  //
  sendPart: function(status, offsetByte)
  {
    if( status == 200 ) {
      this.uploadCompleted();
      return;
    }

    // slow it down...
    //for( var i = 0; i < 10000000; ++i ) {
    //}

    // keep the length within the bounds of the file.blob.length
    var length = this.chunkSize;
    // clamp the length to make sure it doesn't exceed the totalSize
    if( (offsetByte + length) > this.totalSize ) {
      length = this.totalSize - offsetByte; // clamp
    }

    // create a new request object
    this.request = google.gears.factory.create('beta.httprequest');
    this.request.open("POST", "/upload");
    this.request.onreadystatechange = this.trackRequest.bind(this, this.sendPart.bind(this));

    // set the If-Match: "this.tagId"
    this.request.setRequestHeader("If-Match", this.tagId);

    // Content-Range: offsetByte + '-' + (offsetByte + (length-1)) + '/' + this.totalSize;
    var range = offsetByte + "-" + (offsetByte + length ) + "/" + this.totalSize;
    this.request.setRequestHeader("Content-Range", range);

    // listen for network activity, this way we can update the UI thread when while chunkSize is transferring
    this.request.onprogress = this.onProgress.bind(this);

    //this.sendStatus("for: " + this.tagId + ", computed offset: " + this.byteOffset + ", server requested offset: " + offsetByte);
    this.sendProgress(this.file.name, offsetByte);

    try { // Any operation involving a Blob may throw an exception.

      // slice the blob
      var part = this.file.blob.slice(offsetByte,length); // use the server offset

      // compute the offset
      this.byteOffset += length;

      // send the part
      this.request.send(part);

    } catch( e ) {
      this.onError(e);
    }
  },
  onProgress: function(pevent)
  {
    this.sendProgress(this.file.name, this.byteOffset + pevent.loaded );
  },
  onError: function(error)
  {
    if( this.request ) {
      try{ this.request.abort(); } catch(e) {} // try to abort
      this.request = null;
    }
    this.sendError(this.file.name + ": " + error );
  },
  uploadCompleted: function()
  {
    var response = this.request.responseText;
    this.request = null;
    this.completed = true;
    this.sendProgress(this.file.name, this.totalSize );
    this.sendComplete(response);
  },
  trackRequest: function(callback)
  {
    //this.sendStatus(" - for: [" + this.tagId + "] readyState: " + this.request.readyState );
    if( this.request.readyState == 4 ) {
      var status = this.request.status;
      var headers = this.request.getAllResponseHeaders();
      //this.sendError(status + " - for: [" + this.tagId + "] headers: " + this.request.getAllResponseHeaders() );
      if( headers.match(/Range:/) ) {
        var range = this.request.getResponseHeader("Range");
        // parse the last range byte e.g. 0-#{number}
        offset = parseInt(range.replace(/[0-9]+-/,''));
        //this.sendStatus("for: [" + this.tagId + "] offset: " + offset );
        callback(status,offset);
      }
      else {
        callback(status,0);
      }
    }
  },
  pause: function()
  {
    if( this.completed ) { return; } // if completed do nothing
    if( this.request ) {
      this.request.abort();
      this.request = null;
    }
  },
  resume: function()
  {
    if( this.completed ) { return; } // if completed do nothing
    if( this.request ) { return; } // if request is not paused do nothing
    // start the resume process, similar to begin, but send the ETag in the request
    this.begin();
  }
};

// keep track of all running uploads
UploadManager = function() {
  this.uploads = []; // UploadRequest objects indexed by id
};
UploadManager.prototype = {
  addUpload: function(uploadRequest, id) {
    this.uploads[id] = uploadRequest;
  }
};
var uploadManager = new UploadManager();

//
// Monitor messages from the UI Thread
//
// upload:new
//   - create a new uploader and start sending the bytes
//   - requires uploader id and fileBlob to upload
//
// upload:pause
//   - pause an active upload
//   - requires uploader id
//
// upload:resume
//   - resume a paused upload
//   - requires uploader id
//
google.gears.workerPool.onmessage = function(a, b, message) {
  var type = message.body.type;
  var id = message.body.id;
  //google.gears.workerPool.sendMessage({id: id, status:"Recieved message: " + type}, message.sender);
  switch( type ) {
  case "upload:new":
    var uploader = new UploadRequet(id, message.body.file, google.gears.workerPool, message.sender);
    uploader.begin();
    uploadManager.addUpload(uploader,id);
    break;
  case "upload:pause":
    var upload = uploadManager.uploads[id];
    if( upload ) {
      upload.pause();
    }
    else {
      // error
      google.gears.workerPool.sendMessage({id: message.body.id, status:"Received pause message, but could not find uploader for " + id}, message.sender);
    }
    break;
  case "upload:resume":
    var upload = uploadManager.uploads[id];
    if( upload ) {
      upload.resume();
    }
    else {
      // error
      google.gears.workerPool.sendMessage({id: message.body.id, status:"Received resume message, but could not find uploader for " + id}, message.sender);
    }
    break;
  default:
    break;
  }
}


text:
/****************************************************************************
 * arch/arm/src/armv8-m/up_schedulesigaction.c
 *
 *   Copyright (C) 2009-2014 Gregory Nutt. All rights reserved.
 *   Author: Gregory Nutt <gnutt@nuttx.org>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name NuttX nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ****************************************************************************/

/****************************************************************************
 * Included Files
 ****************************************************************************/

#include <tinyara/config.h>

#include <stdint.h>
#include <sched.h>
#include <debug.h>

#include <tinyara/irq.h>
#include <tinyara/arch.h>

#include "psr.h"
#include "exc_return.h"
#include "sched/sched.h"
#include "up_internal.h"
#include "up_arch.h"

#ifndef CONFIG_DISABLE_SIGNALS

/****************************************************************************
 * Pre-processor Definitions
 ****************************************************************************/

/****************************************************************************
 * Private Data
 ****************************************************************************/

/****************************************************************************
 * Private Functions
 ****************************************************************************/

/****************************************************************************
 * Public Functions
 ****************************************************************************/

/****************************************************************************
 * Name: up_schedule_sigaction
 *
 * Description:
 *   This function is called by the OS when one or more
 *   signal handling actions have been queued for execution.
 *   The architecture specific code must configure things so
 *   that the 'sigdeliver' callback is executed on the thread
 *   specified by 'tcb' as soon as possible.
 *
 *   This function may be called from interrupt handling logic.
 *
 *   This operation should not cause the task to be unblocked
 *   nor should it cause any immediate execution of sigdeliver.
 *   Typically, a few cases need to be considered:
 *
 *   (1) This function may be called from an interrupt handler
 *       During interrupt processing, all xcptcontext structures
 *       should be valid for all tasks.  That structure should
 *       be modified to invoke sigdeliver() either on return
 *       from (this) interrupt or on some subsequent context
 *       switch to the recipient task.
 *   (2) If not in an interrupt handler and the tcb is NOT
 *       the currently executing task, then again just modify
 *       the saved xcptcontext structure for the recipient
 *       task so it will invoke sigdeliver when that task is
 *       later resumed.
 *   (3) If not in an interrupt handler and the tcb IS the
 *       currently executing task -- just call the signal
 *       handler now.
 *
 ****************************************************************************/

void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{
	irqstate_t flags;

	/* Make sure that interrupts are disabled */

	flags = irqsave();

	svdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
	DEBUGASSERT(tcb != NULL && sigdeliver != NULL);

	/* Refuse to handle nested signal actions */

	if (!tcb->xcp.sigdeliver) {
		/* First, handle some special cases when the signal is being delivered
		 * to the currently executing task.
		 */

		svdbg("rtcb=0x%p current_regs=0x%p\n", this_task(), current_regs);

		if (tcb == this_task()) {
			/* CASE 1:  We are not in an interrupt handler and a task is
			 * signalling itself for some reason.
			 */

			if (!current_regs) {
				/* In this case just deliver the signal now. */

				sigdeliver(tcb);
			}

			/* CASE 2:  We are in an interrupt handler AND the interrupted
			 * task is the same as the one that must receive the signal, then
			 * we will have to modify the return state as well as the state in
			 * the TCB.
			 */

			else {
				/* Save the return PC, CPSR and either the BASEPRI or PRIMASK
				 * registers (and perhaps also the LR).  These will be
				 * restored by the signal trampoline after the signal has been
				 * delivered.
				 */

				tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
				tcb->xcp.saved_pc = current_regs[REG_PC];
#ifdef CONFIG_ARMV8M_USEBASEPRI
				tcb->xcp.saved_basepri = current_regs[REG_BASEPRI];
#else
				tcb->xcp.saved_primask = current_regs[REG_PRIMASK];
#endif
				tcb->xcp.saved_xpsr = current_regs[REG_XPSR];
#ifdef CONFIG_BUILD_PROTECTED
				tcb->xcp.saved_lr = current_regs[REG_LR];
#endif
				/* Then set up to vector to the trampoline with interrupts
				 * disabled.  The kernel-space trampoline must run in
				 * privileged thread mode.
				 */

				current_regs[REG_PC] = (uint32_t)up_sigdeliver;
#ifdef CONFIG_ARMV8M_USEBASEPRI
				current_regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY;
#else
				current_regs[REG_PRIMASK] = 1;
#endif
#ifdef CONFIG_BUILD_PROTECTED
				current_regs[REG_LR] = EXC_RETURN_PRIVTHR;
#endif
				/* And make sure that the saved context in the TCB is the same
				 * as the interrupt return context.
				 */

				up_savestate(tcb->xcp.regs);

			}
		}

		/* Otherwise, we are (1) signalling a task is not running from an
		 * interrupt handler or (2) we are not in an interrupt handler and the
		 * running task is signalling* some non-running task.
		 */

		else {
			/* Save the return PC, CPSR and either the BASEPRI or PRIMASK
			 * registers (and perhaps also the LR).  These will be restored
			 * by the signal trampoline after the signal has been delivered.
			 */

			tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
			tcb->xcp.saved_pc = tcb->xcp.regs[REG_PC];
#ifdef CONFIG_ARMV8M_USEBASEPRI
			tcb->xcp.saved_basepri = tcb->xcp.regs[REG_BASEPRI];
#else
			tcb->xcp.saved_primask = tcb->xcp.regs[REG_PRIMASK];
#endif
			tcb->xcp.saved_xpsr = tcb->xcp.regs[REG_XPSR];
#ifdef CONFIG_BUILD_PROTECTED
			tcb->xcp.saved_lr = tcb->xcp.regs[REG_LR];
#endif
			/* Then set up to vector to the trampoline with interrupts
			 * disabled.  We must already be in privileged thread mode to be
			 * here.
			 */

			tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver;
#ifdef CONFIG_ARMV8M_USEBASEPRI
			tcb->xcp.regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY;
#else
			tcb->xcp.regs[REG_PRIMASK] = 1;
#endif
#ifdef CONFIG_BUILD_PROTECTED
			tcb->xcp.regs[REG_LR] = EXC_RETURN_PRIVTHR;
#endif
		}
	}

	irqrestore(flags);
}

#endif							/* !CONFIG_DISABLE_SIGNALS */


text:
#include "SimTKmath.h"
#include <vector>
#include <exception>

using namespace SimTK;
using namespace std;

//TODO - had to reduced tol for geodesic tests, should be 1e-10
const Real TOL = 1e-4;

const Real r = 3.5; // radius used for geodesic tests

#define ASSERT(cond) {SimTK_ASSERT_ALWAYS(cond, "Assertion failed");}

template <class T>
void assertEqual(T val1, T val2) {
    const T sz = std::max(std::abs(val1),std::abs(val2));
    const Real tol = std::max(TOL, sz*TOL);
    ASSERT(abs(val1-val2) < tol);
}

template <int N>
void assertEqual(Vec<N> val1, Vec<N> val2) {
    for (int i = 0; i < N; ++i) {
        const Real sz = std::max(std::abs(val1[i]),std::abs(val2[i]));
        const Real tol = std::max(TOL, sz*TOL);
        ASSERT(abs(val1[i]-val2[i]) < tol);
    }
}

void assertEqual(UnitVec3 v1, UnitVec3 v2) {
    return assertEqual(v1.asVec3(), v2.asVec3());
}

void testSurfaceGradient(const ContactGeometry& );
void testSurfaceHessian(const ContactGeometry& );
void compareAnalyticalAndNumericGradient(const ContactGeometry&, const Vec3& );
void compareAnalyticalAndNumericHessian(const ContactGeometry&, const Vec3& );

void testHalfSpace() {
    ContactGeometry::HalfSpace hs;

    // Check intersections with various rays.

    Real distance;
    UnitVec3 normal;
    ASSERT(!hs.intersectsRay(Vec3(4, 0, 0), UnitVec3(1, 0, 0), distance, normal));
    ASSERT(!hs.intersectsRay(Vec3(-1, 0, 0), UnitVec3(-1, 1, 0), distance, normal));
    ASSERT(!hs.intersectsRay(Vec3(-1, 0, 0), UnitVec3(0, 1, 0), distance, normal));
    ASSERT(hs.intersectsRay(Vec3(-1, 0, 0), UnitVec3(1, 0, 0), distance, normal));
    assertEqual(1.0, distance);
    assertEqual(Vec3(-1, 0, 0), normal);
    ASSERT(hs.intersectsRay(Vec3(-2, 15, 37), UnitVec3(1, 0, 0), distance, normal));
    assertEqual(2.0, distance);
    assertEqual(Vec3(-1, 0, 0), normal);
    ASSERT(hs.intersectsRay(Vec3(-3, 1, 2), UnitVec3(1, 1, 1), distance, normal));
    assertEqual(3*Sqrt3, distance);
    assertEqual(Vec3(-1, 0, 0), normal);
    ASSERT(hs.intersectsRay(Vec3(2, 0, 0), UnitVec3(-1, 0, 1), distance, normal));
    assertEqual(2*Sqrt2, distance);
    assertEqual(Vec3(-1, 0, 0), normal);

    // Test finding the nearest point.

    Random::Gaussian random(0, 3);
    for (int i = 0; i < 100; i++) {
        Vec3 pos(random.getValue(), random.getValue(), random.getValue());
        bool inside;
        UnitVec3 normal;
        Vec3 nearest = hs.findNearestPoint(pos, inside, normal);
        assertEqual(nearest, Vec3(0, pos[1], pos[2]));
        ASSERT(inside == (pos[0] >= 0));
        assertEqual(normal, Vec3(-1, 0, 0));
    }
}

void testCylinder() {
    Real radius = 3.5;
    ContactGeometry::Cylinder cyl(radius);
    assert(cyl.getRadius() == radius);

    // Check intersections with various rays.

    Real distance;
    UnitVec3 normal;
    ASSERT(!cyl.intersectsRay(Vec3(radius*1.1, 0, 0), UnitVec3(1, 0, 0), distance, normal));
    ASSERT(!cyl.intersectsRay(Vec3(-radius*1.1, 0, 0), UnitVec3(-1, 1, 0), distance, normal));
    ASSERT(!cyl.intersectsRay(Vec3(-radius*1.1, 0, 0), UnitVec3(0, 1, 0), distance, normal));
    ASSERT(!cyl.intersectsRay(Vec3(-radius, -radius, 0), UnitVec3(1, -Eps, 0), distance, normal));
    ASSERT(cyl.intersectsRay(Vec3(-radius, -radius, 0), UnitVec3(1, Eps, 0), distance, normal));

    ASSERT(cyl.intersectsRay(Vec3(-(radius+1.0), 0, 0), UnitVec3(1, 0, 0), distance, normal));
    assertEqual(1.0, distance);
    assertEqual(Vec3(-1, 0, 0), normal);

    ASSERT(cyl.intersectsRay(Vec3(-radius*2, radius*2, 37), UnitVec3(1, -1, 0), distance, normal));
    assertEqual(radius*(2*Sqrt2-1), distance);
    assertEqual(UnitVec3(-1, 1, 0), normal);

    ASSERT(cyl.intersectsRay(Vec3(-radius*2, 0, -radius*2), UnitVec3(1, 0, 1), distance, normal));
    assertEqual(radius*Sqrt2, distance);
    assertEqual(UnitVec3(-1, 0, 0), normal);

    // Test finding the nearest point.

    Random::Gaussian random(0, 3);
    for (int i = 0; i < 100; i++) {
        Vec3 pos(random.getValue(), random.getValue(), random.getValue());
        Vec3 projpos(pos);
        projpos(2)=0; // cyl axis is z-axis, project pos to x-y plane
        bool inside;
        UnitVec3 normal;
        Vec3 nearest = cyl.findNearestPoint(pos, inside, normal);
        assertEqual(nearest, projpos.normalize()*radius+Vec3(0,0,pos(2)));
        ASSERT(inside == (projpos.norm() <= radius));
        assertEqual(normal, projpos.normalize());
    }

    // Test derivatives
    testSurfaceGradient(cyl);
    testSurfaceHessian(cyl);
}

void testSphere() {
    // Create a sphere.

    Real radius = 3.5;
    ContactGeometry::Sphere sphere(radius);
    assert(sphere.getRadius() == radius);

    // Check intersections with various rays.

    Real distance;
    UnitVec3 normal;
    ASSERT(!sphere.intersectsRay(Vec3(4, 0, 0), UnitVec3(1, 0, 0), distance, normal));
    ASSERT(sphere.intersectsRay(Vec3(2, 0, 0), UnitVec3(1, 0, 0), distance, normal));
    assertEqual(1.5, distance);
    assertEqual(Vec3(1, 0, 0), normal);
    ASSERT(sphere.intersectsRay(Vec3(4, 0, 0), UnitVec3(-1, 0, 0), distance, normal));
    assertEqual(0.5, distance);
    assertEqual(Vec3(1, 0, 0), normal);
    ASSERT(sphere.intersectsRay(Vec3(2, 0, 0), UnitVec3(-1, 0, 0), distance, normal));
    assertEqual(5.5, distance);
    assertEqual(Vec3(-1, 0, 0), normal);
    ASSERT(sphere.intersectsRay(Vec3(0, 0, 0), UnitVec3(1, 1, 1), distance, normal));
    assertEqual(3.5, distance);
    assertEqual(Vec3(1.0/Sqrt3), normal);

    // Test finding the nearest point.

    Random::Gaussian random(0, 3);
    for (int i = 0; i < 100; i++) {
        Vec3 pos(random.getValue(), random.getValue(), random.getValue());
        bool inside;
        UnitVec3 normal;
        Vec3 nearest = sphere.findNearestPoint(pos, inside, normal);
        assertEqual(nearest, pos.normalize()*radius);
        ASSERT(inside == (pos.norm() <= radius));
        assertEqual(normal, pos.normalize());
    }
}

void testEllipsoid() {
    // Create a ellipsoid.

    Vec3 radii(1.5, 2.2, 3.1);
    ContactGeometry::Ellipsoid ellipsoid(radii);
    assert(ellipsoid.getRadii() == radii);

    // Check intersections with various rays.

    Real distance;
    UnitVec3 normal;
    ASSERT(!ellipsoid.intersectsRay(Vec3(4, 0, 0), UnitVec3(1, 0, 0), distance, normal));
    ASSERT(ellipsoid.intersectsRay(Vec3(1, 0, 0), UnitVec3(1, 0, 0), distance, normal));
    assertEqual(0.5, distance);
    assertEqual(Vec3(1, 0, 0), normal);
    ASSERT(ellipsoid.intersectsRay(Vec3(4, 0, 0), UnitVec3(-1, 0, 0), distance, normal));
    assertEqual(2.5, distance);
    assertEqual(Vec3(1, 0, 0), normal);
    ASSERT(ellipsoid.intersectsRay(Vec3(0, -5, 0), UnitVec3(0, 1, 0), distance, normal));
    assertEqual(2.8, distance);
    assertEqual(Vec3(0, -1, 0), normal);
    ASSERT(ellipsoid.intersectsRay(Vec3(0, 0, 0), UnitVec3(1, 1, 1), distance, normal));
    assertEqual(sqrt(3/(1/(radii[0]*radii[0])+1/(radii[1]*radii[1])+1/(radii[2]*radii[2]))), distance);
    assertEqual(UnitVec3(1/(radii[0]*radii[0]), 1/(radii[1]*radii[1]), 1/(radii[2]*radii[2])), normal);

    // Test finding the nearest point.

    Random::Gaussian random(0, 2);
    for (int i = 0; i < 100; i++) {
        Vec3 pos(random.getValue(), random.getValue(), random.getValue());
        bool inside;
        UnitVec3 normal;
        Vec3 nearest = ellipsoid.findNearestPoint(pos, inside, normal);
        assertEqual(nearest[0]*nearest[0]/(radii[0]*radii[0])+nearest[1]*nearest[1]/(radii[1]*radii[1])+nearest[2]*nearest[2]/(radii[2]*radii[2]), 1.0);
        Real projectedRadius = pos[0]*pos[0]/(radii[0]*radii[0])+pos[1]*pos[1]/(radii[1]*radii[1])+pos[2]*pos[2]/(radii[2]*radii[2]);
        ASSERT(inside == (projectedRadius < 1.0));
        Vec3 projectedPoint = pos/sqrt(projectedRadius);
        ASSERT((nearest-pos).normSqr() < (projectedPoint-pos).normSqr());
        assertEqual(normal, UnitVec3(nearest[0]/(radii[0]*radii[0]), nearest[1]/(radii[1]*radii[1]), nearest[2]/(radii[2]*radii[2])));
    }
}

void testTorus() {
    Real radius = r;
    Real tubeRadius = 0.75;
    ContactGeometry::Torus torus(radius, tubeRadius);
    assert(torus.getTorusRadius() == radius);
    assert(torus.getTubeRadius() == tubeRadius);

    // Check intersections with various rays.

//    Real distance;
//    UnitVec3 normal;
//    ASSERT(!torus.intersectsRay(Vec3(radius*1.1, 0, 0), UnitVec3(1, 0, 0), distance, normal));
//    ASSERT(!torus.intersectsRay(Vec3(-radius*1.1, 0, 0), UnitVec3(-1, 1, 0), distance, normal));
//    ASSERT(!torus.intersectsRay(Vec3(-radius*1.1, 0, 0), UnitVec3(0, 1, 0), distance, normal));
//    ASSERT(!torus.intersectsRay(Vec3(-radius, -radius, 0), UnitVec3(1, -Eps, 0), distance, normal));
//    ASSERT(torus.intersectsRay(Vec3(-radius, -radius, 0), UnitVec3(1, Eps, 0), distance, normal));
//
//    ASSERT(torus.intersectsRay(Vec3(-(radius+1.0), 0, 0), UnitVec3(1, 0, 0), distance, normal));
//    assertEqual(1.0, distance);
//    assertEqual(Vec3(-1, 0, 0), normal);
//
//    ASSERT(torus.intersectsRay(Vec3(-radius*2, radius*2, 37), UnitVec3(1, -1, 0), distance, normal));
//    assertEqual(radius*(2*Sqrt2-1), distance);
//    assertEqual(UnitVec3(-1, 1, 0), normal);
//
//    ASSERT(torus.intersectsRay(Vec3(-radius*2, 0, -radius*2), UnitVec3(1, 0, 1), distance, normal));
//    assertEqual(radius*Sqrt2, distance);
//    assertEqual(UnitVec3(-1, 0, 0), normal);
//
//    // Test finding the nearest point.
//
//    Random::Gaussian random(0, 3);
//    for (int i = 0; i < 100; i++) {
//        Vec3 pos(random.getValue(), random.getValue(), random.getValue());
//        Vec3 projpos(pos);
//        projpos(2)=0; // cyl axis is z-axis, project pos to x-y plane
//        bool inside;
//        UnitVec3 normal;
//        Vec3 nearest = torus.findNearestPoint(pos, inside, normal);
//        assertEqual(nearest, projpos.normalize()*radius+Vec3(0,0,pos(2)));
//        ASSERT(inside == (projpos.norm() <= radius));
//        assertEqual(normal, projpos.normalize());
//    }

    // Test derivatives
//    Vec3 pt(2*(radius+tubeRadius), 0,0);
//    Vec3 pt(3,4,5);
//    cout << "surfaceValue( " << pt << " ) = " << torus.calcSurfaceValue(pt) << endl;
//    compareAnalyticalAndNumericGradient(torus, pt);
//    compareAnalyticalAndNumericHessian(torus, pt);
    testSurfaceGradient(torus);
    testSurfaceHessian(torus);

}

//==============================================================================
//                      SURFACE EVALUATORS
//==============================================================================

class ImplicitSurfaceFunction : public Differentiator::GradientFunction {
public:
    ImplicitSurfaceFunction(const ContactGeometry& geom)
        : Differentiator::GradientFunction(3), geom(geom) { }

    int f(const Vector& y, Real& fy) const {
        fy = geom.calcSurfaceValue(Vec3::getAs(&y[0]));
        return 0;
    }

    const ContactGeometry& geom;
};

class ImplicitSurfaceGradient : public Differentiator::JacobianFunction {
public:
    ImplicitSurfaceGradient(const ContactGeometry& geom)
        : Differentiator::JacobianFunction(3,3), geom(geom) { }

    int f(const Vector& y, Vector& fy) const {
        fy = (Vector)geom.calcSurfaceGradient(Vec3::getAs(&y(0)));
        return 0;
    }

    const ContactGeometry& geom;
};

void testSurfaceGradient(const ContactGeometry& geom) {

    // setup random test points
    Random::Gaussian random(0, r);
    for (int i = 0; i < 100; i++) {
        Vec3 pt(random.getValue(), random.getValue(), random.getValue());
        compareAnalyticalAndNumericGradient(geom, pt);
    }
}

void compareAnalyticalAndNumericGradient(const ContactGeometry& geom, const Vec3& pt) {

    ImplicitSurfaceFunction surf(geom);
    Differentiator diff(surf);

    Vector tmp = diff.calcGradient((Vector)pt, Differentiator::CentralDifference);
    Vec3 gradNumeric = Vec3::getAs(&tmp(0));
    Vec3 gradAnalytic = geom.calcSurfaceGradient(pt);

//    cout << "ana gradient = " << gradAnalytic << endl;
//    cout << "num gradient = " << gradNumeric << endl;
    assertEqual(gradNumeric, gradAnalytic);
}

void testSurfaceHessian(const ContactGeometry& geom) {

    // setup random test points
    Random::Gaussian random(0, r);
    for (int i = 0; i < 100; i++) {
        Vec3 pt(random.getValue(), random.getValue(), random.getValue());
        compareAnalyticalAndNumericHessian(geom, pt);
    }
}

void compareAnalyticalAndNumericHessian(const ContactGeometry& geom, const Vec3& pt) {

    ImplicitSurfaceGradient grad(geom);
    Differentiator diff(grad);

    Matrix tmp = diff.calcJacobian((Vector)pt);
    Mat33 hessNumeric = Mat33::getAs(&tmp(0,0));
    Mat33 hessAnalytic = geom.calcSurfaceHessian(pt);

//    cout << "ana hessian = " << hessAnalytic << endl;
//    cout << "num hessian = " << hessNumeric << endl;
    assertEqual(hessNumeric(0), hessAnalytic(0));
    assertEqual(hessNumeric(1), hessAnalytic(1));
    assertEqual(hessNumeric(2), hessAnalytic(2));
}

//==============================================================================
//                            GEODESIC EVALUTORS
//==============================================================================

void compareAnalyticalAndNumericGeodesic(const ContactGeometry& geom, const Vec3& P, const Vec3& Q) {

    Geodesic geodNumeric;
    Geodesic geodAnalytic;

    //TODO -- tests only pass for very small amounts of noise added
    // to the initial conditions for the numerical geodesic calculation

    Real lengthNoise = 0;
    Real tPNoise = 0;

    Real len;
    Random::Gaussian dlen(0, lengthNoise);

    Vec3 tP(0);
    Random::Gaussian dtP(0, tPNoise);

    UnitVec3 e_PQ(Q-P);
//    cout << "P = " << P << ", Q = " << Q << endl;

    // short geodesic, tPhint and tQhint point toward each other
    geom.calcGeodesicAnalytical(P, Q, e_PQ, e_PQ, geodAnalytic);

    // set init length and tangent dir to analytical result + noise
    len = geodAnalytic.getLength()*(1+dlen.getValue());
    tP = geodAnalytic.getTangentP() + Vec3(dtP.getValue(), dtP.getValue(), dtP.getValue());

    geom.calcGeodesicUsingOrthogonalMethod(P, Q, tP, len, geodNumeric);

//        cout << "ana length = " << geodAnalytic.getLength() << endl;
//        cout << "ini length = " << len << endl;
//        cout << "num length = " << geodNumeric.getLength() << endl;
    assertEqual(geodNumeric.getLength(), geodAnalytic.getLength());

//        cout << "ana tangentP = " << geodAnalytic.getTangentP() << endl;
//        cout << "ini tangentP = " << tP << endl;
//        cout << "num tangentP = " << geodNumeric.getTangentP() << endl;
    assertEqual(geodNumeric.getTangentP(), geodAnalytic.getTangentP());

//        cout << "ana tangentQ = " << geodAnalytic.getTangentQ() << endl;
//        cout << "num tangentQ = " << geodNumeric.getTangentQ() << endl;
    assertEqual(geodNumeric.getTangentQ(), geodAnalytic.getTangentQ());
}

void testAnalyticalGeodesicRandom(const ContactGeometry& geom) {

    Vec3 P(r,0,0);
    Vec3 Q(0,r,0);
    compareAnalyticalAndNumericGeodesic(geom,P,Q);

    // setup random test points
    Random::Gaussian random(0, r);
    for (int i = 0; i < 100; i++) {
        Vec3 P(random.getValue(), random.getValue(), random.getValue());
        Vec3 Q(random.getValue(), random.getValue(), random.getValue());
        compareAnalyticalAndNumericGeodesic(geom,P,Q);
    }
}

void testAnalyticalSphereGeodesic() {
    ContactGeometry::Sphere sphere(r);
    testAnalyticalGeodesicRandom(sphere);
}

void testAnalyticalCylinderGeodesic() {
    ContactGeometry::Cylinder cylinder(r);
    testAnalyticalGeodesicRandom(cylinder);
}

void testProjectDownhillToNearestPoint(const ContactGeometry& geom, Real r) {

    bool inside;
    UnitVec3 normal;
    Vec3 pos(1,1,1);

    Random::Gaussian random(0, r);
    for (int i = 0; i < 100; i++) {
        Vec3 pos(random.getValue(), random.getValue(), random.getValue());
//        cout << i << ": pos=" << pos << endl;

        Vec3 nearestAnalytical = geom.findNearestPoint(pos, inside, normal);
        Vec3 nearestProjected = geom.projectDownhillToNearestPoint(pos);

//        cout << "near pt analytical = " << nearestAnalytical << "norm = " << nearestAnalytical.norm() << endl;
//        cout << "near pt projected  = " << nearestProjected << "norm = " << nearestProjected.norm() << endl;
//        cout << endl;
        assertEqual(nearestAnalytical, nearestProjected);

    }
}

int main() {
    try {
        testHalfSpace();
        testSphere();
        testEllipsoid();
        testCylinder();
        testTorus();

        // TODO clean up these tests and use them
//        testAnalyticalSphereGeodesic();
//        testAnalyticalCylinderGeodesic();
        testProjectDownhillToNearestPoint(ContactGeometry::Sphere(r), r);
        testProjectDownhillToNearestPoint(ContactGeometry::Ellipsoid(Vec3(1.5, 2.2, 3.1)), r);
//        testProjectDownhillToNearestPoint(ContactGeometry::Torus(3*r, r), 3*r);
    }
    catch(const std::exception& e) {
        cout << "exception: " << e.what() << endl;
        return 1;
    }
    cout << "Done" << endl;
    return 0;
}


text:
title: Coyotes del Amor video release party
where: Artik Freiburg, DE
date: 2017-10-27
time: "22:00"
more-info: ""
map: ""
published: true
---