text:
package org.kie.workbench.common.services.datamodeller.parser;

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

import org.junit.Test;
import org.kie.workbench.common.services.datamodeller.parser.descr.ClassOrInterfaceTypeDescr;
import org.kie.workbench.common.services.datamodeller.parser.descr.DimensionDescr;
import org.kie.workbench.common.services.datamodeller.parser.descr.ElementDescriptor;
import org.kie.workbench.common.services.datamodeller.parser.descr.EllipsisParameterDescr;
import org.kie.workbench.common.services.datamodeller.parser.descr.IdentifierDescr;
import org.kie.workbench.common.services.datamodeller.parser.descr.JavaTokenDescr;
import org.kie.workbench.common.services.datamodeller.parser.descr.MethodDescr;
import org.kie.workbench.common.services.datamodeller.parser.descr.ModifierDescr;
import org.kie.workbench.common.services.datamodeller.parser.descr.ModifierListDescr;
import org.kie.workbench.common.services.datamodeller.parser.descr.NormalParameterDescr;
import org.kie.workbench.common.services.datamodeller.parser.descr.ParameterListDescr;
import org.kie.workbench.common.services.datamodeller.parser.descr.PrimitiveTypeDescr;
import org.kie.workbench.common.services.datamodeller.parser.descr.TypeDescr;
import org.kie.workbench.common.services.datamodeller.parser.util.ParserUtil;

import static org.junit.Assert.*;
import static org.kie.workbench.common.services.datamodeller.parser.ParserAssert.*;

public class MehodParsing1Test extends JavaParserBaseTest {

    private List<MethodDescr> expectedMethods;

    private List<String> methodSentences;

    public MehodParsing1Test( ) {
        super( "MethodParsing1.java" );
        init( );
    }

    @Test
    public void testMethodsSentencesReading( ) {
        try {
            assertClass( );
            List<MethodDescr> methods = parser.getFileDescr( ).getClassDescr( ).getMethods( );
            int i = 0;
            for ( String methodSentence : methodSentences ) {
                assertEquals( methodSentences.get( i ), ParserUtil.readElement( buffer, methods.get( i ) ) );
                i++;
            }
        } catch ( Exception e ) {
            e.printStackTrace( );
            fail( "Test failed: " + e.getMessage( ) );
        }
    }

    @Test
    public void testClassMethods( ) {

        try {
            assertClass( );

            List<MethodDescr> methods = parser.getFileDescr( ).getClassDescr( ).getMethods( );
            assertEquals( expectedMethods.size( ), methods.size( ) );
            for ( int i = 0; i < expectedMethods.size( ); i++ ) {
                assertEqualsMethodDeclaration( buffer, expectedMethods.get( i ), methods.get( i ) );
            }

        } catch ( Exception e ) {
            e.printStackTrace( );
            fail( "Test failed: " + e.getMessage( ) );
        }

    }

    @Test
    public void testMethodParsingMode( ) {
        try {
            JavaParser parser;
            int i = 0;
            for ( String methodSentence : methodSentences ) {
                parser = JavaParserFactory.newParser( methodSentence, JavaParserBase.ParserMode.PARSE_METHOD );
                parser.methodDeclaration( );
                assertNotNull( parser.getMethodDescr( ) );
                assertEqualsMethodDeclaration( new StringBuffer( methodSentence ), expectedMethods.get( i ), parser.getMethodDescr( ) );
                i++;
            }
        } catch ( Exception e ) {
            e.printStackTrace( );
            fail( "Test failed: " + e.getMessage( ) );
        }
    }

