text:
#include "JoystickShield.h"

/**
 * Constructor
 *
 */
JoystickShield::JoystickShield() {
    // define some threshold values. Change them if your Joystick is different
    setThreshold(510, 530, 510, 540);

    // Sparkfun Joystick shield connects the Joystick to Pins 0 and 1.
    // Change it if you are using a different shield
    setJoystickPins(0, 1);

    // Sparkfun Joystick shield connects the buttons to the following pins.
    // change it if you are using a different shield.
    setButtonPins(8, 2, 3, 4, 5, 7, 6);

    // by default set the position to centered
    currentStatus = CENTER;

    // by default set the button state to NO_BUTTON
    currentButton = NO_BUTTON;

    // initialize all callback function pointers to NULL
    initializeCallbacks();
}

/**
 * Set Analyog pins which are connected to the Joystick
 *
 */
void JoystickShield::setJoystickPins(byte pinX, byte pinY) {
    pin_analog_x = pinX;
    pin_analog_y = pinY;

    // set Joystick pins to input mode
    pinMode(pin_analog_x, INPUT);
    pinMode(pin_analog_y, INPUT);
}

/**
 * Set the pins used by the buttons
 * to deactivate a button use a pin outside of the range of the arduino e.g. 255
 */
void JoystickShield::setButtonPins(byte pinSelect, byte pinUp, byte pinRight, byte pinDown, byte pinLeft, byte pinF, byte pinE)  {
    pin_joystick_button = pinSelect;
    pin_up_button       = pinUp;
    pin_right_button    = pinRight;
    pin_down_button     = pinDown;
    pin_left_button     = pinLeft;
	pin_F_button		= pinF;
	pin_E_button		= pinE;

    // set Button pins to input mode
    pinMode(pin_joystick_button, INPUT);
    pinMode(pin_up_button      , INPUT);
    pinMode(pin_right_button   , INPUT);
    pinMode(pin_down_button    , INPUT);
    pinMode(pin_left_button    , INPUT);
	pinMode(pin_E_button	   , INPUT);
	pinMode(pin_F_button       , INPUT);

    // Enable "pull-up resistors" for buttons
    digitalWrite(pin_joystick_button, HIGH);
    digitalWrite(pin_up_button      , HIGH);
    digitalWrite(pin_right_button   , HIGH);
    digitalWrite(pin_down_button    , HIGH);
    digitalWrite(pin_left_button    , HIGH);
	digitalWrite(pin_F_button       , HIGH);
	digitalWrite(pin_E_button       , HIGH);
}

/**
 * Configure threshold values for Joystick
 *
 */
void JoystickShield::setThreshold(int xLow, int xHigh, int yLow, int yHigh) {
    x_threshold_low  = xLow;
    x_threshold_high = xHigh;
    y_threshold_low  = yLow;
    y_threshold_high = yHigh;
}

/**
 * Calibrate Joystick
 *
 */
void JoystickShield::calibrateJoystick()  {
	byte i;

	// calibrate x
	int xCenter = 0;
	for(i = 0; i<10; i++)
		xCenter += analogRead(pin_analog_x);
	xCenter /= i;

	// calibrate y
	int yCenter = 0;
	for(i = 0; i<10; i++)
		yCenter += analogRead(pin_analog_y);
	yCenter /= i;

	// save Stroke of Joystick
	joystikStroke = max(pin_analog_x, pin_analog_y)*1.01;

	// set Center with tolerance
	setThreshold(xCenter-CENTERTOLERANCE, xCenter+CENTERTOLERANCE, yCenter-CENTERTOLERANCE, yCenter+CENTERTOLERANCE);
}

/**
 * Process Events. This should be called in the loop()
 *
 */
void JoystickShield::processEvents() {
    int x_direction = 0;
    int y_direction = 0;

    // read from Joystick pins
    x_position = analogRead(pin_analog_x);
    y_position = analogRead(pin_analog_y);

//	Serial.print("x->");
//	Serial.print(x_position);
//	Serial.print("\t y->");
//	Serial.println(y_position);

    // determine Joystick direction
    if (x_position > x_threshold_high) {
        x_direction = 1;
		x_position = map(x_position, x_threshold_high,x_threshold_high+x_threshold_low,0,100);
		x_position = constrain(x_position,0,100);
	} else if (x_position < x_threshold_low) {
        x_direction = -1;
		x_position = map(x_position, 0,x_threshold_low,-100,0);
    } else
		x_position = 0;

    if (y_position > y_threshold_high) {
        y_direction = 1;
		y_position = map(y_position, y_threshold_high,y_threshold_high+y_threshold_low,0,100);
		y_position = constrain(y_position,0,100);
    } else if (y_position < y_threshold_low) {
        y_direction = -1;
		y_position = map(y_position, 0,y_threshold_low,-100,0);
    } else
		y_position = 0;

    if (x_direction == -1) {
        if (y_direction == -1) {
            currentStatus = LEFT_DOWN;
        } else if (y_direction == 0) {
            currentStatus = LEFT;
        } else {
            currentStatus = LEFT_UP;
        }
    } else if (x_direction == 0) {
        if (y_direction == -1) {
            currentStatus = DOWN;
        } else if (y_direction == 0) {
            currentStatus = CENTER;
        } else {
            currentStatus = UP;
        }
    } else {
        if (y_direction == -1) {
            currentStatus = RIGHT_DOWN;
        } else if (y_direction == 0) {
            currentStatus = RIGHT;
        } else {
            currentStatus = RIGHT_UP;
        }
    }

    // Determine which buttons were pressed
    if (digitalRead(pin_joystick_button) == LOW) {
        currentButton = JOYSTICK_BUTTON;
    }

    if (digitalRead(pin_up_button) == LOW) {
        currentButton = UP_BUTTON;
    }

    if (digitalRead(pin_right_button) == LOW) {
        currentButton = RIGHT_BUTTON;
    }

    if (digitalRead(pin_down_button) == LOW) {
        currentButton = DOWN_BUTTON;
    }

    if (digitalRead(pin_left_button) == LOW) {
        currentButton = LEFT_BUTTON;
    }

	if (digitalRead(pin_F_button) == LOW) {
		currentButton = F_BUTTON;
	}

	if (digitalRead(pin_E_button) == LOW) {
		currentButton = E_BUTTON;
	}
}

void JoystickShield::processCallbacks() {
    processEvents();

    // Joystick Callbacks
    if (isCenter() && centerCallback != NULL) {
        centerCallback();
    }

    if (isUp() && upCallback != NULL) {
        upCallback();
    }

    if (isRightUp() && rightUpCallback != NULL) {
        rightUpCallback();
    }

    if (isRight() && rightCallback != NULL) {
        rightCallback();
    }

    if (isRightDown() && rightDownCallback != NULL) {
        rightDownCallback();
    }

    if (isDown() && downCallback != NULL) {
        downCallback();
    }

    if (isLeftDown() && leftDownCallback != NULL) {
        leftDownCallback();
    }

    if (isLeft() && leftCallback != NULL) {
        leftCallback();
    }

    if (isLeftUp() && leftUpCallback != NULL) {
        leftUpCallback();
    }

	if (isNotCenter() && notCenterCallback != NULL) {
		notCenterCallback();
	}

    // Button Callbacks
    if (isJoystickButton() && jsButtonCallback != NULL) {
        jsButtonCallback();
    }

    if (isUpButton() && upButtonCallback != NULL) {
        upButtonCallback();
    }

    if (isRightButton() && rightButtonCallback != NULL) {
        rightButtonCallback();
    }

    if (isDownButton() && downButtonCallback != NULL) {
        downButtonCallback();
    }

    if (isLeftButton() && leftButtonCallback != NULL) {
        leftButtonCallback();
    }

	if (isFButton() && FButtonCallback != NULL) {
        FButtonCallback();
    }

	if (isEButton() && EButtonCallback != NULL) {
		EButtonCallback();
	}

}

/**
 * Joystick in Center status
 *
 */
bool JoystickShield::isCenter() {
    if (currentStatus == CENTER ) {
        return true;
    } else {
        return false;
    }
}

/**
 * Joystick in Up status
 *
 */
bool JoystickShield::isUp() {
    if (currentStatus == UP ) {
        return true;
    } else {
        return false;
    }
}

/**
 * Joystick in Right Up status
 *
 */
bool JoystickShield::isRightUp() {
    if (currentStatus == RIGHT_UP ) {
        return true;
    } else {
        return false;
    }
}

/**
 * Joystick in Right status
 *
 */
bool JoystickShield::isRight() {
    if (currentStatus == RIGHT ) {
        return true;
    } else {
        return false;
    }
}

/**
 * Joystick in Right Down status
 *
 */
bool JoystickShield::isRightDown() {
    if (currentStatus == RIGHT_DOWN ) {
        return true;
    } else {
        return false;
    }
}

/**
 * Joystick in Down status
 *
 */
bool JoystickShield::isDown() {
    if (currentStatus == DOWN ) {
        return true;
    } else {
        return false;
    }
}

/**
 * Joystick in Left Down status
 *
 */
bool JoystickShield::isLeftDown() {
    if (currentStatus == LEFT_DOWN ) {
        return true;
    } else {
        return false;
    }
}

/**
 * Joystick in Left status
 *
 */
bool JoystickShield::isLeft() {
    if (currentStatus == LEFT ) {
        return true;
    } else {
        return false;
    }
}

/**
 * Joystick in Left Up status
 *
 */
bool JoystickShield::isLeftUp() {
    if (currentStatus == LEFT_UP) {
        return true;
    } else {
        return false;
    }
}

/**
 * Joystick in not Center status
 *
 */
bool JoystickShield::isNotCenter() {
    if (currentStatus != CENTER) {
        return true;
    } else {
        return false;
    }
}

/**
 * Joystick x position from -100 to 100, 0 = center
 *
 */
int JoystickShield::xAmplitude()  {
	return x_position;
}

/**
 * Joystick y position from -100 to 100, 0 = center
 *
 */
int JoystickShield::yAmplitude()  {
	return y_position;
}

/**
 * Joystick button pressed
 *
 */
bool JoystickShield::isJoystickButton() {
    if (currentButton == JOYSTICK_BUTTON) {
        clearButtonStates();
        return true;
    } else {
        return false;
    }
}

/**
 * Up button pressed
 *
 */
bool JoystickShield::isUpButton() {
    if (currentButton == UP_BUTTON) {
        clearButtonStates();
        return true;
    } else {
        return false;
    }
}

/**
 * Right button pressed
 *
 */
bool JoystickShield::isRightButton() {
    if (currentButton == RIGHT_BUTTON) {
        clearButtonStates();
        return true;
    } else {
        return false;
    }
}

/**
 * Down button pressed
 *
 */
bool JoystickShield::isDownButton() {
    if (currentButton == DOWN_BUTTON) {
        clearButtonStates();
        return true;
    } else {
        return false;
    }
}

/**
 * Left button pressed
 *
 */
bool JoystickShield::isLeftButton() {
    if (currentButton == LEFT_BUTTON) {
        clearButtonStates();
        return true;
    } else {
        return false;
    }
}

/**
 * F button pressed
 *
 */
bool JoystickShield::isFButton() {
    if (currentButton == F_BUTTON) {
        clearButtonStates();
        return true;
    } else {
        return false;
    }
}

/**
 * E button pressed
 *
 */
bool JoystickShield::isEButton() {
    if (currentButton == E_BUTTON) {
        clearButtonStates();
        return true;
    } else {
        return false;
    }
}
/**
 * Joystick Callbacks
 *
 */
/****************************************************************** */
void JoystickShield::onJSCenter(void (*centerCallback)(void)) {
    this->centerCallback = centerCallback;
}

void JoystickShield::onJSUp(void (*upCallback)(void)) {
    this->upCallback = upCallback;
}

void JoystickShield::onJSRightUp(void (*rightUpCallback)(void)) {
    this->rightUpCallback = rightUpCallback;
}

void JoystickShield::onJSRight(void (*rightCallback)(void)) {
    this->rightCallback = rightCallback;
}

void JoystickShield::onJSRightDown(void (*rightDownCallback)(void)) {
    this->rightDownCallback = rightDownCallback;
}

void JoystickShield::onJSDown(void (*downCallback)(void)) {
    this->downCallback = downCallback;
}

void JoystickShield::onJSLeftDown(void (*leftDownCallback)(void)) {
    this->leftDownCallback = leftDownCallback;
}

void JoystickShield::onJSLeft(void (*leftCallback)(void)) {
    this->leftCallback = leftCallback;
}

void JoystickShield::onJSLeftUp(void (*leftUpCallback)(void)) {
    this->leftUpCallback = leftUpCallback;
}

void JoystickShield::onJSnotCenter(void (*notCenterCallback)(void)) {
	this->notCenterCallback = notCenterCallback;
}

/****************************************************************** */

/**
 * Button Callbacks
 *
 */
 /****************************************************************** */
void JoystickShield::onJoystickButton(void (*jsButtonCallback)(void)) {
    this->jsButtonCallback = jsButtonCallback;
}

