text:
var canvas;
var gl;
var shaderProgram;

// Buffers
var teapotVertexPositionBuffer;
var teapotVertexNormalBuffer;
var teapotVertexTextureCoordBuffer;
var teapotVertexIndexBuffer;

// Model-view and projection matrix and model-view matrix stack
var mvMatrixStack = [];
var mvMatrix = mat4.create();
var pMatrix = mat4.create();

// Variable for storing textures
var earthTexture;
var metalTexture;

// Variable that stores  loading state of textures.
var numberOfTextures = 2;
var texturesLoaded = 0;

// Helper variables for rotation
var teapotAngle = 180;

// Helper variable for animation
var lastTime = 0;

//
// Matrix utility functions
//
// mvPush   ... push current matrix on matrix stack
// mvPop    ... pop top matrix from stack
// degToRad ... convert degrees to radians
//
function mvPushMatrix() {
  var copy = mat4.create();
  mat4.set(mvMatrix, copy);
  mvMatrixStack.push(copy);
}

function mvPopMatrix() {
  if (mvMatrixStack.length == 0) {
    throw "Invalid popMatrix!";
  }
  mvMatrix = mvMatrixStack.pop();
}

function degToRad(degrees) {
  return degrees * Math.PI / 180;
}

//
// initGL
//
// Initialize WebGL, returning the GL context or null if
// WebGL isn't available or could not be initialized.
//
function initGL(canvas) {
  var gl = null;
  try {
    // Try to grab the standard context. If it fails, fallback to experimental.
    gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
    gl.viewportWidth = canvas.width;
    gl.viewportHeight = canvas.height;
  } catch(e) {}

  // If we don't have a GL context, give up now
  if (!gl) {
    alert("Unable to initialize WebGL. Your browser may not support it.");
  }
  return gl;
}

//
// getShader
//
// Loads a shader program by scouring the current document,
// looking for a script with the specified ID.
//
function getShader(gl, id) {
  var shaderScript = document.getElementById(id);

  // Didn't find an element with the specified ID; abort.
  if (!shaderScript) {
    return null;
  }

  // Walk through the source element's children, building the
  // shader source string.
  var shaderSource = "";
  var currentChild = shaderScript.firstChild;
  while (currentChild) {
    if (currentChild.nodeType == 3) {
        shaderSource += currentChild.textContent;
    }
    currentChild = currentChild.nextSibling;
  }

  // Now figure out what type of shader script we have,
  // based on its MIME type.
  var shader;
  if (shaderScript.type == "x-shader/x-fragment") {
    shader = gl.createShader(gl.FRAGMENT_SHADER);
  } else if (shaderScript.type == "x-shader/x-vertex") {
    shader = gl.createShader(gl.VERTEX_SHADER);
  } else {
    return null;  // Unknown shader type
  }

  // Send the source to the shader object
  gl.shaderSource(shader, shaderSource);

  // Compile the shader program
  gl.compileShader(shader);

  // See if it compiled successfully
  if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
    alert(gl.getShaderInfoLog(shader));
    return null;
  }

  return shader;
}

//
// initShaders
//
// Initialize the shaders, so WebGL knows how to light our scene.
//
function initShaders() {
    var fragmentShader = getShader(gl, "per-fragment-lighting-fs");
    var vertexShader = getShader(gl, "per-fragment-lighting-vs");

  // Create the shader program
  shaderProgram = gl.createProgram();
  gl.attachShader(shaderProgram, vertexShader);
  gl.attachShader(shaderProgram, fragmentShader);
  gl.linkProgram(shaderProgram);

  // If creating the shader program failed, alert
  if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
    alert("Unable to initialize the shader program.");
  }

  // start using shading program for rendering
  gl.useProgram(shaderProgram);

  // store location of aVertexPosition variable defined in shader
  shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");

  // turn on vertex position attribute at specified position
  gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);

  // store location of vertex normals variable defined in shader
  shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, "aVertexNormal");

  // turn on vertex normals attribute at specified position
  gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);

  // store location of texture coordinate variable defined in shader
  shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");

  // turn on texture coordinate attribute at specified position
  gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);

  // store location of uPMatrix variable defined in shader - projection matrix
  shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, "uPMatrix");
  // store location of uMVMatrix variable defined in shader - model-view matrix
  shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
  // store location of uNMatrix variable defined in shader - normal matrix
  shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, "uNMatrix");
  // store location of uSampler variable defined in shader
  shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
  // store location of uMaterialShininess variable defined in shader
  shaderProgram.materialShininessUniform = gl.getUniformLocation(shaderProgram, "uMaterialShininess");
  // store location of uShowSpecularHighlights variable defined in shader
  shaderProgram.showSpecularHighlightsUniform = gl.getUniformLocation(shaderProgram, "uShowSpecularHighlights");
  // store location of uUseTextures variable defined in shader
  shaderProgram.useTexturesUniform = gl.getUniformLocation(shaderProgram, "uUseTextures");
  // store location of uUseLighting variable defined in shader
  shaderProgram.useLightingUniform = gl.getUniformLocation(shaderProgram, "uUseLighting");
  // store location of uAmbientColor variable defined in shader
  shaderProgram.ambientColorUniform = gl.getUniformLocation(shaderProgram, "uAmbientColor");
  // store location of uPointLightingLocation variable defined in shader
  shaderProgram.pointLightingLocationUniform = gl.getUniformLocation(shaderProgram, "uPointLightingLocation");
  // store location of uPointLightingSpecularColor variable defined in shader
  shaderProgram.pointLightingSpecularColorUniform = gl.getUniformLocation(shaderProgram, "uPointLightingSpecularColor");
  // store location of uPointLightingDiffuseColor variable defined in shader
  shaderProgram.pointLightingDiffuseColorUniform = gl.getUniformLocation(shaderProgram, "uPointLightingDiffuseColor");
}

//
// setMatrixUniforms
//
// Set the uniform values in shaders for model-view and projection matrix.
//
function setMatrixUniforms() {
  gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix);
  gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);

  var normalMatrix = mat3.create();
  mat4.toInverseMat3(mvMatrix, normalMatrix);
  mat3.transpose(normalMatrix);
  gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, normalMatrix);
}

//
// initTextures
//
// Initialize the textures we'll be using, then initiate a load of
// the texture images. The handleTextureLoaded() callback will finish
// the job; it gets called each time a texture finishes loading.
//
function initTextures() {
  earthTexture = gl.createTexture();
  earthTexture.image = new Image();
  earthTexture.image.onload = function () {
    handleTextureLoaded(earthTexture)
  }
  earthTexture.image.src = "./assets/earth.jpg";

  metalTexture = gl.createTexture();
  metalTexture.image = new Image();
  metalTexture.image.onload = function () {
    handleTextureLoaded(metalTexture)
  }
  metalTexture.image.src = "./assets/metal.jpg";
}

function handleTextureLoaded(texture) {
  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);

  // Third texture usus Linear interpolation approximation with nearest Mipmap selection
  gl.bindTexture(gl.TEXTURE_2D, texture);
  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image);
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
  gl.generateMipmap(gl.TEXTURE_2D);

  gl.bindTexture(gl.TEXTURE_2D, null);

  // when texture loading is finished we can draw scene.
  texturesLoaded += 1;
}

//
// handleLoadedTeapot
//
// Handle loaded teapot
//
function handleLoadedTeapot(teapotData) {
  // Pass the normals into WebGL
  teapotVertexNormalBuffer = gl.createBuffer();
  gl.bindBuffer(gl.ARRAY_BUFFER, teapotVertexNormalBuffer);
  gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(teapotData.vertexNormals), gl.STATIC_DRAW);
  teapotVertexNormalBuffer.itemSize = 3;
  teapotVertexNormalBuffer.numItems = teapotData.vertexNormals.length / 3;

  // Pass the texture coordinates into WebGL
  teapotVertexTextureCoordBuffer = gl.createBuffer();
  gl.bindBuffer(gl.ARRAY_BUFFER, teapotVertexTextureCoordBuffer);
  gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(teapotData.vertexTextureCoords), gl.STATIC_DRAW);
  teapotVertexTextureCoordBuffer.itemSize = 2;
  teapotVertexTextureCoordBuffer.numItems = teapotData.vertexTextureCoords.length / 2;

  // Pass the vertex positions into WebGL
  teapotVertexPositionBuffer = gl.createBuffer();
  gl.bindBuffer(gl.ARRAY_BUFFER, teapotVertexPositionBuffer);
  gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(teapotData.vertexPositions), gl.STATIC_DRAW);
  teapotVertexPositionBuffer.itemSize = 3;
  teapotVertexPositionBuffer.numItems = teapotData.vertexPositions.length / 3;

  // Pass the indices into WebGL
  teapotVertexIndexBuffer = gl.createBuffer();
  gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, teapotVertexIndexBuffer);
  gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(teapotData.indices), gl.STATIC_DRAW);
  teapotVertexIndexBuffer.itemSize = 1;
  teapotVertexIndexBuffer.numItems = teapotData.indices.length;

  document.getElementById("loadingtext").textContent = "";
}

//
// loadTeapot
//
// Load teapot
//
function loadTeapot() {
  var request = new XMLHttpRequest();
  request.open("GET", "./assets/Teapot.json");
  request.onreadystatechange = function () {
    if (request.readyState == 4) {
      handleLoadedTeapot(JSON.parse(request.responseText));
    }
  }
  request.send();
}

//
// drawScene
//
// Draw the scene.
//
function drawScene() {
  // set the rendering environment to full canvas size
  gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);
  // Clear the canvas before we start drawing on it.
  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);

  if (teapotVertexPositionBuffer == null || teapotVertexNormalBuffer == null || teapotVertexTextureCoordBuffer == null || teapotVertexIndexBuffer == null) {
    return;
  }

  // Establish the perspective with which we want to view the
  // scene. Our field of view is 45 degrees, with a width/height
  // ratio of 640:480, and we only want to see objects between 0.1 units
  // and 100 units away from the camera.
  mat4.perspective(45, gl.viewportWidth / gl.viewportHeight, 0.1, 100.0, pMatrix);

  var specularHighlights = document.getElementById("specular").checked;
  gl.uniform1i(shaderProgram.showSpecularHighlightsUniform, specularHighlights);

  // Ligthing
  var lighting = document.getElementById("lighting").checked;

  // set uniform to the value of the checkbox.
  gl.uniform1i(shaderProgram.useLightingUniform, lighting);

  // set uniforms for lights as defined in the document
  if (lighting) {
    gl.uniform3f(
      shaderProgram.ambientColorUniform,
      parseFloat(document.getElementById("ambientR").value),
      parseFloat(document.getElementById("ambientG").value),
      parseFloat(document.getElementById("ambientB").value)
    );

    gl.uniform3f(
      shaderProgram.pointLightingLocationUniform,
      parseFloat(document.getElementById("lightPositionX").value),
      parseFloat(document.getElementById("lightPositionY").value),
      parseFloat(document.getElementById("lightPositionZ").value)
    );

    gl.uniform3f(
      shaderProgram.pointLightingSpecularColorUniform,
      parseFloat(document.getElementById("specularR").value),
      parseFloat(document.getElementById("specularG").value),
      parseFloat(document.getElementById("specularB").value)
    );

    gl.uniform3f(
      shaderProgram.pointLightingDiffuseColorUniform,
      parseFloat(document.getElementById("diffuseR").value),
      parseFloat(document.getElementById("diffuseG").value),
      parseFloat(document.getElementById("diffuseB").value)
    );
  }

  // Textures
  var texture = document.getElementById("texture").value;

  // set uniform to the value of the checkbox.
  gl.uniform1i(shaderProgram.useTexturesUniform, texture != "none");

  // Set the drawing position to the "identity" point, which is
  // the center of the scene.
  mat4.identity(mvMatrix);

  // Now move the drawing position a bit to where we want to start
  // drawing the world.
  mat4.translate(mvMatrix, [0, 0, -40]);
  mat4.rotate(mvMatrix, degToRad(23.4), [1, 0, -1]);
  mat4.rotate(mvMatrix, degToRad(teapotAngle), [0, 1, 0]);

  // Activate textures
  gl.activeTexture(gl.TEXTURE0);
  if (texture == "earth") {
    gl.bindTexture(gl.TEXTURE_2D, earthTexture);
  } else if (texture == "galvanized") {
    gl.bindTexture(gl.TEXTURE_2D, metalTexture);
  }
  gl.uniform1i(shaderProgram.samplerUniform, 0);

  // Activate shininess
  gl.uniform1f(shaderProgram.materialShininessUniform, parseFloat(document.getElementById("shininess").value));

  // Set the vertex positions attribute for the teapot vertices.
  gl.bindBuffer(gl.ARRAY_BUFFER, teapotVertexPositionBuffer);
  gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, teapotVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);

  // Set the texture coordinates attribute for the vertices.
  gl.bindBuffer(gl.ARRAY_BUFFER, teapotVertexTextureCoordBuffer);
  gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, teapotVertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);

  // Set the normals attribute for the vertices.
  gl.bindBuffer(gl.ARRAY_BUFFER, teapotVertexNormalBuffer);
  gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, teapotVertexNormalBuffer.itemSize, gl.FLOAT, false, 0, 0);

  // Set the index for the vertices.
  gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, teapotVertexIndexBuffer);
  setMatrixUniforms();

  // Draw the teapot
  gl.drawElements(gl.TRIANGLES, teapotVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);
}