    private void init( ) {

        methodSentences = new ArrayList<String>( );

        methodSentences.add( "public MethodParsing1() { this(null); }" );
        methodSentences.add( "public MethodParsing1(String field1) { this.field1 = field1; }" );
        methodSentences.add( "public MethodParsing1(int a, int b) { this(a, b, (byte)1); }" );
        methodSentences.add( "public MethodParsing1(int a, int b, byte c) { super(); }" );

        methodSentences.add( "public String getField1() { return field1; }" );
        methodSentences.add( "public void setField1(String field1) { this.field1 = field1; }" );
        methodSentences.add( "private int method1() { return -1; }" );
        methodSentences.add( "private void method2() {}" );
        methodSentences.add( "public static java.lang.String method3() { return null; }" );
        methodSentences.add( "public static final Integer method4() { return null; }" );
        methodSentences.add( "public void method5(java.lang.Integer param1, int param2) {}" );
        methodSentences.add( "java.util.List<java.lang.String> method6() { return null;    }" );
        methodSentences.add( "protected   java.util.AbstractList<String>    method7  ( final int   param1 ,  java.lang.Integer   param2  ,   java.util.List<java.lang.Integer>      param3      ) {    return  null  ;    }" );
        methodSentences.add( "int method8  ( final int   param1 ,  java.lang.Integer   param2   ) [  ]   [    ] { return null; }" );
        methodSentences.add( "int method9 ( final Object ...  param1) { return -1;}" );
        methodSentences.add( "private java.util.AbstractList<Object> method10  (  final java.lang.String param1,  int param2 , List<java.util.List<String>>...param3) { return null; }" );

        expectedMethods = new ArrayList<MethodDescr>( );

        MethodDescr method;
        NormalParameterDescr param1;
        NormalParameterDescr param2;
        NormalParameterDescr param3;
        EllipsisParameterDescr ellipsisParam;
        ParameterListDescr parmsList;

        //public MethodParsing1() { this(null); }
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "public" ) );
        method.setIdentifier( new IdentifierDescr( "MethodParsing1", -1, -1, -1, -1 ) );
        expectedMethods.add( method );

        //public MethodParsing1(String field1) { this.field1 = field1; }
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "public" ) );
        method.setIdentifier( new IdentifierDescr( "MethodParsing1", -1, -1, -1, -1 ) );

        param1 = new NormalParameterDescr( );
        //param1.setModifiers( new ModifierListDescr( ) );
        param1.setType( new TypeDescr( null, -1, -1 ) );
        param1.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "String", -1, -1 ) );
        param1.setIdentifier( new IdentifierDescr( "field1", -1, -1, -1, -1 ) );

        parmsList = new ParameterListDescr( );
        parmsList.addParameter( param1 );
        method.setParamsList( parmsList );
        expectedMethods.add( method );

        //public MethodParsing1(int a, int b) { this(a, b, (byte)1); }
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "public" ) );
        method.setIdentifier( new IdentifierDescr( "MethodParsing1", -1, -1, -1, -1 ) );

        param1 = new NormalParameterDescr( );
        //param1.setModifiers( new ModifierListDescr( ) );
        param1.setType( new TypeDescr( null, -1, -1 ) );
        param1.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "int" ) );
        param1.setIdentifier( new IdentifierDescr( "a", -1, -1, -1, -1 ) );

        param2 = new NormalParameterDescr( );
        //param2.setModifiers( new ModifierListDescr( ) );
        param2.setType( new TypeDescr( null, -1, -1 ) );
        param2.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "int" ) );
        param2.setIdentifier( new IdentifierDescr( "b", -1, -1, -1, -1 ) );

        parmsList = new ParameterListDescr( );
        parmsList.addParameter( param1 );
        parmsList.addParameter( param2 );
        method.setParamsList( parmsList );
        expectedMethods.add( method );

        //public MethodParsing1(int a, int b, byte c) { super(); }
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "public" ) );
        method.setIdentifier( new IdentifierDescr( "MethodParsing1", -1, -1, -1, -1 ) );

        param1 = new NormalParameterDescr( );
        //param1.setModifiers( new ModifierListDescr( ) );
        param1.setType( new TypeDescr( null, -1, -1 ) );
        param1.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "int" ) );
        param1.setIdentifier( new IdentifierDescr( "a", -1, -1, -1, -1 ) );

        param2 = new NormalParameterDescr( );
        //param2.setModifiers( new ModifierListDescr( ) );
        param2.setType( new TypeDescr( null, -1, -1 ) );
        param2.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "int" ) );
        param2.setIdentifier( new IdentifierDescr( "b", -1, -1, -1, -1 ) );

        param3 = new NormalParameterDescr( );
        //param3.setModifiers( new ModifierListDescr( ) );
        param3.setType( new TypeDescr( null, -1, -1 ) );
        param3.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "byte" ) );
        param3.setIdentifier( new IdentifierDescr( "c", -1, -1, -1, -1 ) );

        parmsList = new ParameterListDescr( );
        parmsList.addParameter( param1 );
        parmsList.addParameter( param2 );
        parmsList.addParameter( param3 );
        method.setParamsList( parmsList );
        expectedMethods.add( method );

        //"public String getField1() { return field1; }"
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "public" ) );
        method.setType( new TypeDescr( null, -1, -1 ) );
        method.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "String", -1, -1 ) );
        method.setIdentifier( new IdentifierDescr( "getField1", -1, -1, -1, -1 ) );
        expectedMethods.add( method );

        //"public void setField1(String field1) { this.field1 = field1; }"
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "public" ) );
        method.setType( new TypeDescr( ) );
        method.getType( ).setVoidType( new JavaTokenDescr( ElementDescriptor.ElementType.JAVA_VOID, "void", -1, -1, -1, -1 ) );
        method.setIdentifier( new IdentifierDescr( "setField1", -1, -1, -1, -1 ) );
        param1 = new NormalParameterDescr( );
        //param1.setModifiers( new ModifierListDescr( ) );
        param1.setType( new TypeDescr( null, -1, -1 ) );
        param1.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "String", -1, -1 ) );
        param1.setIdentifier( new IdentifierDescr( "field1", -1, -1, -1, -1 ) );

        parmsList = new ParameterListDescr( );
        parmsList.addParameter( param1 );
        method.setParamsList( parmsList );
        expectedMethods.add( method );

        //"private int method1() { return -1; }"
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "private" ) );
        method.setType( new TypeDescr( null, -1, -1 ) );
        method.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "int" ) );
        method.setIdentifier( new IdentifierDescr( "method1", -1, -1, -1, 1 ) );
        expectedMethods.add( method );

        //"private void method2() {}"
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "private" ) );
        method.setType( new TypeDescr( ) );
        method.getType( ).setVoidType( new JavaTokenDescr( ElementDescriptor.ElementType.JAVA_VOID, "void", -1, -1, -1, -1 ) );
        method.setIdentifier( new IdentifierDescr( "method2", -1, -1, -1, -1 ) );
        expectedMethods.add( method );

        //"public static java.lang.String method3() { return null; }"
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "public" ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "static" ) );
        method.setType( new TypeDescr( null, -1, -1 ) );
        method.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "java.lang.String", -1, -1 ) );
        method.setIdentifier( new IdentifierDescr( "method3", -1, -1, -1, -1 ) );
        expectedMethods.add( method );

        //"public static final Integer method4() { return null; }"
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "public" ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "static" ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "final" ) );
        method.setType( new TypeDescr( null, -1, -1 ) );
        method.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "Integer", -1, -1 ) );
        method.setIdentifier( new IdentifierDescr( "method4", -1, -1, -1, -1 ) );
        expectedMethods.add( method );

        //"public void method5(java.lang.Integer param1, int param2) {}"
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "public" ) );
        method.setType( new TypeDescr( ) );
        method.getType( ).setVoidType( new JavaTokenDescr( ElementDescriptor.ElementType.JAVA_VOID, "void", -1, -1, -1, -1 ) );
        method.setIdentifier( new IdentifierDescr( "method5", -1, -1, -1, -1 ) );
        param1 = new NormalParameterDescr( );
        //param1.setModifiers( new ModifierListDescr( ) );
        param1.setType( new TypeDescr( null, -1, -1 ) );
        param1.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "java.lang.Integer", -1, -1 ) );
        param1.setIdentifier( new IdentifierDescr( "param1", -1, -1, -1, -1 ) );

        param2 = new NormalParameterDescr( );
        //param2.setModifiers( new ModifierListDescr( ) );
        param2.setType( new TypeDescr( null, -1, -1 ) );
        param2.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "int" ) );
        param2.setIdentifier( new IdentifierDescr( "param2", -1, -1, -1, -1 ) );

        parmsList = new ParameterListDescr( );
        parmsList.addParameter( param1 );
        parmsList.addParameter( param2 );
        method.setParamsList( parmsList );

        expectedMethods.add( method );

        //"java.util.List<java.lang.String> method6() { return null;    }"
        method = new MethodDescr( null, -1, -1 );
        //method.setModifiers( new ModifierListDescr( ) );
        method.setType( new TypeDescr( null, -1, -1 ) );
        method.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "java.util.List<java.lang.String>", -1, -1 ) );
        method.setIdentifier( new IdentifierDescr( "method6", -1, -1, -1, -1 ) );
        expectedMethods.add( method );

        //"protected   java.util.AbstractList<String>    method7  ( final int   param1 ,  java.lang.Integer   param2  ,   java.util.List<java.lang.Integer>      param3      ) {    return  null  ;    }"
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "protected" ) );
        method.setType( new TypeDescr( null, -1, -1 ) );
        method.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "java.util.AbstractList<String>", -1, -1 ) );
        method.setIdentifier( new IdentifierDescr( "method7", -1, -1, -1, -1 ) );

        param1 = new NormalParameterDescr( );
        param1.setModifiers( new ModifierListDescr( ) );
        param1.addModifier( new ModifierDescr( null, -1, -1, "final" ) );
        param1.setType( new TypeDescr( null, -1, -1 ) );
        param1.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "int" ) );
        param1.setIdentifier( new IdentifierDescr( "param1", -1, -1, -1, -1 ) );

        param2 = new NormalParameterDescr( );
        //param2.setModifiers( new ModifierListDescr( ) );
        param2.setType( new TypeDescr( null, -1, -1 ) );
        param2.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "java.lang.Integer", -1, -1 ) );
        param2.setIdentifier( new IdentifierDescr( "param2", -1, -1, -1, -1 ) );

        param3 = new NormalParameterDescr( );
        //param3.setModifiers( new ModifierListDescr( ) );
        param3.setType( new TypeDescr( null, -1, -1 ) );
        param3.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "java.util.List<java.lang.Integer>", -1, -1 ) );
        param3.setIdentifier( new IdentifierDescr( "param3", -1, -1, -1, -1 ) );

        parmsList = new ParameterListDescr( );
        parmsList.addParameter( param1 );
        parmsList.addParameter( param2 );
        parmsList.addParameter( param3 );
        method.setParamsList( parmsList );
        expectedMethods.add( method );

        //"int method8  ( final int   param1 ,  java.lang.Integer   param2)[][] { return null; }"
        method = new MethodDescr( null, -1, -1 );
        //method.setModifiers( new ModifierListDescr( ) );
        method.setType( new TypeDescr( null, -1, -1 ) );
        method.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "int" ) );
        method.setIdentifier( new IdentifierDescr( "method8", -1, -1, -1, -1 ) );

        param1 = new NormalParameterDescr( );
        param1.setModifiers( new ModifierListDescr( ) );
        param1.setType( new TypeDescr( null, -1, -1 ) );
        param1.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "int" ) );
        param1.addModifier( new ModifierDescr( null, -1, -1, "final" ) );
        param1.setIdentifier( new IdentifierDescr( "param1", -1, -1, -1, -1 ) );

        param2 = new NormalParameterDescr( );
        //param2.setModifiers( new ModifierListDescr( ) );
        param2.setType( new TypeDescr( null, -1, -1 ) );
        param2.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "java.lang.Integer", -1, -1 ) );
        param2.setIdentifier( new IdentifierDescr( "param2", -1, -1, -1, -1 ) );
        method.addDimension( new DimensionDescr( "", -1, -1, -1, -1, new JavaTokenDescr( ElementDescriptor.ElementType.JAVA_LBRACKET, "[", -1, -1, -1, -1 ), new JavaTokenDescr( ElementDescriptor.ElementType.JAVA_RBRACKET, "]", -1, -1, -1, -1 ) ) );
        method.addDimension( new DimensionDescr( "", -1, -1, -1, -1, new JavaTokenDescr( ElementDescriptor.ElementType.JAVA_LBRACKET, "[", -1, -1, -1, -1 ), new JavaTokenDescr( ElementDescriptor.ElementType.JAVA_RBRACKET, "]", -1, -1, -1, -1 ) ) );

        parmsList = new ParameterListDescr( );
        parmsList.addParameter( param1 );
        parmsList.addParameter( param2 );
        method.setParamsList( parmsList );
        expectedMethods.add( method );

        //"int method9 ( final Object ...  param1) { return -1;}"
        method = new MethodDescr( null, -1, -1 );
        //method.setModifiers( new ModifierListDescr( ) );
        method.setType( new TypeDescr( null, -1, -1 ) );
        method.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "int" ) );
        method.setIdentifier( new IdentifierDescr( "method9", -1, -1, -1, -1 ) );

        ellipsisParam = new EllipsisParameterDescr( );
        ellipsisParam.setModifiers( new ModifierListDescr( ) );
        ellipsisParam.setType( new TypeDescr( null, -1, -1 ) );
        ellipsisParam.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "Object", -1, -1 ) );
        ellipsisParam.addModifier( new ModifierDescr( null, -1, -1, "final" ) );
        ellipsisParam.setIdentifier( new IdentifierDescr( "param1", -1, -1, -1, -1 ) );

        parmsList = new ParameterListDescr( );
        parmsList.addParameter( ellipsisParam );
        method.setParamsList( parmsList );
        expectedMethods.add( method );

        //private java.util.AbstractList<Object> method10  (  final java.lang.String param1,  int param2 , List<java.util.List<String>>...param3) { return null; }
        method = new MethodDescr( null, -1, -1 );
        method.setModifiers( new ModifierListDescr( ) );
        method.setType( new TypeDescr( null, -1, -1 ) );
        method.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "java.util.AbstractList<Object>", -1, -1 ) );
        method.addModifier( new ModifierDescr( null, -1, -1, "private" ) );
        method.setIdentifier( new IdentifierDescr( "method10", -1, -1, -1, -1 ) );

        param1 = new NormalParameterDescr( );
        param1.setModifiers( new ModifierListDescr( ) );
        param1.addModifier( new ModifierDescr( null, -1, -1, "final" ) );
        param1.setType( new TypeDescr( null, -1, -1 ) );
        param1.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "java.lang.String", -1, -1 ) );
        param1.setIdentifier( new IdentifierDescr( "param1", -1, -1, -1, -1 ) );

        param2 = new NormalParameterDescr( );
        //param2.setModifiers( new ModifierListDescr( ) );
        param2.setType( new TypeDescr( null, -1, -1 ) );
        param2.getType( ).setPrimitiveType( new PrimitiveTypeDescr( null, -1, -1, "int" ) );
        param2.setIdentifier( new IdentifierDescr( "param2", -1, -1, -1, -1 ) );

        ellipsisParam = new EllipsisParameterDescr( );
        //ellipsisParam.setModifiers( new ModifierListDescr( ) );
        ellipsisParam.setType( new TypeDescr( null, -1, -1 ) );
        ellipsisParam.getType( ).setClassOrInterfaceType( new ClassOrInterfaceTypeDescr( "List<java.util.List<String>>", -1, -1 ) );
        ellipsisParam.setIdentifier( new IdentifierDescr( "param3", -1, -1, -1, -1 ) );

        parmsList = new ParameterListDescr( );
        parmsList.addParameter( param1 );
        parmsList.addParameter( param2 );
        parmsList.addParameter( ellipsisParam );
        method.setParamsList( parmsList );

        expectedMethods.add( method );

    }
}


text:
package edu.gemini.gsa.query

import java.io.IOException

import edu.gemini.gsa.query.GsaQueryError._

/** Types of errors that may occur while processing a GSA query. */
sealed trait GsaQueryError {
  def explain: String = {
    val explanation = this match {
      case InvalidResponse(m)    => s"Archive returned invalid results: $m."
      case RequestError(code, m) => s"Archive rejected the request (http code=$code, message=$m)."
      case IoException(_)        => s"A network issue prevented executing the query."
      case Unexpected(_)         => s"Unexpected exception while working with the archive server."
    }

    val exMessage = for {
      t <- this.exception
      m <- Option(t.getMessage) if m.trim != ""
    } yield m

    exMessage.fold(explanation)(em => s"$explanation ($em)")
  }

  def exception: Option[Throwable] = this match {
    case IoException(ex) => Some(ex)
    case Unexpected(t)   => Some(t)
    case _               => None
  }
}

object GsaQueryError {
  /** GSA server returned an invalid response.. */
  final case class InvalidResponse(msg: String)         extends GsaQueryError