void JoystickShield::onUpButton(void (*upButtonCallback)(void)) {
    this->upButtonCallback = upButtonCallback;
}

void JoystickShield::onRightButton(void (*rightButtonCallback)(void)) {
    this->rightButtonCallback = rightButtonCallback;
}

void JoystickShield::onDownButton(void (*downButtonCallback)(void)) {
    this->downButtonCallback = downButtonCallback;
}

void JoystickShield::onLeftButton(void (*leftButtonCallback)(void)) {
    this->leftButtonCallback = leftButtonCallback;
}

void JoystickShield::onFButton(void (*FButtonCallback)(void)) {
	this->FButtonCallback = FButtonCallback;
}

void JoystickShield::onEButton(void (*EButtonCallback)(void)) {
	this->EButtonCallback = EButtonCallback;
}

/****************************************************************** */

/**
 * Clear the current button state
 *
 */
void JoystickShield::clearButtonStates() {
    currentButton = NO_BUTTON;
}

/**
 * Initialize all Function pointers to NULL
 *
 */
void JoystickShield::initializeCallbacks() {
    // Joystick callbacks
    centerCallback      = NULL;
    upCallback          = NULL;
    rightUpCallback     = NULL;
    rightCallback       = NULL;
    rightDownCallback   = NULL;
    downCallback        = NULL;
    leftDownCallback    = NULL;
    leftCallback        = NULL;
    leftUpCallback      = NULL;
	notCenterCallback   = NULL;

    // Button callbacks
    jsButtonCallback    = NULL;
    upButtonCallback    = NULL;
    rightButtonCallback = NULL;
    downButtonCallback  = NULL;
    leftButtonCallback  = NULL;
	FButtonCallback		= NULL;
	EButtonCallback		= NULL;
}


text:
<?xml version="1.0" encoding="UTF-8"?><module codename="org.netbeans.modules.extexecution.impl">
    <module_version install_time="1370464067230" last="true" origin="installer" specification_version="1.15.1">
        <file crc="985526827" name="config/Modules/org-netbeans-modules-extexecution-impl.xml"/>
        <file crc="1530983162" name="modules/ext/libpam4j-1.1.jar"/>
        <file crc="693707867" name="modules/ext/processtreekiller-1.0.1.jar"/>
        <file crc="1352008848" name="modules/ext/winp-1.14-patched.jar"/>
        <file crc="3850265569" name="modules/locale/org-netbeans-modules-extexecution-impl_ja.jar"/>
        <file crc="1444385553" name="modules/locale/org-netbeans-modules-extexecution-impl_pt_BR.jar"/>
        <file crc="523438744" name="modules/locale/org-netbeans-modules-extexecution-impl_ru.jar"/>
        <file crc="2953082448" name="modules/locale/org-netbeans-modules-extexecution-impl_zh_CN.jar"/>
        <file crc="3733915029" name="modules/org-netbeans-modules-extexecution-impl.jar"/>
    </module_version>
</module>

redpajama_set_name: RedPajamaGithub


text:
package org.spongepowered.api.data.manipulator.entity;

import org.spongepowered.api.data.manipulator.IntData;
import org.spongepowered.api.entity.Entity;

/**
 * Signifies that an {@link Entity} is on fire for a remaining duration of
 * "ticks".
 */
public interface IgniteableData extends IntData<IgniteableData> {

    /**
     * Gets the ticks remaining of being lit on fire.
     *
     * @return The remaining fire ticks
     */
    int getFireTicks();

    /**
     * Sets the remaining ticks of being lit on fire.
     *
     * @param ticks The ticks of being lit on fire
     * @return This manipulator, for chaining
     */
    IgniteableData setFireTicks(int ticks);

    /**
     * Gets the delay in ticks before this entity will catch fire after being in a burning block.
     *
     * @return The delay before catching fire
     */
    int getFireDelay();
}


text:
<?php

namespace Khepin\PrimingBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class KhepinPrimingBundle extends Bundle
{
}


text:
Help

Le opzioni possono essere impostate attraverso il menu opzioni, usando il tutorial o da remoto tramite comandi sms.

Un comando sms deve cominciare con # piu' la password.

Tutti i comandi devono essere separati da -, per es: #pwd-e

Se un comando ha bisogno di un parametro, il nome del comando e il parametro devono essere separati da : (due punti) per es: #pwd-s:on

Puoi specificare piu' di un comando nello stesso sms.

Se un comando ha bisogno di un parametro ma non viene fornito, signica che vuoi disabilitare quella opzione, ad es: #pwd-sms:-m: disabilita l'inoltro via mail.

I comandi disponibili sono:

#pwd SENZA ALTRE OPZIONI: risponde con un esempio di tutti i comandi a disposizione

-e risponde con la lista di tutte le opzioni attive

-w risponde con la posizione corrente del telefono. Fornisce la latitudine e la longitudine e prova a recuperare un indirizzo valido

-s:on / off abilita o disabilita l'inoltro

-m:aa@bb.com abilita l'inoltro via mail all'indirizzo specificato. Senza un indirizzo disabilita la notifica via mail

-sms:123123 abilita l'inoltro via sms al numero specificato. Senza un numero disabilita la notifica via sms

-r:risposta imposta la risposta automatica. Senza una risposta disabilita la risposta automatica

-g:nome prova a recuperare i numeri associati al nome e li notifica


text:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context="fr.free.nrw.commons.explore.recentsearches.RecentSearchesFragment">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="?android:windowBackground"
        android:orientation="vertical"
        android:id="@+id/recent_searches">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/recent_searches_text_view"
                android:layout_width="wrap_content"
                android:layout_height="@dimen/fragment_height"
                android:layout_gravity="start"
                android:gravity="center_vertical"
                android:paddingLeft="@dimen/standard_gap"
                android:paddingRight="@dimen/standard_gap"
                android:text="@string/search_recent_header"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textStyle="bold" />

            <ImageView
                android:id="@+id/recent_searches_delete_button"
                android:layout_width="@dimen/fragment_height"
                android:layout_height="@dimen/fragment_height"
                android:layout_gravity="end"
                android:background="?attr/actionBarItemBackground"
                android:clickable="true"
                android:longClickable="true"
                android:scaleType="centerInside"
                app:srcCompat="@drawable/ic_delete_grey_700_24dp" />

        </FrameLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="0.5dp"
            android:background="@color/opak_middle_grey" />

        <ListView
            android:id="@+id/recent_searches_list"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>

    </LinearLayout>

</FrameLayout>


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/switch1_on" android:state_pressed="true"></item>
    <item android:drawable="@drawable/switch1_on" android:state_selected="true"></item>
    <item android:drawable="@drawable/switch1_off"></item>
</selector>


text:
package org.uda.preciosjustos.filter;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;

public class FilterServletOutputStream extends ServletOutputStream {

    private DataOutputStream stream;

    public FilterServletOutputStream(OutputStream output) {
        stream = new DataOutputStream(output);
    }

    public void write(int b) throws IOException {
        stream.write(b);
    }

    public void write(byte[] b) throws IOException {
        stream.write(b);
    }

    public void write(byte[] b, int off, int len) throws IOException {
        stream.write(b, off, len);
    }

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

	@Override
	public void setWriteListener(WriteListener writeListener) {
		// TODO Auto-generated method stub

	}

}


text:
package com.aimbrain.sdk.faceCapture.views;

import android.content.Context;
import android.util.AttributeSet;
import android.view.SurfaceView;

public class FixedAspectSurfaceView extends SurfaceView {
    private int mRatioWidth = 0;
    private int mRatioHeight = 0;

    public FixedAspectSurfaceView(Context context) {
        this(context, null);
    }

    public FixedAspectSurfaceView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public FixedAspectSurfaceView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public boolean hasValidAspectRatio() {
        return mRatioWidth > 0 && mRatioHeight > 0;
    }

    public float getAspectRatio() {
        return mRatioWidth / (float) mRatioHeight;
    }

    /**
     * Sets the aspect ratio for this view. The size of the view will be measured based on the ratio
     * calculated from the parameters. Note that the actual sizes of parameters don't matter, that
     * is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result.
     *
     * @param width  Relative horizontal size
     * @param height Relative vertical size
     */
    public void setAspectRatio(int width, int height) {
        if (width < 0 || height < 0) {
            throw new IllegalArgumentException("Size cannot be negative.");
        }
        mRatioWidth = width;
        mRatioHeight = height;
        requestLayout();
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        int width = MeasureSpec.getSize(widthMeasureSpec);
        int height = MeasureSpec.getSize(heightMeasureSpec);
        if (!hasValidAspectRatio()) {
            setMeasuredDimension(width, height);
        } else {
            if (width < height * mRatioHeight / mRatioWidth) {
                setMeasuredDimension(width, width * mRatioHeight / mRatioWidth);
            } else {
                setMeasuredDimension(height * mRatioWidth / mRatioHeight, height);
            }
        }
    }
}


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

(function() {

'use strict';

/** @param {Event} event */
function onClick(event) {
  var element = /** @type {HTMLElement} */ (event.target);
  if (element.classList.contains('toggle-licence')) {
    element.parentElement.parentElement.classList.toggle('selected');
    document.body.classList.toggle('show-only-selected');
  }
}

document.addEventListener('click', onClick, false);

})();


text:
package org.broadinstitute.hellbender.engine;

import htsjdk.tribble.Feature;
import htsjdk.tribble.FeatureCodec;
import htsjdk.variant.variantcontext.VariantContext;
import htsjdk.variant.vcf.VCFCodec;
import org.broadinstitute.barclay.argparser.CommandLineException;
import org.broadinstitute.hellbender.GATKBaseTest;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.io.*;

public final class FeatureInputUnitTest extends GATKBaseTest {
    private static final String FEATURE_INPUT_TEST_DIRECTORY = publicTestDir + "org/broadinstitute/hellbender/engine/";

    @DataProvider(name = "InvalidFeatureArgumentValuesDataProvider")
    public Object[][] getInvalidFeatureArgumentValues() {
        return new Object[][] {
                { "name:file:file2" },
                { "name:" },
                { ":file" },
                { ",:file" },
                { "name,key=value=fred:file" },
                { "name,:file"},
                { ",key=value:file"},
                {"name,key:file"},
                {"name,key=:file"},
                {"name,=value:file"},
                {"name,=:file"},
                { ":" },
                { ",:" },
                { "::" },
                { "" },
                { "name,key=value1,key=value2:file" },   //duplicate key
                { "name,key=value,key=value:file" },      //duplicate key
                { "name:name:gendb://mydb" }
        };
    }

    @Test(dataProvider = "InvalidFeatureArgumentValuesDataProvider", expectedExceptions = CommandLineException.BadArgumentValue.class)
    public void testInvalidFeatureArgumentValue( final String invalidFeatureArgumentValue ) {
        FeatureInput<Feature> featureInput = new FeatureInput<>(invalidFeatureArgumentValue);
    }

    @DataProvider(name = "ValidFileOnlyFeatureArgumentValuesDataProvider")
    public Object[][] getValidFileOnlyFeatureArgumentValues() {
        return new Object[][] {
                {"myFile"},
                {"myName,key1=value,myFile"},     //allowed - all of this is treated as a file name
                {"=myFile"},                      //allowed - all of this is treated as a file name
                {",myFile"},                    //allowed - all of this is treated as a file name
                {"=,myFile"},                    //allowed - all of this is treated as a file name
                {"key1=value,myFile"}             //allowed - all of this is treated as a file name
        };
    }

    @Test(dataProvider = "ValidFileOnlyFeatureArgumentValuesDataProvider")
    public void testNoFeatureNameSpecified(final String validFileOnlyFeatureArgumentValue) {
        FeatureInput<Feature> featureInput = new FeatureInput<>(validFileOnlyFeatureArgumentValue);   //"myName,key1=value,myFile"

        Assert.assertEquals(featureInput.getFeaturePath(), validFileOnlyFeatureArgumentValue, "Wrong File in FeatureInput");
        // Name should default to the absolute path of the File when no name is specified
        Assert.assertEquals(featureInput.getName(), new File(validFileOnlyFeatureArgumentValue).getAbsolutePath(), "Wrong default name in FeatureInput");
    }

    @DataProvider(name = "GenDbPathAndNameData")
    public Object[][] genDbPathAndNameData() {
        return new Object[][] {
                // input String, expected Feature path, expected logical name
                {"gendb://myJsons", "gendb://myJsons", "gendb://" + new File("myJsons").getAbsolutePath()},
                {"myname:gendb://myJsons", "gendb://myJsons", "myname"},
                {"myname,key1=value1:gendb://myJsons", "gendb://myJsons", "myname"},
                {"myname//:gendb://myJsons", "gendb://myJsons", "myname//"},
                {"myname:gendb://", "gendb://", "myname"}
        };
    }

