text:
<?xml version='1.0' encoding='utf-8' standalone='no' ?>

<errors>  This table contains all of the error messages generated by core
  avmplus.  This will likely be replaced by a resource table
  for easy localization.
  %o = ScriptObject*
  %t = Traits*
  %m = AbstractFunction*
  %n = Multiname (name portion only)
  %N = Multiname (namespace portion only)
  %a = Atom
  %d = int
  %f = double
  %S = Stringp
  %s = char*

  <error id="1000" label="kOutOfMemoryError">
    El sistema no tiene memoria disponible.
    <description><![CDATA[
		Flash Player needs more memory to compile your code than your system has available.
		Close some of the applications or processes running on your system.
	]]></description></error>

  <error id="1001" label="kNotImplementedError">El método %1 no se ha implementado.</error>
  <error id="1002" label="kInvalidPrecisionError">
    El argumento de precisión debe estar entre %2 y %3; %1 no es válido.
    <description><![CDATA[
		You specified a value that is not within the expected range of the precision argument. Number.toPrecision has a range of 1 to 21. Number.toFixed and Number.toExponential have a range of 0 to 20.
	]]></description></error>

  <error id="1003" label="kInvalidRadixError">
    El argumento de base debe estar entre 2 y 36; se obtuvo %1.
    <description><![CDATA[
		You passed a value less than 2 or greater than 36 for the radix argument of a method or property.
		Pass a value between 2 and 36 as a radix argument.
	]]></description>  </error>
  <error id="1004" label="kInvokeOnIncompatibleObjectError">
    Se invocó el método %1 en un objeto no compatible.
    <description><![CDATA[
		You tried to call a method that is not available to the specified object. This error occurs when
		you have copied a prototype function from one object to another, and then invoked it, but the
		target object is not the same type as the original object. Ensure that the target object and
		original object are the same type. See the ECMAScript Language Specification, 3rd Edition, Chapter 15 for more details.
	]]></description></error>

<error id="1005" label="kArrayIndexNotIntegerError">
    El índice de matriz no es un entero positivo (%1).
    <description><![CDATA[
		You tried to access a member of an array using an index value that is not a positive integer. Pass only positive integers as index values for arrays.
	]]></description></error>

<error id="1006" label="kCallOfNonFunctionError">
    %1 no es una función.
    <description><![CDATA[
		This error occurs when you attempt to call a function that does not exist.
		Make sure you are calling the correct function, and that the API has
		not changed from ActionScript 2.0. Also, make sure you are using the correct
		object. For example, you will see this error when you use the following code
		(because the last line mistakenly calls the variable big instead
		of blg):

var blg:String = "foo";
var big:Sprite = new Sprite();
var error:int = big.length();

	]]></description></error>
  <error id="1007" label="kConstructOfNonFunctionError">Se intentó crear una instancia en un tipo no constructor.</error>
  <error id="1008" label="kAmbiguousBindingError">%1 es ambiguo; se encontró más de una vinculación coincidente.</error>
  <error id="1009" label="kConvertNullToObjectError">
    No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo.
    <description><![CDATA[
	An object that evaluates to null can have no properties. This error can occur in some unexpected
	(though valid) situations. For example, consider the following code, which creates a Sprite
	object. Because this Sprite object is never added to the display list (through the
	addChild() method of a DisplayObjectContainer object), its stage
	property is set to null. Thus, the example generates this error because Sprite object's stage property
	cannot have any properties:

import flash.display.Sprite;
var sprite1:Sprite = new Sprite();
var q:String = sprite1.stage.quality;

	]]></description></error>

  <error id="1010" label="kConvertUndefinedToObjectError">
    Un término no está definido y no tiene propiedades.
    <description><![CDATA[
		This error can occur if you try to access a property of an object that does not exist. For example:

var obj:Object = new Object();
obj.a = "foo";
trace(obj.b.prop);

You can also see this error because of a misspelling, for example in the following, where
		mc represents a MovieClip object in the display list, and the stage
		property is misspelled with a capital S (it should be stage):

trace(mc.Stage.quality);

	]]></description></error>
  <error id="1011" label="kIllegalOpcodeError">
    Código de operación %2 no válido en el desplazamiento %3 del método %1.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1012" label="kLastInstExceedsCodeSizeError">
    La última instrucción superó el tamaño de código.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1013" label="kFindVarWithNoScopeError">
    No se puede llamar a OP_findproperty cuando el valor de scopeDepth es 0.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1014" label="kClassNotFoundError">No se encontró la clase %1.</error>
   <error id="1015" label="kIllegalSetDxns">
    El método %1 no puede establecer el espacio de nombres xml predeterminado
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1016" label="kDescendentsError">Operador de descendientes (..) no admitido en el tipo %1.</error>
   <error id="1017" label="kScopeStackOverflowError">
    Desbordamiento de la pila en el ámbito.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1018" label="kScopeStackUnderflowError">
    Subdesbordamiento de la pila en el ámbito.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1019" label="kGetScopeObjectBoundsError">
    Getscopeobject %1 está fuera de los límites.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>
   <error id="1020" label="kCannotFallOffMethodError">
    El código no puede sobrepasar el final de un método.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1021" label="kInvalidBranchTargetError">
    Hay al menos un destino de rama en una instrucción no válida del método.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1022" label="kIllegalVoidError">
    El tipo Void sólo se puede utilizar como tipo de devolución de función.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1023" label="kStackOverflowError">
    Desbordamiento de la pila.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1024" label="kStackUnderflowError">
    Subdesbordamiento de la pila.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1025" label="kInvalidRegisterError">
    Se obtuvo acceso a un registro no válido %1.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1026" label="kSlotExceedsCountError">
    La ranura %1 supera el valor slotCount=%2 de %3.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1027" label="kMethodInfoExceedsCountError">
    Method_info %1 supera el valor method_count=%2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1028" label="kDispIdExceedsCountError">
    Disp_id %1 supera el valor max_disp_id=%2 de %3.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1029" label="kDispIdUndefinedError">
    Disp_id %1 no está definido en %2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1030" label="kStackDepthUnbalancedError">
    Profundidad de pila desequilibrada. %1 != %2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1031" label="kScopeDepthUnbalancedError">
    Profundidad de ámbito desequilibrada. %1 != %2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1032" label="kCpoolIndexRangeError">
    El índice Cpool %1 está fuera del rango %2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1033" label="kCpoolEntryWrongTypeError">El tipo de la entrada Cpool %1 es incorrecto.<description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1034" label="kCheckTypeFailedError">Error de conversión forzada: no se puede convertir %1 en %2.</error>

   <error id="1035" label="kIllegalSuperCallError">
    Expresión super no válida en el método %1.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1037" label="kCannotAssignToMethodError">
    No se puede asignar a un método %1 en %2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