  /** GSA server rejected the query request for some reason. */
  final case class RequestError(code: Int, msg: String) extends GsaQueryError

  /** An IO exception while contacting the GSA server. */
  final case class IoException(ex: IOException)         extends GsaQueryError

  /** Some random unexpected exception. */
  final case class Unexpected(t: Throwable)             extends GsaQueryError
}

redpajama_set_name: RedPajamaGithub


text:
var assert = require('assert');
var scmp = require('../');

// use safe-buffer in case Buffer.from in newer versions of node aren't
// available
var Buffer = require('safe-buffer').Buffer;

describe('scmp', function() {
  it('should return true for identical strings', function() {
    assert(scmp(Buffer.from('a', 'utf8'), Buffer.from('a', 'utf8')));
    assert(scmp(Buffer.from('abc', 'utf8'), Buffer.from('abc', 'utf8')));
    assert(scmp(Buffer.from('e727d1464ae12436e899a726da5b2f11d8381b26', 'hex'), Buffer.from('e727d1464ae12436e899a726da5b2f11d8381b26', 'hex')));
  });

  it('should return false for non-identical strings', function() {
    assert.ifError(scmp(Buffer.from('a', 'utf8'), Buffer.from('b', 'utf8')));
    assert.ifError(scmp(Buffer.from('abc', 'utf8'), Buffer.from('b', 'utf8')));
    assert.ifError(scmp(Buffer.from('e727d1464ae12436e899a726da5b2f11d8381b26', 'hex'), Buffer.from('e727e1b80e448a213b392049888111e1779a52db', 'hex')));
  });

  it('should throw errors for non-Buffers', function() {
    assert.throws(scmp.bind(null, 'a', {}));
    assert.throws(scmp.bind(null, {}, 'b'));
    assert.throws(scmp.bind(null, 1, 2));
    assert.throws(scmp.bind(null, undefined, 2));
    assert.throws(scmp.bind(null, null, 2));
  });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!--   <modelVersion>4.0.0</modelVersion>
  <groupId>sjph.life.platform</groupId>
  <artifactId>life-platform</artifactId>
  <name>platform group pom</name>
  <description>Life Platform</description>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

   <parent>
    <groupId>sjph.life.build</groupId>
    <artifactId>sjph-life-build-maven-config</artifactId>
        <version>1.0</version>
    <relativePath>../build/greatgrandparent</relativePath>
  </parent>

    <properties>
        <spring.version>5.0.0.RC3</spring.version>
        <spring.security.version>5.0.0.M3</spring.security.version>
        <slf4j.version>1.7.25</slf4j.version>
        <log4j.version>2.8.2</log4j.version>
    </properties>

  <dependencies>
  <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>${spring.version}</version>
            </dependency>
    Redis
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-redis</artifactId>
                <version>1.8.4.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>redis.clients</groupId>
                <artifactId>jedis</artifactId>
                <version>2.9.0</version>
            </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-pool2</artifactId>
      <version>2.4.2</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.9.0</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-cassandra</artifactId>
    </dependency>
    Log4j
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>${log4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <version>${log4j.version}</version>
    </dependency>
  </dependencies> -->
</project>


text:
package fr.landel.utils.assertor.predicate;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.io.IOException;

import org.junit.Test;

import fr.landel.utils.assertor.AbstractTest;
import fr.landel.utils.assertor.Assertor;
import fr.landel.utils.assertor.StepAssertor;
import fr.landel.utils.assertor.enums.EnumOperator;
import fr.landel.utils.assertor.enums.EnumType;
import fr.landel.utils.assertor.utils.AssertorEnum;
import fr.landel.utils.commons.EnumChar;

/**
 * Check {@link AssertorEnum}
 *
 * @since Jul 18, 2016
 * @author Gilles
 *
 */
public class PredicateAssertorEnumTest extends AbstractTest {

    /**
     * Test method for {@link AssertorEnum#AssertorEnum()} .
     */
    @Test
    public void testConstructor() {
        assertNotNull(new AssertorEnum());
    }

    /**
     * Test method for {@link AssertorEnum} .
     */
    @Test
    public void testValues() {
        EnumType[] all = new EnumType[] {EnumType.BOOLEAN, EnumType.NUMBER_INTEGER, EnumType.NUMBER_DECIMAL, EnumType.ARRAY,
                EnumType.ENUMERATION, EnumType.ITERABLE, EnumType.MAP, EnumType.DATE, EnumType.CHAR_SEQUENCE, EnumType.CLASS,
                EnumType.CHARACTER, EnumType.UNKNOWN};

        EnumType[] notAll = new EnumType[] {EnumType.BOOLEAN, EnumType.NUMBER_INTEGER};

        Assertor.that(EnumType.values()).containsAll(all).orElseThrow();

        Assertor.that(notAll).not().containsAll(EnumType.BOOLEAN, EnumType.UNKNOWN).orElseThrow();

        assertTrue(Assertor.that(EnumType.BOOLEAN).hasName("BOOLEAN").isOK());
    }

    /**
     * Test method for {@link AssertorEnum#hasName} .
     */
    @Test
    public void testHasName() {
        StepAssertor<EnumChar> assertorResult = new StepAssertor<>(EnumChar.ASTERISK, EnumType.ENUMERATION, null);
        assertTrue(AssertorEnum.hasName(assertorResult, "ASTERISK", null).getChecker().test(EnumChar.ASTERISK, false));

        try {
            Assertor.<EnumChar> ofEnum().hasName("ASTERISK").that(EnumChar.ASTERISK).orElseThrow("not found");
            Assertor.<EnumChar> ofEnum().not().hasName("ASTERIS").that(EnumChar.ASTERISK).orElseThrow("not found");
            Assertor.<EnumChar> ofEnum().hasName("ASTERISK").that(EnumChar.ASTERISK).orElseThrow(new IllegalArgumentException(), true);
            Assertor.<EnumChar> ofEnum().hasNameIgnoreCase("asTerisK").that(EnumChar.ASTERISK).orElseThrow("not found");
            Assertor.<EnumChar> ofEnum().not().hasNameIgnoreCase("asTeris").that(EnumChar.ASTERISK).orElseThrow();

            Assertor.<EnumChar> ofEnum().hasName("ASTERISK").and(Assertor.<EnumChar> ofEnum().hasOrdinal(EnumChar.ASTERISK.ordinal()))
                    .that(EnumChar.ASTERISK).orElseThrow(JUNIT_THROWABLE);
            Assertor.<EnumChar> ofEnum().hasName("ASTERISK").or(Assertor.<EnumChar> ofEnum().hasOrdinal(EnumChar.ASTERISK.ordinal()))
                    .that(EnumChar.ASTERISK).orElseThrow(JUNIT_THROWABLE);
            Assertor.<EnumChar> ofEnum().hasName("ASTERISK").xor(Assertor.<EnumChar> ofEnum().hasOrdinal(EnumChar.ACK.ordinal()))
                    .that(EnumChar.ASTERISK).orElseThrow(JUNIT_THROWABLE);
            Assertor.<EnumChar> ofEnum().hasName("ASTERIS").nand(Assertor.<EnumChar> ofEnum().hasOrdinal(EnumChar.ACK.ordinal()))
                    .that(EnumChar.ASTERISK).orElseThrow(JUNIT_THROWABLE);
            Assertor.<EnumChar> ofEnum().hasName("ASTERISK").nor(Assertor.<EnumChar> ofEnum().hasOrdinal(EnumChar.ACK.ordinal()))
                    .that(EnumChar.ASTERISK).orElseThrow(JUNIT_THROWABLE);
        } catch (IllegalArgumentException e) {
            fail("The test isn't correct");
        }

        assertException(() -> {
            Assertor.<EnumChar> ofEnum().hasName("asterisk").that(EnumChar.ASTERISK).orElseThrow("not found");
            fail();
        }, IllegalArgumentException.class, "not found");

        assertException(() -> {
            Assertor.<EnumChar> ofEnum().hasName("asterisk", "%s, '%s*'", "not found").that(EnumChar.ASTERISK).orElseThrow();
            fail();

            // to string = unicode character
        }, IllegalArgumentException.class, "not found, '*'");

        assertException(() -> {
            Assertor.<EnumChar> ofEnum().hasName("asterisk").that(EnumChar.ASTERISK).orElseThrow(new IOException("not found"), true);
            fail();
        }, IOException.class, "not found");

        assertException(() -> {
            Assertor.<EnumChar> ofEnum().hasName("asterisk").that((EnumChar) null).orElseThrow(new IOException("not found"), true);
            fail();
        }, IOException.class, "not found");

        assertException(() -> {
            Assertor.<EnumChar> ofEnum().hasName("").that(EnumChar.ASTERISK).orElseThrow(new IOException("not found"), true);
            fail();
        }, IOException.class, "not found");
    }

    /**
     * Test method for {@link AssertorEnum#hasOrdinal} .
     */
    @Test
    public void testHasOrdinal() {
        try {
            assertTrue(Assertor.that(EnumOperator.OR).hasOrdinal(1).isOK());

            Assertor.<EnumOperator> ofEnum().isNotNull().that(EnumOperator.OR).orElseThrow();

            Assertor.<EnumOperator> ofEnum().hasOrdinal(1).that(EnumOperator.OR).orElseThrow();
            Assertor.<EnumOperator> ofEnum().hasOrdinal(1).and().not().hasHashCode(0).that(EnumOperator.OR).orElseThrow("not true");
            Assertor.<EnumOperator> ofEnum().hasOrdinal(1).that(EnumOperator.OR).orElseThrow(new IllegalArgumentException(), true);

            Assertor.<EnumOperator> ofEnum().hasOrdinal(1).and().not().hasName("xor").that(EnumOperator.OR).orElseThrow();
            Assertor.<EnumOperator> ofEnum().hasOrdinal(1).or().hasName("xor").that(EnumOperator.OR).orElseThrow();
            Assertor.<EnumOperator> ofEnum().hasOrdinal(1).xor().hasName("xor").that(EnumOperator.OR).orElseThrow();
            Assertor.<EnumOperator> ofEnum().hasOrdinal(2).nand().hasName("xor").that(EnumOperator.OR).orElseThrow();
            Assertor.<EnumOperator> ofEnum().hasOrdinal(1).nor().hasName("xor").that(EnumOperator.OR).orElseThrow();

        } catch (IllegalArgumentException e) {
            fail("The test isn't correct");
        }

        assertException(() -> {
            Assertor.<EnumOperator> ofEnum().hasOrdinal(100).that(EnumOperator.OR).orElseThrow("not correct");
            fail();
        }, IllegalArgumentException.class, "not correct");

        assertException(() -> {
            Assertor.<EnumOperator> ofEnum().hasOrdinal(0).that(EnumOperator.OR).orElseThrow("not correct");
            fail();
        }, IllegalArgumentException.class, "not correct");

        assertException(() -> {
            Assertor.<EnumOperator> ofEnum().hasOrdinal(0, "%s, '%s*'", "not correct").that(EnumOperator.OR).orElseThrow();
            fail();
        }, IllegalArgumentException.class, "not correct, ' OR '");

        assertException(() -> {
            Assertor.<EnumOperator> ofEnum().hasOrdinal(0).that((EnumOperator) null).orElseThrow(new IOException("not correct"), true);
            fail();
        }, IOException.class, "not correct");

        assertException(() -> {
            Assertor.<EnumOperator> ofEnum().hasOrdinal(-1).that(EnumOperator.OR).orElseThrow(new IOException("not correct"), true);
            fail();
        }, IOException.class, "not correct");
    }
}


text:
package org.apache.streams.datasift.provider;

import com.datasift.client.stream.DeletedInteraction;
import com.datasift.client.stream.StreamEventListener;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import com.google.common.collect.Queues;
import org.apache.streams.core.StreamsDatum;
import org.apache.streams.core.StreamsProvider;
import org.apache.streams.core.StreamsResultSet;
import org.apache.streams.datasift.Datasift;
import org.apache.streams.datasift.DatasiftConfiguration;
import org.apache.streams.datasift.DatasiftWebhookData;
import org.apache.streams.jackson.StreamsJacksonMapper;
import org.apache.streams.util.ComponentUtils;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Resource;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.regex.Pattern;

/**
 * {@code DatasiftPushProvider} is an implementation of the {@link org.apache.streams.core.StreamsProvider} interface, with
 * annotations that allow it to bind as jersey resources within streams-runtime-dropwizard.
 *
 * Whereas GenericWebhookResource outputs ObjectNode datums, DatasiftPushProvider outputs Datasift datums, with
 * metadata when the json_meta endpoint is used.
 */
@Resource
@Path("/streams/webhooks/datasift")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class DatasiftPushProvider implements StreamsProvider {

    private final static Logger LOGGER = LoggerFactory.getLogger(DatasiftPushProvider.class);

    private static ObjectMapper mapper = StreamsJacksonMapper.getInstance();

    protected Queue<StreamsDatum> providerQueue = new ConcurrentLinkedQueue<>();

    protected final ReadWriteLock lock = new ReentrantReadWriteLock();

    private static Pattern newLinePattern = Pattern.compile("(\\r\\n?|\\n)", Pattern.MULTILINE);

    @POST
    @Path("json")
    public Response json(@Context HttpHeaders headers,
                         String body) {

        ObjectNode response = mapper.createObjectNode();

        StreamsDatum datum = new StreamsDatum(body);

        lock.writeLock().lock();
        ComponentUtils.offerUntilSuccess(datum, providerQueue);
        lock.writeLock().unlock();

        Boolean success = true;

        response.put("success", success);

        return Response.status(200).entity(response).build();

    }

    @POST
    @Path("json_new_line")
    public Response json_new_line(@Context HttpHeaders headers,
                                  String body) {

        ObjectNode response = mapper.createObjectNode();

        if (body.equalsIgnoreCase("{}")) {

            Boolean success = true;

            response.put("success", success);

            return Response.status(200).entity(response).build();
        }

        try {

            for( String item : Splitter.on(newLinePattern).split(body)) {
                StreamsDatum datum = new StreamsDatum(item);

                lock.writeLock().lock();
                ComponentUtils.offerUntilSuccess(datum, providerQueue);
                lock.writeLock().unlock();

            }

            Boolean success = true;

            response.put("success", success);

            return Response.status(200).entity(response).build();

        } catch (Exception e) {
            LOGGER.warn(e.toString(), e);

            Boolean success = false;

            response.put("success", success);

            return Response.status(500).entity(response).build();

        }

    }

    @POST
    @Path("json_meta")
    public Response json_meta(@Context HttpHeaders headers,
                              String body) {

        //log.debug(headers.toString(), headers);

        //log.debug(body.toString(), body);

        ObjectNode response = mapper.createObjectNode();

        if (body.equalsIgnoreCase("{}")) {

            Boolean success = true;

            response.put("success", success);

            return Response.status(200).entity(response).build();
        }

        try {

            DatasiftWebhookData objectWrapper = mapper.readValue(body, DatasiftWebhookData.class);

            for( Datasift item : objectWrapper.getInteractions()) {

                String json = mapper.writeValueAsString(item);

                StreamsDatum datum = new StreamsDatum(json);
                if( item.getInteraction() != null &&
                    !Strings.isNullOrEmpty(item.getInteraction().getId())) {
                    datum.setId(item.getInteraction().getId());
                }
                if( item.getInteraction() != null &&
                    item.getInteraction().getCreatedAt() != null) {
                    datum.setTimestamp(item.getInteraction().getCreatedAt());
                }
                Map<String, Object> metadata = Maps.newHashMap();
                metadata.put("hash", objectWrapper.getHash());
                metadata.put("hashType", objectWrapper.getHashType());
                metadata.put("id",objectWrapper.getId());

                if( item.getInteraction() != null &&
                        item.getInteraction().getTags() != null &&
                        item.getInteraction().getTags().size() > 0) {
                    metadata.put("tags", item.getInteraction().getTags());
                }

                datum.setMetadata(metadata);

                lock.writeLock().lock();
                ComponentUtils.offerUntilSuccess(datum, providerQueue);
                lock.writeLock().unlock();
            }

            Boolean success = true;

            response.put("success", success);

            return Response.status(200).entity(response).build();

        } catch (Exception e) {
            LOGGER.warn(e.toString(), e);
        }

        return Response.status(500).build();
    }

    @Override
    public void startStream() {
        return;
    }

    @Override
    public StreamsResultSet readCurrent() {

        StreamsResultSet current;

        lock.writeLock().lock();
        current = new StreamsResultSet(Queues.newConcurrentLinkedQueue(providerQueue));
        providerQueue.clear();
        lock.writeLock().unlock();

        return current;

    }

    @Override
    public StreamsResultSet readNew(BigInteger sequence) {
        return null;
    }

    @Override
    public StreamsResultSet readRange(DateTime start, DateTime end) {
        return null;
    }

    @Override
    public boolean isRunning() {
        return true;
    }

    @Override
    public void prepare(Object configurationObject) {

    }

    @Override
    public void cleanUp() {

    }

}


text:
using System;
using System.Collections.Generic;
using DSL.Demo.Model;

namespace DSL.Demo.SampleDsl
{
    public abstract class SampleDslBase
    {
        #region Delegates

        protected object Entity;

        public delegate void Action();
        private readonly Dictionary<Type, Action> actions =
            new Dictionary<Type, Action>();
        #endregion

        public void OnCreate(Type entity, Action action)
        {
            Console.WriteLine("Action registered for " + entity);
            actions[entity] = action;
        }

        public void BeginManualApprovalFor(Order order)
        {
            Console.WriteLine("Starting manual approval for " + order.Id);
        }

        public abstract void Prepare();

        public void Creating<T>(T entity)
        {
            Entity = entity;
            Action action = actions[typeof (T)];
            action();
        }
    }

    public class MyDsl : SampleDslBase
    {
        public override void Prepare()
        {
            OnCreate(typeof(Account),delegate
            {
                Account account = (Account) Entity;
                account.AccountNumber = DateTime.Now.Ticks;
            });

            OnCreate(typeof(Order), delegate
            {
                Order o = (Order) Entity;
                if(o.Account.MaxOrderTotal > o.Total)
                    BeginManualApprovalFor(o);
            });
        }
    }
}


text:
#include "config.h"
#include "JITToDFGDeferredCompilationCallback.h"

#if ENABLE(DFG_JIT)

#include "CodeBlock.h"
#include "Executable.h"

namespace JSC {

JITToDFGDeferredCompilationCallback::JITToDFGDeferredCompilationCallback() { }
JITToDFGDeferredCompilationCallback::~JITToDFGDeferredCompilationCallback() { }

PassRefPtr<JITToDFGDeferredCompilationCallback> JITToDFGDeferredCompilationCallback::create()
{
    return adoptRef(new JITToDFGDeferredCompilationCallback());
}

void JITToDFGDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously(
    CodeBlock* codeBlock)
{
    ASSERT(codeBlock->alternative()->jitType() == JITCode::BaselineJIT);

    if (Options::verboseOSR())
        dataLog("Optimizing compilation of ", *codeBlock, " did become ready.\n");

    codeBlock->alternative()->forceOptimizationSlowPathConcurrently();
}

void JITToDFGDeferredCompilationCallback::compilationDidComplete(
    CodeBlock* codeBlock, CompilationResult result)
{
    ASSERT(codeBlock->alternative()->jitType() == JITCode::BaselineJIT);

    if (Options::verboseOSR())
        dataLog("Optimizing compilation of ", *codeBlock, " result: ", result, "\n");

    if (result == CompilationSuccessful)
        codeBlock->install();

    codeBlock->alternative()->setOptimizationThresholdBasedOnCompilationResult(result);
}

} // JSC

#endif // ENABLE(DFG_JIT)


text:
/* Hans Pabst (Intel Corp.)
******************************************************************************/
#include <libxsmm_timer.h>
#include "libxsmm_main.h"

#if defined(LIBXSMM_OFFLOAD_TARGET)
# pragma offload_attribute(push,target(LIBXSMM_OFFLOAD_TARGET))
#endif
#if defined(_WIN32)
# include <Windows.h>
#elif defined(__GNUC__) || defined(__PGI) || defined(_CRAYC)
# include <sys/time.h>
# include <time.h>
#endif
#if defined(LIBXSMM_OFFLOAD_TARGET)
# pragma offload_attribute(pop)
#endif

#if defined(__powerpc64__)
# include <sys/platform/ppc.h>
#endif

#if !defined(LIBXSMM_TIMER_TSC)
# define LIBXSMM_TIMER_TSC
#endif
#if !defined(LIBXSMM_TIMER_WPC)
# define LIBXSMM_TIMER_WPC
#endif

#if defined(LIBXSMM_TIMER_TSC)
# if defined(__powerpc64__)
#   define LIBXSMM_TIMER_RDTSC(CYCLE) do { \
      CYCLE = __ppc_get_timebase(); \
    } while(0)
# elif ((defined(LIBXSMM_PLATFORM_X86) && (64 <= (LIBXSMM_BITS))) && \
        (defined(__GNUC__) || defined(LIBXSMM_INTEL_COMPILER) || defined(__PGI)))
#   define LIBXSMM_TIMER_RDTSC(CYCLE) do { \
      libxsmm_timer_tickint libxsmm_timer_rdtsc_hi_; \
      __asm__ __volatile__ ("rdtsc" : "=a"(CYCLE), "=d"(libxsmm_timer_rdtsc_hi_)); \
      CYCLE |= libxsmm_timer_rdtsc_hi_ << 32; \
    } while(0)