    @DataProvider(name = "GcsPathAndNameData")
    public Object[][] gcsPathAndNameData() {
        return new Object[][] {
                // input String, expected Feature path, expected logical name
                {"gs://bucket/user/my.vcf", "gs://bucket/user/my.vcf", "gs://bucket/user/my.vcf"},
                {"myname:gs://bucket/user/my.vcf", "gs://bucket/user/my.vcf", "myname"},
                {"myname,key1=value1:gs://bucket/user/my.vcf", "gs://bucket/user/my.vcf", "myname"},
                {"myname//:gs://bucket/user/my.vcf", "gs://bucket/user/my.vcf", "myname//"}
        };
    }

    @DataProvider(name = "HdfsPathAndNameData")
    public Object[][] hdfsPathAndNameData() {
        return new Object[][] {
                // input String, expected Feature path, expected logical name
                {"hdfs://localhost/user/my.vcf", "hdfs://localhost/user/my.vcf", "hdfs://localhost:8020/user/my.vcf"},
                {"myname:hdfs://localhost/user/my.vcf", "hdfs://localhost/user/my.vcf", "myname"},
                {"myname,key1=value1:hdfs://localhost/user/my.vcf", "hdfs://localhost/user/my.vcf", "myname"},
                {"myname//:hdfs://localhost/user/my.vcf", "hdfs://localhost/user/my.vcf", "myname//"}
        };
    }

    @Test(dataProvider = "GenDbPathAndNameData")
    public void testGenDbPathAndName( final String inputString, final String expectedFeaturePath, final String expectedLogicalName ) {
        final FeatureInput<VariantContext> gendbInput = new FeatureInput<>(inputString);

        Assert.assertEquals(gendbInput.getFeaturePath(), expectedFeaturePath, "wrong featurePath");
        Assert.assertEquals(gendbInput.getName(), expectedLogicalName, "wrong logical name");
    }

    @Test(dataProvider = "GcsPathAndNameData", groups={"bucket"})
    public void testGcsPathAndName( final String inputString, final String expectedFeaturePath, final String expectedLogicalName ) {
        final FeatureInput<VariantContext> gcsInput = new FeatureInput<>(inputString);

        Assert.assertEquals(gcsInput.getFeaturePath(), expectedFeaturePath, "wrong featurePath");
        Assert.assertEquals(gcsInput.getName(), expectedLogicalName, "wrong logical name");
    }

    @Test(dataProvider = "HdfsPathAndNameData")
    public void testHdfsPathAndName( final String inputString, final String expectedFeaturePath, final String expectedLogicalName ) {
        final FeatureInput<VariantContext> hdfsInput = new FeatureInput<>(inputString);

        Assert.assertEquals(hdfsInput.getFeaturePath(), expectedFeaturePath, "wrong featurePath");
        Assert.assertEquals(hdfsInput.getName(), expectedLogicalName, "wrong logical name");
    }

    @Test
    public void testFeatureNameSpecified() {
        FeatureInput<Feature> featureInput = new FeatureInput<>("myName:myFile");

        Assert.assertEquals(featureInput.getFeaturePath(), "myFile", "Wrong File in FeatureInput");
        Assert.assertEquals(featureInput.getName(), "myName", "Wrong name in FeatureInput");
    }

    @Test
    public void testNullOKAsFeatureName() {
        FeatureInput<Feature> featureInput = new FeatureInput<>("null:myFile");

        Assert.assertEquals(featureInput.getFeaturePath(), "myFile", "Wrong File in FeatureInput");
        Assert.assertEquals(featureInput.getName(), "null", "Wrong name in FeatureInput");
    }

    @Test
    public void testNullOKAsFileName() {
        FeatureInput<Feature> featureInput = new FeatureInput<>("myName:null");

        Assert.assertEquals(featureInput.getFeaturePath(), "null", "Wrong File in FeatureInput");
        Assert.assertEquals(featureInput.getName(), "myName", "Wrong name in FeatureInput");
    }

    @Test
    public void testFeatureKeyValuePairsSpecified() {
        FeatureInput<Feature> featureInput = new FeatureInput<>("myName,key1=value1,key2=value2,null=null:myFile");

        Assert.assertEquals(featureInput.getAttribute("key1"), "value1", "wrong attribute value for key1");
        Assert.assertEquals(featureInput.getAttribute("key2"), "value2", "wrong attribute value for key2");
        Assert.assertEquals(featureInput.getAttribute("null"), "null", "wrong attribute value for key \"null\"");
        Assert.assertEquals(featureInput.getAttribute("key3"), null, "wrong attribute value for key3 (not present)");

        Assert.assertEquals(featureInput.getName(), "myName");
        Assert.assertEquals(featureInput.getFeaturePath(), "myFile");
    }

    @Test
    public void testFeatureKeyValuePairSpecified() {
        FeatureInput<Feature> featureInput = new FeatureInput<>("myName,key1=value1:myFile");

        Assert.assertEquals(featureInput.getAttribute("key1"), "value1", "wrong attribute value for key1");
        Assert.assertEquals(featureInput.getAttribute("key2"), null, "wrong attribute value for key2 (not present)");

        Assert.assertEquals(featureInput.getName(), "myName");
        Assert.assertEquals(featureInput.getFeaturePath(), "myFile");
    }

    @Test
    public void testFeatureKeyValuePairsSpecifiedSameValue() {
        FeatureInput<Feature> featureInput = new FeatureInput<>("myName,key1=value,key2=value:myFile");

        Assert.assertEquals(featureInput.getAttribute("key1"), "value", "wrong attribute value for key1");
        Assert.assertEquals(featureInput.getAttribute("key2"), "value", "wrong attribute value for key2");

        Assert.assertEquals(featureInput.getName(), "myName");
        Assert.assertEquals(featureInput.getFeaturePath(), "myFile");
    }

    @DataProvider(name = "KeyValuesDataProviderForTestingNull")
    public Object[][] getKeyValuesDataProviderForTestingNull() {
        return new Object[][] {
                { "myName,key1=value1,key2=value2:myFile" },
                { "myName,null=value:myFile"},
                { "myName:myFile" },
                { "myFile" },
                { "null" },
                { "null:myFile" },
                { "null:null" },
        };
    }

    @Test(dataProvider = "KeyValuesDataProviderForTestingNull", expectedExceptions = IllegalArgumentException.class)
    public void testFeatureValuesForNullKey(final String featureInputArgument ) {
        FeatureInput<Feature> featureInput = new FeatureInput<>(featureInputArgument);
        featureInput.getAttribute(null);
    }

    @Test
    public void testFeatureCodecCache() {
        Assert.assertEquals(getVariantFeatureInputWithCachedCodec().getFeatureCodecClass(), VCFCodec.class);
    }

    @SuppressWarnings("unchecked")
    @Test
    public void testFeatureCodecCacheSerialization() throws IOException, ClassNotFoundException {
        FeatureInput<VariantContext> featureInput = getVariantFeatureInputWithCachedCodec();

        // serialize
        byte[] serializedFeatureInput;
        try (final ByteArrayOutputStream bos = new ByteArrayOutputStream();
             final ObjectOutputStream oos = new ObjectOutputStream(bos)) {
            oos.writeObject(featureInput);
            serializedFeatureInput = bos.toByteArray();
        }
        Assert.assertNotNull(serializedFeatureInput);

        // deserialize
        FeatureInput<VariantContext> roundTrippedFeatureInput;
        try (final ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(serializedFeatureInput))) {
            roundTrippedFeatureInput = (FeatureInput<VariantContext>) ois.readObject();
        }
        Assert.assertNotNull(roundTrippedFeatureInput);

        // we expect to lose the cached feature codec class on serialization, but retain the feature path
        Assert.assertNull(roundTrippedFeatureInput.getFeatureCodecClass());
        Assert.assertEquals(featureInput.getFeaturePath(), roundTrippedFeatureInput.getFeaturePath());
    }

    @SuppressWarnings("unchecked")
    private FeatureInput<VariantContext> getVariantFeatureInputWithCachedCodec() {
        final File inputVCFFile = new File(FEATURE_INPUT_TEST_DIRECTORY, "minimal_vcf4_file.vcf");
        final FeatureInput<VariantContext> featureInput = new FeatureInput<>(inputVCFFile.getAbsolutePath());
        Assert.assertNull(featureInput.getFeatureCodecClass());

        final FeatureCodec<? extends Feature, ?> codec = FeatureManager.getCodecForFile(new File(featureInput.getFeaturePath()));
        featureInput.setFeatureCodecClass((Class<FeatureCodec<VariantContext, ?>>)codec.getClass());

        return featureInput;
    }

    @Test
    public void testToString() {
        final FeatureInput<Feature> namelessFeatureInput = new FeatureInput<>("file1");
        final FeatureInput<Feature> namedFeatureInput = new FeatureInput<>("name:file1");
        final FeatureInput<Feature> namelessGenomicsDB = new FeatureInput<>("gendb://file1");
        final FeatureInput<Feature> namedGenomicsDB = new FeatureInput<>("name:gendb://file1");

        Assert.assertEquals(namelessFeatureInput.toString(), new File("file1").getAbsolutePath(), "String representation of nameless FeatureInput incorrect");
        Assert.assertEquals(namedFeatureInput.toString(), "name:" + new File("file1").getAbsolutePath(), "String representation of named FeatureInput incorrect");
        Assert.assertEquals(namelessGenomicsDB.toString(), "gendb://" + new File("file1").getAbsolutePath(), "String representation of nameless FeatureInput with genomicsDB path incorrect");
        Assert.assertEquals(namedGenomicsDB.toString(), "name:gendb://" + new File("file1").getAbsolutePath(), "String representation of named FeatureInput with genomicsDB path incorrect");
    }

    @DataProvider(name = "HasUserSuppliedNameData")
    public Object[][] hasUserSuppliedNameData() {
        return new Object[][] {
                {"hdfs://localhost/user/my.vcf", false},
                {"myname:hdfs://localhost/user/my.vcf", true},
                {"myname,key1=value1:hdfs://localhost/user/my.vcf", true},
                {"myname//:hdfs://localhost/user/my.vcf", true},
                {"myname//:/user/my.vcf", true},
                {"/user/my.vcf", false},
        };
    }

    @Test(dataProvider = "HasUserSuppliedNameData")
    public void testHasUserSuppliedName(final String inputString, final boolean isUserSupplied) {
        final FeatureInput<VariantContext> input = new FeatureInput<>(inputString);
        Assert.assertEquals(input.hasUserSuppliedName(), isUserSupplied);
    }

}


text:
package org.apache.phoenix.parse;

import static org.apache.phoenix.schema.stats.StatisticsCollectionScope.ALL;
import static org.apache.phoenix.schema.stats.StatisticsCollectionScope.COLUMNS;
import static org.apache.phoenix.schema.stats.StatisticsCollectionScope.INDEX;

import java.util.Map;

import org.apache.phoenix.schema.stats.StatisticsCollectionScope;

import edu.umd.cs.findbugs.annotations.NonNull;

public class UpdateStatisticsStatement extends SingleTableStatement {
    private final StatisticsCollectionScope scope;
    private final Map<String,Object> props;

    public UpdateStatisticsStatement(NamedTableNode table, @NonNull StatisticsCollectionScope scope, Map<String,Object> props) {
        super(table, 0);
        this.scope = scope;
        this.props = props;
    }

    public boolean updateColumns() {
        return scope == COLUMNS || scope == ALL;
    }

    public boolean updateIndex() {
        return scope == INDEX || scope == ALL;
    }

    public boolean updateAll() {
        return scope == ALL;
    }

    public Map<String,Object> getProps() {
        return props;
    };
}