//
// animate
//
// Called every time before redeawing the screen.
//
function animate() {
  var timeNow = new Date().getTime();
  if (lastTime != 0) {
    var elapsed = timeNow - lastTime;

    // rotate the teapot for a small amount
    teapotAngle += 0.05 * elapsed;
  }
  lastTime = timeNow;
}

//
// start
//
// Called when the canvas is created to get the ball rolling.
// Figuratively, that is. There's nothing moving in this demo.
//
function start() {
  canvas = document.getElementById("glcanvas");

  gl = initGL(canvas);      // Initialize the GL context
  if (gl) {
    gl.clearColor(0.0, 0.0, 0.0, 1.0);                      // Set clear color to black, fully opaque
    gl.clearDepth(1.0);                                     // Clear everything
    gl.enable(gl.DEPTH_TEST);                               // Enable depth testing
    gl.depthFunc(gl.LEQUAL);                                // Near things obscure far things

    // Initialize the shaders; this is where all the lighting for the
    // vertices and so forth is established.
    initShaders();

    // Next, load and set up the textures we'll be using.
    initTextures();
    loadTeapot();

    // Set up to draw the scene periodically.
    setInterval(function() {
      if (texturesLoaded == numberOfTextures) { // only draw scene and animate when textures are loaded.
        requestAnimationFrame(animate);
        drawScene();
      }
    }, 15);
  }
}


text:
from .config import *  # noqa
from .parse import *  # noqa

redpajama_set_name: RedPajamaGithub


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

    <groupId>@project.groupId@.it</groupId>
    <artifactId>@project.artifactId@-it</artifactId>
    <version>@project.version@</version>
    <name>IT :: MOJO :: Generate</name>

    <organization>
        <name>Labs64 GmbH</name>
        <url>http://www.labs64.com</url>
    </organization>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>@project.groupId@</groupId>
                <artifactId>@project.artifactId@</artifactId>
                <version>@project.version@</version>
                <executions>
                    <execution>
                        <id>generate</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <domain_creation_date>2010-04</domain_creation_date>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


text:
//-----------------------------------------------------------------------
// <copyright file="CSharpTemplateModelBase.cs" company="NSwag">
//     Copyright (c) Rico Suter. All rights reserved.
// </copyright>
// <license>https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md</license>
// <author>Rico Suter, mail@rsuter.com</author>
//-----------------------------------------------------------------------

using NJsonSchema.CodeGeneration.CSharp;

namespace NSwag.CodeGeneration.CSharp.Models
{
    /// Base class for the CSharp models
    public abstract class CSharpTemplateModelBase
    {
        private readonly string _controllerName;
        private readonly CSharpGeneratorBaseSettings _settings;

        /// Initializes a new instance of the <see cref="CSharpTemplateModelBase"/> class.
        /// <param name="controllerName">Name of the controller.</param>
        /// <param name="settings">The settings.</param>
        protected CSharpTemplateModelBase(string controllerName, CSharpGeneratorBaseSettings settings)
        {
            _controllerName = controllerName;
            _settings = settings;
        }

        /// Gets a value indicating whether the C#8 nullable reference types are enabled for this file.
        public bool GenerateNullableReferenceTypes => _settings.CSharpGeneratorSettings.GenerateNullableReferenceTypes;

        /// Gets a value indicating whether to wrap success responses to allow full response access.
        public bool WrapResponses => _settings.WrapResponses;

        /// Gets the response class name.
        public string ResponseClass => _settings.ResponseClass.Replace("{controller}", _controllerName);

        /// Gets a value indicating whether to use System.Text.Json
        public bool UseSystemTextJson => _settings.CSharpGeneratorSettings.JsonLibrary == CSharpJsonLibrary.SystemTextJson;

        /// Gets the JSON serializer settings type.
        public string JsonSerializerSettingsType => _settings.CSharpGeneratorSettings.JsonLibrary == CSharpJsonLibrary.SystemTextJson ?
            "System.Text.Json.JsonSerializerOptions" :
            "Newtonsoft.Json.JsonSerializerSettings";
    }
}


text:
<?php

class b2c_tasks_cleancartobject extends base_task_abstract implements base_interface_task{
    public function exec($params=null){
        $time = strtotime('-7 days');
        $sql = "DELETE FROM sdb_b2c_cart_objects WHERE member_id='-1' AND time<=$time";
        app::get('b2c')->model('cart_objects')->db->exec( $sql );
    }
}


text:
package org.semispace.actor;

/**
 * The manifest is used when an object is sent without having a clear destination.
 */
public class ActorManifest {
    private Long holderId;
    private Long originatorId;
    public ActorManifest( Long holderId, Long originatorId) {
        this.holderId = holderId;
        this.originatorId = originatorId;
    }
    public ActorManifest(long id) {
        this.holderId = Long.valueOf(id);
    }
    public Long getHolderId() {
        return this.holderId;
    }
    public Long getOriginatorId() {
        return this.originatorId;
    }
}


text:
# include <boost/python/handle.hpp>
# include <boost/python/converter/shared_ptr_deleter.hpp>
# include <boost/python/converter/from_python.hpp>
# include <boost/python/converter/rvalue_from_python_data.hpp>
# include <boost/python/converter/registered.hpp>
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
# include <boost/python/converter/pytype_function.hpp>
#endif
# include <boost/shared_ptr.hpp>

namespace boost { namespace python { namespace converter {

template <class T>
struct shared_ptr_from_python
{
    shared_ptr_from_python()
    {
        converter::registry::insert(&convertible, &construct, type_id<shared_ptr<T> >()
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES
                      , &converter::expected_from_python_type_direct<T>::get_pytype
#endif
                      );
    }

 private:
    static void* convertible(PyObject* p)
    {
        if (p == Py_None)
            return p;

        return converter::get_lvalue_from_python(p, registered<T>::converters);
    }

    static void construct(PyObject* source, rvalue_from_python_stage1_data* data)
    {
        void* const storage = ((converter::rvalue_from_python_storage<shared_ptr<T> >*)data)->storage.bytes;
        // Deal with the "None" case.
        if (data->convertible == source)
            new (storage) shared_ptr<T>();
        else
            new (storage) shared_ptr<T>(
                static_cast<T*>(data->convertible),
                shared_ptr_deleter(handle<>(borrowed(source)))
                );

        data->convertible = storage;
    }
};

}}} // namespace boost::python::converter

#endif // SHARED_PTR_FROM_PYTHON_DWA20021130_HPP


text:
( function ( $, mw, OO ) {

	/**
	 * Accepts a stashed file and displays the information for purposes of
	 * publishing the file at the behest of the user.
	 *
	 * Example use:
	 *     var widget = new mw.widgets.StashedFileWidget( {
	 *       filekey: '12r9e4rugeec.ddtmmp.1.jpg',
	 *     } );
	 *
	 *     widget.getValue(); // '12r9e4rugeec.ddtmmp.1.jpg'
	 *     widget.setValue( '12r9epfbnskk.knfiy7.1.jpg' );
	 *     widget.getValue(); // '12r9epfbnskk.knfiy7.1.jpg'
	 *
	 * Note that this widget will not finish an upload for you. Use mw.Upload
	 * and mw.Upload#setFilekey, then mw.Upload#finishStashUpload to accomplish
	 * that.
	 *
	 * @class mw.widgets.StashedFileWidget
	 * @extends OO.ui.Widget
	 */

	/**
	 * @constructor
	 * @param {Object} config Configuration options
	 * @cfg {string} filekey The filekey of the stashed file.
	 * @cfg {Object} [api] API to use for thumbnails.
	 */
	mw.widgets.StashedFileWidget = function MWWStashedFileWidget( config ) {
		if ( !config.api ) {
			config.api = new mw.Api();
		}

		// Parent constructor
		mw.widgets.StashedFileWidget.parent.call( this, config );

		// Mixin constructors
		OO.ui.mixin.IconElement.call( this, config );
		OO.ui.mixin.LabelElement.call( this, config );
		OO.ui.mixin.PendingElement.call( this, config );

		// Properties
		this.api = config.api;
		this.$info = $( '<span>' );
		this.setValue( config.filekey );
		this.$label.addClass( 'mw-widgets-stashedFileWidget-label' );
		this.$info
			.addClass( 'mw-widgets-stashedFileWidget-info' )
			.append( this.$icon, this.$label );

		this.$thumbnail = $( '<div>' ).addClass( 'mw-widgets-stashedFileWidget-thumbnail' );
		this.setPendingElement( this.$thumbnail );

		this.$thumbContain = $( '<div>' )
			.addClass( 'mw-widgets-stashedFileWidget-thumbnail-container' )
			.append( this.$thumbnail, this.$info );

		this.$element
			.addClass( 'mw-widgets-stashedFileWidget' )
			.append( this.$thumbContain );

		this.updateUI();
	};

	OO.inheritClass( mw.widgets.StashedFileWidget, OO.ui.Widget );
	OO.mixinClass( mw.widgets.StashedFileWidget, OO.ui.mixin.IconElement );
	OO.mixinClass( mw.widgets.StashedFileWidget, OO.ui.mixin.LabelElement );
	OO.mixinClass( mw.widgets.StashedFileWidget, OO.ui.mixin.PendingElement );

	/**
	 * Get the current filekey.
	 *
	 * @return {string|null}
	 */
	mw.widgets.StashedFileWidget.prototype.getValue = function () {
		return this.filekey;
	};

	/**
	 * Set the filekey.
	 *
	 * @param {string|null} filekey
	 */
	mw.widgets.StashedFileWidget.prototype.setValue = function ( filekey ) {
		if ( filekey !== this.filekey ) {
			this.filekey = filekey;
			this.updateUI();
			this.emit( 'change', this.filekey );
		}
	};

	mw.widgets.StashedFileWidget.prototype.updateUI = function () {
		var $label, $filetype;

		if ( this.filekey ) {
			this.$element.removeClass( 'mw-widgets-stashedFileWidget-empty' );
			$label = $( [] );
			$filetype = $( '<span>' )
				.addClass( 'mw-widgets-stashedFileWidget-fileType' );

			$label = $label.add(
				$( '<span>' )
					.addClass( 'mw-widgets-stashedFileWidget-filekey' )
					.text( this.filekey )
			).add( $filetype );

			this.setLabel( $label );

			this.pushPending();
			this.loadAndGetImageUrl().done( function ( url, mime ) {
				this.$thumbnail.css( 'background-image', 'url( ' + url + ' )' );
				if ( mime ) {
					$filetype.text( mime );
					this.setLabel( $label );
				}
			}.bind( this ) ).fail( function () {
				this.$thumbnail.append(
					new OO.ui.IconWidget( {
						icon: 'attachment',
						classes: [ 'mw-widgets-stashedFileWidget-noThumbnail-icon' ]
					} ).$element
				);
			}.bind( this ) ).always( function () {
				this.popPending();
			}.bind( this ) );
		} else {
			this.$element.addClass( 'mw-widgets-stashedFileWidget-empty' );
			this.setLabel( '' );
		}
	};

	mw.widgets.StashedFileWidget.prototype.loadAndGetImageUrl = function () {
		var filekey = this.filekey;

		if ( filekey ) {
			return this.api.get( {
				action: 'query',
				prop: 'stashimageinfo',
				siifilekey: filekey,
				siiprop: [ 'size', 'url', 'mime' ],
				siiurlwidth: 220
			} ).then( function ( data ) {
				var sii = data.query.stashimageinfo[ 0 ];

				return $.Deferred().resolve( sii.thumburl, sii.mime );
			} );
		}

		return $.Deferred().reject( 'No filekey' );
	};
}( jQuery, mediaWiki, OO ) );


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v12/enums/custom_audience_member_type.proto