# elif (defined(_rdtsc) || defined(_WIN32))
#   define LIBXSMM_TIMER_RDTSC(CYCLE) (CYCLE = __rdtsc())
# endif
#endif

LIBXSMM_API_INTERN double libxsmm_timer_duration_rtc(libxsmm_timer_tickint tick0, libxsmm_timer_tickint tick1)
{
  double result = (double)LIBXSMM_DELTA(tick0, tick1);
#if defined(_WIN32)
# if defined(LIBXSMM_TIMER_WPC)
  LARGE_INTEGER frequency;
  QueryPerformanceFrequency(&frequency);
  result /= (double)frequency.QuadPart;
# else /* low resolution */
  result *= 1E-3;
# endif
#elif defined(CLOCK_MONOTONIC)
  result *= 1E-9;
#else
  result *= 1E-6;
#endif
  return result;
}

LIBXSMM_API_INTERN libxsmm_timer_tickint libxsmm_timer_tick_rtc(void)
{
  libxsmm_timer_tickint result;
#if defined(_WIN32)
# if defined(LIBXSMM_TIMER_WPC)
  LARGE_INTEGER t;
  QueryPerformanceCounter(&t);
  result = (libxsmm_timer_tickint)t.QuadPart;
# else /* low resolution */
  result = (libxsmm_timer_tickint)GetTickCount64();
# endif
#elif defined(CLOCK_MONOTONIC)
  struct timespec t;
  clock_gettime(CLOCK_MONOTONIC, &t);
  result = 1000000000ULL * t.tv_sec + t.tv_nsec;
#else
  struct timeval t;
  gettimeofday(&t, 0);
  result = 1000000ULL * t.tv_sec + t.tv_usec;
#endif
  return result;
}