text:
.mstheme{
navbutton-background-color:#CCCCCC;
top-bar-button:url(bleglob1.gif);
}
body{
font-family:"trebuchet ms",arial,helvetica;
background-image:url('blegtext.gif');
}
IL{
list-style-image:url('blebul2a.gif');
}
table.ms-toolbar{
background-image:url('toolgrad.gif');
border:1px solid #BBBBBB
}
.UserDottedLine{
margin-bottom:2px;
height:1px;
overflow:hidden;
background-color:transparent;
background-image:url('dot.gif');
background-repeat:repeat-x
}
.UserToolbar{
background-image:url('toolgrad.gif');
border:1px solid #BBBBBB;
background-repeat:repeat-x;
background-color:transparent
}
.mstheme-topbar-font{
font-family:"trebuchet ms",arial,helvetica;
color:#FFCC00;
}
h1{
font-family:"trebuchet ms",arial,helvetica;
font-weight:bold;
font-style:normal;
}
h2{
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
font-style:normal;
}
h3{
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
font-style:normal;
}
h4{
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
font-style:normal;
}
h5{
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
font-style:normal;
}
h6{
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
font-style:normal;
}
BUTTON{
border-style:solid;
border-width:1pt;
font-family:Arial,Helvetica,sArial,Helvetica,sans-serifans-serif;
font-style:normal;
}
label, .MSTHEME-LABEL{
font-family:"trebuchet ms",arial,helvetica;
font-style:normal;
}
TEXTAREA{
border-width:1pt;
font-family:"trebuchet ms",arial,helvetica;
font-style:normal;
}
FIELDSET{
border-style:solid;
border-width:1pt;
font-family:"trebuchet ms",arial,helvetica;
font-style:normal;
}
LEGEND{
font-family:"trebuchet ms",arial,helvetica;
font-style:normal;
}
SELECT{
border-style:solid;
border-width:1pt;
font-family:"trebuchet ms",arial,helvetica;
font-style:normal;
}
TABLE{
font-family:"trebuchet ms",arial,helvetica;
font-style:normal;
}
CAPTION{
font-family:"trebuchet ms",arial,helvetica;
font-style:normal;
}
TH{
font-family:"trebuchet ms",arial,helvetica;
font-style:bold;
}
MARQUEE{
font-family:"trebuchet ms",arial,helvetica;
}
.ms-main{
border-color:#FFCC00;
}
.ms-bannerframe, .ms-GRHeaderBackground, .ms-storMeFree{
background-image:url('');
background-color:#000000;
background-repeat:repeat-x;
}
.ms-banner{
color:#FFCC00;
font-family:"trebuchet ms",arial,helvetica;
}
.ms-banner a:link{
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
font-weight:normal;
text-decoration:none;
}
.ms-banner a:visited{
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
font-weight:normal;
text-decoration:none;
}
.ms-nav td{
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
color:#000000;
}
.ms-navframe{
border-color:#B9B9B9;
}
.ms-nav a{
text-decoration:none;
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
color:#993300;
}
.ms-nav a:hover{
text-decoration:underline;
color:#FF9900;
}
.ms-nav a:visited{
color:#993300;
}
.ms-viewselect a:link{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
}
.ms-titlearea{
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
}
.ms-pagetitle{
color:#000000;
font-family:"trebuchet ms",arial,helvetica;
font-weight:bold;
}
.ms-pagetitle a{
text-decoration:underline;
color:#993300;
}
.ms-pagetitle a:hover{
text-decoration:underline;
color:#FF9900;
}
.ms-announcementtitle{
font-weight:bold;
}
.ms-formlabel{
font-family:verdana;
font-size:.7em;
font-weight:normal;
color:#330099;
}
.ms-formbody{
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
}
.ms-formdescription{
font-family:"trebuchet ms",arial,helvetica;
color:#330099;
}
.ms-selected{
background-color:#0000FF;
color:#000000;
}
.ms-selected SPAN{
color:#0000FF;
}
.ms-filedialog TD{
height:16px;
}
.ms-descriptiontext{
color:#000000;
font-family:"trebuchet ms",arial,helvetica;
}
.ms-descriptiontext a{
color:#993300;
font-family:"trebuchet ms",arial,helvetica;
}
.ms-separator{
color:#000000;
}
.ms-authoringcontrols{
background-color:#B9B9B9;
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
}
.ms-alternating{
background-color:#B9B9B9;
}
.ms-back{
vertical-align:top;
padding-left:4;
padding-right:4;
padding-top:2;
padding-bottom:4;
background-color:#B9B9B9;
}
.ms-sectionheader{
color:#000000;
font-family:"trebuchet ms",arial,helvetica;
font-weight:bold;
}
.ms-sectionline{
background-color:#0000CC;
}
.ms-partline{
background-color:#0000CC;
}
.ms-propertysheet{
font-family:"trebuchet ms",arial,helvetica;
}
.ms-propertysheet th{
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
font-weight:bold;
}
.ms-propertysheet a{
text-decoration:none;
color:#993300;
}
.ms-propertysheet a:hover{
text-decoration:underline;
color:#FF9900;
}
.ms-propertysheet a:visited{
text-decoration:none;
color:#0000FF;
}
.ms-propertysheet a:visited:hover{
text-decoration:underline;
}
.ms-itemheader a{
font-family:"trebuchet ms",arial,helvetica;
font-weight:bold;
color:#000000;
text-decoration:none;
}
.ms-itemheader a:hover{
text-decoration:underline;
color:#000000;
}
.ms-itemheader a:visited{
text-decoration:none;
color:#000000;
}
.ms-itemheader a:visited:hover{
text-decoration:underline;
}
.ms-vh{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
text-decoration:none;
font-weight:normal;
}
.ms-vb{
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
height:18px;
vertical-align:top;
}
.ms-homepagetitle{
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
font-weight:bold;
text-decoration:none;
}
.ms-homepagetitle:hover{
text-decoration:underline;
color:#993300;
}
.ms-addnew{
font-weight:normal;
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
text-decoration:none;
}
.ms-cal{
border-collapse:collapse;
table-layout:fixed;
font-family:"trebuchet ms",arial,helvetica;
cursor:default;
}
.ms-caltop{
border-top:1px solid #0000CC;
border-left:1px solid #0000CC;
border-right:1px solid #0000CC;
vertical-align:top;
width:14%;
height:30px;
}
.ms-calhead{
border:none;
text-align:center;
background-color:#000000;
color:#CCCCCC;
font-family:"trebuchet ms",arial,helvetica;
padding:2px;
}
.ms-caldow{
border-top:1px solid #0000CC;
border-left:1px solid #0000CC;
border-right:1px solid #0000CC;
vertical-align:top;
text-align:center;
font-weight:bold;
color:#000000;
height:20px;
}
.ms-calmid{
border-left:1px solid #0000CC;
border-right:1px solid #0000CC;
height:20px;
}
.ms-calspacer{
border-left:1px solid #0000CC;
border-right:1px solid #0000CC;
height:4px;
}
.ms-calbot{
border-top:none;
border-left:1px solid #0000CC;
border-right:1px solid #0000CC;
border-bottom:1px solid #0000CC;
height:2px;
}
.ms-appt a{
color:#993300;
}
.ms-appt a:hover{
color:#FF9900;
}
.ms-appt{
border:2px solid #0000CC;
text-align:center;
vertical-align:middle;
height:18px;
overflow:hidden;
text-overflow:ellipsis;
background-color:#0000FF;
color:#000000;
}
.ms-caldowdown{
font-family:"trebuchet ms",arial,helvetica;
font-weight:bold;
color:#000000;
text-align:center;
vertical-align:middle;
}
.ms-caldown{
color:#000000;
vertical-align:top;
}
.ms-datepickeriframe{
position:absolute;
display:none;
background:#FFFFFF;
}
.ms-datepicker{
font-family:Arial,Helvetica,sArial,Helvetica,sans-serifans-serif;
background-color:#CCCCCC;
color:#000000;
border:2px outset activeborder;
cursor:default
}
.ms-dpdow{
border:none;
vertical-align:top;
text-align:center;
font-weight:bold;
color:#000000;
border-bottom:1px solid #0000CC;
}
.ms-dpday{
border:none;
text-align:center;
cursor:hand;
}
.ms-dpselectedday{
border:none;
background-color:#B9B9B9;
text-align:center;
cursor:hand;
}
.ms-dpnonmonth{
color:#BBBBBB;
border:none;
text-align:center;
cursor:hand;
}
.ms-dphead{
border:none;
text-align:center;
font-weight:bold;
background-color:#858585;
color:#000000;
}
.ms-dpfoot{
text-align:center;
font-style:italic;
border-top:1px solid;
border-left:none;
border-bottom:none;
border-right:none;
height:24px;
}
IMG.ms-button{
cursor:hand;
}
.ms-toolbar, .ms-toolbar a:visited{
font-family:"trebuchet ms",arial,helvetica;
text-decoration:none;
color:#993300;
}
.ms-stylebody{
font-family:verdana;
font-size:8pt;
}
.ms-styleheader a:link, .ms-stylebody a:link{
color:#993300;
text-decoration:none;
}
.ms-styleheader a:visited, .ms-stylebody a:visited{
text-decoration:none
}
.ms-styleheader a:hover, .ms-stylebody a:hover{
color:#ff3300;
text-decoration:underline;
}
.ms-gridT1{
font-family:"trebuchet ms",arial,helvetica;
text-align:center;
color:#BBBBBB;
}
select{
font-family:"trebuchet ms",arial,helvetica;
}
hr{
color:#330099;
height:2px;
}
.ms-formdescription A{
color:#993300;
text-decoration:none;
}
.ms-formtable .ms-formbody{
line-height:1.3em;
}
.ms-radiotext{
cursor:default;
text-align:left;
font-family:verdana;
font-size:10pt;
height:19px;
}
.ms-gridtext{
cursor:default;
font-family:"trebuchet ms",arial,helvetica;
height:19px;
}
.ms-formbody{
font-family:"trebuchet ms",arial,helvetica;
vertical-align:top;
}
table.ms-form th{
color:#000000;
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
vertical-align:top;
}
table.ms-form td{
width:100%;
vertical-align:top;
}
.ms-formrecurrence{
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
vertical-align:top;
}
.ms-long{
font-family:Arial,Helvetica,sArial,Helvetica,sans-serifans-serif;
width:386px;
}
.ms-banner a:link{
font-family:"trebuchet ms",arial,helvetica;
color:#FFFFFF;
font-weight:bold;
text-decoration:none;
}
.ms-banner a:visited{
font-family:"trebuchet ms",arial,helvetica;
color:#FFFFFF;
font-weight:bold;
text-decoration:none;
}
.ms-nav td, .ms-nav .ms-SPZoneLabel, .ms-input{
font-family:"trebuchet ms",arial,helvetica;
}
.ms-nav th{
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
color:#000000;
}
.ms-navheader a, .ms-navheader a:link, .ms-navheader a:visited{
font-weight:bold;
}
.ms-navframe{
background:#B9B9B9;
}
.ms-navline{
border-bottom:1px solid #000000;
}
.ms-nav .ms-navwatermark{
color:#D2D2D2;
}
.ms-selectednav{
border:1px solid #000000;
background:#CCCCCC;
padding-top:1px;
padding-bottom:2px;
}
.ms-unselectednav{
border:1px solid #B9B9B9;
padding-top:1px;
padding-bottom:2px;
}
.ms-verticaldots{
border-right:1px solid #0000CC;
border-left:none;
}
.ms-nav a:link{
}
TD.ms-titleareaframe{
color:#000000;
border-color:#FFCC00;
}
TABLE.ms-titleareaframe{
border-left:0px;
}
Div.ms-titleareaframe{
border-top:4px solid #FFCC00;
}
.ms-searchform{
background-color: #FFCC00;
}
.ms-searchcorner{
background-color:#FFCC00;
background-image:none;
}
.ms-titlearealine{
background-color:#0000CC;
}
.ms-bodyareaframe{
border-color:#FFCC00;
}
.ms-pagetitle{
font-family:"trebuchet ms",arial,helvetica;
}
.ms-pagetitle a{
text-decoration:none;
}
.ms-pagetitle a:hover{
text-decoration:underline;
}
.ms-pagecaption{
color:#FFFFFF;
font-family:"trebuchet ms",arial,helvetica;
}
.ms-selectedtitle{
background-color:#B9B9B9;
border:1px solid #999999;
padding-top:1px;
padding-bottom:2px;
}
.ms-unselectedtitle{
margin:1px;
padding-top:1px;
padding-bottom:2px;
}
.ms-menuimagecell{
background-color:#B9B9B9;
cursor:hand;
}
.ms-filedialog td{
height:16px;
}
.ms-alerttext{
color:#DB6751;
font-family:"trebuchet ms",arial,helvetica;
}
.ms-sectionheader a{
color:#000000;
text-decoration:none;
}
.ms-sectionheader a:hover{
color:#000000;
text-decoration:none;
}
.ms-sectionheader a:visited{
color:#000000;
text-decoration:none;
}
.ms-discussiontitle{
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
font-weight:bold;
}
.ms-vh2{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
text-decoration:none;
font-weight:normal;
vertical-align:top;
}
.ms-vh-icon{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
text-decoration:none;
font-weight:normal;
vertical-align:top;
width:22px;
}
.ms-vh-icon-empty{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
text-decoration:none;
font-weight:normal;
vertical-align:top;
width:0px;
}
.ms-vh-left{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
text-decoration:none;
font-weight:normal;
}
.ms-vh-left-icon{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
text-decoration:none;
font-weight:normal;
width:22px;
}
.ms-vh-left-icon-empty{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
text-decoration:none;
font-weight:normal;
width:0px;
}
.ms-vh-right{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
text-decoration:none;
font-weight:normal;
}
.ms-vh-right-icon{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
text-decoration:none;
font-weight:normal;
width:22px;
}
.ms-vh-right-icon-empty{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
text-decoration:none;
font-weight:normal;
width:0px;
}
.ms-vh a, .ms-vh a:visited, .ms-vh2 a, .ms-vh2 a:visited, .ms-vh-left a, .ms-vh-right a{
color:#993300;
text-decoration:none;
}
.ms-vh a:hover, .ms-vh2 a:hover{
text-decoration:underline;
}
.ms-vhImage{
font-family:"trebuchet ms",arial,helvetica;
color:#434343;
text-decoration:none;
font-weight:normal;
vertical-align:top;
width:18pt;
}
.ms-gb{
font-family:"trebuchet ms",arial,helvetica;
height:18px;
color:#000000;
background-color:#B9B9B9;
font-weight:bold;
}
.ms-styleheader{
font-family:verdana;
font-size:0.68em;
background-color:#B9B9B9;
}
.ms-vb, .ms-vb2, .ms-GRFont, .ms-vb-user{
font-family:"trebuchet ms",arial,helvetica;
vertical-align:top;
}
.ms-vb a, .ms-vb2 a, .ms-GRStatusText a, .ms-vb-user a{
color:#993300;
text-decoration:none;
}
.ms-vb a:hover, .ms-vb2 a:hover, .ms-vb-user a:hover{
color:#FF9900;
text-decoration:underline;
}
.ms-vb a:visited, .ms-vb2 a:visited, .ms-GRStatusText a:visited, .ms-vb-user a:visited{
color:#993300;
text-decoration:none;
}
.ms-vb a:visited:hover, .ms-vb2 a:visited:hover, .ms-vb-user a:visited:hover{
color:#FF9900;
text-decoration:underline;
}
.ms-vb2, .ms-vb-title, .ms-vb-icon, .ms-vb-user{
border-top:1px solid #FFCC00;
}
.ms-vb-icon{
vertical-align:top;
width:16px;
padding-top:2px;
padding-bottom:0px;
}
.ms-vb2{
padding-top:3px;
padding-bottom:0px;
}
.ms-addnew{
font-weight:normal;
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
text-decoration:none;
}
.ms-error{
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
color:#db6751;
}
.ms-vcal{
border-collapse:separate;
table-layout:fixed;
font-family:"trebuchet ms",arial,helvetica;
cursor:default;
}
.ms-Dcal{
border-collapse:collapse;
border-left:1px solid #0000CC;
border-right:1px solid #0000CC;
table-layout:fixed;
font-family:"trebuchet ms",arial,helvetica;
cursor:default;
}
.ms-calDmidHour{
border-color:#0000CC;
height:20px;
}
.ms-calDmidHalfHour{
border-color:#0000CC;
height:20px;
}
.ms-calDmidQuarterHour{
border:0px none;
height:20px;
}
.ms-CalSpacer{
border-left:1px solid #0000CC;
border-right:1px solid #0000CC;
height:4px;
}
.ms-CalDSpacer{
border-left:1px solid #0000CC;
border-right:1px solid #0000CC;
height:4px;
}
.ms-CalVSpacer{
background-color:#0000CC;
width:0px;
}
.ms-CalAllDay{
text-align:center;
vertical-align:top;
width:10%;
height:12px;
}
.ms-firstCalHour{
vertical-align:top;
width:10%;
height:12px;
}
.ms-calHour{
border-top:1px solid #0000CC;
vertical-align:top;
width:10%;
height:12px;
}
.ms-calHalfHour{
border-top:1px solid #000000;
vertical-align:top;
height:12px;
}
.ms-calQuarterHour{
border-top:0px none;
vertical-align:top;
height:12px;
}
.ms-Dappt{
border:2px solid #0000CC;
text-align:center;
vertical-align:middle;
height:18px;
overflow:hidden;
background-color:#0000FF;
color:#000000;
}
.ms-Vappt{
border-top:1px solid #000000;
border-left:2px solid #000000;
border-bottom:3px solid #000000;
border-right:2px solid #000000;
text-align:center;
padding-left:3px;
padding-right:3px;
vertical-align:middle;
height:12px;
overflow:hidden;
text-overflow:ellipsis;
background-color:#D2D2D2;
color:#000000;
}
.ms-Vapptsingle a, .ms-Vappt a{
text-decoration:none;
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
color:#993300;
overflow:hidden;
text-overflow:ellipsis;
}
.ms-Vappt a:link{
}
.ms-Vappt a:hover{
text-decoration:underline;
color:#000000;
}
.ms-Vevt{
padding:0px;
text-align:center;
vertical-align:top;
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
height:12px;
overflow:hidden;
text-overflow:ellipsis;
color:#000000;
}
.ms-Vevt a{
text-decoration:none;
font-family:"trebuchet ms",arial,helvetica;
font-weight:normal;
color:#000000;
}
.ms-Vevt a:link{
}
.ms-Vevt a:hover{
text-decoration:underline;
color:#000000;
}
.ms-Vevt a:visited{
color:#DFD664;
}
.ms-apptsingle{
border-left:1px solid #330099;
border-right:1px solid #330099;
height:18px;
vertical-align:middle;
overflow:hidden;
text-overflow:ellipsis;
color:#000000;
}
.ms-Dapptsingle{
border-left:1px solid #330099;
border-right:1px solid #330099;
height:18px;
vertical-align:middle;
overflow:hidden;
color:#000000;
}
.ms-Vapptsingle{
border:1px solid #330099;
text-align:center;
vertical-align:middle;
overflow:hidden;
text-overflow:ellipsis;
color:#000000;
background-color:#D2D2D2;
}
.ms-Vapptsingle a:link{
}
.ms-Vapptsingle a:hover{
text-decoration:underline;
}
.ms-Vapptsingle a:visited{
}
.ms-dpnextprev{
border:none;
text-align:center;
font-weight:bold;
background-color:#858585;
color:#000000;
cursor:hand;
}
.ms-discussionseparator{
color:#000000;
height:1px;
}
.ms-stylelabel{
font-family:verdana;
font-size:8pt;
color:#000000;
}
.ms-stylebox{
font-family:verdana;
border:1px solid #000000;
text-align:left
}
img.thumbnail{
border:3px solid #858585;
}
tr.ms-imglibselectedrow{
background-color:#B9B9B9;
}
table.ms-imglibtitletable{
border:0px solid #FFCC00;
}
.ms-imglibthumbnail{
background-color:#B9B9B9;
border:solid #858585 0px;
}
span.thumbnail{
padding:16 10;
position:relative;
width:5px;
}
span.userdata{
behavior:url(#default#userData);
display:none;
}
.ms-imglibmenuhead{
cursor:move;
}
.ms-imglibmenu{
background-color:#B9B9B9;
cursor:hand;
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
}
.ms-imglibmenutext{
cursor:move;
font-weight:bold;
color:#993300;
}
.ms-imglibmenuarea{
background-color:#B9B9B9;
}
img.ms-imglibpreviewarea{
border:solid #B9B9B9 3px;
margin-top:3px;
}
a.ms-imglibPreviewTitle{
overflow:hidden;
text-overflow:ellipsis;
width:130;
}
table.ms-imglibPreviewTable{
display:none;
}
.UserShadedRegion{
font-family:"trebuchet ms",arial,helvetica;
background-color:#B9B9B9;
}
.UserCaption{
font-family:"trebuchet ms",arial,helvetica;
background-color:#B9B9B9;
}
.UserConfiguration{
font-family:"trebuchet ms",arial,helvetica;
background-color:#B9B9B9;
}
.UserButton, .UserInput, .UserSelect{
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
}
.UserNotification{
font-family:"trebuchet ms",arial,helvetica;
padding:4px;
COLOR:#BBBBBB;
}
.UserToolBarTextArea{
padding-bottom:5px;
font-weight:normal;
font-family:"trebuchet ms",arial,helvetica;
}
.UserToolbarTextArea A:link{
COLOR:#993300;
TEXT-DECORATION:none;
}
.UserToolbarTextArea A:visited{
COLOR:#993300;
TEXT-DECORATION:none;
}
.UserToolbarTextArea A:hover{
COLOR:#FF9900;
TEXT-DECORATION:underline;
}
.UserToolbarDisabledLink{
COLOR:#000000;
font-family:"trebuchet ms",arial,helvetica;
padding:4px;
}
.UserToolbarImage{
border:medium none;
cursor:hand;
background-color:#BBBBBB;
text-align:center;
}
.UserToolBarImageArea{
padding-bottom:5px;
font-weight:normal;
font-family:"trebuchet ms",arial,helvetica;
}
.UserToolbarSelectedImage{
border-right:medium none;
border-top:medium none;
border-left:medium none;
border-bottom:#000000 1px solid;
font-weight:bold;
vertical-align:top;
text-align:center;
}
.UserGenericHeader{
font-weight:bold;
color:#000000;
font-family:"trebuchet ms",arial,helvetica;
}
.UserGeneric{
padding:8px 5px 7px 5px;
}
.UserGenericText{

}
.UserGenericBody{
padding:5px 0px 0px 17px;
}
.UserSectionTitle{
font-weight:bold;
width:100%;
margin-bottom:5px;
padding-bottom:2px;
border-bottom:solid 1px #858585;
color:#000000;
}
.UserSectionHead{
width:100%;
padding:0px 0px 3px 0px;
color:#000000;
}
.UserSectionFooter{
color: ;
border-top:1px solid #858585
}
.UserSectionBody{
width:100%;
padding:0px 0px 0px 7px;
}
.UserControlGroup{
padding-bottom:10px;
padding-top:2px;
}
.UserFooter{
width:100%;
padding:10px 7px 7px 7px;
}
.UserCommandArea{
padding-top:7px;
}
.UserCellSelected{
font-family:"trebuchet ms",arial,helvetica;
padding:1px 4px 2px 4px;
background-color:#CCCCCC;
border:solid 1px #000000;
color:#000000;
}
.UserCell{
font-family:"trebuchet ms",arial,helvetica;
padding:2px 5px 3px 5px;
color:#000000;
}
.UserGenericBulletItem{
padding-bottom:2px;
}
.ms-ToolPaneFrame{
padding:0px;
background-color:#B9B9B9;
}
.ms-ToolPaneBody{
padding-bottom:2px;
padding-top:2px;
}
.ms-ToolPaneHeader{
background-color:#858585;
border-style:none;
}
.ms-ToolPaneBorder{
border-right:#B9B9B9 1px solid;
border-top:solid none;
border-bottom:solid none;
border-left:#B9B9B9 1px solid;
}
.ms-ToolPaneClose{
background-color:#858585;
}
.ms-ToolPaneTitle{
color:#000000;
font-weight:bold;
font-family:"trebuchet ms",arial,helvetica;
padding-top:3px;
padding-bottom:3px;
background-color:#858585;
}
.ms-ToolPaneFooter{
background-color:#858585;
padding:5px;
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
}
.ms-ToolPaneError{
color:#db6751;
font-family:"trebuchet ms",arial,helvetica;
padding:2px;
}
.ms-ToolPaneInfo{
padding-right:5px;
padding-top:5px;
padding-bottom:0px;
padding-left:5px;
color:#000000;
font-family:"trebuchet ms",arial,helvetica;
background-color:#B9B9B9;
}
.ms-ToolPartSpacing{
padding-top:8px;
}
.ms-TPBorder{
border:none;
}
.ms-TPHeader{
background-color:#000000;
}
.ms-TPTitle{
color:#FFFFFF;
font-weight:bold;
font-family:"trebuchet ms",arial,helvetica;
padding-top:2px;
padding-bottom:2px;
}
.ms-TPBody{
color:#000000;
font-family:"trebuchet ms",arial,helvetica;
}
.ms-TPBody a:link, .ms-TPBody a:visited, .ms-TPBody a:hover{
color:#993300;
text-decoration:none;
cursor:hand;
}
.ms-TPCommands{
}
.ms-TPInput{
color:#FFFFFF;
font-family:"trebuchet ms",arial,helvetica;
}
.ms-CategoryTitle{
font-family:"trebuchet ms",arial,helvetica;
font-weight:bold;
text-decoration:none;
}
.ms-PropGridBuilderButton{
border:solid 1px #999999;
width:16px;
display:none;
background-color:#858585;
}
.ms-SPZone{
border:#330099 1px solid;
padding:5px;
}
.ms-SPZoneSelected{
border:#FF9900 1px solid;
padding:5px;
}
.ms-SPZoneIBar{
border:#FF9900 3px solid;
}
.ms-SPZoneLabel{
color:#330099;
font-family:"trebuchet ms",arial,helvetica;
padding:0;
}
.ms-SPError{
color:#DB6751;
font-family:"trebuchet ms",arial,helvetica;
padding-right:2px;
padding-top:2px;
padding-bottom:2px;
padding-left:2px;
border-bottom:#B9B9B9 2px solid;
}
.ms-SPZoneCaption{
color:#330099;
font-family:"trebuchet ms",arial,helvetica;
}
.ms-WPDesign{
background-color:#B9B9B9;
}
.ms-WPMenu{
background-color:#B9B9B9;
}
.ms-WPTitle{
font-weight:bold;
font-family:"trebuchet ms",arial,helvetica;
color:#000000;
padding-top:2px;
padding-bottom:2px;
}
.ms-WPTitle a:link, .ms-WPTitle a:visited{
color:#000000;
text-decoration:none;
cursor:hand;
}
.ms-WPTitle A:hover{
color:#000000;
text-decoration:underline;
cursor:hand;
}
.ms-WPSelected{
border:#0000FF 3px dashed;
}
.ms-WPBody{
font-family:"trebuchet ms",arial,helvetica;
}
.ms-WPBody table, .ms-TPBody table{
}
.ms-WPBody a:link, .ms-WPBody a:visited{
color:#993300;
text-decoration:none;
}
.ms-WPBody A:hover{
color:#FF9900;
text-decoration:underline;
}
.ms-WPBody th, .ms-TPBody th{
font-weight:bold;
}
.ms-WPBody td{
font-family:"trebuchet ms",arial,helvetica;
}
.ms-WPBody h1, .ms-TPBody h1{
font-weight:bold;
}
.ms-WPBody h2, .ms-TPBody h2{
font-weight:bold;
}
.ms-WPBody h3, .ms-TPBody h3{
font-weight:bold;
}
.ms-WPBody h4, .ms-TPBody h4{
font-weight:bold;
}
.ms-WPBody h5, .ms-TPBody h5{
font-weight:bold;
}
.ms-WPBody h6, .ms-TPBody h6{
font-weight:bold;
}
.ms-WPBorder{
border-right:#000000 1px solid;
border-left:#000000 1px solid;
border-top-style:none;
border-bottom:#000000 1px solid;
}
.ms-HoverCellActive{
border:#993300 1px solid;
background-color:#a7d3ff;
}
.ms-HoverCellActiveDark{
border:solid 1px #000000;
background-color:#B9B9B9;
}
.ms-SPLink{
font-family:"trebuchet ms",arial,helvetica;
color:#993300;
}
.ms-SPLink a:link, .ms-SPLink a:visited{
color:#993300;
text-decoration:none;
}
.ms-SPButton{
font-family:"trebuchet ms",arial,helvetica;
}
.ms-PartSpacingVertical, .ms-PartSpacingHorizontal{
padding-top:10px;
}
.ms-WPHeader{
background-color:#B9B9B9;
background-image:url('blank.gif');
background-repeat:repeat-x;
}
.ms-PageHeaderDate{
color:#000000;
font-family:"trebuchet ms",arial,helvetica;
}
.ms-PageHeaderGreeting{
color:#000000;
font-family:"trebuchet ms",arial,helvetica;
}
.ms-rtApplyBackground{
background-color:#330099;
border:0.02cm solid #999999;
}
.ms-rtRemoveBackground{
background-color:transparent;
border:0.02cm solid #CCCCCC;
}
.ms-rtToolbarDefaultStyle{
font:normal 8pt "trebuchet ms",arial,helvetica;
}
.ms-subsmanageheader{
background-color:#B9B9B9;
font-family:"trebuchet ms",arial,helvetica;
text-decoration:none;
font-weight:bold;
vertical-align:top;
}
.ms-subsmanagecell{
color:#000000;
font-family:"trebuchet ms",arial,helvetica;
height:18px;
vertical-align:top;
}
.ms-ConnError{
color:#db6751;
}
.ms-storMeUsed{
background-color:#993300;
}
.ms-storMeFree{
background-color:#0000FF;
}
.ms-storMeEstimated{
background-color:#FF9900;
}
.ms-underline{
vertical-align:top;
border-bottom:1px solid #FFCC00;
padding-left:4;
padding-right:4;
padding-top:2;
padding-bottom:4;
}
.ms-underlineback{
vertical-align:top;
border-bottom:1px solid #FFCC00;
padding-left:4;
padding-right:4;
padding-top:2;
padding-bottom:4;
background-color:#B9B9B9;
}
.ms-smallheader{
font-weight:bold;
color:#000000;
font-family:"trebuchet ms",arial,helvetica;
}
.ms-smallsectionline{
padding-left:0;
padding-right:0;
padding-top:2;
padding-bottom:0;
border-bottom:1px solid #FFCC00;
}
.ms-tabselected{
font-family:"trebuchet ms",arial,helvetica;
background-color:#0000CC;
border-right:#0000CC 2px solid;
border-left:#0000CC 2px solid;
border-top:#0000CC 2px solid;
border-bottom:#0000CC 2px solid;
font-weight:bold;
padding-top:3px;
padding-bottom:3px;
padding-left:10px;
padding-right:10px;
color:#FFCC00;
}
.ms-tabinactive{
font-family:"trebuchet ms",arial,helvetica;
background-color:#B9B9B9;
border-right:#B9B9B9 2px solid;
border-left:#B9B9B9 2px solid;
border-top:#B9B9B9 2px solid;
border-bottom:#B9B9B9 2px solid;
padding-top:3px;
padding-bottom:3px;
padding-right:10px;
padding-left:10px;
color:#993300;
}
.ms-tabinactive a:link, .ms-tabinactive a:hover, .ms-tabinactive a:visited{
color:#993300;
text-decoration:none;
}
.ms-surveyVBarT{
font-size:7pt;
font-family:verdana;
text-align:center;
color:#BBBBBB;
}
.ms-surveyGVVBar{
width:9px;
background-color:#000000;
border-top-color:#000000;
border-top-style:solid;
border-top-width:0px;
border-bottom-color:#999999;
border-bottom-style:solid;
border-bottom-width:0px;
}
.ms-surveyGVVBarS{
width:20px;
}
.ms-uploadborder{
border:1px solid #000000;
}
.ms-uploadcontrol{
background-color:#0000FF;
}
.ms-highlight{
background-color:#000000;
}
.UserBackground{
background-color:#CCCCCC;
}
.ms-MWSSelectedInstance{
color:#000000;
text-decoration:none;
}
.ms-MWSInstantiated a:link, .ms-MWSInstantiated a:visited{
color:#993300;
text-decoration:none;
}
.ms-MWSInstantiated a:hover{
color:#FF9900;
text-decoration:underline;
}
.ms-MWSUninstantiated a:link, .ms-MWSUninstantiated a:visited{
color:#993300;
text-decoration:none;
}
.ms-MWSUninstantiated a:hover{
color:#993300;
text-decoration:underline;
}
.ms-ToolStrip{
color:#000000;
background-color:#B9B9B9;
border-left:#330099 1px solid;
border-right:#330099 1px solid;
border-top:#330099 1px solid;
border-bottom:#330099 1px solid;
}


text:
<?php

	abstract class Tribe__Events__Asset__Abstract_Events_Css {

		abstract public function handle( array &$stylesheets, $mobile_break );

	}


text:
require File.expand_path('../../test_helper', __FILE__)

class QuestionsControllerTest < ActionController::TestCase
  # Replace this with your real tests.
  def test_truth
    assert true
  end
end


text:
module Rumpus.Systems.Selection where
import Data.ECS
import PreludeExtra

data SelectionSystem = SelectionSystem
    { _selSelectedEntityID :: !(Maybe EntityID)
    }
makeLenses ''SelectionSystem
defineSystemKey ''SelectionSystem

initSelectionSystem :: MonadState ECS m => m ()
initSelectionSystem = do
    registerSystem sysSelection (SelectionSystem Nothing)

getSelectedEntityID :: (MonadState ECS m) => m (Maybe EntityID)
getSelectedEntityID = viewSystem sysSelection selSelectedEntityID

setSelectedEntityID :: (MonadState ECS m) => EntityID -> m ()
setSelectedEntityID entityID = modifySystemState sysSelection $
    selSelectedEntityID ?= entityID

clearSelectedEntityID :: (MonadState ECS m) => m ()
clearSelectedEntityID = modifySystemState sysSelection $
    selSelectedEntityID .= Nothing


text:
/**
 * QuestionCreator Controller
 * @param  {Object} $scope Angular scope
 */
Frog.QuizBuilder.controller('QuestionCreator', function($scope) {

});


text:
/*
 * WinJS Contrib v2.1.0.7
 * licensed under MIT license (see http://opensource.org/licenses/MIT)
 * sources available at https://github.com/gleborgne/winjscontrib
 */

.mcn-flipviewpager {
  text-align: center;
  /* zero-out default styles */
}
.mcn-flipviewpager input[type="radio"] {
  margin: 10px 5px;
  width: 50px;
  height: 6px;
  padding: 0px;
}
.mcn-flipviewpager input[type="radio"]::-ms-check {
  width: 50px;
  height: 6px;
  padding: 0px;
  background-color: #555;
  border: 0px;
  border-radius: 0%;
  color: transparent;
}
.mcn-flipviewpager input[type="radio"]:checked:hover:active::-ms-check,
.mcn-flipviewpager input[type="radio"]:checked:hover::-ms-check,
.mcn-flipviewpager input[type="radio"]:checked::-ms-check {
  width: 50px;
  height: 6px;
  padding: 0px;
  background-color: #DDD;
}


text: venv/bin/fab vagrant create_superuser


text:
//-----------------------------------------------------------------------
// <copyright file="FlattenTest.cs" company="Akka.NET Project">
//     Copyright (C) 2009-2020 Lightbend Inc. <http://www.lightbend.com>
//     Copyright (C) 2013-2020 .NET Foundation <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------

using Akka.Streams.Dsl;
using Reactive.Streams;

namespace Akka.Streams.Tests.TCK
{
    class FlattenTest : AkkaPublisherVerification<int>
    {
        public override IPublisher<int> CreatePublisher(long elements)
        {
            var s1 = Source.From(Enumerate(elements/2));
            var s2 = Source.From(Enumerate((elements + 1)/2));
            return Source.From(new[] {s1, s2})
                .ConcatMany(x => x)
                .RunWith(Sink.AsPublisher<int>(false), Materializer);
        }
    }
}


text:
package commands.display_commands;

import java.util.ArrayList;
import java.util.ResourceBundle;

import commands.CommandOneInput;

import model.Model;

/**
 * Sets the color of the pen to the color corresponding to the position,
 * starting at 0, of the color in the drop down menu.
 * @author carlosreyes
 *
 */
public class SetPenColor extends SetViewProperties {

	@Override
	public double evaluate(Model model) {
		ArrayList<String> colors = handleSet(model);
		int pos = (int) getInputValueOne(model);
		String penColor = colors.get(pos);
		model.setPenColor(penColor);
		model.setPenColorChanged(true);
		return getInputValueOne(model);
	}
}


text:
module.exports = {
  presets: [
    [
      require.resolve('babel-preset-es2015'),
      {modules: false}
    ]
  ],
  plugins: [
    require.resolve('babel-plugin-transform-object-rest-spread'),
    require.resolve('babel-plugin-syntax-jsx'),
    require.resolve('babel-plugin-styletron'),
    require.resolve('babel-plugin-inferno')
  ]
}


text:
<!doctype html>

    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>AddressRepository</title>
<link href="../../../images/logo-icon.svg" rel="icon" type="image/svg">

<link href="../../../styles/style.css" rel="Stylesheet">
<link href="../../../styles/jetbrains-mono.css" rel="Stylesheet">
<link href="../../../styles/main.css" rel="Stylesheet">
<link href="../../../styles/prism.css" rel="Stylesheet">
<link href="../../../styles/logo-styles.css" rel="Stylesheet">

stripe-android

        <button id="theme-toggle-button"></button>

payments-ui-core/com.stripe.android.ui.core.address/AddressRepository/AddressRepository

Address<wbr>Repository

@Inject

fun AddressRepository(resources: Resources?)

        © 2022 CopyrightGenerated by dokka


text:
/* advance filter */
(function() {
  'use strict';
  var fieldsets, showFilterBtn, primaryFieldset, secondaryFieldset,
  template = '
' +
    '

' +
    '
' +
        '' +
          '' +
        '' +
    '
' +
  '
';

  function initAdvanceFilter(elem, attrs) {
    $(':submit', elem).clone().appendTo(primaryFieldset);
    primaryFieldset.addClass('skeleton');
    secondaryFieldset.hide();
    elem.bind('click', toggleFilterAction);
    if (attrs.advanceFilter === 'opened') {
      $('a[data-class="J_toggleShowFilterBtn"]').trigger('click');
    }
  }

  function toggleFilter(filterElem, elem) {
    primaryFieldset.toggleClass('skeleton').fadeIn();
    secondaryFieldset.animate({
        height: ['toggle', 'swing'],
        opacity: ['toggle', 'swing']
      }, 200, 'linear');

     primaryFieldset.find(':submit').toggle();
     if($('.glyphicon', elem).hasClass('glyphicon-chevron-down')){
        $('.glyphicon.glyphicon-chevron-down', elem).removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up');
     }else{
        $('.glyphicon.glyphicon-chevron-up', elem).removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down');
     }
  }

  function toggleFilterAction(e, elem) {
    var et = e.target;
    if (($(et).attr('data-class') || $(et).parent().attr('data-class')) ===
        showFilterBtn) {
      toggleFilter(elem);
    }
  }

  function advanceFilterDirective() {
    return {
      restrict: 'A',
      template: template,
      transclude: true,
      link: function (scope, element, attrs) {
        fieldsets = $(element).find('fieldset'),
        showFilterBtn = 'J_toggleShowFilterBtn',
        primaryFieldset = fieldsets.eq(0),
        secondaryFieldset = fieldsets.not(fieldsets.eq(0));
        initAdvanceFilter(element, attrs);
      }
    };
  }

  angular.module('ntd.directives').directive('advanceFilter', [advanceFilterDirective]);
}());


text:
package skripteditor.addons.skript.exp;

import skripteditor.expressions.Expression;

public class ExpHealth extends Expression {

	@Override
	public void registerUserFriendyPatterns() {
		registerUserFriendyPattern("[the] health of %living entities%");
		registerUserFriendyPattern("%living entities%'[s] health");
	}

	@Override
	public void registerPatterns() {
		registerPattern("[the ]health[ of %living entities%]");
		registerPattern("%living entities%['s] health");
	}

	@Override
	public String[] getExamples() {
		return new String[] { "message \"You have %health% HP left.\"",
				"if health of the player is less than 5:\n" + "\tmessage \"Warning health low!!\"" };
	}

	@Override
	public String getName() {
		return "Health";
	}

}


text:
package blackjack;
// This class represents the set of cards held by one player (or the dealer).

public class Hand {

    private Card[] cardHand;
    private int numOfCards, score;

    // This constructor builds a hand (with no cards, initially).
    public Hand() {
        cardHand = new Card[12];
        score = 0;
        numOfCards = 0;
    }

    // This method retrieves the size of this hand.
    public int getNumberOfCards() {
        return numOfCards;
    }

    // This method retrieves a particular card in this hand.  The card number is zero-based.
    public Card getCard(int index) {
        return cardHand[index];
    }

    // This method takes a card and places it into this hand.
    public void addCard(Card newcard) {
        cardHand[numOfCards++] = newcard;
        score = score + newcard.getValue();
    }

    // This method computes the score of this hand.
    public int getScore() {
        int totalScore = 0;

        for (int i = 0; i < cardHand.length; i++) {
            if (cardHand[i] != null) {
                totalScore = totalScore + cardHand[i].getValue();
            }
        }
        //not calculating acess

        boolean aceCard = false;
        for (int i = 0; i < cardHand.length; i++) {
            if (cardHand[i] != null) {
                if (cardHand[i].getFace() == 1) {
                    aceCard = true;
                }
            }
        }
        // aces value evaluation

        if (aceCard == true && totalScore + 10 < 22) {
            totalScore = totalScore + 10;
        }

        return totalScore; // replace this line with your code
    }

    // This methods discards all cards in this hand.
    public void discardAll() {
        cardHand = new Card[12];
        numOfCards = 0;
    }

}


text:
/*
 * Set up general fonts, sizes and colors
 */
body { font-family : Arial, sans-serif; }

H1, H2, H3, H4, p, a { color : #4D4D4D; }

 body {
	background-color : #FFFFFF;
}

/* The label part of the folding section */
.section-title-link .section-title {
	display : inline;
}

h2 {
	font-weight : normal;
	color : #7B8694;
}

/* For regular div labels */
H4 .div-label {
	font-family: Verdana, Arial, Helvetica;
	font-weight: bold;
	color: #4A4D4A;
	line-height:1.3;
}

/* For the main page content's title */
#content-header H4 .div-label {
	font-family: Verdana, Arial, Helvetica;
	color:white;
	font-weight: normal;
	letter-spacing:-0.03em;
}

/* For separators */
HR {
	width: 90%;
	align: left;
	height : 1px;
	color :  #dfdfe4;
}

/* Page description if the page has it. */
.page-description {
	display: block;
	font-family: Verdana, Arial, Helvetica;
	line-height:1.3;
	float : none;
	clear : both;
	margin-left: 70px;
	position : relative;
	top : -25px;
}

a {
	font-weight : bold;
	text-decoration : none;
	color : #4D4D4D;
}

a:hover  {
	color: #69c;
}

/* General link labels */
a .link-label {
	font-weight : normal;
}

/* Floating link labels for navigation links */
#navigation-links a .link-label,
#action links a .text {
	color : white;
}