<error id="1038" label="kRedefinedError">
    %1 ya está definido.
    <description><![CDATA[
		You cannot declare a variable or function with the same identifier name more than once
		within the same scope.
		In ActionScript 3.0, different code blocks (such as those used in two for loops
		in the same function definition) are considered to be in the same scope.
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1039" label="kCannotVerifyUntilReferencedError">
    No se puede verificar el método hasta que se haga referencia a él.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1040" label="kCantUseInstanceofOnNonObjectError">
    A la derecha de instanceof debe haber una clase o una función.
    <description><![CDATA[
		The expression on the right side of the instanceof operator must be a class or function.
	]]></description></error>
  <error id="1041" label="kIsTypeMustBeClassError">
    A la derecha del operador debe haber una clase.
    <description><![CDATA[
		The expression on the right side of the is operator must be a class.
	]]></description></error>
   <error id="1042" label="kInvalidMagicError">
    No es un archivo ABC.  major_version=%1 minor_version=%2.
    <description><![CDATA[
You are attempting to use an  invalid file with the player: the tool that generates the SWF may be out of date or the SWF itself may be corrupt.
	]]></description></error>
   <error id="1043" label="kInvalidCodeLengthError">
    code_length=%1 no válido.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1044" label="kInvalidMethodInfoFlagsError">
    MethodInfo-%1 no admite flags=%2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

 <error id="1045" label="kUnsupportedTraitsKindError">
    traits kind=%1 no admitido.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1046" label="kMethodInfoOrderError">
    Referencia a MethodInfo-%1 antes de la definición.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1047" label="kMissingEntryPointError">
    No se encontró un punto de entrada.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1049" label="kPrototypeTypeError">
    Los objetos de prototipo deben ser objetos vanilla.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1050" label="kConvertToPrimitiveError">
    No se puede convertir %1 en primitiva.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1051" label="kIllegalEarlyBindingError">
    Acceso de vinculación a %1 en tiempo de compilación no válido.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1052" label="kInvalidURIError">
    URI no válido pasado a la función %1.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1053" label="kIllegalOverrideError">
    Sustitución no válida de %1 en %2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1054" label="kIllegalExceptionHandlerError">
    Rango o desplazamientos de destino no válidos en el controlador de excepciones.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1056" label="kWriteSealedError">
    No se puede crear la propiedad %1 en %2.
    <description><![CDATA[
	You are trying to assign a value to a nonexistent property on an instance of a non-dynamic
	class. This is only possible for instances of dynamic classes]]></description></error>

 <error id="1057" label="kIllegalSlotError">
    %1 sólo puede contener métodos.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1058" label="kIllegalOperandTypeError">
    Tipo de operando no válido: %1 debe ser %2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1059" label="kClassInfoOrderError">
    Referencia a ClassInfo-%1 antes de la definición.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1060" label="kClassInfoExceedsCountError">
    ClassInfo %1 supera el valor de class_count=%2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

<error id="1061" label="kNumberOutOfRangeError">
    No se puede convertir el valor %1 en %2 sin perder precisión.
    <description><![CDATA[

		This error appears if you attempt to assign a decimal number to a property that has data type
		int.

This error also appears for out-of-range assignments, such as the following:

var m0:int = 2147483648; // int.MAX_VALUE == 2147483647

You can also see this error when using the bitwise left shift operator (&lt&lt).
		For example, consider the following code:

var m0:uint = 0xFF;
var m1:uint = m0&lt&lt24;

The result of left shift operator (&lt&lt) is interpreted as a 32-bit two's complement number
		with sign. In the example, the result is a negative value, which causes the error when assigned
		to the uint typed property. A workaround is the following:

var m0:uint = 0xFF;
var m1:uint = uint(m0<<24);

	]]></description></error>

  <error id="1063" label="kWrongArgumentCountError">Discordancia del recuento de argumentos en %1. Se esperaba %2 y se obtuvo %3.</error>
  <error id="1064" label="kCannotCallMethodAsConstructor">
    No se puede llamar al método %1 como constructor.
    <description><![CDATA[
	Extracted methods are permanently bound to the object they are extracted from.
	Therefore, they can not later be called as a constructor. For example, the following
	creates function f() in Class A:

class A {
	   function f() {}
	}

	In the following code, extracting the function causes no error. However, creating
	a new instance of the function causes an error.

var a = new A()
	var m = a.f // extract f, don't call it
	m() // same as a.f()
	new m() // causes this error

	]]></description></error>
  <error id="1065" label="kUndefinedVarError">
    No se ha definido la variable %1.
    <description><![CDATA[
	You are using an undefined lexical reference. For example, in the following statements, the
	statement trace(x) generates an error because x is undefined. However, the
	statement trace(y) doesn't generate an error because y is defined:

trace("hello world")
	trace(x) // x is undefined
	var y
	trace(y) // No error, y is defined.

	]]></description></error>
  <error id="1066" label="kFunctionConstructorError">
    No se admite la forma function('cuerpo de función').
    <description><![CDATA[
	Unlike JavaScript, Flash does not compile code on-the-fly using eval() and
	function().  Thus, calling these as a constructor in ActionScript 3.0 generates this error.
	]]></description></error>

<error id="1067" label="kIllegalNativeMethodBodyError">
    El cuerpo del método nativo %1 no es válido.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

<error id="1068" label="kCannotMergeTypesError">
    %1 y %2 no pueden igualarse.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1069" label="kReadSealedError">
    No se encontró la propiedad %1 en %2 y no hay ningún valor predeterminado.
    <description><![CDATA[
	You are referencing an undefined property on a non-dynamic class instance. For example, the following generates this error when it references property
	x, which is not defined and cannot be created dynamically:

class A {} // sealed class, not dynamic
	trace(new A().x) // no property x defined on A, and A is not dynamic

	]]></description></error>
  <error id="1070" label="kCallNotFoundError">
    No se encontró el método %1 en %2
    <description><![CDATA[
	You are using a super statement to call a function, but the function doesn't exist in the super class.
	For example, the following code generates the error:
class A() {}
class B extends A {
  function f() { trace(super.f()); } // error 1070, there is no f on A
}

	]]></description></error>
  <error id="1071" label="kAlreadyBoundError">La función %1 ya se ha vinculado a %2.</error>

<error id="1072" label="kZeroDispIdError">
    Disp_id 0 no es válido.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1073" label="kDuplicateDispIdError">
    Se reemplazó el método %1 de no sustitución por la duplicación de disp_id %2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

<error id="1074" label="kConstWriteError">Lectura no permitida de la propiedad %1 de sólo lectura en %2.</error>
  <error id="1075" label="kMathNotFunctionError">
    Math no es una función.
    <description><![CDATA[
	You are trying to call math() as a function, but the Math class is a class with static methods.
	]]></description></error>
  <error id="1076" label="kMathNotConstructorError">
    Math no es un constructor.
    <description><![CDATA[
	You can not instantiate the Math class.
 	]]></description></error>

  <error id="1077" label="kWriteOnlyError">Lectura no permitida de la propiedad %1 de sólo escritura en %2.</error>
   <error id="1078" label="kIllegalOpMultinameError">
    Combinación no válida de código de operación y nombre múltiple: %1<%2>.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1079" label="kIllegalNativeMethodError">
    No se permiten métodos nativos en el código cargado.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1080" label="kIllegalNamespaceError">
    Valor de espacio de nombres no válido.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1081" label="kReadSealedErrorNs">No se encuentra la propiedad %1 en %2 y no hay ningún valor predeterminado.</error>

 <error id="1082" label="kNoDefaultNamespaceError">
    No se ha establecido ningún espacio de nombres predeterminado.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1083" label="kXMLPrefixNotBound">
    El prefijo "%1" del elemento "%2" no está vinculado.
    <description><![CDATA[
	An attribute name or element name has a prefix but no matching namespace was
	found. This statement generates an error because there is no foo
	namespace to match foo:x:
<foo:x xmlns:clowns='http://circuscenter.org'>

		]]></description></error>

  <error id="1084" label="kXMLBadQName">
    El elemento o el atributo ("%1") no coincide con la regla de producción de QName: QName::=(NCName':')?NCName.
    <description><![CDATA[
	You have foo:  or :foo as an element or attribute name, but there is nothing
	on the other side of the colon.
	]]></description></error>
  <error id="1085" label="kXMLUnterminatedElementTag">El tipo de elemento "%1" debe terminar con la etiqueta final "</%2>" correspondiente.</error>
  <error id="1086" label="kXMLOnlyWorksWithOneItemLists">
    El método %1 sólo funciona en listas que contienen un elemento.
    <description><![CDATA[
	The XMLList class propagates the XML-specific functions to one child if it has only one
	item in its list. If more than one item is in the list, the routines fail with this
	error. This happens for the following XMLList functions that mimic XML functions:

addNamespace, appendChild,  childIndex,
	inScopeNamespaces,  insertChildAfter,  insertChildBefore,
	name,  namespace,  localName,  namespaceDeclarations,
	nodeKind,  prependChild,  removeNamespace,  replace,
	setChildren,  setLocalName,  setName,  and setNamespace.

	]]></description></error>
  <error id="1087" label="kXMLAssignmentToIndexedXMLNotAllowed">No se permite la asignación a XML indexado.</error>
  <error id="1088" label="kXMLMarkupMustBeWellFormed">
    El marcado del documento que sigue al elemento raíz debe estar bien formado.
    <description><![CDATA[
	These are possible causes of this error:

Parsing an XMLList style object as XML

Misbalanced strings

	]]></description></error>

  <error id="1089" label="kXMLAssigmentOneItemLists">No se admite la asignación a listas con más de un elemento.</error>
  <error id="1090" label="kXMLMalformedElement">
    Error del analizador XML: elemento mal formado.
    <description><![CDATA[
	An element name is malformed. This example of an element name is malformed because a
	trailing right angle bracket > is missing:

<a/><b></b
	]]></description></error>

  <error id="1091" label="kXMLUnterminatedCData">Error del analizador XML: sección CDATA sin terminar.</error>
  <error id="1092" label="kXMLUnterminatedXMLDecl">Error del analizador XML: declaración XML sin terminar.</error>
  <error id="1093" label="kXMLUnterminatedDocTypeDecl">Error del analizador XML: declaración DOCTYPE sin terminar.</error>
  <error id="1094" label="kXMLUnterminatedComment">Error del analizador XML: comentario sin terminar.</error>
  <error id="1095" label="kXMLUnterminatedAttribute">Error del analizador XML: atributo sin terminar.</error>
  <error id="1096" label="kXMLUnterminatedElement">Error del analizador XML: elemento sin terminar.</error>
  <error id="1097" label="kXMLUnterminatedProcessingInstruction">Error del analizador XML: instrucción de procesamiento sin terminar.</error>
  <error id="1098" label="kXMLNamespaceWithPrefixAndNoURI">
    Prefijo %1 no válido sin un espacio de nombres.
    <description><![CDATA[
	The namespace constructor throws this error if you try to pass in an empty URI with a
	non-empty prefix as in this example:

ns = new Namespace ("prefix", "");
	]]></description></error>

  <error id="1100" label="kRegExpFlagsArgumentError">
    No se pueden proporcionar indicadores cuando se genera una expresión regular a partir de otra.
    <description><![CDATA[
	Creating a new regular expression from an existing one also copies its flags. To create a regular expression with
	different flags, use the new operator and set the flags as desired. For example, this statement
	creates a regular expression and specifies flag settings:

var re:RegExp = new RegExp("ali", /s)

	Alternatively, this statement creates a regular expression that has the same flags as re:

var re2:RegExp = new RegExp(re, ...)
 	]]></description></error>

   <error id="1101" label="kNoScopeError">
    No se puede verificar el método %1 con ámbito desconocido.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1102" label="kIllegalDefaultValue">
    Valor predeterminado no válido para el tipo %1.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1103" label="kCannotExtendFinalClass">
    La clase %1 no puede ampliar la clase base final.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1104" label="kXMLDuplicateAttribute">El atributo "%1" ya se especificó para el elemento "%2".</error>

  <error id="1107" label="kCorruptABCError">
    Los datos ABC están dañados; intentan leer fuera de los límites.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1108" label="kInvalidBaseClassError">
    El código de operación OP_newclass se utilizó con la clase base incorrecta.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1109" label="kDanglingFunctionError">
    Intento de llamada directa a la función abierta %1 desde el método %2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1110" label="kCannotExtendError">
    %1 no puede ampliar %2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1111" label="kCannotImplementError">
    %1 no puede implementar %2.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

   <error id="1112" label="kCoerceArgumentCountError">Discordancia del recuento de argumentos en coerción de clase.  Se esperaba 1; se obtuvo %1.</error>
   <error id="1113" label="kInvalidNewActivationError">
    Se utilizó OP_newactivation en el método sin el indicador NEED_ACTIVATION.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1114" label="kNoGlobalScopeError">
    Se utilizaron OP_getglobalslot u OP_setglobalslot sin ámbito global.
    <description><![CDATA[
		See the note at the bottom of this table.*
	]]></description></error>

  <error id="1115" label="kNotConstructorError">%1 no es un constructor.</error>
  <error id="1116" label="kApplyError">el segundo argumento de Function.prototype.apply debe ser una matriz.</error>
  <error id="1117" label="kXMLInvalidName">Nombre XML no válido: %1.</error>
  <error id="1118" label="kXMLIllegalCyclicalLoop">Bucle cíclico no válido entre nodos.</error>
  <error id="1119" label="kDeleteTypeError">El operador de eliminación no se admite con el operando de tipo %1.</error>
  <error id="1120" label="kDeleteSealedError">No se puede eliminar la propiedad %1 en %2.</error>
  <error id="1121" label="kDuplicateMethodBodyError">El cuerpo del método %1 está duplicado.</error>
   <error id="1122" label="kIllegalInterfaceMethodBodyError">El cuerpo del método de interfaz %1 no es válido.</error>
  <error id="1123" label="kFilterError">Operador de filtro no admitido en el tipo %1.</error>
  <error id="1124" label="kInvalidHasNextError">OP_hasnext2 requiere que el objeto y el índice sean registros diferentes.</error>
  <error id="1125" label="kOutOfRangeError">El índice %1 está fuera del rango %2.</error>
  <error id="1126" label="kVectorFixedError">No se puede cambiar la longitud de un vector fijo.</error>
  <error id="1127" label="kTypeAppOfNonParamType">La aplicación intentó escribir en un tipo no parametrizado.</error>
  <error id="1128" label="kWrongTypeArgCountError">Número incorrecto de parámetros type para %1. Se esperaba %2 y se obtuvo %3.</error>

  <error id="1500" hidden="true" label="kFileOpenError">Error al abrir el archivo %1.</error>
  <error id="1501" hidden="true" label="kFileWriteError">
    Error al escribir en el archivo %1.
    <description><![CDATA[
		The file you are writing to cannot be opened. Possibly the filename contains an error, the file is read-only, or
		you do not have access privileges.
	  	]]></description>
		</error>
  <error id="1502" label="kScriptTimeoutError">
    El tiempo de ejecución del script ha superado el tiempo de espera predeterminado de 15 segundos.
    <description><![CDATA[
		A script executed after the timeout period. (The default timeout period is 15 seconds.) After this error occurs, the
		script can continue to execute for 15 seconds more, after which the script terminates and throws run-time error number 1503 (A script failed to exit after 30 seconds and was terminated.)
	]]></description>
 </error>
  <error id="1503" label="kScriptTerminatedError">
    No se salió del script en 30 segundos y se ha cerrado.
    <description><![CDATA[
	  The script was still executing after 30 seconds. Flash Player first throws run-time error number 1502 (A script has executed for longer than the default timeout period of 15 seconds.) if the script executed more than 15
	  seconds, which is the default timeout period. This error occurs 15 seconds after Error 1502 occurs.
	]]></description></error>
	 <error id="1504" hidden="true" label="kEndOfFileError">
    Final del archivo.
    <description><![CDATA[
	  Flash Player unexpectedly encountered the end of the file. Possibly the file was not saved correctly or Flash Player expected more data
	  in the file.
	]]></description>
  </error>
  <error id="1505" hidden="true" label="kStringIndexOutOfBoundsError">El índice de cadena %1 está fuera de los límites; debe estar en el rango %2-%3.</error>
  <error id="1506" hidden="true" label="kInvalidRangeError">
    El rango especificado no es válido.
    <description><![CDATA[
	The method's start parameter is greater than its end parameter.
	]]></description></error>
  <error id="1507" label="kNullArgumentError">El argumento %1 no puede ser null.</error>
  <error id="1508" label="kInvalidArgumentError">
    El valor especificado para el argumento %1 no es válido.
    <description><![CDATA[
	You are possibly trying to pass the wrong data type. For example, the code

public function doSomething(const:int):void {
	}
	this ["doSomething"] ("str")

	generates an error at runtime because doSomething is cast as an int data type.	]]></description></error>

  <error id="1509" hidden="true" label="kShellCompressedDataError">
    Se produjo un error al descomprimir los datos.
    <description><![CDATA[
	The de-compressor reached the end of the stream, but more data was expected. The compressed data
	stream is probably corrupted.
	]]></description></error>
  <error id="1510" label="kArrayFilterNonNullObjectError">Si el argumento de la función de repetición de llamada es un método de la clase, el argumento opcional debe ser null.</error>
</errors>


text:
<?php
namespace Airavata\Service\Profile;

/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;

redpajama_set_name: RedPajamaGithub


text:
csd=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# hack app
if [[ "$csd" == *.app/Contents/Resources ]]
then
    parentdir="$(dirname "$(pwd)")"
    parentdir="$(dirname "$parentdir")"
    csd="$(dirname "$parentdir")"
else
    csd=$csd
fi
# hack app done
package=$(basename "$csd")
cd $csd

if [[ -z $(git status -s) ]]
then
    echo "Tree is clean, no need to do anything, exiting..."
    exit
else

R --vanilla -e "devtools::document(roclets=c('rd', 'collate', 'namespace', 'vignette'))"

cd ..
R --vanilla CMD INSTALL --no-multiarch --with-keep.source $package

cd $csd
git add -A
git commit -m 'update'
git push origin master

fi


text:
namespace falcon {
namespace mpl {

template<typename T>
struct identity
{ using type = T; };

}
}

#endif


text:
from abc import ABC, abstractmethod

class A(ABC):
    def print_function(self):
        print("Abstract Base Class")

class B(A):
    def print_function(self):
        print("Subclass")

if __name__ == '__main__':
    A().print_function()
    B().print_function()


text:
extern "C" {

MojoGLES2Context MojoGLES2CreateContext(MojoHandle handle,
                                        MojoGLES2ContextLost lost_callback,
                                        void* closure,
                                        const MojoAsyncWaiter* async_waiter) {
  MGLContext context = gles2::ControlThunksImpl::Get()->CreateContext(
      MGL_API_VERSION_GLES2,  // version
      handle,                 // command_buffer_handle
      MGL_NO_CONTEXT,         // share_group
      static_cast<MGLContextLostCallback>(lost_callback), closure,
      async_waiter);
  return reinterpret_cast<MojoGLES2Context>(context);
}

void MojoGLES2DestroyContext(MojoGLES2Context context) {
  gles2::ControlThunksImpl::Get()->DestroyContext(
      reinterpret_cast<MGLContext>(context));
}

void MojoGLES2MakeCurrent(MojoGLES2Context context) {
  gles2::ControlThunksImpl::Get()->MakeCurrent(
      reinterpret_cast<MGLContext>(context));
}

void MojoGLES2SwapBuffers() {
  gles2::ControlThunksImpl::Get()->SwapBuffers();
}

void* MojoGLES2GetGLES2Interface(MojoGLES2Context context) {
  return gles2::ControlThunksImpl::Get()->GetGLES2Interface(context);
}

void MojoGLES2SignalSyncPoint(MojoGLES2Context context,
                              uint32_t sync_point,
                              MojoGLES2SignalSyncPointCallback callback,
                              void* closure) {
  gles2::ControlThunksImpl::Get()->SignalSyncPoint(context, sync_point,
                                                   callback, closure);
}

#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS)             \
  ReturnType GL_APIENTRY gl##Function PARAMETERS {                             \
    auto interface = gles2::ControlThunksImpl::Get()->CurrentGLES2Interface(); \
    DCHECK(interface);                                                         \
    return interface->Function ARGUMENTS;                                      \
  }
#include "mojo/public/platform/native/gles2/call_visitor_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_chromium_bind_uniform_location_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_chromium_map_sub_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_chromium_miscellaneous_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_chromium_resize_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_chromium_sync_point_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_chromium_texture_mailbox_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_ext_debug_marker_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_occlusion_query_ext_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_oes_vertex_array_object_autogen.h"
#undef VISIT_GL_CALL

}  // extern "C"


text:
import { app, session } from 'electron';
import * as fs from 'fs';
import * as path from 'path';

import { logger } from '../common/logger';

// Cache check file path
const cacheCheckFilePath: string = path.join(app.getPath('userData'), 'CacheCheck');

/**
 * Deletes app cache file if exists or clears
 * the cache for the session
 */
export const cleanUpAppCache = async (): Promise<void> => {
    if (fs.existsSync(cacheCheckFilePath)) {
        await fs.unlinkSync(cacheCheckFilePath);
        logger.info(`app-cache-handler: last exit was clean, deleted the app cache file`);
        return;
    }
    if (session.defaultSession) {
        await session.defaultSession.clearCache();
        logger.info(`app-cache-handler: we didn't have a clean exit last time, so, cleared the cache that may have been corrupted!`);
    }
};

/**
 * Creates a new file cache file on app exit
 */
export const createAppCacheFile = (): void => {
    logger.info(`app-cache-handler: this is a clean exit, creating app cache file`);
    fs.writeFileSync(cacheCheckFilePath, '');
};


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.prestosql.plugin.mongodb;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.prestosql.testing.MaterializedResult;
import io.prestosql.testing.MaterializedRow;
import io.prestosql.tests.AbstractTestIntegrationSmokeTest;
import org.bson.Document;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Arrays;

import static io.airlift.tpch.TpchTable.ORDERS;
import static io.prestosql.plugin.mongodb.MongoQueryRunner.createMongoQueryRunner;
import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;

@Test(singleThreaded = true)
public class TestMongoIntegrationSmokeTest
        extends AbstractTestIntegrationSmokeTest
{
    private MongoQueryRunner mongoQueryRunner;

    public TestMongoIntegrationSmokeTest()
    {
        super(() -> createMongoQueryRunner(ORDERS));
    }

    @BeforeClass
    public void setUp()
    {
        mongoQueryRunner = (MongoQueryRunner) getQueryRunner();
    }

    @AfterClass(alwaysRun = true)
    public final void destroy()
    {
        mongoQueryRunner.shutdown();
        mongoQueryRunner = null;
    }

    @Test
    public void createTableWithEveryType()
    {
        String query = "" +
                "CREATE TABLE test_types_table AS " +
                "SELECT" +
                " 'foo' _varchar" +
                ", cast('bar' as varbinary) _varbinary" +
                ", cast(1 as bigint) _bigint" +
                ", 3.14E0 _double" +
                ", true _boolean" +
                ", DATE '1980-05-07' _date" +
                ", TIMESTAMP '1980-05-07 11:22:33.456' _timestamp" +
                ", ObjectId('ffffffffffffffffffffffff') _objectid";

        assertUpdate(query, 1);

        MaterializedResult results = getQueryRunner().execute(getSession(), "SELECT * FROM test_types_table").toTestTypes();
        assertEquals(results.getRowCount(), 1);
        MaterializedRow row = results.getMaterializedRows().get(0);
        assertEquals(row.getField(0), "foo");
        assertEquals(row.getField(1), "bar".getBytes(UTF_8));
        assertEquals(row.getField(2), 1L);
        assertEquals(row.getField(3), 3.14);
        assertEquals(row.getField(4), true);
        assertEquals(row.getField(5), LocalDate.of(1980, 5, 7));
        assertEquals(row.getField(6), LocalDateTime.of(1980, 5, 7, 11, 22, 33, 456_000_000));
        assertUpdate("DROP TABLE test_types_table");

        assertFalse(getQueryRunner().tableExists(getSession(), "test_types_table"));
    }

    @Test
    public void testInsertWithEveryType()
            throws Exception
    {
        String createSql = "" +
                "CREATE TABLE test_insert_types_table " +
                "(" +
                "  vc varchar" +
                ", vb varbinary" +
                ", bi bigint" +
                ", d double" +
                ", b boolean" +
                ", dt  date" +
                ", ts  timestamp" +
                ", objid objectid" +
                ")";
        getQueryRunner().execute(getSession(), createSql);

        String insertSql = "" +
                "INSERT INTO test_insert_types_table " +
                "SELECT" +
                " 'foo' _varchar" +
                ", cast('bar' as varbinary) _varbinary" +
                ", cast(1 as bigint) _bigint" +
                ", 3.14E0 _double" +
                ", true _boolean" +
                ", DATE '1980-05-07' _date" +
                ", TIMESTAMP '1980-05-07 11:22:33.456' _timestamp" +
                ", ObjectId('ffffffffffffffffffffffff') _objectid";
        getQueryRunner().execute(getSession(), insertSql);

        MaterializedResult results = getQueryRunner().execute(getSession(), "SELECT * FROM test_insert_types_table").toTestTypes();
        assertEquals(results.getRowCount(), 1);
        MaterializedRow row = results.getMaterializedRows().get(0);
        assertEquals(row.getField(0), "foo");
        assertEquals(row.getField(1), "bar".getBytes(UTF_8));
        assertEquals(row.getField(2), 1L);
        assertEquals(row.getField(3), 3.14);
        assertEquals(row.getField(4), true);
        assertEquals(row.getField(5), LocalDate.of(1980, 5, 7));
        assertEquals(row.getField(6), LocalDateTime.of(1980, 5, 7, 11, 22, 33, 456_000_000));
        assertUpdate("DROP TABLE test_insert_types_table");
        assertFalse(getQueryRunner().tableExists(getSession(), "test_insert_types_table"));
    }

    @Test
    public void testArrays()
    {
        assertUpdate("CREATE TABLE tmp_array1 AS SELECT ARRAY[1, 2, NULL] AS col", 1);
        assertQuery("SELECT col[2] FROM tmp_array1", "SELECT 2");
        assertQuery("SELECT col[3] FROM tmp_array1", "SELECT NULL");

        assertUpdate("CREATE TABLE tmp_array2 AS SELECT ARRAY[1.0E0, 2.5E0, 3.5E0] AS col", 1);
        assertQuery("SELECT col[2] FROM tmp_array2", "SELECT 2.5");

        assertUpdate("CREATE TABLE tmp_array3 AS SELECT ARRAY['puppies', 'kittens', NULL] AS col", 1);
        assertQuery("SELECT col[2] FROM tmp_array3", "SELECT 'kittens'");
        assertQuery("SELECT col[3] FROM tmp_array3", "SELECT NULL");

        assertUpdate("CREATE TABLE tmp_array4 AS SELECT ARRAY[TRUE, NULL] AS col", 1);
        assertQuery("SELECT col[1] FROM tmp_array4", "SELECT TRUE");
        assertQuery("SELECT col[2] FROM tmp_array4", "SELECT NULL");

        assertUpdate("CREATE TABLE tmp_array5 AS SELECT ARRAY[ARRAY[1, 2], NULL, ARRAY[3, 4]] AS col", 1);
        assertQuery("SELECT col[1][2] FROM tmp_array5", "SELECT 2");

        assertUpdate("CREATE TABLE tmp_array6 AS SELECT ARRAY[ARRAY['\"hi\"'], NULL, ARRAY['puppies']] AS col", 1);
        assertQuery("SELECT col[1][1] FROM tmp_array6", "SELECT '\"hi\"'");
        assertQuery("SELECT col[3][1] FROM tmp_array6", "SELECT 'puppies'");
    }

    @Test
    public void testTemporalArrays()
    {
        assertUpdate("CREATE TABLE tmp_array7 AS SELECT ARRAY[DATE '2014-09-30'] AS col", 1);
        assertOneNotNullResult("SELECT col[1] FROM tmp_array7");
        assertUpdate("CREATE TABLE tmp_array8 AS SELECT ARRAY[TIMESTAMP '2001-08-22 03:04:05.321'] AS col", 1);
        assertOneNotNullResult("SELECT col[1] FROM tmp_array8");
    }

    @Test
    public void testMaps()
    {
        assertUpdate("CREATE TABLE tmp_map1 AS SELECT MAP(ARRAY[0,1], ARRAY[2,NULL]) AS col", 1);
        assertQuery("SELECT col[0] FROM tmp_map1", "SELECT 2");
        assertQuery("SELECT col[1] FROM tmp_map1", "SELECT NULL");

        assertUpdate("CREATE TABLE tmp_map2 AS SELECT MAP(ARRAY[1.0E0], ARRAY[2.5E0]) AS col", 1);
        assertQuery("SELECT col[1.0] FROM tmp_map2", "SELECT 2.5");

        assertUpdate("CREATE TABLE tmp_map3 AS SELECT MAP(ARRAY['puppies'], ARRAY['kittens']) AS col", 1);
        assertQuery("SELECT col['puppies'] FROM tmp_map3", "SELECT 'kittens'");

        assertUpdate("CREATE TABLE tmp_map4 AS SELECT MAP(ARRAY[TRUE], ARRAY[FALSE]) AS col", "SELECT 1");
        assertQuery("SELECT col[TRUE] FROM tmp_map4", "SELECT FALSE");

        assertUpdate("CREATE TABLE tmp_map5 AS SELECT MAP(ARRAY[1.0E0], ARRAY[ARRAY[1, 2]]) AS col", 1);
        assertQuery("SELECT col[1.0][2] FROM tmp_map5", "SELECT 2");

        assertUpdate("CREATE TABLE tmp_map6 AS SELECT MAP(ARRAY[DATE '2014-09-30'], ARRAY[DATE '2014-09-29']) AS col", 1);
        assertOneNotNullResult("SELECT col[DATE '2014-09-30'] FROM tmp_map6");
        assertUpdate("CREATE TABLE tmp_map7 AS SELECT MAP(ARRAY[TIMESTAMP '2001-08-22 03:04:05.321'], ARRAY[TIMESTAMP '2001-08-22 03:04:05.321']) AS col", 1);
        assertOneNotNullResult("SELECT col[TIMESTAMP '2001-08-22 03:04:05.321'] FROM tmp_map7");

        assertUpdate("CREATE TABLE test.tmp_map8 (col MAP<VARCHAR, VARCHAR>)");
        mongoQueryRunner.getMongoClient().getDatabase("test").getCollection("tmp_map8").insertOne(new Document(
                ImmutableMap.of("col", new Document(ImmutableMap.of("key1", "value1", "key2", "value2")))));
        assertQuery("SELECT col['key1'] FROM test.tmp_map8", "SELECT 'value1'");

        assertUpdate("CREATE TABLE test.tmp_map9 (col VARCHAR)");
        mongoQueryRunner.getMongoClient().getDatabase("test").getCollection("tmp_map9").insertOne(new Document(
                ImmutableMap.of("col", new Document(ImmutableMap.of("key1", "value1", "key2", "value2")))));
        assertQuery("SELECT col FROM test.tmp_map9", "SELECT '{ \"key1\" : \"value1\", \"key2\" : \"value2\" }'");

        assertUpdate("CREATE TABLE test.tmp_map10 (col VARCHAR)");
        mongoQueryRunner.getMongoClient().getDatabase("test").getCollection("tmp_map10").insertOne(new Document(
                ImmutableMap.of("col", ImmutableList.of(new Document(ImmutableMap.of("key1", "value1", "key2", "value2")),
                        new Document(ImmutableMap.of("key3", "value3", "key4", "value4"))))));
        assertQuery("SELECT col FROM test.tmp_map10", "SELECT '[{ \"key1\" : \"value1\", \"key2\" : \"value2\" }, { \"key3\" : \"value3\", \"key4\" : \"value4\" }]'");

        assertUpdate("CREATE TABLE test.tmp_map11 (col VARCHAR)");
        mongoQueryRunner.getMongoClient().getDatabase("test").getCollection("tmp_map11").insertOne(new Document(
                ImmutableMap.of("col", 10)));
        assertQuery("SELECT col FROM test.tmp_map11", "SELECT '10'");

        assertUpdate("CREATE TABLE test.tmp_map12 (col VARCHAR)");
        mongoQueryRunner.getMongoClient().getDatabase("test").getCollection("tmp_map12").insertOne(new Document(
                ImmutableMap.of("col", Arrays.asList(10, null, 11))));
        assertQuery("SELECT col FROM test.tmp_map12", "SELECT '[10, null, 11]'");
    }

    @Test
    public void testCollectionNameContainsDots()
    {
        assertUpdate("CREATE TABLE \"tmp.dot1\" AS SELECT 'foo' _varchar", 1);
        assertQuery("SELECT _varchar FROM \"tmp.dot1\"", "SELECT 'foo'");
        assertUpdate("DROP TABLE \"tmp.dot1\"");
    }

    @Test
    public void testObjectIds()
    {
        String values = "VALUES " +
                " (10, NULL, NULL)," +
                " (11, ObjectId('ffffffffffffffffffffffff'), ObjectId('ffffffffffffffffffffffff'))," +
                " (12, ObjectId('ffffffffffffffffffffffff'), ObjectId('aaaaaaaaaaaaaaaaaaaaaaaa'))," +
                " (13, ObjectId('000000000000000000000000'), ObjectId('000000000000000000000000'))," +
                " (14, ObjectId('ffffffffffffffffffffffff'), NULL)," +
                " (15, NULL, ObjectId('ffffffffffffffffffffffff'))";
        String inlineTable = format("(%s) AS t(i, one, two)", values);

        assertUpdate("DROP TABLE IF EXISTS tmp_objectid");
        assertUpdate("CREATE TABLE tmp_objectid AS SELECT * FROM " + inlineTable, 6);

        // IS NULL
        assertQuery("SELECT i FROM " + inlineTable + " WHERE one IS NULL", "VALUES 10, 15");
        assertQuery("SELECT i FROM tmp_objectid WHERE one IS NULL", "SELECT 0 WHERE false"); // NULL gets replaced with new unique ObjectId in MongoPageSink, this affects other test cases

        // CAST AS varchar
        assertQuery(
                "SELECT i, CAST(one AS varchar) FROM " + inlineTable + " WHERE i <= 13",
                "VALUES (10, NULL), (11, 'ffffffffffffffffffffffff'), (12, 'ffffffffffffffffffffffff'), (13, '000000000000000000000000')");

        // EQUAL
        assertQuery("SELECT i FROM tmp_objectid WHERE one = two", "VALUES 11, 13");
        assertQuery("SELECT i FROM tmp_objectid WHERE one = ObjectId('ffffffffffffffffffffffff')", "VALUES 11, 12, 14");

        // IS DISTINCT FROM
        assertQuery("SELECT i FROM " + inlineTable + " WHERE one IS DISTINCT FROM two", "VALUES 12, 14, 15");
        assertQuery("SELECT i FROM " + inlineTable + " WHERE one IS NOT DISTINCT FROM two", "VALUES 10, 11, 13");

        assertQuery("SELECT i FROM tmp_objectid WHERE one IS DISTINCT FROM two", "VALUES 10, 12, 14, 15");
        assertQuery("SELECT i FROM tmp_objectid WHERE one IS NOT DISTINCT FROM two", "VALUES 11, 13");

        // Join on ObjectId
        assertQuery(
                format("SELECT l.i, r.i FROM (%1$s) AS l(i, one, two) JOIN (%1$s) AS r(i, one, two) ON l.one = r.two", values),
                "VALUES (11, 11), (14, 11), (11, 15), (12, 15), (12, 11), (14, 15), (13, 13)");

        // Group by ObjectId (IS DISTINCT FROM)
        assertQuery("SELECT array_agg(i ORDER BY i) FROM " + inlineTable + " GROUP BY one", "VALUES ((10, 15)), ((11, 12, 14)), ((13))");
        assertQuery("SELECT i FROM " + inlineTable + " GROUP BY one, i", "VALUES 10, 11, 12, 13, 14, 15");

        // Group by Row(ObjectId) (ID DISTINCT FROM in @OperatorDependency)
        assertQuery(
                "SELECT r.i, count(*) FROM (SELECT CAST(row(one, i) AS row(one ObjectId, i bigint)) r FROM " + inlineTable + ") GROUP BY r",
                "VALUES (10, 1), (11, 1), (12, 1), (13, 1), (14, 1), (15, 1)");
        assertQuery(
                "SELECT r.x, CAST(r.one AS varchar), count(*) FROM (SELECT CAST(row(one, i / 3 * 3) AS row(one ObjectId, x bigint)) r FROM " + inlineTable + ") GROUP BY r",
                "VALUES (9, NULL, 1), (9, 'ffffffffffffffffffffffff', 1), (12, 'ffffffffffffffffffffffff', 2), (12, '000000000000000000000000', 1), (15, NULL, 1)");

        assertUpdate("DROP TABLE tmp_objectid");
    }

    private void assertOneNotNullResult(String query)
    {
        MaterializedResult results = getQueryRunner().execute(getSession(), query).toTestTypes();
        assertEquals(results.getRowCount(), 1);
        assertEquals(results.getMaterializedRows().get(0).getFieldCount(), 1);
        assertNotNull(results.getMaterializedRows().get(0).getField(0));
    }
}


text:
<!DOCTYPE HTML>

		<title>SimpleBlock - Options</title>

		<select id="filterSelector" size=20></select>

		<button id="roeButton">Remove/edit selected filter</button>

		<input type="text" id="newFilter"/ >
		<button id="addNewButton">Add to filters</button>

		<button id="disableButton">Disable blocking</button>
		<button id="enableButton">Enable blocking</button>

		<textarea id="importExportFilters"></textarea>

		<button id="importButton">Import filters from JSON</button>
		<button id="exportButton">Export filters as JSON</button>

		<button id="sortButton">Sort filters</button>
		<button id="restoreDefaultsButton">Restore defaults</button>

		<input type="checkbox" id="webRTCBox"/>
		Hide private addresses from WebRTC/ICE/STUN


text:
package org.diirt.util.array;

/**
 * An iterator of {@code float}s.
 *
 * @author Gabriele Carcassi
 */
public abstract class IteratorFloat implements IteratorNumber {

    @Override
    public double nextDouble() {
        return (double) nextFloat();
    }

    @Override
    public byte nextByte() {
        return (byte) nextFloat();
    }

    @Override
    public short nextShort() {
        return (short) nextFloat();
    }

    @Override
    public int nextInt() {
        return (int) nextFloat();
    }

    @Override
    public long nextLong() {
        return (long) nextFloat();
    }

}


text:
struct Package {
	Package() : weight(0), value(0) {}
	Package(size_t w, size_t v) : weight(w), value(v) {}

	size_t weight;
	size_t value;
};

Package operator+(const Package& a, const Package& b) {
	return Package(a.weight + b.weight, a.value + b.value);
}

class Knapsack {
public:

	bool operator==(const Knapsack& k) const {
		if (this->value() != k.value()) return false;
		if (this->weight() != k.weight()) return false;

		// Check same items
		// TODO

		return true;
	}

	void addPackage(const Package& p) {
		packages_.push_back(p);
	}

	size_t weight() const {
		return sum().weight;
	}

	size_t value() const {
		return sum().value;
	}

private:
	std::vector<Package> packages_;

	Package sum() const {
		return std::accumulate(
			packages_.begin(),
			packages_.end(),
			Package()
		);
	}
};

Knapsack boundedPack(const std::vector<Package>& packages, const size_t max_weight) {
	const size_t itemCount = packages.size();

	// Initial knapsacks with 0 packages
	std::vector<Knapsack> vec(max_weight + 1);

	// Pack
	for (size_t i = 0; i < itemCount; ++i) {
		std::vector<Knapsack> newVec(max_weight + 1);
		const std::vector<Knapsack>& prevVec = vec;

		const Package& currentPackage = packages[i];
		for (size_t j = 0; j <= max_weight; ++j) {
			if (currentPackage.weight > j) {
				newVec[j] = prevVec[j];
			} else {
				if (prevVec[j].value() > (prevVec[j - currentPackage.weight].value() + currentPackage.value)) {
					newVec[j] = prevVec[j];
				} else {
					newVec[j] = prevVec[j - currentPackage.weight];
					newVec[j].addPackage(currentPackage);
				}
			}
		}
		vec = newVec;
	}

	return vec.back();
}

Knapsack unboundedPack(const std::vector<Package>& packages, const size_t max_weight) {
	const size_t itemCount = packages.size();

	// Initial knapsacks with 0 packages
	std::vector<Knapsack> vec(max_weight + 1);

	// Pack
	for (size_t i = 0; i < itemCount; ++i) {
		std::vector<Knapsack> newVec(max_weight + 1);
		const std::vector<Knapsack>& prevVec = vec;

		const Package& currentPackage = packages[i];
		for (size_t j = 0; j <= max_weight; ++j) {
			if (currentPackage.weight > j) {
				newVec[j] = prevVec[j];
			}
			else {
				Knapsack currentBag = prevVec[j];
				Knapsack prevBagWithThisItem = prevVec[j - currentPackage.weight];
				prevBagWithThisItem.addPackage(currentPackage);
				Knapsack currentBagWithThisItem = newVec[j - currentPackage.weight];
				currentBagWithThisItem.addPackage(currentPackage);

				// 3 way max choice
				if (currentBag.value() >= prevBagWithThisItem.value() && currentBag.value() >= currentBagWithThisItem.value()) {
					newVec[j] = currentBag;
				}
				else if (prevBagWithThisItem.value() >= currentBag.value() && prevBagWithThisItem.value() >= currentBagWithThisItem.value()) {
					newVec[j] = prevBagWithThisItem;
				}
				else {
					newVec[j] = currentBagWithThisItem;
				}
			}
		}
		vec = newVec;
	}

	return vec.back();
}

TEST_CASE("BoundedPack", "") {
	std::vector<Package> packages = {
		// weight, value
		Package(1, 1),
		Package(2, 3),
		Package(4, 5),
		Package(6, 3)
	};

	// 0 packages == empty sack
	REQUIRE(boundedPack(std::vector<Package>(), 15) == Knapsack());

	// packages all too heavy == empty sack
	REQUIRE(boundedPack(std::vector<Package>({
		Package(10, 1),
		Package(5, 1)
	}), 1) == Knapsack());

	Knapsack k = boundedPack(packages, 10);
	REQUIRE(k.value() == 9);
	REQUIRE(k.weight() == 7);

	std::vector<Package> revPackages(packages.rbegin(), packages.rend());
	k = boundedPack(revPackages, 10);
	REQUIRE(k.value() == 9);
	REQUIRE(k.weight() == 7);
}

TEST_CASE("UnboundedPack", "") {
	std::vector<Package> packages = {
		// weight, value
		Package(1, 1),
		Package(2, 3),
		Package(4, 5),
		Package(6, 3)
	};

	// 0 packages == empty sack
	REQUIRE(unboundedPack(std::vector<Package>(), 15) == Knapsack());

	// packages all too heavy == empty sack
	REQUIRE(unboundedPack(std::vector<Package>({
		Package(10, 1),
		Package(5, 1)
	}), 1) == Knapsack());

	Knapsack k = unboundedPack(packages, 10);
	REQUIRE(k.value() == 15);
	REQUIRE(k.weight() == 10);

	std::vector<Package> revPackages(packages.rbegin(), packages.rend());
	k = unboundedPack(revPackages, 10);
	REQUIRE(k.value() == 15);
	REQUIRE(k.weight() == 10);
}


text:
create table mad_all
select leg, site, hole, core, section, sample_depth, grain_density, porosity
from mad_001_096
union
select leg, site, hole, core, section, sample_depth, grain_density, porosity
from mad_100_312
union
select leg, site, hole, core, section, sample_depth, grain_density, porosity
from mad_317_360
order by 1, 2, 3, 5
;

# Create site list table
create table site_list
select distinct leg, site
from summary_all
order by 1, 2
;

# Select a site's site summary data
select *
from site_summary
where leg = 311
;

# Select a site's pore water data
select *
from iw_100_312
where site = 1327
;

# Combine DSDP, ODP, IODP, and Chikyu carbon tables to create carbon_all
# create table carbon_all
create table carbon_all
select leg, site, hole, sample_depth, total_carbon, organic_carbon, inorganic_carbon
from carbon_001_96
union
select leg, site, hole, sample_depth, total_carbon, organic_carbon, inorganic_carbon
from carbon_100_312
union
select leg, site, hole, sample_depth_csfb as sample_depth, total_carbon, organic_carbon_diff as organic_carbon, inorganic_carbon
from carbon_317_360
union
select leg, site, hole, sample_depth, 'total carbon content: EA, bulk [wt%]' as total_carbon, 'Rock Eval::TOC [wt%]' as organic_carbon, 'sects:inorganic carbon content: carbonate analyzer [wt%]' as inorganic_carbon
from carbon_chikyu
order by 1, 2, 3, 4
;

# Created dmg table (deleted pore water data afterward and added dMg column manually)
create table dMg
as select *
from iw_all
where site in ("U1378", "U1380", "U1414", "C0002")
;

# Created mg_isotopes table (from dmg table and dmg_copy with other isotope data)
create table mg_isotopes
as select dmg.`*`, dmg_copy.d26mg, dmg_copy.d26mg_2sd, dmg_copy.d25mg, dmg_copy.d25mg_2sd
from dmg left join dmg_copy
on dmg_copy.lab_id = dmg.lab_id
order by dmg_index
;

# Add site_key to age_depth
drop table if exists site_list
;
create temporary table site_list
as select distinct site_key, site
from site_info
;
create table age_depth2
as select s.site_key, a.*
from age_depth a left join site_list s
on a.site = s.site
;

# Get list of all sites/holes with both porewater mg data and age-depth data
DROP TABLE IF EXISTS `iw_sites`;
create temporary table iw_sites
as select site_key, group_concat(distinct hole) as holes, count(Mg) as Mg_data, count(Mg_ic) as Mg_ic_data, leg, site
from iw_all
where site_key is not null
group by leg, site
;
DROP TABLE IF EXISTS `ad_sites`;
create temporary table ad_sites
as select site_key, count(age) as Age_data
from age_depth
group by leg, site
;
select leg, site, holes, Age_data, Mg_data, Mg_ic_data
from iw_sites i inner join ad_sites ad
on i.site_key = ad.site_key
where Mg_data + Mg_ic_data > 2 and Age_data > 0
;

# Examine flux results and error
SELECT site_key, round(interface_flux*100,1), round(stdev_flux/median_flux*100,0)
FROM metadata_mg_flux
;

# Create table with all hard rock sites with Mg data > 2
DROP TABLE IF EXISTS `iw_sites`;
create temporary table iw_sites
as select leg, site, hole, count(Mg) as Mg_data, count(Mg_ic) as Mg_ic_data
from iw_all
where site_key is not null
group by leg, site, hole
;
DROP TABLE IF EXISTS `hr_holes`;
create temporary table hr_holes
as select distinct leg, site, hole
from hard_rock_holes
;
select hr.leg, hr.site, hr.hole, i.Mg_data, i.Mg_ic_data
from iw_sites i right outer join hr_holes hr
on i.leg = hr.leg and i.site=hr.site and (i.hole=hr.hole or (i.hole is null and hr.hole is null))
where i.Mg_data < 3
;

# All sites that have temp data but sed rates not yet calculated
DROP TABLE IF EXISTS `iw_sites`;
create temporary table iw_sites
as select site_key, group_concat(distinct hole) as holes, count(Mg) as Mg_data, count(Mg_ic) as Mg_ic_data, leg, site
from iw_all
where site_key is not null
group by leg, site
;
DROP TABLE IF EXISTS `ad_sites`;
create temporary table ad_sites
as select site_key, count(age) as Age_data
from age_depth
group by leg, site
;
DROP TABLE IF EXISTS `c_sites`;
create temporary table c_sites
as select i.site_key, leg, site, holes, Age_data, Mg_data, Mg_ic_data
from iw_sites i inner join ad_sites ad
on i.site_key = ad.site_key
;
DROP TABLE IF EXISTS `t_sites`;
create temporary table t_sites
as select cs.site_key, cs.leg, cs.site, cs.holes, cs.Age_data, cs.Mg_data, cs.Mg_ic_data, si.temp_gradient
from site_info si inner join c_sites cs
on si.site_key = cs.site_key
;
select ts.leg, ts.site, ts.holes, ts.Age_data, ts.Mg_data, ts.Mg_ic_data, ts.temp_gradient
from t_sites ts
left join metadata_sed_rate sr
on ts.site_key = sr.site_key
where sr.site_key is null
and ts.temp_gradient is not null
;

# Show site info and water depths
DROP TABLE IF EXISTS `sa`;
create temporary table sa
as select round(avg(water_depth),0) as water_dep, leg, site
from summary_all
group by leg, site
;
select i.site_key, i.leg, i.site, sa.water_dep, i.advection_rate, i.bottom_water_temp, i.temp_gradient, i.Comments
from site_info i join sa
on i.leg = sa.leg and i.site = sa.site
where sa.water_dep > 1500 and bottom_water_temp > 4.2
;

# Sites with age-depth curve fit but flux not yet calculated
DROP TABLE IF EXISTS `sr`;
create temporary table sr
as select leg, site
from metadata_sed_rate
;
select leg, site
from metadata_mg_flux mgf right join sr
on mgf.leg = sr.leg and mgf.site = sr.site
where sr.leg is null and sr.site is null
;

# Average values from metadata
select avg(interface_flux), avg(burial_flux), avg(sed_rate)
from metadata_mg_flux
;

# Create hole_info table by adding sed_depth and basement_pen to summary_all table
DROP TABLE IF EXISTS `hr`;
create temporary table hr
as select leg, site, hole, sed_thickness, basement_pen
from hard_rock_holes;

create table hole_info2
as select sa.*, hr.sed_thickness, hr.basement_pen
from summary_all sa left join hr
on sa.leg=hr.leg and sa.site=hr.site and (sa.hole=hr.hole or (sa.hole is null and hr.hole is null))
order by hole_key, site_key;

# Create table with all drilling sites with Mg data > 5
DROP TABLE IF EXISTS `iw_sites`;
create temporary table iw_sites
as select site, count(Mg) as Mg_data, count(Mg_ic) as Mg_ic_data
from iw_all
where site_key is not null
group by site
;
DROP TABLE IF EXISTS `coords`;
create temporary table coords
as select site, avg(lat) as alat, avg(lon) as alon
from summary_all
group by site
;
select c.site, c.alat, c.alon
from iw_sites i right outer join coords c
on i.site=c.site
where i.Mg_data+i.Mg_ic_data > 6
;

# Check if fluxes are reasonable compared with solid phase
select leg, site, round((interface_flux/sed_rate*196/1000)/((1-top_por)*2.5*1000)*100,1) as solid, sed_rate*100000, interface_flux*1000, gradient
from metadata_mg_flux
having solid > 10
;

# Check if fluxes are reasonable compared with GLOSS
select leg, site, hole, round((interface_flux/sed_rate*40.32/1000)/((1-top_por)*2.5*1000)*100,1) as solid, datapoints, sed_rate*100000, interface_flux*1000, gradient
from metadata_mg_flux
having solid > 2.5
;

# Site with Mg and Age-depth and porosity that have not yet been run
DROP TABLE IF EXISTS `iw_sites`;
create temporary table iw_sites
as select site_key, group_concat(distinct hole) as holes, count(Mg) as Mg_data, count(Mg_ic) as Mg_ic_data, leg, site
from iw_all
where site_key is not null
group by leg, site
;
DROP TABLE IF EXISTS `ad_sites`;
create temporary table ad_sites
as select site_key, count(age) as Age_data
from age_depth
group by leg, site
;
DROP TABLE IF EXISTS tt2;
create temporary table tt2
as select i.leg, i.site, i.holes, ad.Age_data, i.Mg_data, i.Mg_ic_data
from iw_sites i inner join ad_sites ad
on i.site_key = ad.site_key
where i.Mg_data + i.Mg_ic_data > 9 and ad.Age_data > 0
;
DROP TABLE IF EXISTS tt3;
create temporary table tt3
as select tt2.leg, tt2.site, tt2.holes, tt2.Age_data, tt2.Mg_data, tt2.Mg_ic_data
from tt2 left join metadata_mg_flux m
on tt2.leg = m.leg and tt2.site = m.site
where m.leg is null and m.site is null
;
DROP TABLE IF EXISTS tt4;
create temporary table tt4
as select distinct tt3.leg, tt3.site, tt3.holes, tt3.Age_data, tt3.Mg_data, tt3.Mg_ic_data
from tt3 left join mad_all ma
on tt3.leg = ma.leg and tt3.site = ma.site
where ma.leg is not null and ma.site is not null and tt3.site not in ('643','736','744','811','883','1031','U1381','U1407')
;

select distinct tt4.leg, tt4.site, tt4.holes, tt4.Age_data, tt4.Mg_data, tt4.Mg_ic_data
from tt4 left join metadata_sed_rate ms
on tt4.leg = ms.leg and tt4.site = ms.site
where ms.leg is null and ms.site is null and tt4.site not in ('643','736','744','811','883','1031','U1381','U1407')
;

# Get metadata for sites less than 250 m sediment thickness
select distinct mmf.*, sa.sed_thickness_combined
from summary_all sa right join metadata_mg_flux mmf
on sa.leg = mmf.leg and sa.site = mmf.site
where sa.sed_thickness_combined <=250
;

# eof


text:
/*
 * Copyright (C) 2004 EBI, GRL
 *
 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

package org.ensembl.healthcheck.testcase.generic;

import java.sql.Connection;

import org.ensembl.healthcheck.DatabaseRegistryEntry;
import org.ensembl.healthcheck.ReportManager;
import org.ensembl.healthcheck.Team;
import org.ensembl.healthcheck.testcase.SingleDatabaseTestCase;
import org.ensembl.healthcheck.util.DBUtils;

/**
 * Checks that meta_value for key assembly.name is not longer than 16 characters - the current display width limit on the website.
 */
public class AssemblyNameLength extends SingleDatabaseTestCase {

	public AssemblyNameLength() {

		addToGroup("pre-compara-handover");
                addToGroup("post-compara-handover");
                addToGroup("post-projection");
		setTeamResponsible(Team.GENEBUILD);
		setDescription("Check that meta_value for key assembly.name is not longer than 16 characters");
	}

	/**
	 * Checks that meta_value for key assembly.name is not longer than 16 characters.
	 *
	 * @param dbre
	 *          The database to check.
	 * @return True if the test passed.
	 */
	public boolean run(final DatabaseRegistryEntry dbre) {

		boolean result = true;

		Connection con = dbre.getConnection();

		int rows = DBUtils.getRowCount(con, "SELECT COUNT(*) FROM meta WHERE meta_key='assembly.name'");
		if (rows == 0) {
			ReportManager.problem(this, con, "No entry in meta table for assembly.name");
			return false;
		} else {
			int asemblyNameLength = Integer.valueOf(DBUtils.getRowColumnValue(con, "SELECT LENGTH(meta_value) FROM meta WHERE meta_key='assembly.name'")).intValue();

			if (asemblyNameLength > 16 ) {
				ReportManager.problem(this, con, "assembly.name value in Meta table is longer than 16 characters");
				return false;
			}

		}

		return result;

	} // run

} // AssemblyNameLength


text:
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//	http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package ipv4_entry_test

import (
	"context"
	"fmt"
	"testing"
	"time"

	"github.com/openconfig/featureprofiles/internal/attrs"
	"github.com/openconfig/featureprofiles/internal/deviations"
	"github.com/openconfig/featureprofiles/internal/fptest"
	"github.com/openconfig/featureprofiles/internal/gribi"
	"github.com/openconfig/gribigo/chk"
	"github.com/openconfig/gribigo/client"
	"github.com/openconfig/gribigo/constants"
	"github.com/openconfig/gribigo/fluent"
	"github.com/openconfig/ondatra"
	"github.com/openconfig/ondatra/gnmi"
)

const (
	// Next-hop group ID for dstPfx
	nhgID = 42
	// Next-hop 1 ID for dutPort2
	nh1ID = 43
	// Next-hop 2 ID for dutPort3
	nh2ID = 44
	// Unconfigured next-hop ID
	badNH = 45
	// Unconfigured static MAC address
	badMAC = "02:00:00:00:00:01"
)

const (
	// Destination prefix for DUT to ATE traffic.
	dstPfx      = "198.51.100.0/24"
	dstPfxMin   = "198.51.100.0"
	dstPfxMax   = "198.51.100.255"
	dstPfxCount = 256
)

var (
	dutPort1 = attrs.Attributes{
		Desc:    "DUT Port 1",
		IPv4:    "192.0.2.1",
		IPv4Len: 30,
	}
	dutPort2 = attrs.Attributes{
		Desc:    "DUT Port 2",
		IPv4:    "192.0.2.5",
		IPv4Len: 30,
	}
	dutPort3 = attrs.Attributes{
		Desc:    "DUT Port 3",
		IPv4:    "192.0.2.9",
		IPv4Len: 30,
	}

	atePort1 = attrs.Attributes{
		Name:    "atePort1",
		Desc:    "ATE Port 1",
		IPv4:    "192.0.2.2",
		IPv4Len: 30,
	}
	atePort2 = attrs.Attributes{
		Name:    "atePort2",
		Desc:    "ATE Port 2",
		IPv4:    "192.0.2.6",
		IPv4Len: 30,
	}
	atePort3 = attrs.Attributes{
		Name:    "atePort3",
		Desc:    "ATE Port 3",
		IPv4:    "192.0.2.10",
		IPv4Len: 30,
	}
)

func TestMain(m *testing.M) {
	fptest.RunTests(m)
}

// TestIPv4Entry tests a single IPv4Entry forwarding entry.
func TestIPv4Entry(t *testing.T) {
	ctx := context.Background()

	dut := ondatra.DUT(t, "dut")
	configureDUT(t, dut)

	gribic := dut.RawAPIs().GRIBI().Default(t)

	ate := ondatra.ATE(t, "ate")
	ateTop := configureATE(t, ate)

	port2Flow := createFlow("Port 1 to Port 2", ate, ateTop, &atePort2)
	port3Flow := createFlow("Port 1 to Port 3", ate, ateTop, &atePort3)
	ecmpFlow := createFlow("Port 1 to Port 2 & 3", ate, ateTop, &atePort2, &atePort3)

	cases := []struct {
		desc                 string
		entries              []fluent.GRIBIEntry
		downPort             *ondatra.Port
		wantGoodFlows        []*ondatra.Flow
		wantBadFlows         []*ondatra.Flow
		wantOperationResults []*client.OpResult
	}{
		{
			desc: "Single next-hop",
			entries: []fluent.GRIBIEntry{
				fluent.NextHopEntry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithIndex(nh1ID).WithIPAddress(atePort2.IPv4),
				fluent.NextHopGroupEntry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithID(nhgID).AddNextHop(nh1ID, 1),
				fluent.IPv4Entry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithPrefix(dstPfx).WithNextHopGroup(nhgID),
			},
			wantGoodFlows: []*ondatra.Flow{port2Flow},
			wantBadFlows:  []*ondatra.Flow{port3Flow},
			wantOperationResults: []*client.OpResult{
				fluent.OperationResult().
					WithNextHopOperation(nh1ID).
					WithProgrammingResult(fluent.InstalledInFIB).
					WithOperationType(constants.Add).
					AsResult(),
				fluent.OperationResult().
					WithNextHopGroupOperation(nhgID).
					WithProgrammingResult(fluent.InstalledInFIB).
					WithOperationType(constants.Add).
					AsResult(),
				fluent.OperationResult().
					WithIPv4Operation(dstPfx).
					WithProgrammingResult(fluent.InstalledInFIB).
					WithOperationType(constants.Add).
					AsResult(),
			},
		},
		{
			desc: "Multiple next-hops",
			entries: []fluent.GRIBIEntry{
				fluent.NextHopEntry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithIndex(nh1ID).WithIPAddress(atePort2.IPv4),
				fluent.NextHopEntry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithIndex(nh2ID).WithIPAddress(atePort3.IPv4),
				fluent.NextHopGroupEntry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithID(nhgID).AddNextHop(nh1ID, 1).AddNextHop(nh2ID, 1),
				fluent.IPv4Entry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithPrefix(dstPfx).WithNextHopGroup(nhgID),
			},
			wantGoodFlows: []*ondatra.Flow{ecmpFlow},
			wantOperationResults: []*client.OpResult{
				fluent.OperationResult().
					WithNextHopOperation(nh1ID).
					WithProgrammingResult(fluent.InstalledInFIB).
					WithOperationType(constants.Add).
					AsResult(),
				fluent.OperationResult().
					WithNextHopOperation(nh2ID).
					WithProgrammingResult(fluent.InstalledInFIB).
					WithOperationType(constants.Add).
					AsResult(),
				fluent.OperationResult().
					WithNextHopGroupOperation(nhgID).
					WithProgrammingResult(fluent.InstalledInFIB).
					WithOperationType(constants.Add).
					AsResult(),
				fluent.OperationResult().
					WithIPv4Operation(dstPfx).
					WithProgrammingResult(fluent.InstalledInFIB).
					WithOperationType(constants.Add).
					AsResult(),
			},
		},
		{
			desc: "Nonexistant next-hop",
			entries: []fluent.GRIBIEntry{
				fluent.NextHopGroupEntry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithID(nhgID).AddNextHop(badNH, 1),
				fluent.IPv4Entry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithPrefix(dstPfx).WithNextHopGroup(nhgID),
			},
			wantBadFlows: []*ondatra.Flow{port2Flow, port3Flow},
			wantOperationResults: []*client.OpResult{
				fluent.OperationResult().
					WithNextHopGroupOperation(nhgID).
					WithProgrammingResult(fluent.ProgrammingFailed).
					WithOperationType(constants.Add).
					AsResult(),
				fluent.OperationResult().
					WithIPv4Operation(dstPfx).
					WithProgrammingResult(fluent.ProgrammingFailed).
					WithOperationType(constants.Add).
					AsResult(),
			},
		},
		{
			desc:     "Downed next-hop interface",
			downPort: ate.Port(t, "port2"),
			entries: []fluent.GRIBIEntry{
				fluent.NextHopEntry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithIndex(nh1ID).WithIPAddress(atePort2.IPv4).
					WithInterfaceRef(dut.Port(t, "port2").Name()).WithMacAddress(badMAC),
				fluent.NextHopGroupEntry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithID(nhgID).AddNextHop(nh1ID, 1),
				fluent.IPv4Entry().WithNetworkInstance(*deviations.DefaultNetworkInstance).
					WithPrefix(dstPfx).WithNextHopGroup(nhgID),
			},
			wantBadFlows: []*ondatra.Flow{port2Flow, port3Flow},
			wantOperationResults: []*client.OpResult{
				fluent.OperationResult().
					WithNextHopOperation(nh1ID).
					WithProgrammingResult(fluent.InstalledInFIB).
					WithOperationType(constants.Add).
					AsResult(),
				fluent.OperationResult().
					WithNextHopGroupOperation(nhgID).
					WithProgrammingResult(fluent.InstalledInFIB).
					WithOperationType(constants.Add).
					AsResult(),
				fluent.OperationResult().
					WithIPv4Operation(dstPfx).
					WithProgrammingResult(fluent.InstalledInFIB).
					WithOperationType(constants.Add).
					AsResult(),
			},
		},
	}

	const (
		usePreserve = "PRESERVE"
		useDelete   = "DELETE"
	)

	// Each case will run with its own gRIBI fluent client.
	for _, persist := range []string{usePreserve, useDelete} {
		t.Run(fmt.Sprintf("Persistence=%s", persist), func(t *testing.T) {
			if *deviations.GRIBIPreserveOnly && persist == useDelete {
				t.Skip("Skipping due to --deviation_gribi_preserve_only")
			}

			for _, tc := range cases {
				t.Run(tc.desc, func(t *testing.T) {
					// Configure the gRIBI client.
					c := fluent.NewClient()
					conn := c.Connection().
						WithStub(gribic).
						WithRedundancyMode(fluent.ElectedPrimaryClient).
						WithInitialElectionID(1 /* low */, 0 /* hi */) // ID must be > 0.
					if persist == usePreserve {
						conn.WithPersistence()
					}

					if !*deviations.GRIBIRIBAckOnly {
						// The main difference WithFIBACK() made was that we are now expecting
						// fluent.InstalledInFIB in []*client.OpResult, as opposed to
						// fluent.InstalledInRIB.
						conn.WithFIBACK()
					}

					c.Start(ctx, t)
					defer c.Stop(t)
					c.StartSending(ctx, t)
					if err := awaitTimeout(ctx, c, t, time.Minute); err != nil {
						t.Fatalf("Await got error during session negotiation: %v", err)
					}
					gribi.BecomeLeader(t, c)

					if persist == usePreserve {
						defer func() {
							if err := gribi.FlushAll(c); err != nil {
								t.Errorf("Cannot flush: %v", err)
							}
						}()
					}

					if tc.downPort != nil {
						ate.Actions().NewSetPortState().WithPort(tc.downPort).WithEnabled(false).Send(t)
						defer ate.Actions().NewSetPortState().WithPort(tc.downPort).WithEnabled(true).Send(t)
					}

					c.Modify().AddEntry(t, tc.entries...)
					if err := awaitTimeout(ctx, c, t, time.Minute); err != nil {
						t.Fatalf("Await got error for entries: %v", err)
					}
					defer func() {
						// Delete should reverse the order of entries, i.e. IPv4Entry must be removed
						// before NextHopGroupEntry, which must be removed before NextHopEntry.
						var revEntries []fluent.GRIBIEntry
						for i := len(tc.entries) - 1; i >= 0; i-- {
							revEntries = append(revEntries, tc.entries[i])
						}
						c.Modify().DeleteEntry(t, revEntries...)
						if err := awaitTimeout(ctx, c, t, time.Minute); err != nil {
							t.Fatalf("Await got error for entries: %v", err)
						}
					}()

					for _, wantResult := range tc.wantOperationResults {
						chk.HasResult(t, c.Results(t), wantResult, chk.IgnoreOperationID())
					}

					validateTrafficFlows(t, ate, tc.wantGoodFlows, tc.wantBadFlows)
				})
			}
		})
	}
}

// configureDUT configures port1-3 on the DUT.
func configureDUT(t *testing.T, dut *ondatra.DUTDevice) {
	d := gnmi.OC()

	p1 := dut.Port(t, "port1")
	p2 := dut.Port(t, "port2")
	p3 := dut.Port(t, "port3")

	gnmi.Replace(t, dut, d.Interface(p1.Name()).Config(), dutPort1.NewOCInterface(p1.Name()))
	gnmi.Replace(t, dut, d.Interface(p2.Name()).Config(), dutPort2.NewOCInterface(p2.Name()))
	gnmi.Replace(t, dut, d.Interface(p3.Name()).Config(), dutPort3.NewOCInterface(p3.Name()))
}

// configreATE configures port1-3 on the ATE.
func configureATE(t *testing.T, ate *ondatra.ATEDevice) *ondatra.ATETopology {
	top := ate.Topology().New()

	p1 := ate.Port(t, "port1")
	p2 := ate.Port(t, "port2")
	p3 := ate.Port(t, "port3")

	atePort1.AddToATE(top, p1, &dutPort1)
	atePort2.AddToATE(top, p2, &dutPort2)
	atePort3.AddToATE(top, p3, &dutPort3)

	top.Push(t).StartProtocols(t)

	return top
}

// createFlow returns a flow from atePort1 to the dstPfx, expected to arrive on ATE interface dsts.
func createFlow(name string, ate *ondatra.ATEDevice, ateTop *ondatra.ATETopology, dsts ...*attrs.Attributes) *ondatra.Flow {
	hdr := ondatra.NewIPv4Header()
	hdr.WithSrcAddress(dutPort1.IPv4).
		DstAddressRange().WithMin(dstPfxMin).WithMax(dstPfxMax).WithCount(dstPfxCount)

	endpoints := []ondatra.Endpoint{}
	for _, dst := range dsts {
		endpoints = append(endpoints, ateTop.Interfaces()[dst.Name])
	}

	flow := ate.Traffic().NewFlow(name).
		WithSrcEndpoints(ateTop.Interfaces()[atePort1.Name]).
		WithDstEndpoints(endpoints...).
		WithHeaders(ondatra.NewEthernetHeader(), hdr)

	return flow
}

func validateTrafficFlows(t *testing.T, ate *ondatra.ATEDevice, good []*ondatra.Flow, bad []*ondatra.Flow) {
	if len(good) == 0 && len(bad) == 0 {
		return
	}

	flows := append(good, bad...)
	ate.Traffic().Start(t, flows...)
	time.Sleep(15 * time.Second)
	ate.Traffic().Stop(t)

	for _, flow := range good {
		if got := gnmi.Get(t, ate, gnmi.OC().Flow(flow.Name()).LossPct().State()); got > 0 {
			t.Fatalf("LossPct for flow %s: got %g, want 0", flow.Name(), got)
		}
	}

	for _, flow := range bad {
		if got := gnmi.Get(t, ate, gnmi.OC().Flow(flow.Name()).LossPct().State()); got < 100 {
			t.Fatalf("LossPct for flow %s: got %g, want 100", flow.Name(), got)
		}
	}
}

// awaitTimeout calls a fluent client Await, adding a timeout to the context.
func awaitTimeout(ctx context.Context, c *fluent.GRIBIClient, t testing.TB, timeout time.Duration) error {
	subctx, cancel := context.WithTimeout(ctx, timeout)
	defer cancel()
	return c.Await(subctx, t)
}


text:
class BehaviorProfilesController < ProfilesController
  def profile_params
    params.require(:behavior_profile).permit(:key, :type, :name, :curve, :public)
  end
end


text:
#!/usr/bin/env python3

# Copyright 2016 Conchylicultor. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

"""
Some utilities functions, to easily manipulate large volume of downloaded files.
Independent of the main program but useful to extract/create the dataset
"""

import os
import subprocess
import glob

def extract_files():
    """ Recursively extract all files from a given directory
    """
    input_dir = '../www.chopinmusic.net/'
    output_dir = 'chopin_clean/'

    os.makedirs(output_dir, exist_ok=True)

    print('Extracting:')
    i = 0
    for filename in glob.iglob(os.path.join(input_dir, '**/*.mid'), recursive=True):
        print(filename)
        os.rename(filename, os.path.join(output_dir, os.path.basename(filename)))
        i += 1
    print('{} files extracted.'.format(i))

def rename_files():
    """ Rename all files of the given directory following some rules
    """
    input_dir = 'chopin/'
    output_dir = 'chopin_clean/'

    assert os.path.exists(input_dir)
    os.makedirs(output_dir, exist_ok=True)

    list_files = [f for f in os.listdir(input_dir) if f.endswith('.mid')]

    print('Renaming {} files:'.format(len(list_files)))
    for prev_name in list_files:
        new_name = prev_name.replace('midi.asp?file=', '')
        new_name = new_name.replace('%2F', '_')
        print('{} -> {}'.format(prev_name, new_name))
        os.rename(os.path.join(input_dir, prev_name), os.path.join(output_dir, new_name))

def convert_midi2mp3():
    """ Convert all midi files of the given directory to mp3
    """
    input_dir = 'docs/midi/'
    output_dir = 'docs/mp3/'

    assert os.path.exists(input_dir)
    os.makedirs(output_dir, exist_ok=True)

    print('Converting:')
    i = 0
    for filename in glob.iglob(os.path.join(input_dir, '**/*.mid'), recursive=True):
        print(filename)
        in_name = filename
        out_name = os.path.join(output_dir, os.path.splitext(os.path.basename(filename))[0] + '.mp3')
        command = 'timidity {} -Ow -o - | ffmpeg -i - -acodec libmp3lame -ab 64k {}'.format(in_name, out_name)  # TODO: Redirect stdout to avoid polluting the screen (have cleaner printing)
        subprocess.call(command, shell=True)
        i += 1
    print('{} files converted.'.format(i))

if __name__ == '__main__':
    convert_midi2mp3()


text:
(function(module) {
  var homeController = {};

  homeController.index = function() {
    $('.content-to-toggle').hide();
    $('#projects').fadeIn();
    $('hr:eq(5)').hide();
  };

  module.homeController = homeController;
})(window);


text:
/*!
  \class SoVBO
  \brief The SoVBO class is used to handle OpenGL vertex buffer objects.

  It wraps the buffer handling, taking care of multi-context handling
  and allocation/deallocation of buffers. FIXME: more doc.

*/

#include "rendering/SoVBO.h"

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

#include <Inventor/misc/SoContextHandler.h>
#include <Inventor/misc/SoGLDriverDatabase.h>
#include <Inventor/elements/SoGLCacheContextElement.h>
#include <Inventor/elements/SoShapeStyleElement.h>
#include <Inventor/C/tidbits.h>
#include <Inventor/SbVec3f.h>
#include <Inventor/errors/SoDebugError.h>

#include "rendering/SoVertexArrayIndexer.h"
#include "threads/threadsutilp.h"
#include "glue/glp.h"
#include "tidbitsp.h"

static int vbo_vertex_count_min_limit = -1;
static int vbo_vertex_count_max_limit = -1;
static int vbo_render_as_vertex_arrays = -1;
static int vbo_enabled = -1;
static int vbo_debug = -1;

// VBO rendering seems to be faster than other rendering, even for
// large VBOs. Just set the default limit very high
static const int DEFAULT_MAX_LIMIT = 100000000;
static const int DEFAULT_MIN_LIMIT = 20;

static SbHash<uint32_t, SbBool> * vbo_isfast_hash;

/*!
  Constructor
*/
SoVBO::SoVBO(const GLenum target, const GLenum usage)
  : target(target),
    usage(usage),
    data(NULL),
    datasize(0),
    dataid(0),
    didalloc(FALSE),
    vbohash(5)
{
  SoContextHandler::addContextDestructionCallback(context_destruction_cb, this);
}

//
// Callback from SoGLCacheContextElement
//
void
SoVBO::vbo_delete(void * closure, uint32_t contextid)
{
  const cc_glglue * glue = cc_glglue_instance((int) contextid);
  GLuint id = (GLuint) ((uintptr_t) closure);
  cc_glglue_glDeleteBuffers(glue, 1, &id);
}

/*!
  Destructor
*/
SoVBO::~SoVBO()
{
  SoContextHandler::removeContextDestructionCallback(context_destruction_cb, this);
  // schedule delete for all allocated GL resources
  for(
      SbHash<uint32_t, GLuint>::const_iterator iter =
       this->vbohash.const_begin();
      iter!=this->vbohash.const_end();
      ++iter
      )
    {
      void * ptr = (void*) ((uintptr_t) iter->obj);
      SoGLCacheContextElement::scheduleDeleteCallback(iter->key, SoVBO::vbo_delete, ptr);
  }

  if (this->didalloc) {
    char * ptr = (char*) this->data;
    delete[] ptr;
  }
}

// atexit cleanup function
static void vbo_atexit_cleanup(void)
{
  delete vbo_isfast_hash;
  vbo_isfast_hash = NULL;
  vbo_vertex_count_min_limit = -1;
  vbo_vertex_count_max_limit = -1;
  vbo_render_as_vertex_arrays = -1;
  vbo_enabled = -1;
}

void
SoVBO::init(void)
{
  coin_glglue_add_instance_created_callback(context_created, NULL);

  vbo_isfast_hash = new SbHash<uint32_t, SbBool> (3);
  coin_atexit(vbo_atexit_cleanup, CC_ATEXIT_NORMAL);

  // use COIN_VBO_MAX_LIMIT to set the largest VBO we create
  if (vbo_vertex_count_max_limit < 0) {
    const char * env = coin_getenv("COIN_VBO_MAX_LIMIT");
    if (env) {
      vbo_vertex_count_max_limit = atoi(env);
    }
    else {
      vbo_vertex_count_max_limit = DEFAULT_MAX_LIMIT;
    }
  }

  // use COIN_VBO_MIN_LIMIT to set the smallest VBO we create
  if (vbo_vertex_count_min_limit < 0) {
    const char * env = coin_getenv("COIN_VBO_MIN_LIMIT");
    if (env) {
      vbo_vertex_count_min_limit = atoi(env);
    }
    else {
      vbo_vertex_count_min_limit = DEFAULT_MIN_LIMIT;
    }
  }

  // use COIN_VERTEX_ARRAYS to globally disable vertex array rendering
  if (vbo_render_as_vertex_arrays < 0) {
    const char * env = coin_getenv("COIN_VERTEX_ARRAYS");
    if (env) {
      vbo_render_as_vertex_arrays = atoi(env);
    }
    else {
      vbo_render_as_vertex_arrays = 1;
    }
  }

  // use COIN_VBO to globally disable VBOs when doing vertex array rendering
  if (vbo_enabled < 0) {
    const char * env = coin_getenv("COIN_VBO");
    if (env) {
      vbo_enabled = atoi(env);
    }
    else {
      vbo_enabled = 1;
    }
  }
  if (vbo_debug < 0) {
    const char * env = coin_getenv("COIN_DEBUG_VBO");
    if (env) {
      vbo_debug = atoi(env);
    }
    else {
      vbo_debug = 0;
    }
  }
}

/*!
  Used to allocate buffer data. The user is responsible for filling in
  the correct type of data in the buffer before the buffer is used.

  \sa setBufferData()
*/
void *
SoVBO::allocBufferData(intptr_t size, SbUniqueId dataid)
{
  // schedule delete for all allocated GL resources
  for(
      SbHash<uint32_t, GLuint>::const_iterator iter =
       this->vbohash.const_begin();
      iter!=this->vbohash.const_end();
      ++iter
      ) {
    void * ptr = (void*) ((uintptr_t) iter->obj);
    SoGLCacheContextElement::scheduleDeleteCallback(iter->key, SoVBO::vbo_delete, ptr);
  }

  // clear hash table
  this->vbohash.clear();

  if (this->didalloc && this->datasize == size) {
    return (void*)this->data;
  }
  if (this->didalloc) {
    char * ptr = (char*) this->data;
    delete[] ptr;
  }

  char * ptr = new char[size];
  this->didalloc = TRUE;
  this->data = (const GLvoid*) ptr;
  this->datasize = size;
  this->dataid = dataid;
  return (void*) this->data;
}

/*!
  Sets the buffer data. \a dataid is a unique id used to identify
  the buffer data. In Coin it's possible to use the node id
  (SoNode::getNodeId()) to test if a buffer is valid for a node.
*/
void
SoVBO::setBufferData(const GLvoid * data, intptr_t size, SbUniqueId dataid)
{
  // schedule delete for all allocated GL resources
  for(
      SbHash<uint32_t, GLuint>::const_iterator iter =
       this->vbohash.const_begin();
      iter!=this->vbohash.const_end();
      ++iter
      ) {
    void * ptr = (void*) ((uintptr_t) iter->obj);
    SoGLCacheContextElement::scheduleDeleteCallback(iter->key, SoVBO::vbo_delete, ptr);
  }

  // clear hash table
  this->vbohash.clear();

  // clean up old buffer (if any)
  if (this->didalloc) {
    char * ptr = (char*) this->data;
    delete[] ptr;
  }

  this->data = data;
  this->datasize = size;
  this->dataid = dataid;
  this->didalloc = FALSE;
}

/*!
  Returns the buffer data id.

  \sa setBufferData()
*/
SbUniqueId
SoVBO::getBufferDataId(void) const
{
  return this->dataid;
}

/*!
  Returns the data pointer and size.
*/
void
SoVBO::getBufferData(const GLvoid *& data, intptr_t & size)
{
  data = this->data;
  size = this->datasize;
}

/*!
  Binds the buffer for the context \a contextid.
*/
void
SoVBO::bindBuffer(uint32_t contextid)
{
  if ((this->data == NULL) ||
      (this->datasize == 0)) {
    assert(0 && "no data in buffer");
    return;
  }

  const cc_glglue * glue = cc_glglue_instance((int) contextid);

  GLuint buffer;
  if (!this->vbohash.get(contextid, buffer)) {
    // need to create a new buffer for this context
    cc_glglue_glGenBuffers(glue, 1, &buffer);
    cc_glglue_glBindBuffer(glue, this->target, buffer);
    cc_glglue_glBufferData(glue, this->target,
                           this->datasize,
                           this->data,
                           this->usage);
    this->vbohash.put(contextid, buffer);
  }
  else {
    // buffer already exists, bind it
    cc_glglue_glBindBuffer(glue, this->target, buffer);
  }

#if COIN_DEBUG
  if (vbo_debug) {
    if (this->target == GL_ELEMENT_ARRAY_BUFFER) {
      SoDebugError::postInfo("SoVBO::bindBuffer",
                             "Rendering using VBO. Index array size: %d",
                             this->datasize / sizeof(int32_t));
    }
    else {
      SoDebugError::postInfo("SoVBO::bindBuffer",
                             "Setting up buffer for rendering. Datasize: %d",
                             this->datasize);
    }
  }
#endif // COIN_DEBUG
}

//
// Callback from SoContextHandler
//
void
SoVBO::context_destruction_cb(uint32_t context, void * userdata)
{
  GLuint buffer;
  SoVBO * thisp = (SoVBO*) userdata;

  if (thisp->vbohash.get(context, buffer)) {
    const cc_glglue * glue = cc_glglue_instance((int) context);
    cc_glglue_glDeleteBuffers(glue, 1, &buffer);
    thisp->vbohash.erase(context);
  }
}

/*!
  Sets the global limits on the number of vertex data in a node before
  vertex buffer objects are considered to be used for rendering.
*/
void
SoVBO::setVertexCountLimits(const int minlimit, const int maxlimit)
{
  vbo_vertex_count_min_limit = minlimit;
  vbo_vertex_count_max_limit = maxlimit;
}

/*!
  Returns the vertex VBO minimum limit.

  \sa setVertexCountLimits()
 */
int
SoVBO::getVertexCountMinLimit(void)
{
  return vbo_vertex_count_min_limit;
}

/*!
  Returns the vertex VBO maximum limit.

  \sa setVertexCountLimits()
 */
int
SoVBO::getVertexCountMaxLimit(void)
{
  return vbo_vertex_count_max_limit;
}

SbBool
SoVBO::shouldCreateVBO(SoState * state, const uint32_t contextid, const int numdata)
{
  if (!vbo_enabled || !vbo_render_as_vertex_arrays) return FALSE;
  int minv = SoVBO::getVertexCountMinLimit();
  int maxv = SoVBO::getVertexCountMaxLimit();
  return
    (numdata >= minv) &&
    (numdata <= maxv) &&
    SoVBO::isVBOFast(contextid) &&
    !(SoShapeStyleElement::get(state)->getFlags() & SoShapeStyleElement::SHADOWMAP);

}

SbBool
SoVBO::shouldRenderAsVertexArrays(SoState * COIN_UNUSED_ARG(state),
                                  const uint32_t COIN_UNUSED_ARG(contextid),
                                  const int numdata)
{
  // FIXME: consider also using results from the performance tests

  // don't render as vertex arrays if there are very few elements to
  // be rendered. The VA setup overhead would make it slower than just
  // doing plain immediate mode rendering.
  return (numdata >= vbo_vertex_count_min_limit) && vbo_render_as_vertex_arrays;
}

SbBool
SoVBO::isVBOFast(const uint32_t contextid)
{
  SbBool result = TRUE;
  assert(vbo_isfast_hash != NULL);
  (void) vbo_isfast_hash->get(contextid, result);
  return result;
}

//
// callback from glglue (when a new glglue instance is created)
//
void
SoVBO::context_created(const uint32_t contextid, void * COIN_UNUSED_ARG(closure))
{
  SoVBO::testGLPerformance(contextid);
}

//
// test OpenGL performance for a context.
//
void
SoVBO::testGLPerformance(const uint32_t contextid)
{
  SbBool isfast;
  // did we alreay test this for this context?
  assert(vbo_isfast_hash != NULL);
  if (vbo_isfast_hash->get(contextid, isfast)) return;

  // Run time test disabled. Our old test seemed to be buggy, and
  // VBO should be fast on all platforms supporting it now. It was
  // really just one obscure laptop driver that caused problems for
  // us. This should be handled in the driver database anyway
  const cc_glglue * glue = cc_glglue_instance(contextid);
  if (SoGLDriverDatabase::isSupported(glue, SO_GL_VERTEX_BUFFER_OBJECT)) {
    vbo_isfast_hash->put(contextid, TRUE);
  }
  else {
    vbo_isfast_hash->put(contextid, FALSE);
  }
}


text:
<!--===========================================================================
  This is the build file for the HDP 1.3 Shim modules.

  See ../build-res/subfloor.xml for more details
============================================================================-->
<project name="pentaho-hadoop-shims-hdp20" basedir="." default="dist"
  xmlns:ivy="antlib:org.apache.ivy.ant" >

  <description>
    This build file is used to create the HDP1.3 Shim module for the Big Data plugin
    and is based off Subfloor (../build-res/subfloor.xml)
  </description>

  <import file="../common-shims-build.xml"/>

  <target name="clean-jars" depends="subfloor.clean-jars" >
    <delete dir="${lib.provided.dir}"/>
  </target>

  <target name="resolve" depends="subfloor.resolve">
    <copy todir="lib" >
      <fileset dir="lib-dist" />
    </copy>
  </target>

  <!--=======================================================================
      create-dot-classpath

      Creates the Eclipse .classpath file from the resolved
      classpath from Ant.
    ====================================================================-->
  <target name="create-dot-classpath" depends="install-pentaho-ant-tasks,init">
    <dot-classpath>
      <!-- Include all lib dirs -->
      <classpath>
        <fileset dir="${devlib.dir}">
          <include name="*.jar" />
        </fileset>
        <fileset dir="${testlib.dir}">
          <include name="*.jar" />
        </fileset>
        <fileset dir="${lib.dir}">
          <include name="**/*.jar" />
        </fileset>
      	<fileset dir="${lib.provided.dir}">
          <include name="**/*.jar" />
        </fileset>
      </classpath>
    </dot-classpath>
  </target>
</project>