LIBXSMM_API_INTERN LIBXSMM_INTRINSICS(LIBXSMM_X86_GENERIC)
libxsmm_timer_tickint libxsmm_timer_tick_tsc(void)
{
  libxsmm_timer_tickint result;
#if defined(LIBXSMM_TIMER_RDTSC)
  LIBXSMM_TIMER_RDTSC(result);
#else
  result = libxsmm_timer_tick_rtc();
#endif
  return result;
}

LIBXSMM_API int libxsmm_get_timer_info(libxsmm_timer_info* info)
{
  int result;
  if (NULL != info) {
#if defined(LIBXSMM_TIMER_RDTSC)
    if (0 < libxsmm_timer_scale) {
      info->tsc = 1;
    }
# if !defined(LIBXSMM_INIT_COMPLETED)
    else if (2 > libxsmm_ninit) {
      libxsmm_init();
      if (0 < libxsmm_timer_scale) {
        info->tsc = 1;
      }
      else {
        info->tsc = 0;
      }
    }
# endif
    else {
      info->tsc = 0;
    }
#else
    info->tsc = 0;
#endif
    result = EXIT_SUCCESS;
  }
  else {
#if !defined(NDEBUG)
    static int error_once = 0;
    if (0 != libxsmm_verbosity /* library code is expected to be mute */
      && 1 == LIBXSMM_ATOMIC_ADD_FETCH(&error_once, 1, LIBXSMM_ATOMIC_RELAXED))
    {
      fprintf(stderr, "LIBXSMM ERROR: invalid argument for libxsmm_get_timer_info specified!\n");
    }
#endif
    result = EXIT_FAILURE;
  }
  return result;
}

LIBXSMM_API libxsmm_timer_tickint libxsmm_timer_tick(void)
{
  libxsmm_timer_tickint result;
#if defined(LIBXSMM_TIMER_RDTSC)
  if (0 < libxsmm_timer_scale) {
    LIBXSMM_TIMER_RDTSC(result);
  }
# if !defined(LIBXSMM_INIT_COMPLETED)
  else if (2 > libxsmm_ninit) {
    libxsmm_init();
    if (0 < libxsmm_timer_scale) {
      LIBXSMM_TIMER_RDTSC(result);
    }
    else {
      result = libxsmm_timer_tick_rtc();
    }
  }
# endif
  else {
    result = libxsmm_timer_tick_rtc();
  }
#else
  result = libxsmm_timer_tick_rtc();
#endif
  return result;
}

LIBXSMM_API double libxsmm_timer_duration(libxsmm_timer_tickint tick0, libxsmm_timer_tickint tick1)
{
  double result;
#if defined(LIBXSMM_TIMER_RDTSC)
  if (0 < libxsmm_timer_scale) {
    result = (double)LIBXSMM_DELTA(tick0, tick1) * libxsmm_timer_scale;
  }
  else
#endif
  {
    result = libxsmm_timer_duration_rtc(tick0, tick1);
  }
  return result;
}

#if defined(LIBXSMM_BUILD) && (!defined(LIBXSMM_NOFORTRAN) || defined(__clang_analyzer__))

/* implementation provided for Fortran 77 compatibility */
LIBXSMM_API void LIBXSMM_FSYMBOL(libxsmm_timer_ncycles)(libxsmm_timer_tickint* /*ncycles*/, const libxsmm_timer_tickint* /*tick0*/, const libxsmm_timer_tickint* /*tick1*/);
LIBXSMM_API void LIBXSMM_FSYMBOL(libxsmm_timer_ncycles)(libxsmm_timer_tickint* ncycles, const libxsmm_timer_tickint* tick0, const libxsmm_timer_tickint* tick1)
{
#if !defined(NDEBUG)
  static int error_once = 0;
  if (NULL != ncycles && NULL != tick0 && NULL != tick1)
#endif
  {
    *ncycles = libxsmm_timer_ncycles(*tick0, *tick1);
  }
#if !defined(NDEBUG)
  else if (0 != libxsmm_verbosity /* library code is expected to be mute */
    && 1 == LIBXSMM_ATOMIC_ADD_FETCH(&error_once, 1, LIBXSMM_ATOMIC_RELAXED))
  {
    fprintf(stderr, "LIBXSMM ERROR: invalid arguments for libxsmm_timer_ncycles specified!\n");
  }
#endif
}

#endif /*defined(LIBXSMM_BUILD) && (!defined(LIBXSMM_NOFORTRAN) || defined(__clang_analyzer__))*/


text:
using UnityEngine;
using System.Collections.Generic;
using System;

namespace EA4S
{
    public class StrollingLetterWalkingState : StrollingLetterState
    {
        LetterCharacterController movement;

        public StrollingLetterWalkingState(StrollingLivingLetter letter) : base(letter)
        {
            movement = letter.GetComponent<LetterCharacterController>();

        }

        const float RUN_SPEED = 6.0f;
        const float WALK_SPEED = 3.0f;

        const float STUCK_THRESHOLD = 0.5f;

        float timer;
        Vector3 target;
        float speed;

        float stuckTimer;
        Vector3 lastPosition;

        public override void EnterState()
        {
            bool running = UnityEngine.Random.value < 0.5f;

            if (!letter.walkableArea.IsInside(letter.transform.position, true))
                running = true;

            letter.gameObject.GetComponent<LetterObjectView>().SetState(LLAnimationStates.LL_walking);
            if (running)
            {
                // set letter animation
                letter.gameObject.GetComponent<LetterObjectView>().SetWalkingSpeed(LetterObjectView.RUN_SPEED);
                speed = RUN_SPEED;
            }
            else
            {

                // set letter animation
                letter.gameObject.GetComponent<LetterObjectView>().SetWalkingSpeed(LetterObjectView.WALKING_SPEED);
                speed = WALK_SPEED;
            }

            timer = 3.0f + 5.0f * UnityEngine.Random.value;

            // Get a Random destination
            target = letter.walkableArea.GetRandomPosition();
            lastPosition = letter.transform.position;
            stuckTimer = STUCK_THRESHOLD;
        }

        public override void ExitState()
        {
            letter.gameObject.GetComponent<LetterObjectView>().SetState(LLAnimationStates.LL_idle);
        }

        public override void Update(float delta)
        {
            Vector3 distance = target - letter.transform.position;
            distance.y = 0;

            movement.MoveAmount(distance.normalized * speed * delta);
            movement.LerpLookAt(target, 4 * delta);

            timer -= delta;

            if (timer < 0 || distance.sqrMagnitude < 0.05f)
            {
                letter.SetCurrentState(letter.IdleState);
            }

            // if stuck for too long, change direction
            float avgSpeed = Vector3.Distance(letter.transform.position, lastPosition)/delta;

            if (avgSpeed < 0.5f * speed)
            {
                stuckTimer -= Time.deltaTime;
            }
            else
                stuckTimer = STUCK_THRESHOLD;

            if (stuckTimer <= 0)
            {
                // change direction
                target = letter.crowd.walkableArea.GetNearestPoint(letter.transform.position - 2*distance, true);
                stuckTimer = STUCK_THRESHOLD;
            }

            lastPosition = letter.transform.position;

#if UNITY_EDITOR
            Debug.DrawLine(letter.transform.position, target);
#endif
        }

        public override void UpdatePhysics(float delta)
        {
        }
    }
}


text:
/**
 * @file desktop.h
 * @author Joe Wingbermuehle
 * @date 2004-2006
 *
 * @brief Header for the desktop management functions.
 *
 */

#include "jwm.h"
#include "desktop.h"
#include "main.h"
#include "client.h"
#include "clientlist.h"
#include "taskbar.h"
#include "error.h"
#include "menu.h"
#include "misc.h"
#include "background.h"
#include "settings.h"
#include "grab.h"
#include "event.h"
#include "tray.h"