namespace Google\Ads\GoogleAds\V12\Enums;

if (false) {
    /**
     * This class is deprecated. Use Google\Ads\GoogleAds\V12\Enums\CustomAudienceMemberTypeEnum\CustomAudienceMemberType instead.
     * @deprecated
     */
    class CustomAudienceMemberTypeEnum_CustomAudienceMemberType {}
}
class_exists(CustomAudienceMemberTypeEnum\CustomAudienceMemberType::class);
@trigger_error('Google\Ads\GoogleAds\V12\Enums\CustomAudienceMemberTypeEnum_CustomAudienceMemberType is deprecated and will be removed in the next major release. Use Google\Ads\GoogleAds\V12\Enums\CustomAudienceMemberTypeEnum\CustomAudienceMemberType instead', E_USER_DEPRECATED);


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using WebApi.Migration.Demo.Model;

namespace WebApi.Migration.Demo
{
    public class AppContext:DbContext
    {
        public AppContext(DbContextOptions options) : base(options){
            Database.Migrate();
        }
        public DbSet<Destination> Destination { get; set; }
        public DbSet<Lodging> Lodging { get; set; }

        public DbSet<Student> Student { get; set; }
        public DbSet<Course> Course { get; set; }

        public DbSet<Person> Person { get; set; }
        public DbSet<PersonPhoto> PersonPhoto { get; set; }

        public DbSet<Activity> Activity { get; set; }
        public DbSet<Trip> Trip { get; set; }
        public DbSet<ActivityTripMap> ActivityTripMap { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder) {
            base.OnModelCreating(modelBuilder);

            //多对多
            modelBuilder.Entity<ActivityTripMap>().HasKey(g => new { g.ActivityId, g.TripId });
            modelBuilder.Entity<ActivityTripMap>().HasOne(t => t.Activity).WithMany(t => t.ActivityTripMaps).HasForeignKey(t => t.ActivityId);
            modelBuilder.Entity<ActivityTripMap>().HasOne(t => t.Trip).WithMany(t => t.ActivityTripMaps).HasForeignKey(t => t.TripId);
        }
    }
}


text:
using Orchard.Data.Conventions;
using System.Collections.Generic;

namespace CloudBust.Localization.Models
{
    public class CountryRecord
    {
        public virtual int Id { get; set; }

        public virtual string Name { get; set; }

        public virtual string TwoDigitCode { get; set; }

        public virtual string ThreeDigitCode { get; set; }

        [Aggregate]
        public virtual CurrencyRecord Currency { get; set; }

        public virtual int Taxation { get; set; }

        [Aggregate]
        public virtual TranslationRecord Translation { get; set; }

        [Aggregate]
        [CascadeAllDeleteOrphan]
        public virtual IList<CountryTranslationRecord> CountryTranslation { get; set; }

        public CountryRecord()
        {
            CountryTranslation = new List<CountryTranslationRecord>();
        }
    }
}


text:
using UnityEngine;
using System.Collections;

public class CloneAbilitesColliderHandler : MonoBehaviour {

	// Use this for initialization
//	void Start () {
//
//	}

	// Update is called once per frame
//	void Update () {
//
//	}

	public virtual void OnTriggerEnter(Collider other) {
		if (other.gameObject.tag == "Clone") {
			//Debug.Log("APANHEI TRIGGER COM: " + other.gameObject.name + "\nCHAMO-ME "+ this.gameObject.transform.parent.gameObject.name);
			other.gameObject.GetComponent<ClonePassiveAbilities>().doStuff(this.gameObject.transform.parent.gameObject);
			//gameObject.transform.parent.gameObject.GetComponent<ClonePassiveAbilities>().doStuff(other.gameObject);
		}
	}
}


text:
'use strict';

const health = require('../controllers/__health.server.controller');

module.exports = (app) => {

	app.route('/__health').get(health.handle);
};


text:
namespace OpenTracing.Tracer.Zipkin
{
    internal enum OtSpanKind
    {
        Server,
        Client,
        Local
    }
}


text:
const defaultByteLength = 1024 * 8
const charArray = []

/**
 * Class for writing and reading binary data
 */
class IOBuffer {
  /**
   * @param {undefined|number|ArrayBuffer|TypedArray|IOBuffer|Buffer} data - The data to construct the IOBuffer with.
   *
   * If it's a number, it will initialize the buffer with the number as
   * the buffer's length. If it's undefined, it will initialize the buffer
   * with a default length of 8 Kb. If its an ArrayBuffer, a TypedArray,
   * an IOBuffer instance, or a Node.js Buffer, it will create a view over
   * the underlying ArrayBuffer.
   * @param {object} [params]
   * @param {number} [params.offset=0] - Ignore the first n bytes of the ArrayBuffer
   */
  constructor (data, params) {
    const p = params || {}
    let dataIsGiven = false
    if (data === undefined) {
      data = defaultByteLength
    }
    if (typeof data === 'number') {
      data = new ArrayBuffer(data)
    } else {
      dataIsGiven = true
      this._lastWrittenByte = data.byteLength
    }

    const offset = p.offset ? p.offset >>> 0 : 0
    let byteLength = data.byteLength - offset
    let dvOffset = offset
    if (data.buffer) {
      if (data.byteLength !== data.buffer.byteLength) {
        dvOffset = data.byteOffset + offset
      }
      data = data.buffer
    }
    if (dataIsGiven) {
      this._lastWrittenByte = byteLength
    } else {
      this._lastWrittenByte = 0
    }

    /**
     * Reference to the internal ArrayBuffer object
     * @type {ArrayBuffer}
     */
    this.buffer = data
    /**
     * Byte length of the internal ArrayBuffer
     * @type {Number}
     */
    this.length = byteLength
    /**
     * Byte length of the internal ArrayBuffer
     * @type {Number}
     */
    this.byteLength = byteLength
    /**
     * Byte offset of the internal ArrayBuffer
     * @type {Number}
     */
    this.byteOffset = dvOffset
    /**
     * The current offset of the buffer's pointer
     * @type {Number}
     */
    this.offset = 0

    this.littleEndian = true
    this._data = new DataView(this.buffer, dvOffset, byteLength)
    this._mark = 0
    this._marks = []
  }

  /**
   * Checks if the memory allocated to the buffer is sufficient to store more bytes after the offset
   * @param {number} [byteLength=1] The needed memory in bytes
   * @return {boolean} Returns true if there is sufficient space and false otherwise
   */
  available (byteLength) {
    if (byteLength === undefined) byteLength = 1
    return (this.offset + byteLength) <= this.length
  }

  /**
   * Check if little-endian mode is used for reading and writing multi-byte values
   * @return {boolean} Returns true if little-endian mode is used, false otherwise
   */
  isLittleEndian () {
    return this.littleEndian
  }

  /**
   * Set little-endian mode for reading and writing multi-byte values
   * @return {IOBuffer}
   */
  setLittleEndian () {
    this.littleEndian = true
    return this
  }

  /**
   * Check if big-endian mode is used for reading and writing multi-byte values
   * @return {boolean} Returns true if big-endian mode is used, false otherwise
   */
  isBigEndian () {
    return !this.littleEndian
  }

  /**
   * Switches to big-endian mode for reading and writing multi-byte values
   * @return {IOBuffer}
   */
  setBigEndian () {
    this.littleEndian = false
    return this
  }

  /**
   * Move the pointer n bytes forward
   * @param {number} n
   * @return {IOBuffer}
   */
  skip (n) {
    if (n === undefined) n = 1
    this.offset += n
    return this
  }

  /**
   * Move the pointer to the given offset
   * @param {number} offset
   * @return {IOBuffer}
   */
  seek (offset) {
    this.offset = offset
    return this
  }

  /**
   * Store the current pointer offset.
   * @see {@link IOBuffer#reset}
   * @return {IOBuffer}
   */
  mark () {
    this._mark = this.offset
    return this
  }

  /**
   * Move the pointer back to the last pointer offset set by mark
   * @see {@link IOBuffer#mark}
   * @return {IOBuffer}
   */
  reset () {
    this.offset = this._mark
    return this
  }

  /**
   * Push the current pointer offset to the mark stack
   * @see {@link IOBuffer#popMark}
   * @return {IOBuffer}
   */
  pushMark () {
    this._marks.push(this.offset)
    return this
  }

  /**
   * Pop the last pointer offset from the mark stack, and set the current pointer offset to the popped value
   * @see {@link IOBuffer#pushMark}
   * @return {IOBuffer}
   */
  popMark () {
    const offset = this._marks.pop()
    if (offset === undefined) throw new Error('Mark stack empty')
    this.seek(offset)
    return this
  }

  /**
   * Move the pointer offset back to 0
   * @return {IOBuffer}
   */
  rewind () {
    this.offset = 0
    return this
  }

  /**
   * Make sure the buffer has sufficient memory to write a given byteLength at the current pointer offset
   * If the buffer's memory is insufficient, this method will create a new buffer (a copy) with a length
   * that is twice (byteLength + current offset)
   * @param {number} [byteLength = 1]
   * @return {IOBuffer}
   */
  ensureAvailable (byteLength) {
    if (byteLength === undefined) byteLength = 1
    if (!this.available(byteLength)) {
      const lengthNeeded = this.offset + byteLength
      const newLength = lengthNeeded * 2
      const newArray = new Uint8Array(newLength)
      newArray.set(new Uint8Array(this.buffer))
      this.buffer = newArray.buffer
      this.length = this.byteLength = newLength
      this._data = new DataView(this.buffer)
    }
    return this
  }

  /**
   * Read a byte and return false if the byte's value is 0, or true otherwise
   * Moves pointer forward
   * @return {boolean}
   */
  readBoolean () {
    return this.readUint8() !== 0
  }

  /**
   * Read a signed 8-bit integer and move pointer forward
   * @return {number}
   */
  readInt8 () {
    return this._data.getInt8(this.offset++)
  }

  /**
   * Read an unsigned 8-bit integer and move pointer forward
   * @return {number}
   */
  readUint8 () {
    return this._data.getUint8(this.offset++)
  }

  /**
   * Alias for {@link IOBuffer#readUint8}
   * @return {number}
   */
  readByte () {
    return this.readUint8()
  }

  /**
   * Read n bytes and move pointer forward.
   * @param {number} n
   * @return {Uint8Array}
   */
  readBytes (n) {
    if (n === undefined) n = 1
    var bytes = new Uint8Array(n)
    for (var i = 0; i < n; i++) {
      bytes[i] = this.readByte()
    }
    return bytes
  }

  /**
   * Read a 16-bit signed integer and move pointer forward
   * @return {number}
   */
  readInt16 () {
    var value = this._data.getInt16(this.offset, this.littleEndian)
    this.offset += 2
    return value
  }

  /**
   * Read a 16-bit unsigned integer and move pointer forward
   * @return {number}
   */
  readUint16 () {
    var value = this._data.getUint16(this.offset, this.littleEndian)
    this.offset += 2
    return value
  }

  /**
   * Read a 32-bit signed integer and move pointer forward
   * @return {number}
   */
  readInt32 () {
    var value = this._data.getInt32(this.offset, this.littleEndian)
    this.offset += 4
    return value
  }

  /**
   * Read a 32-bit unsigned integer and move pointer forward
   * @return {number}
   */
  readUint32 () {
    var value = this._data.getUint32(this.offset, this.littleEndian)
    this.offset += 4
    return value
  }

  /**
   * Read a 32-bit floating number and move pointer forward
   * @return {number}
   */
  readFloat32 () {
    var value = this._data.getFloat32(this.offset, this.littleEndian)
    this.offset += 4
    return value
  }

  /**
   * Read a 64-bit floating number and move pointer forward
   * @return {number}
   */
  readFloat64 () {
    var value = this._data.getFloat64(this.offset, this.littleEndian)
    this.offset += 8
    return value
  }

  /**
   * Read 1-byte ascii character and move pointer forward
   * @return {string}
   */
  readChar () {
    return String.fromCharCode(this.readInt8())
  }

  /**
   * Read n 1-byte ascii characters and move pointer forward
   * @param {number} n
   * @return {string}
   */
  readChars (n) {
    if (n === undefined) n = 1
    charArray.length = n
    for (var i = 0; i < n; i++) {
      charArray[i] = this.readChar()
    }
    return charArray.join('')
  }

  /**
   * Write 0xff if the passed value is truthy, 0x00 otherwise
   * @param {any} value
   * @return {IOBuffer}
   */
  writeBoolean (value) {
    this.writeUint8(value ? 0xff : 0x00)
    return this
  }