#navigation-links a#overview:hover .link-label
{
    color : #FFEC89;
}

#navigation-links a#tutorials:hover .link-label,
#navigation-links a#samples:hover .link-label
{
    color : #ACCCE9;
}

#navigation-links a#whatsnew:hover .link-label,
#navigation-links a#firststeps:hover .link-label
{
    color : #E5CD89;
}

#navigation-links a#webresources:hover .link-label ,
#navigation-links a#migrate:hover .link-label
{
    color : #BCD77C;
}

#action-links a:hover .link-label {
    color : E0DFE3;
}

/* Text in links. */
a .text {
	font-weight : normal;
}

p .group-description {
	font-family: Verdana, Arial, Helvetica;
	font-weight : normal;
}

/* Hide the extra div in links by default. */
.link-extra-div {
	display : none;
}

/*
 * Set up other general properties like padding/margins
 */
html, body { width : 100%; height : 100%; }

html, body, div, h1, h4, p, a { margin : 0px; padding : 0px; }

/* Needed in IE to get shift+tab to show the active image properly */
a:active {
	border : solid 0px;
}

a img {
	border-width : 0;
}

/*
 * to get scrollbars working in both IE and Mozilla
 */
html,body { overflow: auto; }
html>body { overflow: visible; }

/***********************************************************\
 * Setup the top-level branding
\***********************************************************/