static char **desktopNames = NULL;
static char *showingDesktop = NULL;

/** Startup desktop support. */
void StartupDesktops(void)
{

   unsigned int x;

   if(desktopNames == NULL) {
      desktopNames = Allocate(settings.desktopCount * sizeof(char*));
      for(x = 0; x < settings.desktopCount; x++) {
         desktopNames[x] = NULL;
      }
   }
   for(x = 0; x < settings.desktopCount; x++) {
      if(desktopNames[x] == NULL) {
         desktopNames[x] = Allocate(4 * sizeof(char));
         snprintf(desktopNames[x], 4, "%d", x + 1);
      }
   }
   if(showingDesktop == NULL) {
      showingDesktop = Allocate(settings.desktopCount * sizeof(char));
      for(x = 0; x < settings.desktopCount; x++) {
         showingDesktop[x] = 0;
      }
   }
}

/** Release desktop data. */
void DestroyDesktops(void)
{

   if(desktopNames) {
      unsigned int x;
      for(x = 0; x < settings.desktopCount; x++) {
         Release(desktopNames[x]);
      }
      Release(desktopNames);
      desktopNames = NULL;
   }
   if(showingDesktop) {
      Release(showingDesktop);
      showingDesktop = NULL;
   }

}

/** Get the right desktop. */
unsigned int GetRightDesktop(unsigned int desktop)
{
   const int y = desktop / settings.desktopWidth;
   const int x = (desktop + 1) % settings.desktopWidth;
   return y * settings.desktopWidth + x;
}

/** Get the left desktop. */
unsigned int GetLeftDesktop(unsigned int desktop)
{
   const int y = currentDesktop / settings.desktopWidth;
   int x = currentDesktop % settings.desktopWidth;
   x = x > 0 ? x - 1 : settings.desktopWidth - 1;
   return y * settings.desktopWidth + x;
}

/** Get the above desktop. */
unsigned int GetAboveDesktop(unsigned int desktop)
{
   if(currentDesktop >= settings.desktopWidth) {
      return currentDesktop - settings.desktopWidth;
   }
   return currentDesktop + (settings.desktopHeight - 1) * settings.desktopWidth;
}

/** Get the below desktop. */
unsigned int GetBelowDesktop(unsigned int desktop)
{
   return (currentDesktop + settings.desktopWidth) % settings.desktopCount;
}

/** Change to the desktop to the right. */
char RightDesktop(void)
{
   if(settings.desktopWidth > 1) {
      const unsigned int desktop = GetRightDesktop(currentDesktop);
      ChangeDesktop(desktop);
      return 1;
   } else {
      return 0;
   }
}

/** Change to the desktop to the left. */
char LeftDesktop(void)
{
   if(settings.desktopWidth > 1) {
      const unsigned int desktop = GetLeftDesktop(currentDesktop);
      ChangeDesktop(desktop);
      return 1;
   } else {
      return 0;
   }
}

/** Change to the desktop above. */
char AboveDesktop(void)
{
   if(settings.desktopHeight > 1) {
      const int desktop = GetAboveDesktop(currentDesktop);
      ChangeDesktop(desktop);
      return 1;
   } else {
      return 0;
   }
}

/** Change to the desktop below. */
char BelowDesktop(void)
{
   if(settings.desktopHeight > 1) {
      const unsigned int desktop = GetBelowDesktop(currentDesktop);
      ChangeDesktop(desktop);
      return 1;
   } else {
      return 0;
   }
}

/** Change to the specified desktop. */
void ChangeDesktop(unsigned int desktop)
{

   ClientNode *np;
   unsigned int x;

   if(JUNLIKELY(desktop >= settings.desktopCount)) {
      return;
   }

   if(currentDesktop == desktop) {
      return;
   }

   /* Hide clients from the old desktop.
    * Note that we show clients in a separate loop to prevent an issue
    * with clients losing focus.
    */
   for(x = 0; x < LAYER_COUNT; x++) {
      for(np = nodes[x]; np; np = np->next) {
         if(np->state.status & STAT_STICKY) {
            continue;
         }
         if(np->state.desktop == currentDesktop) {
            HideClient(np);
         }
      }
   }

   /* Show clients on the new desktop. */
   for(x = 0; x < LAYER_COUNT; x++) {
      for(np = nodes[x]; np; np = np->next) {
         if(np->state.status & STAT_STICKY) {
            continue;
         }
         if(np->state.desktop == desktop) {
            ShowClient(np);
         }
      }
   }

   currentDesktop = desktop;

   SetCardinalAtom(rootWindow, ATOM_NET_CURRENT_DESKTOP, currentDesktop);
   SetCardinalAtom(rootWindow, ATOM_NET_SHOWING_DESKTOP,
                   showingDesktop[currentDesktop]);

   RequireRestack();
   RequireTaskUpdate();

   LoadBackground(desktop);

}

/** Create a desktop menu. */
Menu *CreateDesktopMenu(unsigned int mask, void *context)
{

   Menu *menu;
   int x;

   menu = CreateMenu();
   for(x = settings.desktopCount - 1; x >= 0; x--) {
      const size_t len = strlen(desktopNames[x]);
      MenuItem *item = CreateMenuItem(MENU_ITEM_NORMAL);
      item->next = menu->items;
      menu->items = item;

      item->action.type = MA_DESKTOP;
      item->action.context = context;
      item->action.value = x;

      item->name = Allocate(len + 3);
      item->name[0] = (mask & (1 << x)) ? '[' : ' ';
      memcpy(&item->name[1], desktopNames[x], len);
      item->name[len + 1] = (mask & (1 << x)) ? ']' : ' ';
      item->name[len + 2] = 0;
   }

   return menu;

}

/** Create a sendto menu. */
Menu *CreateSendtoMenu(MenuActionType mask, void *context)
{

   Menu *menu;
   int x;

   menu = CreateMenu();
   for(x = settings.desktopCount - 1; x >= 0; x--) {
      const size_t len = strlen(desktopNames[x]);
      MenuItem *item = CreateMenuItem(MENU_ITEM_NORMAL);
      item->next = menu->items;
      menu->items = item;

      item->action.type = MA_SENDTO | mask;
      item->action.context = context;
      item->action.value = x;

      item->name = Allocate(len + 3);
      item->name[0] = (x == currentDesktop) ? '[' : ' ';
      memcpy(&item->name[1], desktopNames[x], len);
      item->name[len + 1] = (x == currentDesktop) ? ']' : ' ';
      item->name[len + 2] = 0;
   }

   return menu;
}

/** Toggle the "show desktop" state. */
void ShowDesktop(void)
{

   ClientNode *np;
   int layer;

   GrabServer();
   for(layer = 0; layer < LAYER_COUNT; layer++) {
      for(np = nodes[layer]; np; np = np->next) {
         if(np->state.status & STAT_NOLIST) {
            continue;
         }
         if((np->state.desktop == currentDesktop) ||
            (np->state.status & STAT_STICKY)) {
            if(showingDesktop[currentDesktop]) {
               if(np->state.status & STAT_SDESKTOP) {
                  RestoreClient(np, 0);
               }
            } else {
               if(np->state.status & STAT_ACTIVE) {
                  JXSetInputFocus(display, rootWindow, RevertToParent,
                                  CurrentTime);
               }
               if(np->state.status & (STAT_MAPPED | STAT_SHADED)) {
                  MinimizeClient(np, 0);
                  np->state.status |= STAT_SDESKTOP;
               }
            }
         }
      }
   }
   RequireRestack();
   RequireTaskUpdate();
   JXSync(display, True);

   if(showingDesktop[currentDesktop]) {
      char first = 1;
      JXSync(display, False);
      for(layer = 0; layer < LAYER_COUNT; layer++) {
         for(np = nodes[layer]; np; np = np->next) {
            if(np->state.status & STAT_NOLIST) {
               continue;
            }
            if((np->state.desktop == currentDesktop) ||
               (np->state.status & STAT_STICKY)) {
               if(first) {
                  FocusClient(np);
                  first = 0;
               }
               DrawBorder(np);
            }
         }
      }
      showingDesktop[currentDesktop] = 0;
   } else {
      showingDesktop[currentDesktop] = 1;
   }
   SetCardinalAtom(rootWindow, ATOM_NET_SHOWING_DESKTOP,
                   showingDesktop[currentDesktop]);
   UngrabServer();
   DrawTray();

}

/** Set the name for a desktop. */
void SetDesktopName(unsigned int desktop, const char *str)
{

   if(JUNLIKELY(!str)) {
      Warning(_("empty Desktops Name tag"));
      return;
   }

   Assert(desktop < settings.desktopWidth * settings.desktopHeight);

   if(!desktopNames) {
      unsigned int x;
      desktopNames = Allocate(settings.desktopCount * sizeof(char*));
      for(x = 0; x < settings.desktopCount; x++) {
         desktopNames[x] = NULL;
      }
   }

   Assert(desktopNames[desktop] == NULL);

   desktopNames[desktop] = CopyString(str);

}

/** Get the name of a desktop. */
const char *GetDesktopName(unsigned int desktop)
{
   Assert(desktop < settings.desktopCount);
   if(desktopNames && desktopNames[desktop]) {
      return desktopNames[desktop];
   } else {
      return "";
   }
}


text:
var http = require('http'),
    htmlparser = require('htmlparser');

exports.available = function(options, callback) {
    http.get({
        host: options.hostname,
        path: '/grid/console',
        port: options.port || 4444
    }, function(res) {
        var data = '';

        if (res.statusCode !== 200) {
            return callback('server returned status code ' + res.statusCode);
        }

        res.on('data', function(c) {
            data += c;
        });

        res
            .on('end', function () { parseHtml(data, callback); })
            .on('error', callback);
    });
};

exports.parseHtml = parseHtml;

function parseHtml(data, callback) {
    var parser,
        handler = new htmlparser.DefaultHandler(function (error, dom) {
            if (error) {return callback(error);}
            var container, browsers, parsed;
            try {
                container = find(matchBrowserList, dom);
                browsers = find(matchBrowserItem, container);
                parsed = parseItems(browsers);
            } catch (e) {
                return callback(e);
            }
            callback(null, parsed);
        }, { verbose: false, ignoreWhitespace: true });

    parser = new htmlparser.Parser(handler);
    parser.parseComplete(data);
}