  /**
   * Write value as an 8-bit signed integer
   * @param {number} value
   * @return {IOBuffer}
   */
  writeInt8 (value) {
    this.ensureAvailable(1)
    this._data.setInt8(this.offset++, value)
    this._updateLastWrittenByte()
    return this
  }

  /**
   * Write value as a 8-bit unsigned integer
   * @param {number} value
   * @return {IOBuffer}
   */
  writeUint8 (value) {
    this.ensureAvailable(1)
    this._data.setUint8(this.offset++, value)
    this._updateLastWrittenByte()
    return this
  }

  /**
   * An alias for {@link IOBuffer#writeUint8}
   * @param {number} value
   * @return {IOBuffer}
   */
  writeByte (value) {
    return this.writeUint8(value)
  }

  /**
   * Write bytes
   * @param {Array|Uint8Array} bytes
   * @return {IOBuffer}
   */
  writeBytes (bytes) {
    this.ensureAvailable(bytes.length)
    for (var i = 0; i < bytes.length; i++) {
      this._data.setUint8(this.offset++, bytes[i])
    }
    this._updateLastWrittenByte()
    return this
  }

  /**
   * Write value as an 16-bit signed integer
   * @param {number} value
   * @return {IOBuffer}
   */
  writeInt16 (value) {
    this.ensureAvailable(2)
    this._data.setInt16(this.offset, value, this.littleEndian)
    this.offset += 2
    this._updateLastWrittenByte()
    return this
  }

  /**
   * Write value as a 16-bit unsigned integer
   * @param {number} value
   * @return {IOBuffer}
   */
  writeUint16 (value) {
    this.ensureAvailable(2)
    this._data.setUint16(this.offset, value, this.littleEndian)
    this.offset += 2
    this._updateLastWrittenByte()
    return this
  }

  /**
   * Write a 32-bit signed integer at the current pointer offset
   * @param {number} value
   * @return {IOBuffer}
   */
  writeInt32 (value) {
    this.ensureAvailable(4)
    this._data.setInt32(this.offset, value, this.littleEndian)
    this.offset += 4
    this._updateLastWrittenByte()
    return this
  }

  /**
   * Write a 32-bit unsigned integer at the current pointer offset
   * @param {number} value - The value to set
   * @return {IOBuffer}
   */
  writeUint32 (value) {
    this.ensureAvailable(4)
    this._data.setUint32(this.offset, value, this.littleEndian)
    this.offset += 4
    this._updateLastWrittenByte()
    return this
  }

  /**
   * Write a 32-bit floating number at the current pointer offset
   * @param {number} value - The value to set
   * @return {IOBuffer}
   */
  writeFloat32 (value) {
    this.ensureAvailable(4)
    this._data.setFloat32(this.offset, value, this.littleEndian)
    this.offset += 4
    this._updateLastWrittenByte()
    return this
  }

  /**
   * Write a 64-bit floating number at the current pointer offset
   * @param {number} value
   * @return {IOBuffer}
   */
  writeFloat64 (value) {
    this.ensureAvailable(8)
    this._data.setFloat64(this.offset, value, this.littleEndian)
    this.offset += 8
    this._updateLastWrittenByte()
    return this
  }

  /**
   * Write the charCode of the passed string's first character to the current pointer offset
   * @param {string} str - The character to set
   * @return {IOBuffer}
   */
  writeChar (str) {
    return this.writeUint8(str.charCodeAt(0))
  }

  /**
   * Write the charCodes of the passed string's characters to the current pointer offset
   * @param {string} str
   * @return {IOBuffer}
   */
  writeChars (str) {
    for (var i = 0; i < str.length; i++) {
      this.writeUint8(str.charCodeAt(i))
    }
    return this
  }

  /**
   * Export a Uint8Array view of the internal buffer.
   * The view starts at the byte offset and its length
   * is calculated to stop at the last written byte or the original length.
   * @return {Uint8Array}
   */
  toArray () {
    return new Uint8Array(this.buffer, this.byteOffset, this._lastWrittenByte)
  }

  /**
   * Same as {@link IOBuffer#toArray} but returns a Buffer if possible. Otherwise returns a Uint8Array.
   * @return {Buffer|Uint8Array}
   */
  getBuffer () {
    if (typeof Buffer !== 'undefined') {
      return Buffer.from(this.toArray())
    } else {
      return this.toArray()
    }
  }

  /**
   * Update the last written byte offset
   * @private
   */
  _updateLastWrittenByte () {
    if (this.offset > this._lastWrittenByte) {
      this._lastWrittenByte = this.offset
    }
  }
}

export default IOBuffer


text:
%!TEX root = thesis.tex

% Set german to default language and load english as well
\usepackage[english,ngerman]{babel}

% Set UTF8 as input encoding
\usepackage[utf8]{inputenc}

% Set T1 as font encoding
\usepackage[T1]{fontenc}
% Load a slightly more modern font
\usepackage{lmodern}
% Use the symbol collection textcomp, which is needed by listings.
\usepackage{textcomp}
% Load a better font for monospace.
\usepackage{courier}
% Load package to configure header and footer
\usepackage{scrlayer-scrpage}

% Set some options regarding the document layout. See KOMA guide
\KOMAoptions{%
  paper=a4,
  fontsize=12pt,
  parskip=half,
  headings=normal,
  BCOR=1cm,
  headsepline,
  headsepline=0.5pt,
  DIV=12}

% do not align bottom of pages
\raggedbottom

% set style of captions
\setcapindent{0pt} % do not indent second line of captions
\setkomafont{caption}{\small}
\setkomafont{captionlabel}{\bfseries}
\setcapwidth[c]{0.9\textwidth}

% set the style of the bibliography
\bibliographystyle{alphadin}

% load extended tabulars used in the list of abbreviation
\usepackage{tabularx}

% load the color package and enable colored tables
\usepackage[table]{xcolor}

% define new environment for zebra tables
\newcommand{\mainrowcolors}{\rowcolors{1}{maincolor!25}{maincolor!5}}
\newenvironment{zebratabular}{\mainrowcolors\begin{tabular}}{\end{tabular}}
\newcommand{\setrownumber}[1]{\global\rownum#1\relax}
\newcommand{\headerrow}{\rowcolor{maincolor!50}\setrownumber1}

% add main color to section headers
\addtokomafont{chapter}{\color{maincolor}}
\addtokomafont{section}{\color{maincolor}}
\addtokomafont{subsection}{\color{maincolor}}
\addtokomafont{subsubsection}{\color{maincolor}}
\addtokomafont{paragraph}{\color{maincolor}}

% do not print numbers next to each formula
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}
% left align formulas
\makeatletter
\@fleqntrue\let\mathindent\@mathmargin \@mathmargin=\leftmargini
\makeatother

% Allow page breaks in align environments
\allowdisplaybreaks

% header and footer
\pagestyle{scrheadings}
\setkomafont{pagenumber}{\normalfont\sffamily\color{maincolor}}
\setkomafont{pageheadfoot}{\normalfont\sffamily}
\setkomafont{headsepline}{\color{maincolor}}

% German guillemets quotes
\usepackage[german=guillemets]{csquotes}

% load TikZ to draw diagrams
\usepackage{tikz}

% load additional libraries for TikZ
\usetikzlibrary{%
  automata,%
  positioning,%
}

% set some default options for TikZ -- in this case for automata
\tikzset{
  every state/.style={
    draw=maincolor,
    thick,
    fill=maincolor!18,
    minimum size=0pt
  }
}

% load listings package to typeset sourcecode
\usepackage{listings}

% set some options for the listings package
\lstset{%
  upquote=true,%
  showstringspaces=false,%
  captionpos=b,%
  basicstyle=\ttfamily,%
  keywordstyle=\color{keywordcolor}\slshape,%
  commentstyle=\color{commentcolor}\itshape,%
  stringstyle=\color{stringcolor}}
\renewcommand{\lstlistingname}{Quelltext}
\renewcommand{\lstlistlistingname}{Quelltextverzeichnis}