/*
 * We either use the intro-header OR we use content-header
 */
.intro-header {
	display : none;
}

/*
 * Hide the general-purpose groups - not using them in this theme
 * except for the root page
 */
#extra-group1,
#extra-group2,
#extra-group3,
#extra-group4,
#extra-group5 {
	display : none;
}

/*
 * Dimensions.
 */
body, .page {
	/* since IE doesn't support min-width, try expression */
	height : 100%;
}

.page {
	background-repeat : no-repeat;
	background-position : top left;

	min-width : 770px;
	width:expression(document.body.clientWidth < 770? "770px": "auto" );
    min-height : 425px;
	height : expression(document.body.clientHeight < 425? "425px": "100%" );
}

.intro-header, #content-header {
	position: relative;

	height: 50px;
    margin-bottom: 40px;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 8%;

    background-image : url("../graphics/contentpage/breadcrumbs-large-bg.jpg");
	background-position : top left;
	background-repeat : repeat-x;
}

/*
 * Lay out the navigation links
 * (Root page does something similar for its navigation)
 */
#navigation-links {
	position:absolute;
	top: 0px;
	right: 0px;
	padding-right: 20px;
	z-index: 100;
}

#navigation-links #page-links, #navigation-links #action-links {
	display: inline;
}

#navigation-links a {
	height : 64px;
	float : left;
	margin-left : 10px;
	position : relative;
}