var regContent = /{\s*([^\s].*[^\s])\s*}/;
var regSplit = /\s*,\s*/;
var regPart = /^(.*)\s*=\s*(.*)$/;

function find(match, dom) {
    var children = [], c;
    if (!dom) {return children;}
    if (Array.isArray(dom)) {
        dom.forEach(function(item) {
            var c = find(match, item);
            if (c.length) {
                c.forEach(function(i) {
                    children.push(i);
                });
            }
        });
    } else {
        if (dom.type === "tag" && match(dom)) {
            children.push(dom);
        }

        if (dom.children) {
            c = find(match, dom.children);
            if (c.length) {
                c.forEach(function(i) {
                    children.push(i);
                });
            }
        }
    }

    return children;
}

function matchBrowserList(node) {
    return node.name === 'div' && node.attribs && node.attribs.type === 'browsers';
}

function matchBrowserItem(node) {
    return node.name === 'img';
}

function parseItems(items) {
    var browsers = [];
    items.forEach(function (item) {
        var result = parseItem(item.attribs.title);
        if (result) {
            browsers.push(result);
        }
    });
    return browsers;
}

function parseItem(title) {
    if (!regContent.test(title)) {
        // this is not an available node
        return false;
    }
    var raw = regContent.exec(title)[1];
    var parts = raw.split(regSplit);
    var result = {};
    parts.forEach(function (part) {
        var parsed = regPart.exec(part);
        var key = parsed[1];
        var value = parsed[2];

        result[key] = value;
    });

    return result;
}


text:
namespace credential_provider {

GcpCrashReporterClient::~GcpCrashReporterClient() = default;

base::FilePath GcpCrashReporterClient::GetPathForFileVersionInfo(
    const std::wstring& exe_path) {
  return base::FilePath(exe_path);
}

bool GcpCrashReporterClient::ShouldCreatePipeName(
    const std::wstring& process_type) {
  return true;
}

bool GcpCrashReporterClient::GetAlternativeCrashDumpLocation(
    std::wstring* crash_dir) {
  return false;
}

void GcpCrashReporterClient::GetProductNameAndVersion(
    const std::wstring& exe_path,
    std::wstring* product_name,
    std::wstring* version,
    std::wstring* special_build,
    std::wstring* channel_name) {
  DCHECK(product_name);
  DCHECK(version);
  DCHECK(special_build);
  DCHECK(channel_name);
  // Report crashes under the same product name as the browser. This string
  // MUST match server-side configuration.
  *product_name = L"Chrome";
  special_build->clear();
  channel_name->clear();
  std::unique_ptr<FileVersionInfo> version_info(
      FileVersionInfo::CreateFileVersionInfo(
          GetPathForFileVersionInfo(exe_path)));

  if (version_info) {
    *version = base::AsWString(version_info->product_version());
    *special_build = base::AsWString(version_info->special_build());
  } else {
    *version = L"0.0.0.0-devel";
  }
}

bool GcpCrashReporterClient::ShouldShowRestartDialog(std::wstring* title,
                                                     std::wstring* message,
                                                     bool* is_rtl_locale) {
  // There is no UX associated with GCPW, so no dialog should be shown.
  return false;
}

bool GcpCrashReporterClient::AboutToRestart() {
  // GCPW should never be restarted after a crash.
  return false;
}

bool GcpCrashReporterClient::GetIsPerUserInstall() {
  // GCPW can only be installed at system level.
  return false;
}

bool GcpCrashReporterClient::GetShouldDumpLargerDumps() {
  return false;
}

int GcpCrashReporterClient::GetResultCodeRespawnFailed() {
  // The restart dialog is never shown for GCPW.
  NOTREACHED();
  return 0;
}

bool GcpCrashReporterClient::GetCrashDumpLocation(std::wstring* crash_dir) {
  base::FilePath crash_directory_path = GetFolderForCrashDumps();
  if (crash_directory_path.empty())
    return false;
  *crash_dir = crash_directory_path.value();
  return true;
}

bool GcpCrashReporterClient::IsRunningUnattended() {
  return false;
}

bool GcpCrashReporterClient::GetCollectStatsConsent() {
  return GetGCPWCollectStatsConsent();
}

bool GcpCrashReporterClient::EnableBreakpadForProcess(
    const std::string& process_type) {
  // This function is only called on Linux which the GCPW does not support.
  NOTREACHED();
  return false;
}

}  // namespace credential_provider


text:
<!DOCTYPE html>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Name of the work 8</title>
<meta name="description" content="Describe your website">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="all,follow">
<meta name="googlebot" content="index,follow,snippet,archive">
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:400,300,700,400italic">
<link rel="stylesheet" href="/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/owl.carousel.css">
<link rel="stylesheet" href="/css/owl.theme.css">

  <link href="/css/style.pink.css" rel="stylesheet" id="theme-stylesheet">

<link href="/css/custom.css" rel="stylesheet">
<link rel="shortcut icon" href="/img/favicon.png">

Kirsten Gotting

 I am a PhD candidate at the University of Wisconsin Madison.  My research uses the fungus-growing ant-microbe symbiosis to study co-evolution between the parasitic symbiont Escovopsis and the defensive adaptations developed by fungus-growing ant hosts to stop this parasite.

 I write about graduate school and what resources people have asked me for in the past. My interests include:

 - Justice in STEM
 - Trait Evolution and Diversification
 - Mycology and Bacteriology
 - Symbiosis and Adaptation
 - The History of Genetics

Home

About

Current Research

Online CV

          ©2020 Kirsten Gotting |

        Template by Bootstrapious.com

& ported to Hugo by Kishan B

  <button type="button" data-toggle="offcanvas" class="btn btn-ghost pull-left">  Menu</button>

Kirsten Gotting

Name of the work 8

Fifth abundantly made Give sixth hath. Cattle creature i be don’t them.

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.

A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Aliquam tincidunt mauris eu risus.

The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way.

Header Level 2

Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar.

The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Aliquam tincidunt mauris eu risus.

When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek, then


text:
package com.planet_ink.coffee_mud.Commands;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;

import org.mozilla.javascript.*;

public class MPRun extends StdCommand
{
	public MPRun()
	{
	}

	private final String[]	access	= I(new String[] { "MPRUN" });

	@Override
	public String[] getAccessWords()
	{
		return access;
	}

	@Override
	public boolean execute(MOB mob, List<String> commands, int metaFlags)
		throws java.io.IOException
	{
		if(mob.findTattoo("SYSTEM_MPRUNDOWN")!=null)
			return CMLib.commands().handleUnknownCommand(mob, commands);
		MOB checkMOB=mob;
		if(commands.size()>1)
		{
			final String firstParm=commands.get(1);
			final int x=firstParm.indexOf(':');
			if(x>0)
			{
				checkMOB=CMLib.players().getLoadPlayer(firstParm.substring(0,x));
				if(checkMOB==null)
				{
					mob.addTattoo("SYSTEM_MPRUNDOWN",(int)CMProps.getTicksPerMinute());
					return CMLib.commands().handleUnknownCommand(mob, commands);
				}
				final String pw=firstParm.substring(x+1);
				if(!checkMOB.playerStats().matchesPassword(pw))
				{
					mob.addTattoo("SYSTEM_MPRUNDOWN",(int)(2 * CMProps.getTicksPerMinute()));
					return CMLib.commands().handleUnknownCommand(mob, commands);
				}
				commands.remove(1);
			}
		}
		if(!CMSecurity.isAllowed(checkMOB,mob.location(),CMSecurity.SecFlag.JSCRIPTS))
			return CMLib.commands().handleUnknownCommand(mob, commands);
		if(commands.size()<2)
		{
			mob.tell(L("mprun (user:password) [script]"));
			return false;
		}
		commands.remove(0);

		final String cmd = CMParms.combineQuoted(commands, 0);
		executeScript(mob, cmd);
		mob.tell(L("Completed."));
		return false;
	}

	private void executeScript(MOB mob, String script)
	{
		final ScriptingEngine S=(ScriptingEngine)CMClass.getCommon("DefaultScriptingEngine");
		S.setSavable(false);
		S.setVarScope("*");
		S.setScript(script);
		final CMMsg msg2=CMClass.getMsg(mob,mob,null,CMMsg.MSG_OK_VISUAL,null,null,L("MPRUN"));
		S.executeMsg(mob, msg2);
		S.dequeResponses();
		S.tick(mob,Tickable.TICKID_MOB);
	}

	@Override
	public boolean canBeOrdered()
	{
		return false;
	}

	@Override
	public boolean securityCheck(MOB mob)
	{
		return true;
	}

	@Override
	public int compareTo(CMObject o)
	{
		return CMClass.classID(this).compareToIgnoreCase(CMClass.classID(o));
	}
}


text:
package com.linecorp.armeria.internal.server.annotation;

import java.lang.reflect.Type;

import com.google.common.collect.ImmutableList;

import com.linecorp.armeria.common.HttpData;
import com.linecorp.armeria.common.HttpHeaders;
import com.linecorp.armeria.common.HttpResponse;
import com.linecorp.armeria.common.MediaType;
import com.linecorp.armeria.common.ResponseHeaders;
import com.linecorp.armeria.common.annotation.Nullable;
import com.linecorp.armeria.common.util.SafeCloseable;
import com.linecorp.armeria.server.ServiceRequestContext;
import com.linecorp.armeria.server.annotation.FallthroughException;
import com.linecorp.armeria.server.annotation.ResponseConverterFunction;

/**
 * A {@link ResponseConverterFunction} which wraps a list of {@link ResponseConverterFunction}s.
 */
final class CompositeResponseConverterFunction implements ResponseConverterFunction {

    private final ImmutableList<ResponseConverterFunction> functions;

    CompositeResponseConverterFunction(ImmutableList<ResponseConverterFunction> functions) {
        this.functions = functions;
    }

    @Override
    @Nullable
    public Boolean isResponseStreaming(Type returnType, @Nullable MediaType produceType) {
        for (ResponseConverterFunction function : functions) {
            final Boolean responseStreaming = function.isResponseStreaming(returnType, produceType);
            if (responseStreaming != null) {
                return responseStreaming;
            }
        }
        return null;
    }