% enable german umlauts in listings
\lstset{
  literate={ö}{{\"o}}1
           {Ö}{{\"O}}1
           {ä}{{\"a}}1
           {Ä}{{\"A}}1
           {ü}{{\"u}}1
           {Ü}{{\"U}}1
           {ß}{{\ss}}1
}

% define style for pseudo code
\lstdefinestyle{pseudo}{language={},%
  basicstyle=\normalfont,%
  morecomment=[l]{//},%
  morekeywords={for,to,while,do,if,then,else},%
  mathescape=true,%
  columns=fullflexible}

% load the AMS math library to typeset formulas
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{amssymb}

% load the paralist library to use compactitem and compactenum environment
\usepackage{paralist}

% load varioref and hyperref to create nicer references using vref
\usepackage[ngerman]{varioref}
\PassOptionsToPackage{hyphens}{url} % allow line break at hyphens in URLs
\usepackage{hyperref}

% setup hyperref
\hypersetup{breaklinks=true,
            pdfborder={0 0 0},
            ngerman,
            pdfhighlight={/N},
            pdfdisplaydoctitle=true}

% Fix bugs in some package, e.g. listings and hyperref
\usepackage{scrhack}

% Allow todos
\usepackage{todonotes}

% define german names for referenced elements
% (vref automatically inserts these names in front of the references)
\labelformat{figure}{Abbildung\ #1}
\labelformat{table}{Tabelle\ #1}
\labelformat{appendix}{Anhang\ #1}
\labelformat{chapter}{Kapitel\ #1}
\labelformat{section}{Abschnitt\ #1}
\labelformat{subsection}{Unterabschnitt\ #1}
\labelformat{subsubsection}{Unterunterabschnitt\ #1}
\AtBeginDocument{\labelformat{lstlisting}{Quelltext\ #1}}

% define theorem environments
\declaretheorem[numberwithin=chapter,style=plain]{Theorem}
\labelformat{Theorem}{Theorem\ #1}

\declaretheorem[sibling=Theorem,style=plain]{Lemma}
\labelformat{Lemma}{Lemma\ #1}

\declaretheorem[sibling=Theorem,style=plain]{Korollar}
\labelformat{Korollar}{Korollar\ #1}

\declaretheorem[sibling=Theorem,style=definition]{Definition}
\labelformat{Definition}{Definition\ #1}

\declaretheorem[sibling=Theorem,style=definition]{Beispiel}
\labelformat{Beispiel}{Beispiel\ #1}

\declaretheorem[sibling=Theorem,style=definition]{Bemerkung}
\labelformat{Bemerkung}{Bemerkung\ #1}


text:
date: 2017-05-01 22:33:00-05:00
layout: post
link_url: https://www.dallasnews.com/news/crime/2017/05/01/multiple-people-stabbed-ut-austin-campus
loc: Home
tags:
- news
- crime
timestamp: 1493695980
title: 1 killed, 3 injured in stabbing at UT Austin
type: link

---


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

		<title>Media Properties</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta content="noindex, nofollow" name="robots">

		<link href="../../dialog/common/fck_dialog_common.css" type="text/css" rel="stylesheet">

								URL

								  <input id="btnBrowse" onclick="BrowseServer();" type="button" value="Browse Server" fckLang="DlgBtnBrowseServer">

								<input id="txtUrl" style="WIDTH: 100%" type="text">

					Short Description

						<input id="txtAlt" style="WIDTH: 100%" type="text">

											Media Id
											<input type="text" id="txtAttId" size="5">

											Auto Play

											<input id="chkAutoPlay" type="checkbox">

											Width
											<input type="text" class="FCK__FieldNumeric" id="txtWidth" value="420" size="3">

											Height
											<input type="text" class="FCK__FieldNumeric" id="txtHeight" value="280" size="3">

								* Support MP3,Windows Media,Real,etc.

			<form id="frmUpload" method="post" target="UploadWindow" enctype="multipart/form-data" action="" onsubmit="return CheckUpload();">
				Upload

				<input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" />

				<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />

			</form>


text:
package ac.uk.abdn.fits.demo.mvc.control.operator;

/**
 * @author Cheng Zeng, University of Aberdeen
 *
 */

public class Surcharge {

	private double surcharge_dist1_mile;
	private String surcharge_dist1_type;
	private double surcharge_dist1_charge;
	private double surcharge_dist2_1;
	private double surcharge_dist2_2;
	private String surcharge_dist2_type;
	private double surcharge_dist2_charge;
	private double surcharge_dist3_mile_1;
	private double surcharge_dist3_mile_2;
	private String surcharge_dist3_type;
    private double surcharge_dist3_charge;
    private double surcharge_dist4_mile_1;
    private double surcharge_dist4_mile_2;
    private String surcharge_dist4_type;
    private double surcharge_dist4_charge;
	private boolean surcharge_checkbox_under16;
	private double surcharge_under_16_num;
	private boolean surcharge_checkbox_17_to_21;
	private double surcharge_17_21_years_old_num;
	private boolean surcharge_checkbox_22_to_54;
	private double surcharge_22_54_years_old_num;
	private boolean surcharge_checkbox_55_to_59;
	private double surcharge_55_59_years_old_num;
	private boolean surcharge_checkbox_over60;
	private double surcharge_over_60_years_old_num;
	private boolean surcharge_checkbox_able_bodied;
	private double surcharge_able_bodied_num;
	private boolean surcharge_checkbox_mobility_prevents_PT;
	private double surcharge_mobility_prevents_PT_num;
	private boolean surcharge_checkbox_diable_wheelchair_user;
	private double surcharge_disable_wheelchair_user_num;
	private boolean surcharge_checkbox_disable_other;
	private double surcharge_disable_other_num;
	private boolean surcharge_checkbox_health_appointment;
	private double surcharge_health_appointment_num;
	private boolean surcharge_checkbox_social_care;
	private double surcharge_social_care_num;
	private boolean surcharge_checkbox_shopping;
	private double surcharge_shopping_num;
	private boolean surcharge_checkbox_leisure_visiting_friends;
	private double surcharge_leisure_visiting_friends_num;
	private boolean surcharge_checkbox_school_education;
	private double surcharge_school_education_num;
	private boolean surcharge_checkbox_work_commuting;
	private double surcharge_work_commuting_num;
	private boolean surcharge_checkbox_other_purpose;
	private double surcharge_other_purpose_num;
	private boolean surcharge_checkbox_start_05_hours_earlier;
	private double surcharge_start_05_hours_earlier;
	private boolean surcharge_checkbox_start_1_hour_earlier;
	private double surcharge_start_1_hour_earlier;
	private boolean surcharge_checkbox_start_15_hours_earlier;
	private double surcharge_start_15_hours_earlier;
	private boolean surcharge_checkbox_finish_05_hours_later;
	private double surcharge_finish_05_hours_later;
	private boolean surcharge_checkbox_finish_1_hour_later;
	private double surcharge_finish_1_hour_later;
	private boolean surcharge_checkbox_finish_15_hours_later;
	private double surcharge_finish_15_hours_later;

	public boolean isSurcharge_checkbox_under16() {
		return surcharge_checkbox_under16;
	}
	public void setSurcharge_checkbox_under16(boolean surcharge_checkbox_under16) {
		this.surcharge_checkbox_under16 = surcharge_checkbox_under16;
	}
	public double getSurcharge_under_16_num() {
		return surcharge_under_16_num;
	}
	public void setSurcharge_under_16_num(double surcharge_under_16_num) {
		this.surcharge_under_16_num = surcharge_under_16_num;
	}
	public boolean isSurcharge_checkbox_17_to_21() {
		return surcharge_checkbox_17_to_21;
	}
	public void setSurcharge_checkbox_17_to_21(boolean surcharge_checkbox_17_to_21) {
		this.surcharge_checkbox_17_to_21 = surcharge_checkbox_17_to_21;
	}
	public double getSurcharge_17_21_years_old_num() {
		return surcharge_17_21_years_old_num;
	}
	public void setSurcharge_17_21_years_old_num(
			double surcharge_17_21_years_old_num) {
		this.surcharge_17_21_years_old_num = surcharge_17_21_years_old_num;
	}
	public boolean isSurcharge_checkbox_22_to_54() {
		return surcharge_checkbox_22_to_54;
	}
	public void setSurcharge_checkbox_22_to_54(boolean surcharge_checkbox_22_to_54) {
		this.surcharge_checkbox_22_to_54 = surcharge_checkbox_22_to_54;
	}
	public double getSurcharge_22_54_years_old_num() {
		return surcharge_22_54_years_old_num;
	}
	public void setSurcharge_22_54_years_old_num(
			double surcharge_22_54_years_old_num) {
		this.surcharge_22_54_years_old_num = surcharge_22_54_years_old_num;
	}
	public boolean isSurcharge_checkbox_55_to_59() {
		return surcharge_checkbox_55_to_59;
	}
	public void setSurcharge_checkbox_55_to_59(boolean surcharge_checkbox_55_to_59) {
		this.surcharge_checkbox_55_to_59 = surcharge_checkbox_55_to_59;
	}
	public double getSurcharge_55_59_years_old_num() {
		return surcharge_55_59_years_old_num;
	}
	public void setSurcharge_55_59_years_old_num(
			double surcharge_55_59_years_old_num) {
		this.surcharge_55_59_years_old_num = surcharge_55_59_years_old_num;
	}
	public boolean isSurcharge_checkbox_over60() {
		return surcharge_checkbox_over60;
	}
	public void setSurcharge_checkbox_over60(boolean surcharge_checkbox_over60) {
		this.surcharge_checkbox_over60 = surcharge_checkbox_over60;
	}
	public double getSurcharge_over_60_years_old_num() {
		return surcharge_over_60_years_old_num;
	}
	public void setSurcharge_over_60_years_old_num(
			double surcharge_over_60_years_old_num) {
		this.surcharge_over_60_years_old_num = surcharge_over_60_years_old_num;
	}
	public boolean isSurcharge_checkbox_able_bodied() {
		return surcharge_checkbox_able_bodied;
	}
	public void setSurcharge_checkbox_able_bodied(
			boolean surcharge_checkbox_able_bodied) {
		this.surcharge_checkbox_able_bodied = surcharge_checkbox_able_bodied;
	}
	public double getSurcharge_able_bodied_num() {
		return surcharge_able_bodied_num;
	}
	public void setSurcharge_able_bodied_num(double surcharge_able_bodied_num) {
		this.surcharge_able_bodied_num = surcharge_able_bodied_num;
	}
	public boolean isSurcharge_checkbox_mobility_prevents_PT() {
		return surcharge_checkbox_mobility_prevents_PT;
	}
	public void setSurcharge_checkbox_mobility_prevents_PT(
			boolean surcharge_checkbox_mobility_prevents_PT) {
		this.surcharge_checkbox_mobility_prevents_PT = surcharge_checkbox_mobility_prevents_PT;
	}
	public double getSurcharge_mobility_prevents_PT_num() {
		return surcharge_mobility_prevents_PT_num;
	}
	public void setSurcharge_mobility_prevents_PT_num(
			double surcharge_mobility_prevents_PT_num) {
		this.surcharge_mobility_prevents_PT_num = surcharge_mobility_prevents_PT_num;
	}
	public boolean isSurcharge_checkbox_diable_wheelchair_user() {
		return surcharge_checkbox_diable_wheelchair_user;
	}
	public void setSurcharge_checkbox_diable_wheelchair_user(
			boolean surcharge_checkbox_diable_wheelchair_user) {
		this.surcharge_checkbox_diable_wheelchair_user = surcharge_checkbox_diable_wheelchair_user;
	}
	public double getSurcharge_disable_wheelchair_user_num() {
		return surcharge_disable_wheelchair_user_num;
	}
	public void setSurcharge_disable_wheelchair_user_num(
			double surcharge_disable_wheelchair_user_num) {
		this.surcharge_disable_wheelchair_user_num = surcharge_disable_wheelchair_user_num;
	}
	public boolean isSurcharge_checkbox_disable_other() {
		return surcharge_checkbox_disable_other;
	}
	public void setSurcharge_checkbox_disable_other(
			boolean surcharge_checkbox_disable_other) {
		this.surcharge_checkbox_disable_other = surcharge_checkbox_disable_other;
	}
	public double getSurcharge_disable_other_num() {
		return surcharge_disable_other_num;
	}
	public void setSurcharge_disable_other_num(double surcharge_disable_other_num) {
		this.surcharge_disable_other_num = surcharge_disable_other_num;
	}
	public boolean isSurcharge_checkbox_health_appointment() {
		return surcharge_checkbox_health_appointment;
	}
	public void setSurcharge_checkbox_health_appointment(
			boolean surcharge_checkbox_health_appointment) {
		this.surcharge_checkbox_health_appointment = surcharge_checkbox_health_appointment;
	}
	public double getSurcharge_health_appointment_num() {
		return surcharge_health_appointment_num;
	}
	public void setSurcharge_health_appointment_num(
			double surcharge_health_appointment_num) {
		this.surcharge_health_appointment_num = surcharge_health_appointment_num;
	}
	public boolean isSurcharge_checkbox_social_care() {
		return surcharge_checkbox_social_care;
	}
	public void setSurcharge_checkbox_social_care(
			boolean surcharge_checkbox_social_care) {
		this.surcharge_checkbox_social_care = surcharge_checkbox_social_care;
	}
	public double getSurcharge_social_care_num() {
		return surcharge_social_care_num;
	}
	public void setSurcharge_social_care_num(double surcharge_social_care_num) {
		this.surcharge_social_care_num = surcharge_social_care_num;
	}
	public boolean isSurcharge_checkbox_shopping() {
		return surcharge_checkbox_shopping;
	}
	public void setSurcharge_checkbox_shopping(boolean surcharge_checkbox_shopping) {
		this.surcharge_checkbox_shopping = surcharge_checkbox_shopping;
	}
	public double getSurcharge_shopping_num() {
		return surcharge_shopping_num;
	}
	public void setSurcharge_shopping_num(double surcharge_shopping_num) {
		this.surcharge_shopping_num = surcharge_shopping_num;
	}
	public boolean isSurcharge_checkbox_leisure_visiting_friends() {
		return surcharge_checkbox_leisure_visiting_friends;
	}
	public void setSurcharge_checkbox_leisure_visiting_friends(
			boolean surcharge_checkbox_leisure_visiting_friends) {
		this.surcharge_checkbox_leisure_visiting_friends = surcharge_checkbox_leisure_visiting_friends;
	}
	public double getSurcharge_leisure_visiting_friends_num() {
		return surcharge_leisure_visiting_friends_num;
	}
	public void setSurcharge_leisure_visiting_friends_num(
			double surcharge_leisure_visiting_friends_num) {
		this.surcharge_leisure_visiting_friends_num = surcharge_leisure_visiting_friends_num;
	}
	public boolean isSurcharge_checkbox_school_education() {
		return surcharge_checkbox_school_education;
	}
	public void setSurcharge_checkbox_school_education(
			boolean surcharge_checkbox_school_education) {
		this.surcharge_checkbox_school_education = surcharge_checkbox_school_education;
	}
	public double getSurcharge_school_education_num() {
		return surcharge_school_education_num;
	}
	public void setSurcharge_school_education_num(
			double surcharge_school_education_num) {
		this.surcharge_school_education_num = surcharge_school_education_num;
	}
	public boolean isSurcharge_checkbox_work_commuting() {
		return surcharge_checkbox_work_commuting;
	}
	public void setSurcharge_checkbox_work_commuting(
			boolean surcharge_checkbox_work_commuting) {
		this.surcharge_checkbox_work_commuting = surcharge_checkbox_work_commuting;
	}
	public double getSurcharge_work_commuting_num() {
		return surcharge_work_commuting_num;
	}
	public void setSurcharge_work_commuting_num(double surcharge_work_commuting_num) {
		this.surcharge_work_commuting_num = surcharge_work_commuting_num;
	}
	public boolean isSurcharge_checkbox_other_purpose() {
		return surcharge_checkbox_other_purpose;
	}
	public void setSurcharge_checkbox_other_purpose(
			boolean surcharge_checkbox_other_purpose) {
		this.surcharge_checkbox_other_purpose = surcharge_checkbox_other_purpose;
	}
	public double getSurcharge_other_purpose_num() {
		return surcharge_other_purpose_num;
	}
	public void setSurcharge_other_purpose_num(double surcharge_other_purpose_num) {
		this.surcharge_other_purpose_num = surcharge_other_purpose_num;
	}
	public boolean isSurcharge_checkbox_start_05_hours_earlier() {
		return surcharge_checkbox_start_05_hours_earlier;
	}
	public void setSurcharge_checkbox_start_05_hours_earlier(
			boolean surcharge_checkbox_start_05_hours_earlier) {
		this.surcharge_checkbox_start_05_hours_earlier = surcharge_checkbox_start_05_hours_earlier;
	}
	public double getSurcharge_start_05_hours_earlier() {
		return surcharge_start_05_hours_earlier;
	}
	public void setSurcharge_start_05_hours_earlier(
			double surcharge_start_05_hours_earlier) {
		this.surcharge_start_05_hours_earlier = surcharge_start_05_hours_earlier;
	}
	public boolean isSurcharge_checkbox_start_1_hour_earlier() {
		return surcharge_checkbox_start_1_hour_earlier;
	}
	public void setSurcharge_checkbox_start_1_hour_earlier(
			boolean surcharge_checkbox_start_1_hour_earlier) {
		this.surcharge_checkbox_start_1_hour_earlier = surcharge_checkbox_start_1_hour_earlier;
	}
	public double getSurcharge_start_1_hour_earlier() {
		return surcharge_start_1_hour_earlier;
	}
	public void setSurcharge_start_1_hour_earlier(
			double surcharge_start_1_hour_earlier) {
		this.surcharge_start_1_hour_earlier = surcharge_start_1_hour_earlier;
	}
	public boolean isSurcharge_checkbox_start_15_hours_earlier() {
		return surcharge_checkbox_start_15_hours_earlier;
	}
	public void setSurcharge_checkbox_start_15_hours_earlier(
			boolean surcharge_checkbox_start_15_hours_earlier) {
		this.surcharge_checkbox_start_15_hours_earlier = surcharge_checkbox_start_15_hours_earlier;
	}
	public double getSurcharge_start_15_hours_earlier() {
		return surcharge_start_15_hours_earlier;
	}
	public void setSurcharge_start_15_hours_earlier(
			double surcharge_start_15_hours_earlier) {
		this.surcharge_start_15_hours_earlier = surcharge_start_15_hours_earlier;
	}
	public boolean isSurcharge_checkbox_finish_05_hours_later() {
		return surcharge_checkbox_finish_05_hours_later;
	}
	public void setSurcharge_checkbox_finish_05_hours_later(
			boolean surcharge_checkbox_finish_05_hours_later) {
		this.surcharge_checkbox_finish_05_hours_later = surcharge_checkbox_finish_05_hours_later;
	}
	public double getSurcharge_finish_05_hours_later() {
		return surcharge_finish_05_hours_later;
	}
	public void setSurcharge_finish_05_hours_later(
			double surcharge_finish_05_hours_later) {
		this.surcharge_finish_05_hours_later = surcharge_finish_05_hours_later;
	}
	public boolean isSurcharge_checkbox_finish_1_hour_later() {
		return surcharge_checkbox_finish_1_hour_later;
	}
	public void setSurcharge_checkbox_finish_1_hour_later(
			boolean surcharge_checkbox_finish_1_hour_later) {
		this.surcharge_checkbox_finish_1_hour_later = surcharge_checkbox_finish_1_hour_later;
	}
	public double getSurcharge_finish_1_hour_later() {
		return surcharge_finish_1_hour_later;
	}
	public void setSurcharge_finish_1_hour_later(
			double surcharge_finish_1_hour_later) {
		this.surcharge_finish_1_hour_later = surcharge_finish_1_hour_later;
	}
	public boolean isSurcharge_checkbox_finish_15_hours_later() {
		return surcharge_checkbox_finish_15_hours_later;
	}
	public void setSurcharge_checkbox_finish_15_hours_later(
			boolean surcharge_checkbox_finish_15_hours_later) {
		this.surcharge_checkbox_finish_15_hours_later = surcharge_checkbox_finish_15_hours_later;
	}
	public double getSurcharge_finish_15_hours_later() {
		return surcharge_finish_15_hours_later;
	}
	public void setSurcharge_finish_15_hours_later(
			double surcharge_finish_15_hours_later) {
		this.surcharge_finish_15_hours_later = surcharge_finish_15_hours_later;
	}

	public void setField(OperatorDataInputForm form ){

		surcharge_dist1_mile = form.getSurcharge_dist1_mile();
		surcharge_dist1_type = form.getSurcharge_dist1_type();
		surcharge_dist1_charge = form.getSurcharge_dist1_charge();
		surcharge_dist2_1 = form.getSurcharge_dist2_1();
		surcharge_dist2_2 = form.getSurcharge_dist2_2();
		surcharge_dist2_type = form.getSurcharge_dist2_type();
		surcharge_dist2_charge = form.getSurcharge_dist2_charge();
		surcharge_dist3_mile_1 = form.getSurcharge_dist3_mile_1();
		surcharge_dist3_mile_2= form.getSurcharge_dist3_mile_2();
		surcharge_dist3_type = form.getSurcharge_dist3_type();
	    surcharge_dist3_charge = form.getSurcharge_dist3_charge();
	    surcharge_dist4_mile_1 = form.getSurcharge_dist4_mile_1();
	    surcharge_dist4_mile_2 = form.getSurcharge_dist4_mile_2();
	    surcharge_dist4_type = form.getSurcharge_dist4_type();
	    surcharge_dist4_charge = form.getSurcharge_dist4_charge();
		surcharge_checkbox_under16 = form.isSurcharge_checkbox_under16();
		surcharge_under_16_num = form.getSurcharge_under_16_num();
		surcharge_checkbox_17_to_21 = form.isSurcharge_checkbox_17_to_21();
		surcharge_17_21_years_old_num = form.getSurcharge_17_21_years_old_num();
		surcharge_checkbox_22_to_54 = form.isSurcharge_checkbox_22_to_54();
		surcharge_22_54_years_old_num = form.getSurcharge_22_54_years_old_num();
		surcharge_checkbox_55_to_59 = form.isSurcharge_checkbox_55_to_59();
		surcharge_55_59_years_old_num = form.getSurcharge_55_59_years_old_num();
		surcharge_checkbox_over60 = form.isSurcharge_checkbox_over60();
		surcharge_over_60_years_old_num = form.getSurcharge_over_60_years_old_num();
		surcharge_checkbox_able_bodied = form.isSurcharge_checkbox_able_bodied();
		surcharge_able_bodied_num = form.getSurcharge_able_bodied_num();
		surcharge_checkbox_mobility_prevents_PT = form.isSurcharge_checkbox_mobility_prevents_PT();
		surcharge_mobility_prevents_PT_num = form.getSurcharge_mobility_prevents_PT_num();
		surcharge_checkbox_diable_wheelchair_user = form.isSurcharge_checkbox_diable_wheelchair_user();
		surcharge_disable_wheelchair_user_num = form.getSurcharge_disable_wheelchair_user_num();
		surcharge_checkbox_disable_other = form.isSurcharge_checkbox_disable_other();
		surcharge_disable_other_num = form.getSurcharge_disable_other_num();
		surcharge_checkbox_health_appointment = form.isSurcharge_checkbox_health_appointment();
		surcharge_health_appointment_num = form.getSurcharge_health_appointment_num();
		surcharge_checkbox_social_care = form.isSurcharge_checkbox_social_care();
		surcharge_social_care_num = form.getSurcharge_social_care_num();
		surcharge_checkbox_shopping = form.isSurcharge_checkbox_shopping();
		surcharge_shopping_num = form.getSurcharge_shopping_num();
		surcharge_checkbox_leisure_visiting_friends = form.isSurcharge_checkbox_leisure_visiting_friends();
		surcharge_leisure_visiting_friends_num = form.getSurcharge_leisure_visiting_friends_num();
		surcharge_checkbox_school_education = form.isSurcharge_checkbox_school_education();
		surcharge_school_education_num = form.getSurcharge_school_education_num();
		surcharge_checkbox_work_commuting = form.isSurcharge_checkbox_work_commuting();
		surcharge_work_commuting_num = form.getSurcharge_work_commuting_num();
		surcharge_checkbox_other_purpose = form.isSurcharge_checkbox_other_purpose();
		surcharge_other_purpose_num = form.getSurcharge_other_purpose_num();
		surcharge_checkbox_start_05_hours_earlier = form.isSurcharge_checkbox_start_05_hours_earlier();
		surcharge_start_05_hours_earlier = form.getSurcharge_start_05_hours_earlier();
		surcharge_checkbox_start_1_hour_earlier = form.isSurcharge_checkbox_start_1_hour_earlier();
		surcharge_start_1_hour_earlier = form.getSurcharge_start_1_hour_earlier();
		surcharge_checkbox_start_15_hours_earlier = form.isSurcharge_checkbox_start_15_hours_earlier();
		surcharge_start_15_hours_earlier = form.getSurcharge_start_15_hours_earlier();
		surcharge_checkbox_finish_05_hours_later = form.isSurcharge_checkbox_finish_05_hours_later();
		surcharge_finish_05_hours_later = form.getSurcharge_finish_05_hours_later();
		surcharge_checkbox_finish_1_hour_later = form.isSurcharge_checkbox_finish_1_hour_later();
		surcharge_finish_1_hour_later = form.getSurcharge_finish_1_hour_later();
		surcharge_checkbox_finish_15_hours_later = form.isSurcharge_checkbox_finish_15_hours_later();
		surcharge_finish_15_hours_later = form.getSurcharge_finish_15_hours_later();

	}

	public String toString(){

		StringBuilder sb = new  StringBuilder();
	    sb.append("surcharge_dist1_mile: "+ surcharge_dist1_mile+"\n");
		sb.append("surcharge_dist1_type: "+ this.surcharge_dist1_type+"\n");
		sb.append("surcharge_dist1_charge: "+ this.surcharge_dist1_charge+"\n");
		sb.append("surcharge_dist2_1: "+ this.surcharge_dist2_1+"\n");
		sb.append("surcharge_dist2_2: "+ this.surcharge_dist2_2+"\n");
		sb.append("surcharge_dist2_type: "+ this.surcharge_dist2_type+"\n");
		sb.append("surcharge_dist2_charge: "+ this.surcharge_dist2_charge+"\n");
		sb.append("surcharge_dist3_mile_1: "+ this.surcharge_dist3_mile_1+"\n");
		sb.append("surcharge_dist3_mile_2: "+ this.surcharge_dist3_mile_2+"\n");
		sb.append("surcharge_dist3_type: "+ this.surcharge_dist3_type+"\n");
		sb.append("surcharge_dist3_charge: "+ this.surcharge_dist3_charge+"\n");
		sb.append("surcharge_dist4_mile_1: "+ this.surcharge_dist4_mile_1+"\n");
		sb.append("surcharge_dist4_mile_2: "+ this.surcharge_dist4_mile_2+"\n");
		sb.append("surcharge_dist4_type: "+ this.surcharge_dist4_type+"\n");
		sb.append("surcharge_dist4_charge: "+ this.surcharge_dist4_charge+"\n");
		sb.append("surcharge_checkbox_under16: "+ this.isSurcharge_checkbox_under16()+"\n");
		sb.append("surcharge_under_16_num: "+ this.getSurcharge_under_16_num()+"\n");
		sb.append("surcharge_checkbox_17_to_21: "+ this.isSurcharge_checkbox_17_to_21()+"\n");
		sb.append("surcharge_17_21_years_old_num: "+ this.getSurcharge_17_21_years_old_num()+"\n");
		sb.append("surcharge_checkbox_22_to_54: "+ this.isSurcharge_checkbox_22_to_54()+"\n");
		sb.append("surcharge_22_54_years_old_num: "+ this.getSurcharge_22_54_years_old_num()+"\n");
		sb.append("surcharge_checkbox_55_to_59: "+ this.isSurcharge_checkbox_55_to_59()+"\n");
		sb.append("surcharge_55_59_years_old_num: "+ this.getSurcharge_55_59_years_old_num()+"\n");
		sb.append("surcharge_checkbox_over60: "+ this.isSurcharge_checkbox_over60()+"\n");
		sb.append("surcharge_over_60_years_old_num: "+ this.getSurcharge_over_60_years_old_num()+"\n");
		sb.append("surcharge_checkbox_able_bodied: "+ this.isSurcharge_checkbox_able_bodied()+"\n");
		sb.append("surcharge_able_bodied_num: "+ this.getSurcharge_able_bodied_num()+"\n");
		sb.append("surcharge_checkbox_mobility_prevents_PT: "+ this.isSurcharge_checkbox_mobility_prevents_PT()+"\n");
		sb.append("surcharge_mobility_prevents_PT_num: "+ this.getSurcharge_mobility_prevents_PT_num()+"\n");
		sb.append("surcharge_checkbox_diable_wheelchair_user: "+ this.isSurcharge_checkbox_diable_wheelchair_user()+"\n");
		sb.append("surcharge_disable_wheelchair_user_num: "+ this.getSurcharge_disable_wheelchair_user_num()+"\n");
		sb.append("surcharge_checkbox_disable_other: "+ this.isSurcharge_checkbox_disable_other()+"\n");
		sb.append("surcharge_disable_other_num: "+ this.getSurcharge_disable_other_num()+"\n");
		sb.append("surcharge_checkbox_health_appointment: "+ this.isSurcharge_checkbox_health_appointment()+"\n");
		sb.append("surcharge_health_appointment_num: "+ this.getSurcharge_health_appointment_num()+"\n");
		sb.append("surcharge_checkbox_social_care: "+ this.isSurcharge_checkbox_social_care()+"\n");
		sb.append("surcharge_social_care_num: "+ this.getSurcharge_social_care_num()+"\n");
		sb.append("surcharge_checkbox_shopping: "+ this.isSurcharge_checkbox_shopping()+"\n");
		sb.append("surcharge_shopping_num: "+ this.getSurcharge_leisure_visiting_friends_num()+"\n");
		sb.append("surcharge_checkbox_leisure_visiting_friends: "+ this.isSurcharge_checkbox_leisure_visiting_friends()+"\n");
		sb.append("surcharge_leisure_visiting_friends_num: "+ this.getSurcharge_leisure_visiting_friends_num()+"\n");
		sb.append("surcharge_checkbox_school_education: "+ this.isSurcharge_checkbox_school_education()+"\n");
		sb.append("surcharge_school_education_num: "+ this.getSurcharge_school_education_num()+"\n");
		sb.append("surcharge_checkbox_work_commuting: "+ this.isSurcharge_checkbox_work_commuting()+"\n");
		sb.append("surcharge_work_commuting_num: "+ this.getSurcharge_work_commuting_num()+"\n");
		sb.append("surcharge_checkbox_other_purpose: "+ this.isSurcharge_checkbox_other_purpose()+"\n");
		sb.append("surcharge_other_purpose_num: "+ this.getSurcharge_other_purpose_num()+"\n");
		sb.append("surcharge_checkbox_start_05_hours_earlier: "+ this.isSurcharge_checkbox_start_05_hours_earlier()+"\n");
		sb.append("surcharge_start_05_hours_earlier: "+ this.getSurcharge_start_05_hours_earlier()+"\n");
		sb.append("surcharge_checkbox_start_1_hour_earlier: "+ this.isSurcharge_checkbox_start_1_hour_earlier()+"\n");
		sb.append("surcharge_start_1_hour_earlier: "+ this.getSurcharge_start_1_hour_earlier()+"\n");
		sb.append("surcharge_checkbox_start_15_hours_earlier: "+ this.isSurcharge_checkbox_start_15_hours_earlier()+"\n");
		sb.append("surcharge_start_15_hours_earlier: "+ this.getSurcharge_start_15_hours_earlier()+"\n");
		sb.append("surcharge_checkbox_finish_05_hours_later: "+ this.isSurcharge_checkbox_finish_05_hours_later()+"\n");
		sb.append("surcharge_finish_05_hours_later: "+ this.getSurcharge_finish_05_hours_later()+"\n");
		sb.append("surcharge_checkbox_finish_1_hour_later: "+ this.isSurcharge_checkbox_finish_1_hour_later()+"\n");
		sb.append("surcharge_finish_1_hour_later: "+ this.getSurcharge_finish_1_hour_later()+"\n");
		sb.append("surcharge_checkbox_finish_15_hours_later: "+ this.isSurcharge_checkbox_finish_15_hours_later()+"\n");
		sb.append("surcharge_finish_15_hours_later: "+ this.getSurcharge_finish_15_hours_later()+"\n");
		return sb.toString();
	}
	public double getSurcharge_dist1_mile() {
		return surcharge_dist1_mile;
	}
	public void setSurcharge_dist1_mile(double surcharge_dist1_mile) {
		this.surcharge_dist1_mile = surcharge_dist1_mile;
	}
	public String getSurcharge_dist1_type() {
		return surcharge_dist1_type;
	}
	public void setSurcharge_dist1_type(String surcharge_dist1_type) {
		this.surcharge_dist1_type = surcharge_dist1_type;
	}
	public double getSurcharge_dist1_charge() {
		return surcharge_dist1_charge;
	}
	public void setSurcharge_dist1_charge(double surcharge_dist1_charge) {
		this.surcharge_dist1_charge = surcharge_dist1_charge;
	}
	public double getSurcharge_dist2_1() {
		return surcharge_dist2_1;
	}
	public void setSurcharge_dist2_1(double surcharge_dist2_1) {
		this.surcharge_dist2_1 = surcharge_dist2_1;
	}
	public double getSurcharge_dist2_2() {
		return surcharge_dist2_2;
	}
	public void setSurcharge_dist2_2(double surcharge_dist2_2) {
		this.surcharge_dist2_2 = surcharge_dist2_2;
	}
	public String getSurcharge_dist2_type() {
		return surcharge_dist2_type;
	}
	public void setSurcharge_dist2_type(String surcharge_dist2_type) {
		this.surcharge_dist2_type = surcharge_dist2_type;
	}
	public double getSurcharge_dist2_charge() {
		return surcharge_dist2_charge;
	}
	public void setSurcharge_dist2_charge(double surcharge_dist2_charge) {
		this.surcharge_dist2_charge = surcharge_dist2_charge;
	}
	public double getSurcharge_dist3_mile_1() {
		return surcharge_dist3_mile_1;
	}
	public void setSurcharge_dist3_mile_1(double surcharge_dist3_mile_1) {
		this.surcharge_dist3_mile_1 = surcharge_dist3_mile_1;
	}
	public double getSurcharge_dist3_mile_2() {
		return surcharge_dist3_mile_2;
	}
	public void setSurcharge_dist3_mile_2(double surcharge_dist3_mile_2) {
		this.surcharge_dist3_mile_2 = surcharge_dist3_mile_2;
	}
	public String getSurcharge_dist3_type() {
		return surcharge_dist3_type;
	}
	public void setSurcharge_dist3_type(String surcharge_dist3_type) {
		this.surcharge_dist3_type = surcharge_dist3_type;
	}
	public double getSurcharge_dist3_charge() {
		return surcharge_dist3_charge;
	}
	public void setSurcharge_dist3_charge(double surcharge_dist3_charge) {
		this.surcharge_dist3_charge = surcharge_dist3_charge;
	}
	public double getSurcharge_dist4_mile_1() {
		return surcharge_dist4_mile_1;
	}
	public void setSurcharge_dist4_mile_1(double surcharge_dist4_mile_1) {
		this.surcharge_dist4_mile_1 = surcharge_dist4_mile_1;
	}
	public double getSurcharge_dist4_mile_2() {
		return surcharge_dist4_mile_2;
	}
	public void setSurcharge_dist4_mile_2(double surcharge_dist4_mile_2) {
		this.surcharge_dist4_mile_2 = surcharge_dist4_mile_2;
	}
	public String getSurcharge_dist4_type() {
		return surcharge_dist4_type;
	}
	public void setSurcharge_dist4_type(String surcharge_dist4_type) {
		this.surcharge_dist4_type = surcharge_dist4_type;
	}
	public double getSurcharge_dist4_charge() {
		return surcharge_dist4_charge;
	}
	public void setSurcharge_dist4_charge(double surcharge_dist4_charge) {
		this.surcharge_dist4_charge = surcharge_dist4_charge;
	}

}


text:
goog.module('goog.testing.events.EventObserverTest');
goog.setTestOnly();

const EventObserver = goog.require('goog.testing.events.EventObserver');
const GoogEvent = goog.require('goog.events.Event');
const GoogEventTarget = goog.require('goog.events.EventTarget');
const googArray = goog.require('goog.array');
const googEvents = goog.require('goog.events');
const testSuite = goog.require('goog.testing.testSuite');

// Return an event's type
function getEventType(e) {
  return e.type;
}

testSuite({
  testGetEvents() {
    const observer = new EventObserver();
    const target = new GoogEventTarget();
    googEvents.listen(target, ['foo', 'bar', 'baz'], observer);

    const eventTypes =
        ['bar', 'baz', 'foo', 'qux', 'quux', 'corge', 'foo', 'baz'];
    googArray.forEach(eventTypes, goog.bind(target.dispatchEvent, target));

    const replayEvents = observer.getEvents();

    assertArrayEquals(
        'Only the listened-for event types should be remembered',
        ['bar', 'baz', 'foo', 'foo', 'baz'],
        googArray.map(observer.getEvents(), getEventType));

    assertArrayEquals(
        ['bar'], googArray.map(observer.getEvents('bar'), getEventType));
    assertArrayEquals(
        ['baz', 'baz'], googArray.map(observer.getEvents('baz'), getEventType));
    assertArrayEquals(
        ['foo', 'foo'], googArray.map(observer.getEvents('foo'), getEventType));
  },

  testHandleEvent() {
    const events = [
      new GoogEvent('foo'),
      new GoogEvent('bar'),
      new GoogEvent('baz'),
    ];

    const observer = new EventObserver();
    googArray.forEach(events, goog.bind(observer.handleEvent, observer));

    assertArrayEquals(events, observer.getEvents());
    assertArrayEquals([events[0]], observer.getEvents('foo'));
    assertArrayEquals([events[1]], observer.getEvents('bar'));
    assertArrayEquals([events[2]], observer.getEvents('baz'));
  },

  testClear() {
    const event = new GoogEvent('foo');

    const observer = new EventObserver();
    observer.handleEvent(event);

    assertArrayEquals([event], observer.getEvents());

    observer.clear();

    assertArrayEquals([], observer.getEvents());

    const otherEvent = new GoogEvent('baz');
    observer.handleEvent(otherEvent);

    assertArrayEquals([otherEvent], observer.getEvents());
  },
});


text:
<resources>
    <string name="app_name">StudyAdvancedThread</string>
    <string name="image_download">image</string>
</resources>


text:
angular.module('characterCreator')
    .directive('incrementInput', ['coreService', incrementInput]);

function incrementInput(coreService) {
    return {
        restrict: 'E',
        scope: {
            value: '=',
            canIncrement: '&',
            canDecrement: '&',
            increment: '&',
            decrement: '&'
        },
        templateUrl: 'partials/incrementInput.html',
        link: link
    };

    function link(scope, element, attrs) {
    }
}


text:
go.app = function() {
    var vumigo = require('vumigo_v02');
    var App = vumigo.App;
    var FreeText = vumigo.states.FreeText;
    var Choice = vumigo.states.Choice;
    var ChoiceState = vumigo.states.ChoiceState;
    var EndState = vumigo.states.EndState;
    var JsonApi = vumigo.http.api.JsonApi;

    var GoApp = App.extend(function(self) {

        App.call(self, 'states:start');

        self.init = function() {
            self.http = new JsonApi(self.im);
        };

        // This is the initial state that the user is presented with. It fetches
        // the definition for the word and sends it to the end state if the word
        // is found, otherwise it sends a list of related words to the
        // wordchoice state.
        self.states.add('states:start', function(name) {
            return new FreeText(name, {
                question:
                    'Hi there! What word would you like the definition for?',

                next: function(content) {
                    return self
                        // Send the request to the API
                        .http.get([
                                "http://api.wordnik.com/v4/word.json/",
                                content,
                                "/definitions"
                            ].join(""),
                            {
                                params: {
                                    "limit":"1",
                                    "sourceDictionaries":"webster",
                                    "useCanonical":"true",
                                    "includeRelated":"true",
                                    "api_key":self.im.config.apikey
                                }
                            })
                        .then(function(resp) {
                            // If no related words are found, send to a
                            // different end state
                            if(!resp.data[0] || !resp.data[0].word) {
                                return {
                                    name: 'states:nothingfound',
                                    creator_opts: {
                                        query:content
                                    }
                                };
                            }
                            // If the searched word isn't found, give the user a
                            // choice of related words to choose from.
                            else if(content != resp.data[0].word) {
                                return {
                                    name: 'states:wordchoice',
                                    creator_opts: {
                                        query: content,
                                        word: resp.data[0].word,
                                        related: resp.data[0].relatedWords
                                    }
                                };
                            }
                            // If the searched word is found, return the
                            // definition
                            else return {
                                name: 'states:end',
                                creator_opts: {
                                    query: content,
                                    definition: resp.data[0].text
                                }
                            };
                        });
                    }
                });
        });

        // This state will give the user a list of words if what they searched
        // for wasn't found. It then gets the definition of the word they choose
        // and sends it to the end state.
        self.states.add('states:wordchoice', function(name, opts) {
            // Build a list of choices from the 'nearest' word as well as
            // related words.
            var choiceList = [new Choice(opts.word, opts.word)];
            for(var relatedWord in opts.related) {
                for(var word in opts.related[relatedWord].words) {
                    var wordToAdd = opts.related[relatedWord].words[word];
                    choiceList.push(new Choice(wordToAdd, wordToAdd));
                }
            }

            return new ChoiceState(name, {
                question: ["Your word was not found, did you mean one of the ",
                           "following?"].join(''),
                choices: choiceList,
                next: function(choice) {
                    return self
                        // Now get the definition for the chosen correct word
                        // and then return the definition to the user.
                        .http.get([
                                "http://api.wordnik.com/v4/word.json/",
                                choice.value,
                                "/definitions"
                            ].join(''),
                            {
                                params: {
                                    "limit":"1",
                                    "sourceDictionaries":"webster",
                                    "useCanonical":"true",
                                    "includeRelated":"true",
                                    "api_key":self.im.config.apikey
                                }
                            })
                        .then(function(resp) {
                                return {
                                    name: 'states:end',
                                    creator_opts: {
                                        query: choice.value,
                                        definition: resp.data[0].text
                                    }
                                };
                            });

                }
            });
        });

        // This state is the end states that recieves the word 'query' and the
        // definition 'definition' and displays it to the user. If the response
        // is too long, it will truncate it.
        self.states.add('states:end', function(name, opts) {
            // Build the response, then truncate if it is too long
            var response = 'Definition of ' + opts.query + ": "
                + opts.definition;
            if(response.length > self.im.config.responselength) {
                response = response.substring(0, self.im.config.responselength
                    - 3) + "...";
            }

            return new EndState(name, {
                text: response,
                next: 'states:start'
            });
        });

        self.states.add('states:nothingfound', function(name, opts) {
            return new EndState(name, {
                text: [
                    "Sorry, no results were found for the search term '",
                    opts.query,
                    "'"].join(''),
                next: 'states:start'
            });
        });

    });

    return {
        GoApp: GoApp
    };
}();


text:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)

package edu.wustl.catissuecore.domainobject.impl;

import edu.wustl.catissuecore.domainobject.*;
import java.io.PrintStream;
import java.io.Serializable;
import java.util.List;

public class ParticipantMedicalIdentifierImpl
    implements Serializable, ParticipantMedicalIdentifier
{

    public ParticipantMedicalIdentifierImpl()
    {
    }

    public Long getId()
    {
        return id;
    }

    public void setId(Long long1)
    {
        id = long1;
    }

    public String getMedicalRecordNumber()
    {
        return medicalRecordNumber;
    }

    public void setMedicalRecordNumber(String s)
    {
        medicalRecordNumber = s;
    }

    public Participant getParticipant()
    {

        return participant;
    }

    public void setParticipant(Participant participant1)
    {
        participant = participant1;
    }

    public Site getSite()
    {

        return site;
    }

    public void setSite(Site site1)
    {
        site = site1;
    }

    public boolean equals(Object obj)
    {
        boolean flag = false;
        if(obj instanceof ParticipantMedicalIdentifier)
        {
            ParticipantMedicalIdentifier participantmedicalidentifier = (ParticipantMedicalIdentifier)obj;
            Long long1 = getId();
            if(long1 != null && long1.equals(participantmedicalidentifier.getId()))
                flag = true;
        }
        return flag;
    }

    public int hashCode()
    {
        int i = 0;
        if(getId() != null)
            i += getId().hashCode();
        return i;
    }

    private static final long serialVersionUID = 0x499602d2L;
    protected Long id;
    protected String medicalRecordNumber;
    private Participant participant;
    private Site site;
}


text:
package amai.org.conventions.events.activities;

import android.annotation.SuppressLint;
import android.graphics.PorterDuff;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.ScaleAnimation;
import android.widget.ImageView;
import android.widget.Toast;

import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.viewpager.widget.ViewPager;

import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.tabs.TabLayout;
import com.google.firebase.analytics.FirebaseAnalytics;

import java.util.Calendar;

import amai.org.conventions.FeedbackActivity;
import amai.org.conventions.R;
import amai.org.conventions.ThemeAttributes;
import amai.org.conventions.events.adapters.DayFragmentAdapter;
import amai.org.conventions.model.ConventionEvent;
import amai.org.conventions.model.conventions.Convention;
import amai.org.conventions.navigation.NavigationActivity;
import amai.org.conventions.networking.ModelRefresher;
import amai.org.conventions.utils.Dates;

public class ProgrammeActivity extends NavigationActivity implements ProgrammeDayFragment.EventsListener {

	public static final String EXTRA_DELAY_SCROLLING = "DelayScrollingExtra";
	public static final int MAX_DAYS_NUMBER = 5;
	private static final String STATE_NAVIGATE_ICON_MODIFIED = "StateNavigateIconModified";
	private static final String STATE_SELECTED_DATE_INDEX = "StateSelectedDateIndex";
	private final static int SELECT_CURRENT_DATE = -1;
	private TabLayout daysTabLayout;
	private ViewPager daysPager;

	private Menu menu;
	private boolean navigateToMyEventsIconModified = false;
	private boolean isRefreshing = false;

	@Override
	protected void onCreate(final Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentInContentContainer(R.layout.activity_programme);
		setToolbarTitle(getResources().getString(R.string.programme_title));
		removeForeground();

		setupActionButton(ThemeAttributes.getDrawable(this, R.attr.actionButtonIcon), new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				navigateToActivity(ProgrammeSearchActivity.class, false, null);
			}
		});
		if (ThemeAttributes.getBoolean(this, R.attr.fabOnProgrammeTop)) {
			FloatingActionButton actionButton = getActionButton();
			if (actionButton.getLayoutParams() instanceof CoordinatorLayout.LayoutParams) {
				CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) actionButton.getLayoutParams();
				layoutParams.anchorGravity = Gravity.TOP | Gravity.END;
				layoutParams.topMargin = ThemeAttributes.getDimensionSize(this, android.R.attr.actionBarSize) +
						getResources().getDimensionPixelOffset(R.dimen.fab_margin_anchored_to_top);
				actionButton.setLayoutParams(actionButton.getLayoutParams());
			}
		}

		int dateIndexToSelect = savedInstanceState == null ? SELECT_CURRENT_DATE : savedInstanceState.getInt(STATE_SELECTED_DATE_INDEX, SELECT_CURRENT_DATE);
		setupDays(dateIndexToSelect);

		if (savedInstanceState != null && savedInstanceState.getBoolean(STATE_NAVIGATE_ICON_MODIFIED, false)) {
			navigateToMyEventsIconModified = true;
		}
	}

	private void setupDays(int dateIndexToSelect) {
		daysTabLayout = (TabLayout) findViewById(R.id.programme_days_tabs);
		daysPager = (ViewPager) findViewById(R.id.programme_days_pager);

		int days = Convention.getInstance().getLengthInDays();
		if (days == 1) {
			daysTabLayout.setVisibility(View.GONE);
		}

		// Setup view pager
		int delay = getIntent().getIntExtra(EXTRA_DELAY_SCROLLING, 0);
		ProgrammeDayAdapter adapter = new ProgrammeDayAdapter(getSupportFragmentManager(), delay, Convention.getInstance().getEventDates());
		daysPager.setAdapter(adapter);
		daysPager.setOffscreenPageLimit(days); // Load all dates for smooth scrolling

		// Setup tabs
		daysTabLayout.setupWithViewPager(daysPager, false);

		int selectedDateIndex = dateIndexToSelect;
		// Find the current date's index if requested
		if (dateIndexToSelect == SELECT_CURRENT_DATE) {
			selectedDateIndex = adapter.getItemToDisplayForDate(Dates.toCalendar(Dates.now()));
		}

		// Default - first day
		if (selectedDateIndex < 0) {
			selectedDateIndex = 0;
		}
		daysPager.setCurrentItem(selectedDateIndex, false);
	}

	@Override
	public boolean onCreateCustomOptionsMenu(Menu menu) {
		this.menu = menu;
		getMenuInflater().inflate(R.menu.programme_menu, menu);

		if (navigateToMyEventsIconModified) {
			MenuItem item = menu.findItem(R.id.programme_navigate_to_my_events);
			changeIconColor(item);
		}

		Convention convention = Convention.getInstance();
		if (!convention.canFillFeedback()) {
			menu.removeItem(R.id.programme_navigate_to_feedback);
		} else if (convention.hasEnded() && !convention.getFeedback().isSent() && !convention.isFeedbackSendingTimeOver()) {
			MenuItem item = menu.findItem(R.id.programme_navigate_to_feedback);
			changeIconColor(item);
		}
		return true;
	}

	@Override
	public void onEventFavoriteChanged(ConventionEvent updatedEvent) {
		if (!navigateToMyEventsIconModified) {
			navigateToMyEventsIconModified = true;
			final MenuItem item = menu.findItem(R.id.programme_navigate_to_my_events);

			// This view is set as an action view. Its layout parameters are both wrap_content so it doesn't
			// need a root view to resolve them.
			@SuppressLint("InflateParams")
			View actionView = getLayoutInflater().inflate(R.layout.my_events_icon, null);
			ImageView myEventsNonAnimatedIcon = (ImageView) actionView.findViewById(R.id.non_animated_icon);

			int accentColor = ThemeAttributes.getColor(ProgrammeActivity.this, R.attr.toolbarIconAccentColor);
			myEventsNonAnimatedIcon.setColorFilter(accentColor, PorterDuff.Mode.SRC_ATOP);

			final ImageView myEventsAnimatedIcon = (ImageView) actionView.findViewById(R.id.icon_to_animate);

			AnimationSet set = new AnimationSet(true);
			set.addAnimation(new ScaleAnimation(1, 2, 1, 2, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f));
			set.addAnimation(new AlphaAnimation(1, 0));
			set.setDuration(800);

			myEventsAnimatedIcon.startAnimation(set);
			item.setActionView(actionView);
			set.setAnimationListener(new Animation.AnimationListener() {
				@Override
				public void onAnimationStart(Animation animation) {
				}

				@Override
				public void onAnimationEnd(Animation animation) {
					item.setActionView(null);
					changeIconColor(item);
				}

				@Override
				public void onAnimationRepeat(Animation animation) {
				}
			});
		}
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
			case R.id.programme_navigate_to_my_events:
				navigateToMyEventsIconModified = false;
				navigateToActivity(MyEventsActivity.class);
				return true;
			case R.id.programme_navigate_to_feedback:
				navigateToActivity(FeedbackActivity.class);
				return true;
		}

		return super.onOptionsItemSelected(item);
	}

	@Override
	public void onSaveInstanceState(Bundle outState) {
		outState.putBoolean(STATE_NAVIGATE_ICON_MODIFIED, navigateToMyEventsIconModified);
		// We must re-set the current page since the rtl view pager has a bug that it doesn't remember it
		outState.putInt(STATE_SELECTED_DATE_INDEX, daysPager.getCurrentItem());
		super.onSaveInstanceState(outState);
	}

	@Override
	public void onRefresh() {
		isRefreshing = true;
		for (int i = 0; i < daysPager.getAdapter().getCount(); ++i) {
			ProgrammeDayFragment fragment = getDayFragment(i);
			fragment.setRefreshing(true);
		}

		FirebaseAnalytics
				.getInstance(this)
				.logEvent("pull_to_refresh", null);

		new AsyncTask<Void, Void, Boolean>() {
			@Override
			protected Boolean doInBackground(Void... params) {
				ModelRefresher modelRefresher = new ModelRefresher();
				return modelRefresher.refreshFromServer(true);
			}

			@Override
			protected void onPostExecute(Boolean isSuccess) {
				isRefreshing = false;
				for (int i = 0; i < daysPager.getAdapter().getCount(); ++i) {
					ProgrammeDayFragment fragment = getDayFragment(i);
					fragment.setRefreshing(false);
					if (isSuccess) {
						fragment.updateEvents();
					}
				}
				if (!isSuccess) {
					Toast.makeText(ProgrammeActivity.this, R.string.update_refresh_failed, Toast.LENGTH_SHORT).show();
				}
			}
		}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
	}

	private ProgrammeDayFragment getDayFragment(int i) {
		return (ProgrammeDayFragment) daysPager.getAdapter().instantiateItem(daysPager, i);
	}

	private class ProgrammeDayAdapter extends DayFragmentAdapter {
		private final int delayScrolling;

		public ProgrammeDayAdapter(FragmentManager fm, int delayAnimation, Calendar[] eventDates) {
			super(fm, eventDates);
			this.delayScrolling = delayAnimation;
		}

		@Override
		public Fragment getItem(int position) {
			return ProgrammeDayFragment.newInstance(getDate(position), delayScrolling);
		}
	}
}