#action-links a {
    float : right;
}

#navigation-links a img {
	/*max-height : 32px;*/
	height: 32px;
	width: 32px;
	vertical-align: center;
	horizontal-align: center;
	display : block;
	margin-top: 10px;
	margin-bottom: 0px;
	margin-left: auto;
	margin-right: auto;
}

#navigation-links a.high-contrast img {
	margin-bottom : 0px;
}

/*
 * Not showing description for navigation links.
 */
#navigation-links a .text { display : none; }

/* properties for each of the navigation-links  */
#navigation-links a#overview img {
	background: url(../graphics/icons/ctool/overview.png) center/contain no-repeat;
}

#navigation-links a#firststeps img {
	background: url(../graphics/icons/ctool/firststeps.png) center/contain no-repeat;
}

#navigation-links a#tutorials img {
	background: url(../graphics/icons/ctool/tutorials.png) center/contain no-repeat;
}

#navigation-links a#samples img {
	background: url(../graphics/icons/ctool/samples.png) center/contain no-repeat;
}

#navigation-links a#whatsnew img {
	background: url(../graphics/icons/ctool/whatsnew.png) center/contain no-repeat;
}

#navigation-links a#migrate img {
	background: url(../graphics/icons/ctool/migrate.png) center/contain no-repeat;
}

#navigation-links a#webresources img {
	background: url(../graphics/icons/ctool/webresources.png) center/contain no-repeat;
}

#navigation-links a#workbench img {
	background: url(../graphics/icons/ctool/workbench.png) center/contain no-repeat;
}

#action-links a {
	text-align : center;
}

#action-links a.high-contrast .link-label {
	display: none;
}

#navigation-links a.high-contrast .background-image {
	display: none;
}

#page-links a.high-contrast:focus .link-label,
#page-links a.high-contrast:active .link-label {
	display: block !important;
	text-decoration: underline;
	top : 5px;
}

#page-links span {
    display : block;
}

/*
 * Lay out the page title and description
 */

/* position the page content so that the page title overlays the bottom
 * of the background image, but make sure the content is always on top
 * (using z-index) */

#page-content {
	float : none;
	clear : both;
	position : relative;
	z-index : 10;
}

#page-content p {
	padding-bottom : 15px;
	text-align : left;
	float : none;
	clear : both;
}

/* Page content quadrants. Page content is placed in four quadrants.
 * Upper pair is separated from the bottom pair with a divider
 * to ensure bottom pair is aligned even with the uneven content
 * in the upper pair.
 */

#page-content #top-left {
  border: none; float: left; margin: 0px; padding: 0px; margin-left: 8%; width: 40%;
  clear: left;
  position: relative;
}
#page-content #top-right {
  border: none; float: right; margin: 0px; padding: 0px; margin-right: 8%; width: 40%;
  clear: right;
  position: relative;
}
/* top-bottom divider - runs the entire width to ensure
 * bottom boxes start at the same y
 */
#page-content #content-divider {
  border: none; float: none; margin: 0; padding: 0px; width: 100%;
  clear: both;
}

#page-content #bottom-left {
  border: none; float: left; margin: 0px; padding: 0px; margin-left: 8%; width: 40%;
  clear: left;
  position: relative;
}
#page-content #bottom-right {
  border: none; float: right; margin: 0px; padding: 0px; margin-right: 8%; width: 40%;
  clear: right;
  position: relative;
}

#page-content #content-header H4, .page-description {
	text-align : left;
	margin-right : 10px;
	float : none;
	clear : both;
}

/* The following rules are for extensions in all pages. Extensions should be placed in
 * groups with the style 'content-group' and contain links with the style 'content-link'.
 * Group is important so that importance mixin style can be applied to the group that
 * uses block display. We need to see a solid rectangle around the extension, not
 * a tight polygon around the link perimeter.
 */

.content-group {
	float : none;
	clear : both;
	text-align: left;
}

.content-link {
	display: block;
	margin-bottom : 20px;
	min-height: 5em;
	padding-left: 60px;	/* image will be placed here */
	position:relative;
}

.content-link img.background-image, .content-link img.content-img {
	width: 32px;
	height : auto;

	/* position image to the left of the text */
	position:absolute;
	left: 0px;
	top: 0px;

	background-size:     cover;
	background-repeat:   no-repeat;
	background-position: center center;
}

#page-content * a:hover { border-right : 5px; }

.content-link .link-label {
	font-family: Verdana, Arial, Helvetica;
	line-height:1.5;
	color: #F59616;
}

.content-link:hover .link-label {
	text-decoration : underline;
}
.content-link:hover .link-label {
	color: #69c;
	text-decoration : underline;
}

.content-link .text {
	font-family: Verdana, Arial, Helvetica;
	line-height: 1.3;
}

.categoryContentnav {
	font-family: Verdana, Arial, Helvetica;
	font-weight: bold;
	color: #4A4D4A;
	line-height:1.3;
}

.contentpgNavhover {
	font-family: Verdana, Arial, Helvetica;
	font-weight: bold;
	color: #000;
}

.topicList {
	font-family: Verdana, Arial, Helvetica;
	line-height:1.75;
	color: #00507C;
}

.topicList:hover {
	color: #69c;
}

.rss-feed-link a {
	font-family: Verdana, Arial, Helvetica;
	color: #00507C;
}

/*
 * This part is for hosting embedded document inside
 * the content area.
 */

iframe {
	position:relative;
	top:16px;
	width:100%;
	height:100%;
	padding-left:10px;
}

/* mozilla scrollbar appearing off page fix */
#page-content > iframe {
	width: 98%;
	padding-left: 2%;
}


text: {{ elementName }}


text:
import gitCommitRange from 'git-commit-range';
import chalk from 'chalk';

import commitMeetsRules from './helpers/commitMeetsRules';

const check = ({ start }: { start?: string } = {}): void => {
  const commitRangeText: string[] = gitCommitRange({
    from: start,
    type: 'text',
    includeMerges: false,
  });
  const commitRangeSha: string[] = gitCommitRange({
    from: start,
    includeMerges: false,
  });

  let hasErrors = false;

  commitRangeText.forEach((commit, i) => {
    const isCommitValid = commitMeetsRules(commit);

    if (!isCommitValid) {
      const commitSha = commitRangeSha[i].slice(0, 7);

      hasErrors = true;

      // eslint-disable-next-line no-console
      console.error(chalk.red(`\n${chalk.bold(commitSha)}\n${commit}`));
    }

    return isCommitValid;
  });

  process.exit(+hasErrors);
};

export default check;


text:
import pkg_resources

default_app_config = "pinax.documents.apps.AppConfig"
__version__ = pkg_resources.get_distribution("pinax-documents").version


text:
#ifndef __GSL_PERMUTATION_H__
#define __GSL_PERMUTATION_H__

#include <stdlib.h>
#include <gsl/gsl_types.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_inline.h>
#include <gsl/gsl_check_range.h>

#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
#endif

__BEGIN_DECLS

struct gsl_permutation_struct
{
  size_t size;
  size_t *data;
};