    @Override
    public HttpResponse convertResponse(ServiceRequestContext ctx,
                                        ResponseHeaders headers,
                                        @Nullable Object result,
                                        HttpHeaders trailers) throws Exception {
        if (result instanceof HttpResponse) {
            return (HttpResponse) result;
        }
        try (SafeCloseable ignored = ctx.push()) {
            for (final ResponseConverterFunction func : functions) {
                try {
                    return func.convertResponse(ctx, headers, result, trailers);
                } catch (FallthroughException ignore) {
                    // Do nothing.
                } catch (Exception e) {
                    throw new IllegalStateException(
                            "Response converter " + func.getClass().getName() +
                            " cannot convert a result to HttpResponse: " + result, e);
                }
            }
        }
        // There is no response converter which is able to convert 'null' result to a response.
        // In this case, a response with the specified HTTP headers would be sent.
        // If you want to force to send '204 No Content' for this case, add
        // 'NullToNoContentResponseConverterFunction' to the list of response converters.
        if (result == null) {
            return HttpResponse.of(headers, HttpData.empty(), trailers);
        }
        throw new IllegalStateException(
                "No response converter exists for a result: " + result.getClass().getName());
    }
}


text:
<!DOCTYPE html>

  <link href='imagenes/favicon.ico' rel='shortcut icon' type='image/png'>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<meta name="description" content="Apartment Share  page">
		<meta name="author" content="DSA">

		<title>Apartment Share</title>
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
		<link href="css/navbar-fixed-top.css" rel="stylesheet">
		<link href="css/apartmentshare.css" rel="stylesheet">

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            Toggle navigation

          </button>
          Actualizar mi cuenta

Acerca de nosotros

Volver al índice

Mi Cuenta

Mis Pisos

Mensajes

Cerrar Sesión

Si ves esto es que no funciono

Cabecera

						 <h6 Descripcion: <input type="text" id="descripcion">

      	<form class="form-signin" id="editar">
        	Username
            <input type="text" id="loginid" class="form-control" placeholder="Nombre de Usuario" required autofocus>

         	fullname
            <input type="text" id="fullname" class="form-control" placeholder="Nombre completo (Nombre y apellidos)" required>

	         email
            <input type="text" id="email" class="form-control" placeholder="Correo electrónico" required>

            <button class="btn btn-success" id='registrar' type="submit">Editar Cuenta</button>

            Atrás
      </form>


text:
require 'spec_helper'

describe 'newrelic_infrastructure::install' do
  let (:facts) do
    {
      :osfamily        => 'Debian',
      :operatingsystem => 'Ubuntu',
      :lsbdistrelease  => '14.04',
      :puppetversion   => Puppet.version,
      :lsbdistid       => 'Ubuntu',
      :lsbdistcodename => 'trusty',
    }
  end

  it { should contain_package('newrelic-infra') }

  it do
    should contain_apt__source('newrelic_infrastructure').with({
      :location => 'https://download.newrelic.com/infrastructure_agent/linux/apt',
      :repos    => 'main',
      :release  => 'trusty',
      :key      => {
        'id'     => 'A758B3FBCD43BE8D123A3476BB29EE038ECCE87C',
        'source' => 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg'
      }})
  end
end


text:
using Lucene.Net.Util;
using NUnit.Framework;
using System;

namespace Lucene.Net.Analysis.El
{

    /// <summary>
    /// A unit test class for verifying the correct operation of the GreekAnalyzer.
    ///
    /// </summary>
    public class GreekAnalyzerTest : BaseTokenStreamTestCase
    {

        /// <summary>
        /// Test the analysis of various greek strings.
        /// </summary>
        /// <exception cref="Exception"> in case an error occurs </exception>
        [Test]
        public virtual void TestAnalyzer()
        {
            Analyzer a = new GreekAnalyzer(TEST_VERSION_CURRENT);
            // Verify the correct analysis of capitals and small accented letters, and
            // stemming
            AssertAnalyzesTo(a, "Μία εξαιρετικά καλή και πλούσια σειρά χαρακτήρων της Ελληνικής γλώσσας", new string[] { "μια", "εξαιρετ", "καλ", "πλουσ", "σειρ", "χαρακτηρ", "ελληνικ", "γλωσσ" });
            // Verify the correct analysis of small letters with diaeresis and the elimination
            // of punctuation marks
            AssertAnalyzesTo(a, "Προϊόντα (και)     [πολλαπλές] - ΑΝΑΓΚΕΣ", new string[] { "προιοντ", "πολλαπλ", "αναγκ" });
            // Verify the correct analysis of capital accented letters and capital letters with diaeresis,
            // as well as the elimination of stop words
            AssertAnalyzesTo(a, "ΠΡΟΫΠΟΘΕΣΕΙΣ  Άψογος, ο μεστός και οι άλλοι", new string[] { "προυποθεσ", "αψογ", "μεστ", "αλλ" });
        }

        /// <summary>
        /// Test the analysis of various greek strings.
        /// </summary>
        /// <exception cref="Exception"> in case an error occurs </exception>
        /// @deprecated (3.1) Remove this test when support for 3.0 is no longer needed
        [Test]
        [Obsolete("(3.1) Remove this test when support for 3.0 is no longer needed")]
        public virtual void TestAnalyzerBWCompat()
        {
            Analyzer a = new GreekAnalyzer(LuceneVersion.LUCENE_30);
            // Verify the correct analysis of capitals and small accented letters
            AssertAnalyzesTo(a, "Μία εξαιρετικά καλή και πλούσια σειρά χαρακτήρων της Ελληνικής γλώσσας", new string[] { "μια", "εξαιρετικα", "καλη", "πλουσια", "σειρα", "χαρακτηρων", "ελληνικησ", "γλωσσασ" });
            // Verify the correct analysis of small letters with diaeresis and the elimination
            // of punctuation marks
            AssertAnalyzesTo(a, "Προϊόντα (και)     [πολλαπλές] - ΑΝΑΓΚΕΣ", new string[] { "προιοντα", "πολλαπλεσ", "αναγκεσ" });
            // Verify the correct analysis of capital accented letters and capital letters with diaeresis,
            // as well as the elimination of stop words
            AssertAnalyzesTo(a, "ΠΡΟΫΠΟΘΕΣΕΙΣ  Άψογος, ο μεστός και οι άλλοι", new string[] { "προυποθεσεισ", "αψογοσ", "μεστοσ", "αλλοι" });
        }

        [Test]
        public virtual void TestReusableTokenStream()
        {
            Analyzer a = new GreekAnalyzer(TEST_VERSION_CURRENT);
            // Verify the correct analysis of capitals and small accented letters, and
            // stemming
            AssertAnalyzesTo(a, "Μία εξαιρετικά καλή και πλούσια σειρά χαρακτήρων της Ελληνικής γλώσσας", new string[] { "μια", "εξαιρετ", "καλ", "πλουσ", "σειρ", "χαρακτηρ", "ελληνικ", "γλωσσ" });
            // Verify the correct analysis of small letters with diaeresis and the elimination
            // of punctuation marks
            AssertAnalyzesTo(a, "Προϊόντα (και)     [πολλαπλές] - ΑΝΑΓΚΕΣ", new string[] { "προιοντ", "πολλαπλ", "αναγκ" });
            // Verify the correct analysis of capital accented letters and capital letters with diaeresis,
            // as well as the elimination of stop words
            AssertAnalyzesTo(a, "ΠΡΟΫΠΟΘΕΣΕΙΣ  Άψογος, ο μεστός και οι άλλοι", new string[] { "προυποθεσ", "αψογ", "μεστ", "αλλ" });
        }

        /// <summary>
        /// blast some random strings through the analyzer </summary>
        [Test]
        public virtual void TestRandomStrings()
        {
            CheckRandomData(Random(), new GreekAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
        }
    }
}


text:
{!! Form::open(array('url' => url('/auth/register'), 'method' => 'POST', 'role' => 'form')) !!}

	{!! csrf_field() !!}

	@include('admin.partials.return-messages')

    	{!! Form::label('name', Lang::get('auth.name') , array('class' => 'sr-only')); !!}
        {!! Form::text('name', old('name'), array('id' => 'name', 'class' => 'form-control', 'placeholder' => Lang::get('auth.ph_name'), 'required' => 'required')) !!}

		{!! Form::label('first_name', Lang::get('auth.first_name') , array('class' => 'sr-only')); !!}
		{!! Form::text('first_name', old('first_name'), array('id' => 'first_name', 'class' => 'form-control', 'placeholder' => Lang::get('auth.ph_firstname'), 'required' => 'required')) !!}

		{!! Form::label('last_name', Lang::get('auth.last_name') , array('class' => 'sr-only')); !!}
		{!! Form::text('last_name', old('last_name'), array('id' => 'last_name', 'class' => 'form-control', 'placeholder' => Lang::get('auth.ph_lastname'), 'required' => 'required')) !!}

		{!! Form::label('email', Lang::get('auth.email') , array('class' => 'sr-only')); !!}
		{!! Form::email('email', old('email'), array('id' => 'email', 'class' => 'form-control', 'placeholder' => Lang::get('auth.ph_email'), 'required' => 'required')) !!}

		{!! Form::label('password', Lang::get('auth.password') , array('class' => 'sr-only')); !!}
		{!! Form::password('password', array('id' => 'password', 'class' => 'form-control', 'placeholder' => Lang::get('auth.ph_password'), 'required' => 'required',)) !!}

		{!! Form::label('password_confirmation', Lang::get('auth.confirmPassword') , array('class' => 'sr-only')); !!}
		{!! Form::password('password_confirmation', array('id' => 'password_confirmation', 'class' => 'form-control', 'placeholder' => Lang::get('auth.ph_password_conf'), 'required' => 'required',)) !!}

   {{--

--}}

                {!! Form::label('agree', 'I agree to the terms', array('class' => 'sr-only')); !!}
                {!! Form::checkbox('agree', 'agree', true, array('id' => 'agree',  'class' => 'icheckbox_square-blue','required' => 'required')); !!}
                  I agree to the {!! HTML::link('#', 'terms'); !!}

            {!! Form::button(' '.Lang::get('auth.register_submit'), array('class' => 'btn btn-primary btn-block btn-flat','type' => 'submit')) !!}

{!! Form::close() !!}


text:
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\ReservationSearchGii */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Reservations';
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

        <?= Html::a('Create Reservation', ['create'], ['class' => 'btn btn-success']) ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'room_id',
            'customer_id',
            'price_per_day',
            'date_from',
            // 'date_to',
            // 'reservation_date',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>