typedef struct gsl_permutation_struct gsl_permutation;

gsl_permutation *gsl_permutation_alloc (const size_t n);
gsl_permutation *gsl_permutation_calloc (const size_t n);
void gsl_permutation_init (gsl_permutation * p);
void gsl_permutation_free (gsl_permutation * p);
int gsl_permutation_memcpy (gsl_permutation * dest, const gsl_permutation * src);

int gsl_permutation_fread (FILE * stream, gsl_permutation * p);
int gsl_permutation_fwrite (FILE * stream, const gsl_permutation * p);
int gsl_permutation_fscanf (FILE * stream, gsl_permutation * p);
int gsl_permutation_fprintf (FILE * stream, const gsl_permutation * p, const char *format);

size_t gsl_permutation_size (const gsl_permutation * p);
size_t * gsl_permutation_data (const gsl_permutation * p);

int gsl_permutation_swap (gsl_permutation * p, const size_t i, const size_t j);

int gsl_permutation_valid (const gsl_permutation * p);
void gsl_permutation_reverse (gsl_permutation * p);
int gsl_permutation_inverse (gsl_permutation * inv, const gsl_permutation * p);
int gsl_permutation_next (gsl_permutation * p);
int gsl_permutation_prev (gsl_permutation * p);
int gsl_permutation_mul (gsl_permutation * p, const gsl_permutation * pa, const gsl_permutation * pb);

int gsl_permutation_linear_to_canonical (gsl_permutation * q, const gsl_permutation * p);
int gsl_permutation_canonical_to_linear (gsl_permutation * p, const gsl_permutation * q);

size_t gsl_permutation_inversions (const gsl_permutation * p);
size_t gsl_permutation_linear_cycles (const gsl_permutation * p);
size_t gsl_permutation_canonical_cycles (const gsl_permutation * q);

INLINE_DECL size_t gsl_permutation_get (const gsl_permutation * p, const size_t i);

#ifdef HAVE_INLINE

INLINE_FUN
size_t
gsl_permutation_get (const gsl_permutation * p, const size_t i)
{
#if GSL_RANGE_CHECK
  if (GSL_RANGE_COND(i >= p->size))
    {
      GSL_ERROR_VAL ("index out of range", GSL_EINVAL, 0);
    }
#endif
  return p->data[i];
}

#endif /* HAVE_INLINE */

__END_DECLS

#endif /* __GSL_PERMUTATION_H__ */


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using Xunit;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyCopyright("Copyright ©  2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: InternalsVisibleTo("Toggl.Core.Tests.Sync")]
[assembly: CollectionBehavior(MaxParallelThreads = 8)]


text:
export function getCustomColors (state) {
  return state.userPalette.colors;
}

export function getTempColor (state) {
  return state.userPalette.tempColor;
}


text:
/*
 * Hibernate Validator, declare and validate application constraints
 *
 * License: Apache License, Version 2.0
 * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
 */
package org.hibernate.validator.test.constraints.records;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Set;
import java.util.stream.Collectors;

import jakarta.validation.Constraint;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.ConstraintViolationException;
import jakarta.validation.OverridesAttribute;
import jakarta.validation.Payload;
import jakarta.validation.Valid;
import jakarta.validation.Validator;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.Size;

import org.hibernate.validator.test.constraints.annotations.AbstractConstrainedTest;
import org.hibernate.validator.testutils.ValidatorUtil;

import org.testng.Assert;
import org.testng.annotations.Test;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static org.hibernate.validator.testutil.ConstraintViolationAssert.assertNoViolations;
import static org.hibernate.validator.testutil.ConstraintViolationAssert.assertThat;
import static org.hibernate.validator.testutil.ConstraintViolationAssert.pathWith;
import static org.hibernate.validator.testutil.ConstraintViolationAssert.violationOf;

/**
 * @author Jan Schatteman
 */
public class RecordConstrainedTest extends AbstractConstrainedTest {

	@Test
	public void testRecord() {
		PersonRecord r = new PersonRecord( "David", 15 );
		Set<ConstraintViolation<PersonRecord>> violations = validator.validate( r );
		assertNoViolations( violations );

		r = new PersonRecord( null, 15 );
		violations = validator.validate( r );
		assertThat( violations ).containsOnlyViolations( violationOf( NotBlank.class ).withProperty( "name" ) );
		assertThat( violations ).containsOnlyViolations( violationOf( NotBlank.class ).withMessage( "Name cannot be null or empty" ) );

		r = new PersonRecord( "", 15 );
		violations = validator.validate( r );
		assertThat( violations ).containsOnlyViolations( violationOf( NotBlank.class ).withProperty( "name" ) );
		assertThat( violations ).containsOnlyViolations( violationOf( NotBlank.class ).withMessage( "Name cannot be null or empty" ) );

		r = new PersonRecord( " ", 15 );
		violations = validator.validate( r );
		assertThat( violations ).containsOnlyViolations( violationOf( NotBlank.class ).withProperty( "name" ) );
		assertThat( violations ).containsOnlyViolations( violationOf( NotBlank.class ).withMessage( "Name cannot be null or empty" ) );

		r = new PersonRecord( "David", 0 );
		 violations = validator.validate( r );
		assertThat( violations ).containsOnlyViolations( violationOf( Positive.class ).withProperty( "age" ) );
		assertThat( violations ).containsOnlyViolations( violationOf( Positive.class ).withMessage( "Age has to be a strictly positive integer" ) );

		r = new PersonRecord( "David", -15 );
		violations = validator.validate( r );
		assertThat( violations ).containsOnlyViolations( violationOf( Positive.class ).withProperty( "age" ) );
		assertThat( violations ).containsOnlyViolations( violationOf( Positive.class ).withMessage( "Age has to be a strictly positive integer" ) );
	}

	@Test
	public void testRecordWithComposedConstraint() {
		Set<ConstraintViolation<NameRecord>> violations = validator.validate( new NameRecord( "a", "b" ) );
		assertThat( violations ).containsOnlyViolations(
				violationOf( Size.class ).withProperty( "first" ),
				violationOf( Size.class ).withProperty( "last" )
		);
	}

	@Test
	public void testRecordWithCascading() {
		Set<ConstraintViolation<UserRecord>> violations = validator.validate(
				new UserRecord( new NameRecord( "a", "bbbb" ), "not_an_email" )
		);

		assertThat( violations ).containsOnlyViolations(
				violationOf( Email.class ).withProperty( "email" ),
				violationOf( Size.class ).withPropertyPath( pathWith()
						.property( "name" )
						.property( "first" )
				)
		);
	}

	@Test
	public void testRecordWithComposingConstraintAndIncorrectTarget() {
		Set<ConstraintViolation<BadNameRecord>> violations = validator.validate( new BadNameRecord( "a", "b" ) );
		assertThat( violations ).isEmpty();
	}

	@Test
	public void testExplicitConstructorRecord() {
		try {
			new ConstructorValidationRecord( "David", 15 );
		}
		catch (ConstraintViolationException e) {
			Assert.fail( "No violations expected" );
		}

		try {
			new ConstructorValidationRecord( null, 15 );
		}
		catch (ConstraintViolationException e) {
			assertThat( e.getConstraintViolations() ).containsOnlyViolations( violationOf( NotBlank.class ).withMessage( "Name cannot be null or empty" ) );
		}

		try {
			new ConstructorValidationRecord( "", 15 );
		}
		catch (ConstraintViolationException e) {
			assertThat( e.getConstraintViolations() ).containsOnlyViolations( violationOf( NotBlank.class ).withMessage( "Name cannot be null or empty" ) );
		}

		try {
			new ConstructorValidationRecord( " ", 15 );
		}
		catch (ConstraintViolationException e) {
			assertThat( e.getConstraintViolations() ).containsOnlyViolations( violationOf( NotBlank.class ).withMessage( "Name cannot be null or empty" ) );
		}

		try {
			new ConstructorValidationRecord( "David", 0 );
		}
		catch (ConstraintViolationException e) {
			assertThat( e.getConstraintViolations() ).containsOnlyViolations( violationOf( Positive.class ).withMessage( "Age has to be a strictly positive integer" ) );
		}

		try {
			new ConstructorValidationRecord( "David", -15 );
		}
		catch (ConstraintViolationException e) {
			assertThat( e.getConstraintViolations() ).containsOnlyViolations( violationOf( Positive.class ).withMessage( "Age has to be a strictly positive integer" ) );
		}
	}

	@Test
	public void testCompactConstructorRecord() {
		try {
			new CompactConstructorValidationRecord( "David" );
		}
		catch (ConstraintViolationException e) {
			Assert.fail( "No violations expected" );
		}

		try {
			new CompactConstructorValidationRecord( null );
		}
		catch (ConstraintViolationException e) {
			assertThat( e.getConstraintViolations() ).containsOnlyViolations( violationOf( NotBlank.class ).withMessage( "Name cannot be null or empty" ) );
		}

		try {
			new CompactConstructorValidationRecord( "" );
		}
		catch (ConstraintViolationException e) {
			assertThat( e.getConstraintViolations() ).containsOnlyViolations( violationOf( NotBlank.class ).withMessage( "Name cannot be null or empty" ) );
		}

		try {
			new CompactConstructorValidationRecord( " " );
		}
		catch (ConstraintViolationException e) {
			assertThat( e.getConstraintViolations() ).containsOnlyViolations( violationOf( NotBlank.class ).withMessage( "Name cannot be null or empty" ) );
		}
	}

	@Test
	public void testRecordMethodValidation() {
		try {
			new MethodValidationRecord( 50 );
		}
		catch (ConstraintViolationException e) {
			assertThat( e.getConstraintViolations() ).containsOnlyViolations( violationOf( Positive.class ) );
		}
	}

	private record PersonRecord(@NotBlank(message = "Name cannot be null or empty") String name, @Positive(message = "Age has to be a strictly positive integer") int age) {
	}

	private record BadNameRecord(@AtLeastNCharactersWrongTarget(min = 2) String first, @AtLeastNCharactersWrongTarget(min = 2) String last) {
	}

	private record NameRecord(@AtLeastNCharacters(min = 2) String first, @AtLeastNCharacters(min = 2) String last) {
	}

	private record UserRecord(@Valid NameRecord name, @Email String email) {
	}

	private record ConstructorValidationRecord(String name, int age) implements ConstructorValidator {
		private ConstructorValidationRecord(@NotBlank(message = "Name cannot be null or empty") String name, @Positive(message = "Age has to be a strictly positive integer") int age) {
			validate( name, age );
			this.name = name;
			this.age = age;
		}
	}

	private record CompactConstructorValidationRecord(
			@NotBlank(message = "Name cannot be null or empty") String name) implements ConstructorValidator {
		private CompactConstructorValidationRecord {
			validate( name );
		}
	}

	private record MethodValidationRecord(int age) implements MethodValidator {
		private MethodValidationRecord(@Positive int age) {
			this.age = age;
			doSomethingSilly( age - 100 );
		}

		public void doSomethingSilly(@Positive int arg) {
			validate( this, new Object() { }.getClass().getEnclosingMethod(), arg );
		}
	}

	private interface ConstructorValidator {
		default void validate(Object ... args) {
			Validator v = ValidatorUtil.getValidator();
			Constructor c = getClass().getDeclaredConstructors()[0];
			Set<ConstraintViolation<?>> violations = v.forExecutables().validateConstructorParameters( c, args );
			if ( !violations.isEmpty() ) {
				String message = violations.stream()
						.map( ConstraintViolation::getMessage )
						.collect( Collectors.joining( ";" ) );
				throw new ConstraintViolationException( message, violations );
			}
		}
	}

	private interface MethodValidator {
		default void validate(Object instance, Method m, Object ... args) {
			Validator v = ValidatorUtil.getValidator();
			Set<ConstraintViolation<Object>> violations = v.forExecutables().validateParameters( instance, m, args );
			if ( !violations.isEmpty() ) {
				String message = violations.stream()
						.map( ConstraintViolation::getMessage )
						.collect( Collectors.joining( ";" ) );
				throw new ConstraintViolationException( message, violations );
			}
		}
	}

	@Size
	@NotNull
	@Documented
	@Retention(RetentionPolicy.RUNTIME)
	@Target({FIELD})
	@Constraint(validatedBy = {})
	@interface AtLeastNCharacters {

		@OverridesAttribute(constraint = Size.class, name = "min")
		int min() default 0;

		String message() default "message";

		Class<?>[] groups() default {};

		Class<? extends Payload>[] payload() default {};
	}

	@Size
	@NotNull
	@Documented
	@Retention(RetentionPolicy.RUNTIME)
	@Target({METHOD})
	@Constraint(validatedBy = {})
	@interface AtLeastNCharactersWrongTarget {

		@OverridesAttribute(constraint = Size.class, name = "min")
		int min() default 0;

		String message() default "message";

		Class<?>[] groups() default {};

		Class<? extends Payload>[] payload() default {};
	}
}


text:
<?php

namespace PhpParser\Node;

use PhpParser\NodeAbstract;

abstract class Stmt extends NodeAbstract {

}