text:
package com.presidentio.teamcity.rest.dto;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for agent complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="agent">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element ref="{http://dto.rest.teamcity.presidentio.com}properties" minOccurs="0"/>
 *         <element name="pool" type="{http://dto.rest.teamcity.presidentio.com}agentPool" minOccurs="0"/>
 *         <element name="compatibleBuildTypes" type="{http://dto.rest.teamcity.presidentio.com}buildTypes" minOccurs="0"/>
 *         <element name="incompatibleBuildTypes" type="{http://dto.rest.teamcity.presidentio.com}compatibilities" minOccurs="0"/>
 *       </sequence>
 *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}int" />
 *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="typeId" type="{http://www.w3.org/2001/XMLSchema}int" />
 *       <attribute name="connected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *       <attribute name="enabled" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *       <attribute name="authorized" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *       <attribute name="uptodate" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *       <attribute name="ip" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="protocol" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="href" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="locator" type="{http://www.w3.org/2001/XMLSchema}string" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "agent", propOrder = {
    "properties",
    "pool",
    "compatibleBuildTypes",
    "incompatibleBuildTypes"
})
public class Agent {

    @XmlElement(namespace = "http://dto.rest.teamcity.presidentio.com")
    protected Properties properties;
    protected AgentPool pool;
    protected BuildTypes compatibleBuildTypes;
    protected Compatibilities incompatibleBuildTypes;
    @XmlAttribute(name = "id")
    protected Integer id;
    @XmlAttribute(name = "name")
    protected String name;
    @XmlAttribute(name = "typeId")
    protected Integer typeId;
    @XmlAttribute(name = "connected")
    protected Boolean connected;
    @XmlAttribute(name = "enabled")
    protected Boolean enabled;
    @XmlAttribute(name = "authorized")
    protected Boolean authorized;
    @XmlAttribute(name = "uptodate")
    protected Boolean uptodate;
    @XmlAttribute(name = "ip")
    protected String ip;
    @XmlAttribute(name = "protocol")
    protected String protocol;
    @XmlAttribute(name = "href")
    protected String href;
    @XmlAttribute(name = "locator")
    protected String locator;

    /**
     * Gets the value of the properties property.
     *
     * @return
     *     possible object is
     *     {@link Properties }
     *
     */
    public Properties getProperties() {
        return properties;
    }

    /**
     * Sets the value of the properties property.
     *
     * @param value
     *     allowed object is
     *     {@link Properties }
     *
     */
    public void setProperties(Properties value) {
        this.properties = value;
    }

    /**
     * Gets the value of the pool property.
     *
     * @return
     *     possible object is
     *     {@link AgentPool }
     *
     */
    public AgentPool getPool() {
        return pool;
    }

    /**
     * Sets the value of the pool property.
     *
     * @param value
     *     allowed object is
     *     {@link AgentPool }
     *
     */
    public void setPool(AgentPool value) {
        this.pool = value;
    }

    /**
     * Gets the value of the compatibleBuildTypes property.
     *
     * @return
     *     possible object is
     *     {@link BuildTypes }
     *
     */
    public BuildTypes getCompatibleBuildTypes() {
        return compatibleBuildTypes;
    }

    /**
     * Sets the value of the compatibleBuildTypes property.
     *
     * @param value
     *     allowed object is
     *     {@link BuildTypes }
     *
     */
    public void setCompatibleBuildTypes(BuildTypes value) {
        this.compatibleBuildTypes = value;
    }

    /**
     * Gets the value of the incompatibleBuildTypes property.
     *
     * @return
     *     possible object is
     *     {@link Compatibilities }
     *
     */
    public Compatibilities getIncompatibleBuildTypes() {
        return incompatibleBuildTypes;
    }

    /**
     * Sets the value of the incompatibleBuildTypes property.
     *
     * @param value
     *     allowed object is
     *     {@link Compatibilities }
     *
     */
    public void setIncompatibleBuildTypes(Compatibilities value) {
        this.incompatibleBuildTypes = value;
    }

    /**
     * Gets the value of the id property.
     *
     * @return
     *     possible object is
     *     {@link Integer }
     *
     */
    public Integer getId() {
        return id;
    }

    /**
     * Sets the value of the id property.
     *
     * @param value
     *     allowed object is
     *     {@link Integer }
     *
     */
    public void setId(Integer value) {
        this.id = value;
    }

    /**
     * Gets the value of the name property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setName(String value) {
        this.name = value;
    }

    /**
     * Gets the value of the typeId property.
     *
     * @return
     *     possible object is
     *     {@link Integer }
     *
     */
    public Integer getTypeId() {
        return typeId;
    }

    /**
     * Sets the value of the typeId property.
     *
     * @param value
     *     allowed object is
     *     {@link Integer }
     *
     */
    public void setTypeId(Integer value) {
        this.typeId = value;
    }

    /**
     * Gets the value of the connected property.
     *
     * @return
     *     possible object is
     *     {@link Boolean }
     *
     */
    public Boolean isConnected() {
        return connected;
    }

    /**
     * Sets the value of the connected property.
     *
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *
     */
    public void setConnected(Boolean value) {
        this.connected = value;
    }

    /**
     * Gets the value of the enabled property.
     *
     * @return
     *     possible object is
     *     {@link Boolean }
     *
     */
    public Boolean isEnabled() {
        return enabled;
    }

    /**
     * Sets the value of the enabled property.
     *
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *
     */
    public void setEnabled(Boolean value) {
        this.enabled = value;
    }

    /**
     * Gets the value of the authorized property.
     *
     * @return
     *     possible object is
     *     {@link Boolean }
     *
     */
    public Boolean isAuthorized() {
        return authorized;
    }

    /**
     * Sets the value of the authorized property.
     *
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *
     */
    public void setAuthorized(Boolean value) {
        this.authorized = value;
    }

    /**
     * Gets the value of the uptodate property.
     *
     * @return
     *     possible object is
     *     {@link Boolean }
     *
     */
    public Boolean isUptodate() {
        return uptodate;
    }

    /**
     * Sets the value of the uptodate property.
     *
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *
     */
    public void setUptodate(Boolean value) {
        this.uptodate = value;
    }

    /**
     * Gets the value of the ip property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getIp() {
        return ip;
    }

    /**
     * Sets the value of the ip property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setIp(String value) {
        this.ip = value;
    }

    /**
     * Gets the value of the protocol property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getProtocol() {
        return protocol;
    }

    /**
     * Sets the value of the protocol property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setProtocol(String value) {
        this.protocol = value;
    }

    /**
     * Gets the value of the href property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getHref() {
        return href;
    }

    /**
     * Sets the value of the href property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setHref(String value) {
        this.href = value;
    }

    /**
     * Gets the value of the locator property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getLocator() {
        return locator;
    }

    /**
     * Sets the value of the locator property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setLocator(String value) {
        this.locator = value;
    }

}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.blogspot.na5cent.connectdb.util;

/**
 *
 * @author anonymous
 */
public class StringUtils {

    public static boolean isEmpty(String str) {
        return str == null || str.isEmpty();
    }
}

redpajama_set_name: RedPajamaGithub


text:
GraphHopper licensed under the Apache license, Version 2.0

Copyright 2012 - 2016 GraphHopper GmbH

The core module includes the following software:

 * slf4j.org - SLF4J distributed under the MIT license.
 * hppc (Apache license)
 * SparseArray from the Android project (Apache license)
 * Snippets regarding mmap, vint/vlong and compression from Lucene (Apache license)
 * XMLGraphics-Commons for CGIAR elevation files (Apache License)
 * Apache Commons Lang - we copied the implementation of the Levenshtein Distance (Apache License)
 * Apache Commons Collections - we copied parts of the BinaryHeap (Apache License)
 * java-string-similarity - we copied the implementation of JaroWinkler (MIT license)

reader-osm:

 * protobuf - New BSD license
 * OSM-binary - LGPL license
 * Osmosis - public domain, see osmosis-copying.txt under core/files

reader-overlay-data:

 * com.google.code.gson:gson (Apache license)

reader-shp:

 * org.geotools:gt-shapefile (LGPL)

tools:

 * uses Apache Compress (Apache license)

web:

 * org.json, MIT style license
 * com.google.inject (Apache license)
 * images from mapbox https://www.mapbox.com/maki/, BSD License, see core/files

android:

 * android (Apache license)
 * org.mapsforge, LGPL
 * VTM, LGPL


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Utils = void 0;
const tslib_1 = require("tslib");
const Enums_1 = require("../Enums");
const ColorUtils_1 = require("./ColorUtils");
class Utils {
    static isSsr() {
        return typeof window === "undefined" || !window;
    }
    static get animate() {
        return this.isSsr()
            ? (callback) => setTimeout(callback)
            : (callback) => (window.requestAnimationFrame ||
                window.webkitRequestAnimationFrame ||
                window.mozRequestAnimationFrame ||
                window.oRequestAnimationFrame ||
                window.msRequestAnimationFrame ||
                window.setTimeout)(callback);
    }
    static get cancelAnimation() {
        return this.isSsr()
            ? (handle) => clearTimeout(handle)
            : (handle) => (window.cancelAnimationFrame ||
                window.webkitCancelRequestAnimationFrame ||
                window.mozCancelRequestAnimationFrame ||
                window.oCancelRequestAnimationFrame ||
                window.msCancelRequestAnimationFrame ||
                window.clearTimeout)(handle);
    }
    static replaceColorSvg(image, color, opacity) {
        if (!image.svgData) {
            return "";
        }
        const svgXml = image.svgData;
        const rgbHex = /#([0-9A-F]{3,6})/gi;
        return svgXml.replace(rgbHex, () => ColorUtils_1.ColorUtils.getStyleFromHsl(color, opacity));
    }
    static clamp(num, min, max) {
        return Math.min(Math.max(num, min), max);
    }
    static isInArray(value, array) {
        return value === array || (array instanceof Array && array.indexOf(value) > -1);
    }
    static mix(comp1, comp2, weight1, weight2) {
        return Math.floor((comp1 * weight1 + comp2 * weight2) / (weight1 + weight2));
    }
    static getParticleBaseVelocity(particle) {
        let velocityBase;
        switch (particle.direction) {
            case Enums_1.MoveDirection.top:
                velocityBase = { x: 0, y: -1 };
                break;
            case Enums_1.MoveDirection.topRight:
                velocityBase = { x: 0.5, y: -0.5 };
                break;
            case Enums_1.MoveDirection.right:
                velocityBase = { x: 1, y: -0 };
                break;
            case Enums_1.MoveDirection.bottomRight:
                velocityBase = { x: 0.5, y: 0.5 };
                break;
            case Enums_1.MoveDirection.bottom:
                velocityBase = { x: 0, y: 1 };
                break;
            case Enums_1.MoveDirection.bottomLeft:
                velocityBase = { x: -0.5, y: 1 };
                break;
            case Enums_1.MoveDirection.left:
                velocityBase = { x: -1, y: 0 };
                break;
            case Enums_1.MoveDirection.topLeft:
                velocityBase = { x: -0.5, y: -0.5 };
                break;
            default:
                velocityBase = { x: 0, y: 0 };
                break;
        }
        return velocityBase;
    }
    static getDistances(pointA, pointB) {
        const dx = pointA.x - pointB.x;
        const dy = pointA.y - pointB.y;
        return { dx: dx, dy: dy, distance: Math.sqrt(dx * dx + dy * dy) };
    }
    static getDistance(pointA, pointB) {
        return this.getDistances(pointA, pointB).distance;
    }
    static loadFont(character) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            try {
                yield document.fonts.load(`${character.weight} 36px '${character.font}'`);
            }
            catch (_a) {
            }
        });
    }
    static arrayRandomIndex(array) {
        return Math.floor(Math.random() * array.length);
    }
    static itemFromArray(array, index) {
        return array[index !== null && index !== void 0 ? index : this.arrayRandomIndex(array)];
    }
    static randomInRange(r1, r2) {
        const max = Math.max(r1, r2), min = Math.min(r1, r2);
        return Math.random() * (max - min) + min;
    }
    static isPointInside(point, size, radius) {
        return this.areBoundsInside(this.calculateBounds(point, radius !== null && radius !== void 0 ? radius : 0), size);
    }
    static areBoundsInside(bounds, size) {
        return bounds.left < size.width && bounds.right > 0 && bounds.top < size.height && bounds.bottom > 0;
    }
    static calculateBounds(point, radius) {
        return {
            bottom: point.y + radius,
            left: point.x - radius,
            right: point.x + radius,
            top: point.y - radius,
        };
    }
    static loadImage(source) {
        return new Promise((resolve, reject) => {
            if (!source) {
                reject("Error tsParticles - No image.src");
                return;
            }
            const image = {
                source: source,
                type: source.substr(source.length - 3),
            };
            const img = new Image();
            img.addEventListener("load", () => {
                image.element = img;
                resolve(image);
            });
            img.addEventListener("error", () => {
                reject(`Error tsParticles - loading image: ${source}`);
            });
            img.src = source;
        });
    }
    static downloadSvgImage(source) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            if (!source) {
                throw new Error("Error tsParticles - No image.src");
            }
            const image = {
                source: source,
                type: source.substr(source.length - 3),
            };
            if (image.type !== "svg") {
                return this.loadImage(source);
            }
            const response = yield fetch(image.source);
            if (!response.ok) {
                throw new Error("Error tsParticles - Image not found");
            }
            image.svgData = yield response.text();
            return image;
        });
    }
    static deepExtend(destination, ...sources) {
        for (const source of sources.filter((s) => s !== undefined && s !== null)) {
            if (typeof source !== "object") {
                destination = source;
                continue;
            }
            const sourceIsArray = Array.isArray(source);
            if (sourceIsArray && (typeof destination !== "object" || !destination || !Array.isArray(destination))) {
                destination = [];
            }
            else if (!sourceIsArray &&
                (typeof destination !== "object" || !destination || Array.isArray(destination))) {
                destination = {};
            }
            for (const key in source) {
                if (key === "__proto__") {
                    continue;
                }
                const value = source[key];
                const isObject = typeof value === "object";
                destination[key] =
                    isObject && Array.isArray(value)
                        ? value.map((v) => this.deepExtend(destination[key], v))
                        : this.deepExtend(destination[key], value);
            }
        }
        return destination;
    }
    static isDivModeEnabled(mode, divs) {
        return divs instanceof Array
            ? !!divs.find((t) => t.enable && Utils.isInArray(mode, t.mode))
            : Utils.isInArray(mode, divs.mode);
    }
    static divModeExecute(mode, divs, callback) {
        if (divs instanceof Array) {
            for (const div of divs) {
                const divMode = div.mode;
                const divEnabled = div.enable;
                if (divEnabled && Utils.isInArray(mode, divMode)) {
                    this.singleDivModeExecute(div, callback);
                }
            }
        }
        else {
            const divMode = divs.mode;
            const divEnabled = divs.enable;
            if (divEnabled && Utils.isInArray(mode, divMode)) {
                this.singleDivModeExecute(divs, callback);
            }
        }
    }
    static singleDivModeExecute(div, callback) {
        const ids = div.ids;
        if (ids instanceof Array) {
            for (const id of ids) {
                callback(id, div);
            }
        }
        else {
            callback(ids, div);
        }
    }
    static divMode(divs, divId) {
        if (!divId || !divs) {
            return;
        }
        if (divs instanceof Array) {
            return divs.find((d) => Utils.isInArray(divId, d.ids));
        }
        else if (Utils.isInArray(divId, divs.ids)) {
            return divs;
        }
    }
}
exports.Utils = Utils;


text:
package com.interfaces.robotstories;

import com.auxiliar.robotstories.BluetoothMethods;
import com.auxiliar.robotstories.ImageHandler;
import com.example.robotstories.R;
import com.types.robotstories.Motor;
import com.types.robotstories.Play;
import com.types.robotstories.Robot;
import com.types.robotstories.Sensor;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Toast;

/**
 * Creates an interface to create or modify the properties of a robot
 *
Creates an auxiliar robot if there is no one created previously to be able to call the methods to know
 * the number of motors and sensors
.
 *
This interface shows a tableLayout which contains all created motors, an another tablelayout which shows all the sensor. Under each
 * table appears a button which allows us to add more motors or sensors to the tables, and to the play.
 *
Can't go to anywhere until a name and a size is set

 * @author Arturo Gil
 */
@SuppressWarnings({"deprecation", "rawtypes"})
public class create_robot extends Activity{

	/*CONSTANTS*/
	/* FOR THE ID OF DIALOGS (SENSOR AND MOTOR)*/
    /**
     * The value of this constant is {@value}. It is the code to call the dialog for defining a motor
     */
	private static final int MOTOR_DIALOG= 0;
    /**
     * The value of this constant is {@value}. It is the code to call the dialog for defining a sensor
     */
	private static final int SENSOR_DIALOG= 1;
    /**
     * The value of this constant is {@value}. It is the code to call the dialog for setting the picture for the robot
     */
	private static final int PICTURE_DIALOG = 2;
    /**
     * The value of this constant is {@value}. It is the code to call the dialog for setting the principal action of the robot
     */
	private static final int ACTION_DIALOG = 3;
    /**
     * POSITION OF THE SPINNER IN TABLE ROW. The value of this constant is {@value}.
	 * (necessary in save motor/sensor, because it needs to know where it is to read its value)
     */
	private static final int POS_SPINNER_ON_ROW = 2;
    /**
     * POSITION OF THE TV OF THE NAME OF THE MOTOR/SENSOR IN TABLE ROW.
     * The value of this constant is {@value}.
	 * (necessary in save motor/sensor, because it needs to know where it is to read its value)
     */
	private static final int POS_TV_ON_ROW = 0;

	private static final int RECTANGLE_SMALLBUTTON = 40;
	private static final int RECTANGLE_BIGIMAGE = 80;

	/*Variables received*/
	Play play;
	Robot robot;
	/**
	 *This is the name of the activity who call this activity, necesary for ensure to come back
	 *to the correct place once we finish
	 */
	String previousActivity;

	/*New robot data*/
	String name;
	int HSize, VSize;

	/*New motor/sensor data*/
	String dialog_name;
	String dialog_selected;
	/**
	 * This is the name of the image asociated to the robot. It is initialized whit the value "default_image"
	 */
	private String imageName= "defaultactor";
	private String actionName;

	private ImageHandler images;

	private BluetoothMethods bluetooth;

	/**
	 * Add listeners to buttons, and calls to iniLayout, creates the imageHandler and the bluethoothMethods
	 */
	protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.create_robot);
        this.images = new ImageHandler(this);
        this.bluetooth = new BluetoothMethods(this);
        iniLayout();

        /*Set label 2 of size robot*/
        final Spinner type= (Spinner) this.findViewById(R.id.RobotTypeSize);
		type.setOnItemSelectedListener( new OnItemSelectedListener ()   {
			public void onItemSelected(AdapterView<?> parent, View view,
					int position, long id) {
		    	String selected= (String) type.getSelectedItem();
		    	TextView type2 = (TextView) findViewById(R.id.RobotTypeSize2);
		    	type2.setText(selected);
			}
			public void onNothingSelected(AdapterView<?> parent) {
				type.setSelection(0);
		}});
		/*SAVE ROBOT*/
		Button aux =(Button) this.findViewById(R.id.RobotSave);
		aux.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				saveAndGo();
		}});
		/*ADD MOTOR*/
		aux = (Button) this.findViewById(R.id.RobotAddMotor);
		aux.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				showDialog(MOTOR_DIALOG);
		}});
		/*ADD SENSOR*/
		aux = (Button) this.findViewById(R.id.RobotAddSensor);
		aux.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				showDialog(SENSOR_DIALOG);
		}});
		/*SELECT ACTION*/
		aux = (Button) this.findViewById(R.id.ROBOTAction);
		aux.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				showDialog(ACTION_DIALOG);
		}});
		/*ADD PICTURE*/
		aux= (Button) this.findViewById(R.id.RobotPic);
		aux.setOnClickListener(new OnClickListener(){
			public void onClick(View v) {
				showDialog(PICTURE_DIALOG);
		}});
		/*FIND MACHINE*/
		aux = (Button) this.findViewById(R.id.ROBOTmachine);
		aux.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				findMachines();

			}
		});
	}

	/**
	 * Activates the bluetooth, and initializes it in the mode of add devices. After try to find all the devices
	 * */
	protected void findMachines() {
		this.bluetooth.activateBluetooth();
		if(bluetooth.initializeBlueToothAddDevices()==false){
			Toast.makeText(getBaseContext(), "Problems at the time of creating the bluetooth", Toast.LENGTH_SHORT).show();
			return;
		}
		this.bluetooth.findDevices();

	}

	/**
	 *  Reads play and previous activity, if this values are null, finish the activity
	 *  Set previous defined values in their places (if we come to modify a robot)
	 *  Creates a new robot if doesn't exists*/
	private void iniLayout() {

		/*Previous values*/
		Bundle extras = getIntent().getExtras();
		if(extras == null){
			finish();
		/*It seems we have some previous values, let's set them in their places*/
		}else{
			this.play = (Play) extras.getSerializable("Play");
			if(this.play==null)
				finish();

			this.previousActivity = extras.getString("previousActivity");
			if(this.previousActivity==null)
				finish();

			this.robot = (Robot) extras.getSerializable("Robot");
			if(this.robot!=null){
				/*Name*/
				EditText aux= (EditText)findViewById(R.id.ROBOTName);
				aux.setText(this.robot.name);
				/*Horizontal size*/
				aux= (EditText)findViewById(R.id.ROBOTHSize);
				aux.setText(Integer.toString(this.robot.HSize));
				/*Vertical size*/
				aux= (EditText)findViewById(R.id.ROBOTVSize);
				aux.setText(Integer.toString(this.robot.VSize));
				this.imageName= this.robot.imageName;
				if(this.robot.moveAction!=null){
					this.actionName= this.robot.moveAction.name;
					this.refreshActionLayout(this.actionName);
				}
			}
			else
				this.robot= new Robot();

			/*We add the pre-created motors and sensors of the play*/
			if(this.play.motors!= null){
				String[] portsNumbers = this.robot.arrayMotorPorts();
				int id_table = R.id.ROBOTTableM;
				for (Motor m: this.play.motors){
					this.dialog_name=m.name;
					this.dialog_selected=m.type;
					addRow(id_table, portsNumbers, Integer.toString(this.robot.PortMotor(m)));
				}
				this.robot.removeMotors();
			}
			if(this.play.sensors!= null){
				String[] portsNumbers = this.robot.arraySensorPorts();
				int id_table = R.id.ROBOTTableS;
				for (Sensor s: this.play.sensors){
					this.dialog_name=s.name;
					this.dialog_selected=s.type;
					addRow(id_table, portsNumbers, Integer.toString(this.robot.PortSensor(s)));
				}
				this.robot.removeSensors();
			}
		}
	}

	public void onBackPressed() {
        new AlertDialog.Builder(this)
            .setIcon(android.R.drawable.ic_dialog_alert)
            .setTitle("Closing Activity")
            .setMessage("Are you sure you want to leave whitout saving?")
            .setPositiveButton("Yes", new DialogInterface.OnClickListener(){

            public void onClick(DialogInterface dialog, int which) {
        		Class comeBack;
        		try {
        			comeBack= Class.forName(previousActivity);
        			Intent intent = new Intent(create_robot.this, comeBack);
        			intent.putExtra("Play", play);
        			startActivity(intent);
        			finish();
        		} catch (ClassNotFoundException e) {
        		    AlertDialog ad = new AlertDialog.Builder(getApplicationContext()).create();
        		    ad.setCancelable(false);
        		    ad.setMessage("Fail loading previous class "+ previousActivity);
        		    ad.show();
        			e.printStackTrace();
        		}
            }

        })
        .setNegativeButton("No", null)
        .show();
    }
	/**
	 * Save all the data and come back to the previous activity.
	 * Checks if there are more than one motor/sensor per port*/

	private void saveAndGo(){
		boolean go=true;

		/*Title, checks if the name is already in use*/
		EditText aux= (EditText)findViewById(R.id.ROBOTName);
		name= aux.getText().toString();
		if(name.length()<=0){
			aux.setError("Introduce a valid name for the robot");
			go=false;
		}
		else{
			if(this.play.findRobotByName(name)!=null){
				aux.setError("This name is already on use");
				go=false;
			}
			else
				aux.setError(null);
		}

		/*Horizontal size*/
		aux= (EditText)findViewById(R.id.ROBOTHSize);
		if(aux.getText().toString().length()>0){
			HSize = Integer.parseInt(aux.getText().toString());
			if(HSize<= 0){
				aux.setError("Introduce a valid horizontal size for the robot");
				go=false;
			}
		}
		else{
			aux.setError("Introduce an horizontal size for the robot");
			go=false;
		}

		/*Vertical size*/
		aux= (EditText)findViewById(R.id.ROBOTVSize);
		if(aux.getText().toString().length()>0){
			VSize = Integer.parseInt(aux.getText().toString());
			if(VSize<= 0){
				aux.setError("Introduce a valid vertical size for the robot");
				go=false;
			}
		}
		else{
			aux.setError("Introduce an horizontal size for the robot");
			go=false;
		}

		/*First check of everything alright*/
		if(!go)
			return;

		/*MOTORS AND SENSORS*/
		/*Check table to find the motor/sensor asignations*/
		if( this.saveMotors()==false){
			go=false;
			Toast.makeText(create_robot.this, "Problems at the time of saving the motors, " +
					"please check if there is any motor port whit two motors asigned", Toast.LENGTH_SHORT).show();
		}
		if (this.saveSensors()==false){
			go=false;
			Toast.makeText(create_robot.this, "Problems at the time of saving the sensors, " +
					"please check if there is any sensor port whit two motors asigned", Toast.LENGTH_SHORT).show();
		}
		/*Are everything ready to go? If not clear motor and sensors*/
		if(!go){
			this.robot.removeMotors();
			this.robot.removeSensors();
			return;
		}

		this.robot.name= name;
		this.robot.HSize=HSize;
		this.robot.VSize=VSize;
		this.robot.imageName=this.imageName;
		this.robot.device = this.bluetooth.selectedAdress;
		//TODO What happens if there is no device?
		if(this.actionName!=null){
			this.robot.moveAction= this.play.findActionByName(this.actionName);
		}

		/*Add robot to play, checks if it already exists*/
		this.play.AddRobot(this.robot);

		/**come back to previous activity, if any problem, gets blocked (should not happen never,
		 * if it happens the responsability is from the calling class, not sending the correct name)*/
		Class comeBack;
		try {
			comeBack= Class.forName(this.previousActivity);
			Intent intent = new Intent(create_robot.this, comeBack);
			intent.putExtra("Play", this.play);
			startActivity(intent);
			finish();
		} catch (ClassNotFoundException e) {
		    AlertDialog ad = new AlertDialog.Builder(this).create();
		    ad.setCancelable(false);
		    ad.setMessage("Fail loading previous class "+ this.previousActivity);
		    ad.show();
			e.printStackTrace();
		}
	}
	/**Save the sensors in their respective ports in the robot
	 * if there is any problem at the time of save any sensor, return false
	 * alright returns true
	 *
VERY FRAGILE METHOD, IF YOU MAKE ANY CHANGE IN THE TABLE, PLEASE CHECK IF THERE IS ANY NEED OF CHANGING
	 * THE VALUE OF POS_SPINNER_ON_ROW, AND POS_TV_ON_ROW
 */
	private boolean saveSensors() {
		TableLayout tl = (TableLayout) findViewById(R.id.ROBOTTableS);
		/*Remember the first child (0) is the title*/
		/*For each row in the table, read the value of the TV for the name
		 * and the value of the spinner for taking the number of the port*/
		for(int i=1; i<tl.getChildCount(); i++){
			TableRow tr= (TableRow) tl.getChildAt(i);
			Spinner aux= (Spinner) tr.getChildAt(create_robot.POS_SPINNER_ON_ROW);
			int pos=-1;
			if(aux.getSelectedItemPosition()!=0)
				pos = Integer.parseInt(aux.getSelectedItem().toString());
			 /* if there is any problem at the time of assign port to a sensor return false and stops*/
			if (pos>0){
				TextView name = (TextView) tr.getChildAt(create_robot.POS_TV_ON_ROW);
				Sensor s = this.play.findSensorByName((String)name.getText());
				if(this.robot.setSensorInPort(s, pos)==false)
					return false;
			}
		}
		return true;
	}
	/**
	 *Save the motors in their respective ports in the robot
	 * if there is any problem at the time of save any motor, return false
	 * alright returns true
	 *
VERY FRAGILE METHOD, IF YOU MAKE ANY CHANGE IN THE TABLE, PLEASE CHECK IF THERE IS ANY NEED OF CHANGING
	 * THE VALUE OF POS_SPINNER_ON_ROW, AND POS_TV_ON_ROW
 */
	private boolean saveMotors(){
		TableLayout tl = (TableLayout) findViewById(R.id.ROBOTTableM);
		/*Remember the first child (0) is the title*/
		/*For each row in the table, read the value of the TV for the name
		 * and the value of the spinner for taking the number of the port*/
		for(int i=1; i<tl.getChildCount(); i++){
			TableRow tr= (TableRow) tl.getChildAt(i);
			Spinner aux= (Spinner) tr.getChildAt(create_robot.POS_SPINNER_ON_ROW);
			int pos=-1;
			if(aux.getSelectedItemPosition()!=0)
				pos = Integer.parseInt(aux.getSelectedItem().toString());
			if (pos>0){
				TextView name = (TextView) tr.getChildAt(create_robot.POS_TV_ON_ROW);
				Motor m = this.play.findMotorByName((String)name.getText());
				 /* if there is any problem at the time of assign port to a motor return false and stops*/
				if(this.robot.setMotorInPort(m, pos)==false)
					return false;
			}
		}
		return true;
	}
	/**Create dialog for input data for sensor and for motors, select a picture for the robot, or for selecting the basic action of the robot
	 *
	 * @param id of the dialog to show (motor or sensor)*/
	protected Dialog onCreateDialog(final int id, Bundle args) {
		AlertDialog dialog=null;
		AlertDialog.Builder builder =null;

		LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		final EditText nameET;
	    final Spinner typeSP ;
	    final View layout ;

		switch(id){
			case MOTOR_DIALOG:
				layout = inflater.inflate(R.layout.motor_dialog, (ViewGroup) findViewById(R.id.MOTORroot));
				nameET = (EditText) layout.findViewById(R.id.MOTORName);
				typeSP = (Spinner) layout.findViewById(R.id.MOTORType);
				builder = new AlertDialog.Builder(this);
				builder.setTitle("Define a new motor");
				break;

			case SENSOR_DIALOG:
				layout = inflater.inflate(R.layout.sensor_dialog, (ViewGroup) findViewById(R.id.SENSORroot));
				nameET = (EditText) layout.findViewById(R.id.SENSORName);
				typeSP = (Spinner) layout.findViewById(R.id.SENSORType);
				builder = new AlertDialog.Builder(this);
				builder.setTitle("Define a new sensor");
				break;

			case PICTURE_DIALOG:
				layout = inflater.inflate(R.layout.picture_dialog, (ViewGroup) findViewById(R.id.PICTURETable));
				builder = new AlertDialog.Builder(this);
				builder.setTitle("Select a image for the robot");
				typeSP=null;
				nameET=null;

				/*Puts available images*/
				String[] values = getResources().getStringArray(R.array.RobotImages);
				this.setButtonPics(layout, values, values, id);
				break;

			case ACTION_DIALOG:
				layout = inflater.inflate(R.layout.picture_dialog, (ViewGroup) findViewById(R.id.PICTURETable));
				builder = new AlertDialog.Builder(this);
				builder.setTitle("Select an action for the robot");
				typeSP=null;
				nameET=null;

				/*Puts available images*/
				String[] images = this.play.getActionImagesWhitTarget();
				values = this.play.getActionNamesWhitTarget();
				if(images==null || values==null){
					Toast.makeText(this, "There are not valid actions created yet", Toast.LENGTH_SHORT).show();
					return null;
				}
				if(images.length!=values.length){
					Toast.makeText(this, "Corrupted actions", Toast.LENGTH_SHORT).show();
					return null;
				}
				this.setButtonPics(layout, values, images, id);
				break;

			default:
				return null;
			}

		/*Create cancel button*/
		builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int whichButton) {
				removeDialog(id);
			}
		});
		/*Create OK button (only if it is motor or sensor)*/
		if(id== MOTOR_DIALOG || id== SENSOR_DIALOG)
			builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int which) {
					dialog_selected= (String) typeSP.getSelectedItem();
					saveInputDataDialog(id, nameET);
					removeDialog(id);
			}
		});
		/*Display dialog*/
		builder.setView(layout);
		dialog = builder.create();
		return dialog;
	}

	/**
	 * Get the names of the images which are available for represent an action from strings.xml (R.array.RobotImages),
	 * and shows them in the dialog inside a tablelayout which shows its name and the picture
	 *
	 * @param layout the dialog in which the images are shown
	 * @param images
	 */
	private void setButtonPics(View layout, String[] values, String[] images, final int id) {
		TableLayout tl = (TableLayout) layout.findViewById(R.id.PICTURETable);
		int i=0;

		for(final String name: values){
			TableRow tr = new TableRow(this);
			tr.setGravity(Gravity.CENTER_HORIZONTAL);
			tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.FILL_PARENT));
			/* Create a button for the row */
			Button botaux = new Button (this);
			botaux.setText(name);
			botaux.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.FILL_PARENT));
			BitmapDrawable imagechanged= this.images.resizeImage(images[i], create_robot.RECTANGLE_SMALLBUTTON);
			i++;
			botaux.setCompoundDrawablesWithIntrinsicBounds(null, null, imagechanged, null);
			botaux.setOnClickListener(new OnClickListener() {
				String selected= name;
				int dialog= id;
				public void onClick(View v) {
					if(this.dialog==PICTURE_DIALOG){
						imageName= this.selected;
						removeDialog(PICTURE_DIALOG);
					}
					if(this.dialog==ACTION_DIALOG){
						actionName= this.selected;
						refreshActionLayout(this.selected);
						removeDialog(ACTION_DIALOG);
					}
				}
			});
			/* Add objects to row. */
			tr.addView(botaux);

			/* Add row to TableLayout. */
			tl.addView(tr, new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));
		}

	}

	/**Put the name and the image of the action which is the move action of the robot
	 *
	 * @param action the name of the action
	 */
	private void refreshActionLayout(String action) {
		/*Image*/
		ImageView imageView= (ImageView) this.findViewById(R.id.ROBOTActionImage);
		imageView.setImageDrawable(this.images.resizeImage(this.play.findActionByName(action).image, RECTANGLE_BIGIMAGE));
		/*name*/
		TextView name= (TextView) this.findViewById(R.id.ROBOTActionName);
		name.setText(action);
	}

	/**Check if the name is already in use by another motor or sensor (respectively) or if it null-> show toast
	 * if not save input data from the dialog -> save + add row
	 * @param id case motor/sensor
	 * @param nameET place to read the name of the motor/sensor
	 */
	protected void saveInputDataDialog(final int id, final EditText nameET) {

		int id_table;

		dialog_name = nameET.getText().toString();

		/*Check if the name of the motor/sensor is valid*/
		if(dialog_name.length() == 0){
			Toast.makeText(create_robot.this, "This name is not valid", Toast.LENGTH_SHORT).show();
			return;
		}

		switch(id){
			case MOTOR_DIALOG:
				if (play.findMotorByName(dialog_name)!=null){
					Toast.makeText(create_robot.this, "The name " + dialog_name +
							"is already in use by another motor", Toast.LENGTH_SHORT).show();
					return;
				}
				this.play.AddMotor(new Motor (this.dialog_name, this.dialog_selected));
				id_table = R.id.ROBOTTableM;
				this.addRow(id_table, this.robot.arrayMotorPorts(), null);
				break;
			case SENSOR_DIALOG:
				if (play.findSensorByName(dialog_name)!=null){
					Toast.makeText(create_robot.this, "The name \"" + dialog_name +
							"\" is already in use by another sensor", Toast.LENGTH_SHORT).show();
					return;
				}
				this.play.AddSensor(new Sensor (this.dialog_name, this.dialog_selected));
				id_table = R.id.ROBOTTableS;
				this.addRow(id_table, this.robot.arraySensorPorts(), null);
				break;
			default:
				return;
		}
	}

	/**Add row whit the new motor/sensor, add the delete button to row
	 *
	 * @param id_table case motor/sensor
	 * @param portsNumbers array for the spinner whit the number of the ports
	 * @param value the initial value of the spinner. If this value is not contained in the array of valid values (portsNumber), it will be set
	 * to "-"
	 */
	protected void addRow(int id_table, String[] portsNumbers, String value){
		/* Find Tablelayout defined in main.xml */
		TableLayout tl = (TableLayout) findViewById(id_table);
		/* Create a new row to be added. */
		final TableRow tr = new TableRow(this);
		tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));

		/* Create a 2TV, the spinner and the delete button to be the row-content. */
		/*2TV*/
		TextView nameTV = new TextView(this);
		nameTV.setText(this.dialog_name);
		nameTV.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.MATCH_PARENT, 2));
		nameTV.setGravity(Gravity.CENTER);
		nameTV.setBackgroundResource(R.drawable.cells_create_robot);
		nameTV.setMaxWidth(tr.getWidth()/3);
		TextView typeTV = new TextView(this);
		typeTV.setText(this.dialog_selected);
		typeTV.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.MATCH_PARENT, 1));
		typeTV.setGravity(Gravity.CENTER);
		typeTV.setBackgroundResource(R.drawable.cells_create_robot);

		/*Spinner*/
		Spinner ports = new Spinner (this);
		ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, portsNumbers); //selected item will look like a spinner set from XML
		spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		ports.setAdapter(spinnerArrayAdapter);
		ports.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.MATCH_PARENT, 1));
		for(int i=0; i<portsNumbers.length; i++){
			if(portsNumbers[i].equals(value))
				ports.setSelection(i);
		}

		/*Delete Button*/
		ImageButton botaux = new ImageButton(this);
		botaux.setImageResource(R.drawable.cross_red);
		botaux.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.MATCH_PARENT));
		botaux.setOnClickListener(new OnClickListener() {
			String name=dialog_name;
			TableRow tr_delete =tr;
			public void onClick(View v) {
				deleteRow(name, tr_delete);
		}});

		/* Add objects to row. */
		tr.addView(nameTV);
		tr.addView(typeTV);
		tr.addView(ports);
		tr.addView(botaux);

		/* Add row to TableLayout. */
		tl.addView(tr, new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));
	}
	/**
	 * Delete a row from the table of available motors/sensor and remove the motor/sensor from the play.
	 * Reads if it is motor or sensor taking the parent of the tableRow, it is the TableLayout, and
	 * sees if its id is from motor or sensor
	 * Use the tablelayout to delete the row from it
	 *
	 * @param name of the motor/sensor
	 * @param tr where the motor/sensor is
	 */
	protected void deleteRow(String name, TableRow tr) {
		tr.removeAllViews();
		TableLayout tl= (TableLayout) tr.getParent();
		if(tl.getId()==R.id.ROBOTTableM)
			this.play.RemoveMotor(this.play.findMotorByName(name));
		else
			this.play.RemoveSensor(this.play.findSensorByName(name));
		tl.removeView(tr);
	}

}


text:
.class public abstract Landroid/graphics/drawable/Drawable$ConstantState;
.super Ljava/lang/Object;
.source "Drawable.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/graphics/drawable/Drawable;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x409
    name = "ConstantState"
.end annotation

# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 1213
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public addAtlasableBitmaps(Ljava/util/Collection;)I
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Collection",
            "<",
            "Landroid/graphics/Bitmap;",
            ">;)I"
        }
    .end annotation

    .prologue
    .line 1252
    .local p1, "atlasList":Ljava/util/Collection;, "Ljava/util/Collection<Landroid/graphics/Bitmap;>;"
    const/4 v0, 0x0

    return v0
.end method

.method public canApplyTheme()Z
    .locals 1

    .prologue
    .line 1264
    const/4 v0, 0x0

    return v0
.end method

.method public abstract getChangingConfigurations()I
.end method

.method protected final isAtlasable(Landroid/graphics/Bitmap;)Z
    .locals 2
    .param p1, "bitmap"    # Landroid/graphics/Bitmap;

    .prologue
    .line 1257
    if-eqz p1, :cond_0

    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getConfig()Landroid/graphics/Bitmap$Config;

    move-result-object v0

    sget-object v1, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    if-ne v0, v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public abstract newDrawable()Landroid/graphics/drawable/Drawable;
.end method

.method public newDrawable(Landroid/content/res/Resources;)Landroid/graphics/drawable/Drawable;
    .locals 1
    .param p1, "res"    # Landroid/content/res/Resources;

    .prologue
    .line 1230
    invoke-virtual {p0}, Landroid/graphics/drawable/Drawable$ConstantState;->newDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    return-object v0
.end method

.method public newDrawable(Landroid/content/res/Resources;Landroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
    .locals 1
    .param p1, "res"    # Landroid/content/res/Resources;
    .param p2, "theme"    # Landroid/content/res/Resources$Theme;

    .prologue
    .line 1238
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Landroid/graphics/drawable/Drawable$ConstantState;->newDrawable(Landroid/content/res/Resources;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    return-object v0
.end method


text:
<?php

use Psr\Log\LogLevel;

/**
 * A logger that may be configured to either buffer logs or to print them to
 * the output where PHPUnit will complain about them.
 *
 * @since 1.27
 */
class TestLogger extends \Psr\Log\AbstractLogger {
	private $collect = false;
	private $buffer = [];
	private $filter = null;

	/**
	 * @param bool $collect Whether to collect logs
	 * @param callable $filter Filter logs before collecting/printing. Signature is
	 *  string|null function ( string $message, string $level );
	 */
	public function __construct( $collect = false, $filter = null ) {
		$this->collect = $collect;
		$this->filter = $filter;
	}

	/**
	 * Set the "collect" flag
	 * @param bool $collect
	 */
	public function setCollect( $collect ) {
		$this->collect = $collect;
	}

	/**
	 * Return the collected logs
	 * @return array Array of array( string $level, string $message )
	 */
	public function getBuffer() {
		return $this->buffer;
	}

	/**
	 * Clear the collected log buffer
	 */
	public function clearBuffer() {
		$this->buffer = [];
	}

	public function log( $level, $message, array $context = [] ) {
		$message = trim( $message );

		if ( $this->filter ) {
			$message = call_user_func( $this->filter, $message, $level );
			if ( $message === null ) {
				return;
			}
		}

		if ( $this->collect ) {
			$this->buffer[] = [ $level, $message ];
		} else {
			switch ( $level ) {
				case LogLevel::DEBUG:
				case LogLevel::INFO:
				case LogLevel::NOTICE:
					trigger_error( "LOG[$level]: $message", E_USER_NOTICE );
					break;

				case LogLevel::WARNING:
					trigger_error( "LOG[$level]: $message", E_USER_WARNING );
					break;

				case LogLevel::ERROR:
				case LogLevel::CRITICAL:
				case LogLevel::ALERT:
				case LogLevel::EMERGENCY:
					trigger_error( "LOG[$level]: $message", E_USER_ERROR );
					break;
			}
		}
	}
}


text:
title: Dota2 Data Parser
summary: Collect dota2 data
repoUrl: https://github.com/ganesshkumar/dota2-data-parser
order: 9
---

A collection of scripts to parse data from [www.dota2.com](www.dota2.com) and convert it into more usable format. The generated data resides in a separate project, [dota2-data](https://github.com/squarehammer/dota2-data), for immediate consumption.


text:
package ca.ualberta.cs.linkai.beep;

import android.util.Pair;

import com.google.android.gms.maps.model.LatLng;

import org.junit.Test;

import static org.junit.Assert.assertTrue;

/**
 * Created by lincolnqi on 2016-11-14.
 */

public class StatusTest {
    //rider1
    Account rider1 = new Account("testRiderName1", "7807101111", "CMPUT301@ualberta.ca", 3);
    // driver
    Account driver = new Account("testDriverName", "7807103333", "CMPUT303@ualberta.ca", 3);

    LatLng startLocation1 = new LatLng(-34, 151);
    LatLng endLocation1 = new LatLng(-41, 139);

    /**
     * Test for UC-ST01 (US02.01.01)
     */
    @Test
    public void testDisplayRequestStatus(){
        String reason = new String("This is a reason for testing.");
        Request myRequest = new Request(rider1, startLocation1, endLocation1);

        // test Confirmed&Paid status function
        assertTrue(myRequest.getStatus().equals(0));

        myRequest.setConfirmedDriver(driver);
        myRequest.setStatus(1);
        assertTrue(myRequest.getStatus().equals(1));

        myRequest.setPayment(new Payment());
        myRequest.setStatus(2);
        assertTrue("Status not match", myRequest.getStatus().equals(2));

        // test "Accepted" status function
        myRequest.setStatus(3);
        assertTrue("Status not match", myRequest.getStatus().equals(3));
    }
}


text:
'''
Created on 12.12.2016

@author: martin
'''
# standard libraries
from datetime import timedelta, datetime
import os
import unittest

# own libraries
from financial_life.financing import accounts as a
from financial_life.reports import html

class Test(unittest.TestCase):

    def setUp(self):
        """ Mostly taken from examples/simple_example.py """
        account = a.Bank_Account(amount = 1000, interest = 0.001, name = 'Main account', date=datetime(2016,9, 1))
        savings = a.Bank_Account(amount = 5000, interest = 0.013, name = 'Savings', date=datetime(2016,9, 1))
        loan = a.Loan(amount = 100000, interest = 0.01, name = 'House Credit', date=datetime(2016,9, 1))

        simulation = a.Simulation(account, savings, loan, name = 'Testsimulation', date=datetime(2016,9, 1))
        simulation.add_regular(from_acc = 'Income',
                               to_acc = account,
                               payment = 2000,
                               interval = 'monthly',
                               date_start = datetime(2016,9,15),
                               day = 15,
                               name = 'Income')

        simulation.add_regular(from_acc = account,
                               to_acc = savings,
                               payment = 500,
                               interval = 'monthly',
                               date_start = datetime(2016,9,30),
                               day = 30,
                               name = 'Savings')

        simulation.add_regular(from_acc = account,
                               to_acc= loan,
                               payment = 1000,
                               interval = 'monthly',
                               date_start = datetime(2016,9,15),
                               day = 15,
                               name = 'Debts',
                               fixed = False,
                               date_stop = lambda cdate: loan.is_finished())

        simulation.add_regular(from_acc = account,
                               to_acc= loan,
                               payment = lambda : min(8000, max(0,account.get_account()-4000)),
                               interval = 'yearly',
                               date_start = datetime(2016,11,20),
                               day = 20,
                               name = 'Debts',
                               fixed = False,
                               date_stop = lambda cdate: loan.is_finished())

        simulation.simulate(delta=timedelta(days=2000))

        self.simulation = simulation
        self.account = account
        self.loan = loan

    def tearDown(self):
        pass

    def testGeneral(self):
        interests = sum(self.account.report.yearly().interest)+sum(self.loan.report.yearly().interest)
        self.assertTrue(abs(interests - (-3086.08)) < 0.00001)

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()


text:
Mobile wine classification model.

<!-- asset-path: @visionkit/fermi/classifier/wine_classifier_V2/1 -->
<!-- task: image-classification -->
<!-- fine-tunable: false -->
<!-- format: hub -->
<!-- language: en -->
<!-- interactive-visualizer: vision -->

## Overview

This model is trained to recognize more than 400,000 popular wine bottles from
images. The model is mobile-friendly and can run on-device.

### Input

This model takes input of images.

*   Inputs are expected to be 3-channel RGB color images of size 224 x 224,
    scaled to [0, 1].

### Output

This model outputs to `prediction:logits`.

*   `prediction:logits`: A vector of 409776 similarity scores, corresponding to
    items in the
    [labelmap](https://www.gstatic.com/aihub/tfhub/labelmaps/popular_wine_V1_labelmap.csv).
    Note that each item may appear in the labelmap multiple times; there are
    373034 unique labels. Because the output vectors contains duplicate labels,
    **users of this model should postprocess its output**. To do this, group
    each dimension of the output vector by the corresponding labels in the label
    map, and take the highest-scoring logit from each group. For example, for a
    output vector containing `[0.3, 0.5, 0.1]` and a label map of `['label_1',
    'label_2', 'label_1']`, generate `{"label_1": 0.3, "label_2": 0.5}` as your
    output.

## Example use

```python

# TF1 version
import tensorflow.compat.v1 as tf
import tensorflow_hub as hub

m = hub.Module('https://tfhub.dev/google/on_device_vision/classifier/popular_wine_V1/1')
...

# TF2 version
import tensorflow.compat.v2 as tf
import tensorflow_hub as hub

m = hub.KerasLayer('https://tfhub.dev/google/on_device_vision/classifier/popular_wine_V1/1')
...
```

## Suitable Use, Limitations, and Fair Use Terms

### Suitable use cases

This model is **suitable** for:

*   Recognizing popular wine bottles.

### Unsuitable use cases

This model is **unsuitable** for:

*   Providing allergen information about a product.
*   Providing alcohol content information, such as alcohol by volume (ABV)
    information about a product.

### Limitations

*   This model may not generalize to wine bottles which are less commonly found.

## License

This model follows [*Apache 2.0*](https://www.apache.org/licenses/LICENSE-2.0).
If you intend to use it beyond permissible usage, please consult with the model
owners ahead of time.


text:
external help file: Microsoft.Azure.Commands.Network.dll-Help.xml
Module Name: AzureRM.Network
ms.assetid: 48C33FAF-83C1-4725-AD2A-CF48D0718182
online version:
schema: 2.0.0
---

# New-AzureRmApplicationGatewaySku

## SYNOPSIS
Creates a SKU for an application gateway.

## SYNTAX

```
New-AzureRmApplicationGatewaySku -Name <String> -Tier <String> -Capacity <Int32> [<CommonParameters>]
```

## DESCRIPTION
The **New-AzureRmApplicationGatewaySku** cmdlet creates a stock keeping unit (SKU) for an Azure application gateway.

## EXAMPLES

### Example 1: Create a SKU for an Azure application gateway
```
PS C:\>$SKU = New-AzureRmApplicationGatewaySku -Name "Standard_Small" -Tier "Standard" -Capacity 2
```

This command creates a SKU named Standard_Small for an Azure application gateway and stores the result in the variable named $SKU.

## PARAMETERS

### -Capacity
Specifies the number of instances of an application gateway.

```yaml
Type: Int32
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Name
Specifies the name of the SKU.

The acceptable values for this parameter are:

- Standard_Small
- Standard_Medium
- Standard_Large
- WAF_Medium
- WAF_Large

```yaml
Type: String
Parameter Sets: (All)
Aliases:
Accepted values: Standard_Small, Standard_Medium, Standard_Large, WAF_Medium, WAF_Large

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Tier
Specifies the tier of the SKU.
The acceptable values for this parameter are:

- Standard
- WAF

```yaml
Type: String
Parameter Sets: (All)
Aliases:
Accepted values: Standard, WAF

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### System.String

## OUTPUTS

### Microsoft.Azure.Commands.Network.Models.PSApplicationGatewaySku

## NOTES

## RELATED LINKS

[Get-AzureRmApplicationGatewaySku](./Get-AzureRmApplicationGatewaySku.md)

[Set-AzureRmApplicationGatewaySku](./Set-AzureRmApplicationGatewaySku.md)


text:
package integration_test

import (
	"fmt"
	"net/http"
	"os/exec"
	"strings"

	"github.com/concourse/concourse/atc"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/gbytes"
	"github.com/onsi/gomega/ghttp"
	"github.com/tedsuo/rata"

	"github.com/onsi/gomega/gexec"
)

var _ = Describe("Fly CLI", func() {
	Describe("pin-resource", func() {
		var (
			listVersionsStatus                            int
			pinVersionStatus                              int
			saveCommentStatus                             int
			pinVersionPath, listVersionsPath, commentPath string
			err                                           error
			teamName                                      = "main"
			pipelineName                                  = "pipeline"
			resourceName                                  = "resource"
			resourceVersionID                             = "42"
			pinVersion                                    = "some:value"
			pipelineRef                                   = atc.PipelineRef{Name: pipelineName, InstanceVars: atc.InstanceVars{"branch": "master"}}
			pipelineResource                              = fmt.Sprintf("%s/%s", pipelineRef.String(), resourceName)
			versionToPin                                  = atc.ResourceVersion{
				ID:      42,
				Version: atc.Version{"some": "value"},
			}
			expectedQueryParams []string
		)

		BeforeEach(func() {
			listVersionsPath, err = atc.Routes.CreatePathForRoute(atc.ListResourceVersions, rata.Params{
				"pipeline_name": pipelineName,
				"team_name":     teamName,
				"resource_name": resourceName,
			})
			Expect(err).NotTo(HaveOccurred())
			pinVersionPath, err = atc.Routes.CreatePathForRoute(atc.PinResourceVersion, rata.Params{
				"pipeline_name":              pipelineName,
				"team_name":                  teamName,
				"resource_name":              resourceName,
				"resource_config_version_id": resourceVersionID,
			})
			Expect(err).NotTo(HaveOccurred())
			commentPath, err = atc.Routes.CreatePathForRoute(atc.SetPinCommentOnResource, rata.Params{
				"pipeline_name": pipelineName,
				"team_name":     teamName,
				"resource_name": resourceName,
			})
			Expect(err).NotTo(HaveOccurred())
			expectedQueryParams = []string{
				"vars.branch=%22master%22",
				"filter=some:value",
			}
		})

		It("is a subcommand", func() {
			flyCmd := exec.Command(flyPath, "pin-resource")
			sess, err := gexec.Start(flyCmd, GinkgoWriter, GinkgoWriter)

			Expect(err).ToNot(HaveOccurred())
			Consistently(sess.Err).ShouldNot(gbytes.Say("error: Unknown command"))

			<-sess.Exited
		})

		It("asks the user to specify a version when no version or comment are specified", func() {
			flyCmd := exec.Command(flyPath, "-t", targetName, "pin-resource", "-r", pipelineResource)
			sess, err := gexec.Start(flyCmd, GinkgoWriter, GinkgoWriter)
			Expect(err).NotTo(HaveOccurred())

			Eventually(sess).Should(gexec.Exit(1))
			Expect(sess.Err).To(gbytes.Say("error: the required flag `" + osFlag("v", "version") + "' was not specified"))
		})

		Context("when a version is specified", func() {
			JustBeforeEach(func() {
				atcServer.AppendHandlers(
					ghttp.CombineHandlers(
						ghttp.VerifyRequest("GET", listVersionsPath, strings.Join(expectedQueryParams, "&")),
						ghttp.RespondWithJSONEncoded(listVersionsStatus, []atc.ResourceVersion{versionToPin}),
					),
					ghttp.CombineHandlers(
						ghttp.VerifyRequest("PUT", pinVersionPath, "vars.branch=%22master%22"),
						ghttp.RespondWith(pinVersionStatus, nil),
					),
				)
			})

			Context("when the resource and versions exist and pinning succeeds", func() {
				BeforeEach(func() {
					listVersionsStatus = http.StatusOK
					pinVersionStatus = http.StatusOK
				})

				It("pins the resource version", func() {
					flyCmd := exec.Command(flyPath, "-t", targetName, "pin-resource", "-r", pipelineResource, "-v", pinVersion)

					sess, err := gexec.Start(flyCmd, GinkgoWriter, GinkgoWriter)
					Expect(err).NotTo(HaveOccurred())

					Eventually(sess.Out).Should(gbytes.Say(fmt.Sprintf("pinned '%s' with version {\"some\":\"value\"}\n", pipelineResource)))

					<-sess.Exited
					Expect(sess.ExitCode()).To(Equal(0))
				})

			})

			Context("when the resource or version cannot be found", func() {
				BeforeEach(func() {
					listVersionsStatus = http.StatusNotFound
				})

				It("errors", func() {
					flyCmd := exec.Command(flyPath, "-t", targetName, "pin-resource", "-r", pipelineResource, "-v", pinVersion)

					sess, err := gexec.Start(flyCmd, GinkgoWriter, GinkgoWriter)
					Expect(err).NotTo(HaveOccurred())

					Eventually(sess.Err).Should(gbytes.Say(fmt.Sprintf("could not find version matching {\"some\":\"value\"}\n")))

					<-sess.Exited
					Expect(sess.ExitCode()).To(Equal(1))
				})
			})

			Context("when the resource disappears before pinning", func() {
				BeforeEach(func() {
					listVersionsStatus = http.StatusOK
					pinVersionStatus = http.StatusNotFound
				})

				It("fails to pin", func() {
					flyCmd := exec.Command(flyPath, "-t", targetName, "pin-resource", "-r", pipelineResource, "-v", pinVersion)

					sess, err := gexec.Start(flyCmd, GinkgoWriter, GinkgoWriter)
					Expect(err).NotTo(HaveOccurred())

					Eventually(sess.Err).Should(gbytes.Say(fmt.Sprintf("could not pin '%s', make sure the resource exists", pipelineResource)))

					<-sess.Exited
					Expect(sess.ExitCode()).To(Equal(1))
				})
			})
		})

		Context("when version and comment are provided", func() {
			var sess *gexec.Session
			JustBeforeEach(func() {
				atcServer.AppendHandlers(
					ghttp.CombineHandlers(
						ghttp.VerifyRequest("GET", listVersionsPath, strings.Join(expectedQueryParams, "&")),
						ghttp.RespondWithJSONEncoded(listVersionsStatus, []atc.ResourceVersion{versionToPin}),
					),
					ghttp.CombineHandlers(
						ghttp.VerifyRequest("PUT", pinVersionPath, "vars.branch=%22master%22"),
						ghttp.RespondWith(pinVersionStatus, nil),
					),
					ghttp.CombineHandlers(
						ghttp.VerifyRequest("PUT", commentPath),
						ghttp.VerifyJSONRepresenting(atc.SetPinCommentRequestBody{PinComment: "some pin message"}),
						ghttp.RespondWith(saveCommentStatus, nil),
					),
				)

				var err error
				flyCmd := exec.Command(flyPath, "-t", targetName, "pin-resource", "-r", pipelineResource, "-c", "some pin message", "-v", pinVersion)
				sess, err = gexec.Start(flyCmd, GinkgoWriter, GinkgoWriter)
				Expect(err).NotTo(HaveOccurred())
			})

			Context("when the resource and versions exist, pinning succeeds and saving the comment succeeds", func() {
				BeforeEach(func() {
					listVersionsStatus = http.StatusOK
					pinVersionStatus = http.StatusOK
					saveCommentStatus = http.StatusOK
				})

				It("saves the pin comment", func() {
					Eventually(sess.Out).Should(gbytes.Say(fmt.Sprintf("pin comment 'some pin message' is saved\n")))
					<-sess.Exited
					Expect(sess.ExitCode()).To(Equal(0))
				})
			})

			Context("when the resource or versions cannot be found", func() {
				BeforeEach(func() {
					listVersionsStatus = http.StatusNotFound
					pinVersionStatus = http.StatusOK
					saveCommentStatus = http.StatusOK
				})

				It("errors", func() {
					Eventually(sess.Err).Should(gbytes.Say(fmt.Sprintf("could not find version matching")))
					<-sess.Exited
					Expect(sess.ExitCode()).To(Equal(1))
				})
			})

			Context("when the resource disappears before pinning", func() {
				BeforeEach(func() {
					listVersionsStatus = http.StatusOK
					pinVersionStatus = http.StatusNotFound
					saveCommentStatus = http.StatusOK
				})

				It("errors", func() {
					Eventually(sess.Err).Should(gbytes.Say(fmt.Sprintf("could not pin '%s', make sure the resource exists", pipelineResource)))
					<-sess.Exited
					Expect(sess.ExitCode()).To(Equal(1))
				})
			})
		})

		Context("when comment is provided without version and saving the comment fails", func() {
			BeforeEach(func() {
				saveCommentStatus = http.StatusNotFound
			})

			JustBeforeEach(func() {
				atcServer.AppendHandlers(
					ghttp.CombineHandlers(
						ghttp.VerifyRequest("PUT", commentPath),
						ghttp.VerifyJSONRepresenting(atc.SetPinCommentRequestBody{PinComment: "some pin message"}),
						ghttp.RespondWith(saveCommentStatus, nil),
					),
				)
			})

			It("errors", func() {
				flyCmd := exec.Command(flyPath, "-t", targetName, "pin-resource", "-r", pipelineResource, "-c", "some pin message")

				sess, err := gexec.Start(flyCmd, GinkgoWriter, GinkgoWriter)
				Expect(err).NotTo(HaveOccurred())

				Eventually(sess.Err).Should(gbytes.Say(fmt.Sprintf("could not save comment, make sure '%s' is pinned", pipelineResource)))
				<-sess.Exited
				Expect(sess.ExitCode()).To(Equal(1))
			})
		})
	})
})


text:
<?xml version="1.0" encoding="UTF-8"?>

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
                          http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

    <entity name="Doctrine\Tests\ORM\Mapping\User" table="cms_users">
        <options>
            <option name="foo">bar</option>
            <option name="baz">
                <option name="key">val</option>
            </option>
        </options>

        <indexes>
            <index name="name_idx" columns="name"/>
            <index columns="user_email"/>
        </indexes>

        <unique-constraints>
            <unique-constraint columns="name,user_email" name="search_idx" />
        </unique-constraints>

        <lifecycle-callbacks>
            <lifecycle-callback type="prePersist" method="doStuffOnPrePersist"/>
            <lifecycle-callback type="prePersist" method="doOtherStuffOnPrePersistToo"/>
            <lifecycle-callback type="postPersist" method="doStuffOnPostPersist"/>
        </lifecycle-callbacks>

        <named-queries>
            <named-query name="all" query="SELECT u FROM __CLASS__ u"/>
        </named-queries>

        <id name="id" type="integer" column="id">
            <generator strategy="AUTO"/>
            <sequence-generator sequence-name="tablename_seq" allocation-size="100" initial-value="1" />
            <options>
                <option name="foo">bar</option>
            </options>
        </id>

        <field name="name" column="name" type="string" length="50" nullable="true" unique="true">
            <options>
                <option name="foo">bar</option>
                <option name="baz">
                    <option name="key">val</option>
                </option>
            </options>
        </field>
        <field name="email" column="user_email" type="string" column-definition="CHAR(32) NOT NULL" />

        <field name="version" type="integer" version="true" />

        <one-to-one field="address" target-entity="Address" inversed-by="user">
            <cascade><cascade-remove /></cascade>
            <join-column name="address_id" referenced-column-name="id" on-delete="CASCADE" />
        </one-to-one>

        <one-to-many field="phonenumbers" target-entity="Phonenumber" mapped-by="user" index-by="number" orphan-removal="true">
            <cascade>
                <cascade-persist/>
            </cascade>
            <order-by>
                <order-by-field name="number" direction="ASC" />
            </order-by>
        </one-to-many>

        <many-to-many field="groups" target-entity="Group">
            <cascade>
                <cascade-all/>
            </cascade>
            <join-table name="cms_users_groups">
                <join-columns>
                    <join-column name="user_id" referenced-column-name="id" nullable="false" unique="false" />
                </join-columns>
                <inverse-join-columns>
                    <join-column name="group_id" referenced-column-name="id" column-definition="INT NULL" />
                </inverse-join-columns>
            </join-table>
        </many-to-many>

    </entity>

</doctrine-mapping>


text:
ExampleData = Object.toJSON(
[{"_class": "Datatype", "name": "String"},
{"_class": "Class", "name": "Expression", "abstract": true},
{"_class": "Class", "name": "Sqrt", "superTypes": "Expression", "features":
  {"_class": "Feature", "name": "expr", "kind": "containment", "lowerLimit": 1, "upperLimit": 1, "type": "Expression"}},
{"_class": "Class", "name": "Fraction", "superTypes": "Expression", "features": [
  {"_class": "Feature", "name": "expr1", "kind": "containment", "lowerLimit": 1, "upperLimit": 1, "type": "Expression"},
  {"_class": "Feature", "name": "expr2", "kind": "containment", "lowerLimit": 1, "upperLimit": 1, "type": "Expression"}]},
{"_class": "Class", "name": "Mult", "superTypes": "Expression", "features": [
  {"_class": "Feature", "name": "expr1", "kind": "containment", "lowerLimit": 1, "upperLimit": 1, "type": "Expression"},
  {"_class": "Feature", "name": "expr2", "kind": "containment", "lowerLimit": 1, "upperLimit": 1, "type": "Expression"}]},
{"_class": "Class", "name": "Plus", "superTypes": "Expression", "features": [
  {"_class": "Feature", "name": "expr1", "kind": "containment", "lowerLimit": 1, "upperLimit": 1, "type": "Expression"},
  {"_class": "Feature", "name": "expr2", "kind": "containment", "lowerLimit": 1, "upperLimit": 1, "type": "Expression"}]},
{"_class": "Class", "name": "Neg", "superTypes": "Expression", "features":
  {"_class": "Feature", "name": "expr", "kind": "containment", "lowerLimit": 1, "upperLimit": 1, "type": "Expression"}},
{"_class": "Class", "name": "Value", "superTypes": "Expression", "features":
  {"_class": "Feature", "name": "value", "kind": "attribute", "lowerLimit": 1, "upperLimit": 1, "type": "String"}}]
);


text:
<?php

namespace RGies\MetricsBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

/**
 * Custom fields controller.
 *
 * @Route("/custom-fields")
 */
class CustomFieldsController extends Controller
{

    /**
     * Lists all Params entities.
     *
     * @Route("/input/{id}/{name}/{value}{placeholder}", name="default-input-field")
     * @Method("GET")
     * @Template()
     */
    public function inputFieldAction(Request $request, $id, $name, $value, $placeholder = '')
    {
        return array(
            'id'            => $id,
            'name'          => $name,
            'value'         => $value,
            'placeholder'   => $placeholder,
        );
    }

}


text:
.class final Lcom/google/common/collect/CustomConcurrentHashMap$KeyIterator;
.super Lcom/google/common/collect/CustomConcurrentHashMap$HashIterator;
.source "CustomConcurrentHashMap.java"

# interfaces
.implements Ljava/util/Iterator;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/google/common/collect/CustomConcurrentHashMap;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x10
    name = "KeyIterator"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/google/common/collect/CustomConcurrentHashMap",
        "<TK;TV;>.HashIterator;",
        "Ljava/util/Iterator",
        "<TK;>;"
    }
.end annotation

# instance fields
.field final synthetic this$0:Lcom/google/common/collect/CustomConcurrentHashMap;

# direct methods
.method constructor <init>(Lcom/google/common/collect/CustomConcurrentHashMap;)V
    .locals 0

    .prologue
    .line 3533
    .local p0, "this":Lcom/google/common/collect/CustomConcurrentHashMap$KeyIterator;, "Lcom/google/common/collect/CustomConcurrentHashMap<TK;TV;>.KeyIterator;"
    iput-object p1, p0, Lcom/google/common/collect/CustomConcurrentHashMap$KeyIterator;->this$0:Lcom/google/common/collect/CustomConcurrentHashMap;

    invoke-direct {p0, p1}, Lcom/google/common/collect/CustomConcurrentHashMap$HashIterator;-><init>(Lcom/google/common/collect/CustomConcurrentHashMap;)V

    return-void
.end method

# virtual methods
.method public next()Ljava/lang/Object;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()TK;"
        }
    .end annotation

    .prologue
    .line 3536
    .local p0, "this":Lcom/google/common/collect/CustomConcurrentHashMap$KeyIterator;, "Lcom/google/common/collect/CustomConcurrentHashMap<TK;TV;>.KeyIterator;"
    invoke-virtual {p0}, Lcom/google/common/collect/CustomConcurrentHashMap$KeyIterator;->nextEntry()Lcom/google/common/collect/CustomConcurrentHashMap$WriteThroughEntry;

    move-result-object v0

    invoke-virtual {v0}, Lcom/google/common/collect/CustomConcurrentHashMap$WriteThroughEntry;->getKey()Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method


text:
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Comment
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class Comment
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="userName", type="string", length=255)
     */
    private $userName;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="createdBy", type="datetime")
     */
    private $createdBy;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="createdAt", type="datetime")
     */
    private $createdAt;

    /**
     * @var string
     *
     * @ORM\Column(name="categoryId", type="string", length=255)
     */
    private $categoryId;

    /**
     * @var string
     *
     * @ORM\Column(name="commentId", type="string", length=255)
     */
    private $commentId;

    /**
     * @var string
     *@ORM\ManyToOne(targetEntity="Post", inversedBy="comments")
     * @ORM\JoinColumn(name="post_id", referencedColumnName="id")
     */
    private $post;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set userName
     *
     * @param string $userName
     * @return Comment
     */
    public function setUserName($userName)
    {
        $this->userName = $userName;

        return $this;
    }

    /**
     * Get userName
     *
     * @return string
     */
    public function getUserName()
    {
        return $this->userName;
    }

    /**
     * Set createdBy
     *
     * @param \DateTime $createdBy
     * @return Comment
     */
    public function setCreatedBy($createdBy)
    {
        $this->createdBy = $createdBy;

        return $this;
    }

    /**
     * Get createdBy
     *
     * @return \DateTime
     */
    public function getCreatedBy()
    {
        return $this->createdBy;
    }

    /**
     * Set createdAt
     *
     * @param \DateTime $createdAt
     * @return Comment
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * Get createdAt
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * Set categoryId
     *
     * @param string $categoryId
     * @return Comment
     */
    public function setCategoryId($categoryId)
    {
        $this->categoryId = $categoryId;

        return $this;
    }

    /**
     * Get categoryId
     *
     * @return string
     */
    public function getCategoryId()
    {
        return $this->categoryId;
    }

    /**
     * Set commentId
     *
     * @param string $commentId
     * @return Comment
     */
    public function setCommentId($commentId)
    {
        $this->commentId = $commentId;

        return $this;
    }

    /**
     * Get commentId
     *
     * @return string
     */
    public function getCommentId()
    {
        return $this->commentId;
    }

    /**
     * Set post
     *
     * @param \AppBundle\Entity\Post $post
     * @return Comment
     */
    public function setPost(\AppBundle\Entity\Post $post = null)
    {
        $this->post = $post;

        return $this;
    }

    /**
     * Get post
     *
     * @return \AppBundle\Entity\Post
     */
    public function getPost()
    {
        return $this->post;
    }
}


text:
module Hbc
  class DSL
    class Version < ::String
      DIVIDERS = {
                   "." => :dots,
                   "-" => :hyphens,
                   "_" => :underscores,
                   "/" => :slashes,
                 }.freeze

      DIVIDER_REGEX = %r{(#{DIVIDERS.keys.map { |v| Regexp.quote(v) }.join('|')})}

      MAJOR_MINOR_PATCH_REGEX = %r{^(\d+)(?:\.(\d+)(?:\.(\d+))?)?}

      class << self
        private

        def define_divider_methods(divider)
          define_divider_deletion_method(divider)
          define_divider_conversion_methods(divider)
        end

        def define_divider_deletion_method(divider)
          method_name = deletion_method_name(divider)
          define_method(method_name) do
            version { delete(divider) }
          end
        end

        def deletion_method_name(divider)
          "no_#{DIVIDERS[divider]}"
        end

        def define_divider_conversion_methods(left_divider)
          (DIVIDERS.keys - [left_divider]).each do |right_divider|
            define_divider_conversion_method(left_divider, right_divider)
          end
        end

        def define_divider_conversion_method(left_divider, right_divider)
          method_name = conversion_method_name(left_divider, right_divider)
          define_method(method_name) do
            version { gsub(left_divider, right_divider) }
          end
        end

        def conversion_method_name(left_divider, right_divider)
          "#{DIVIDERS[left_divider]}_to_#{DIVIDERS[right_divider]}"
        end
      end

      DIVIDERS.keys.each do |divider|
        define_divider_methods(divider)
      end

      attr_reader :raw_version

      def initialize(raw_version)
        @raw_version = raw_version
        super(raw_version.to_s)
      end

      def latest?
        to_s == "latest"
      end

      def major
        version { slice(MAJOR_MINOR_PATCH_REGEX, 1) }
      end

      def minor
        version { slice(MAJOR_MINOR_PATCH_REGEX, 2) }
      end

      def patch
        version { slice(MAJOR_MINOR_PATCH_REGEX, 3) }
      end

      def major_minor
        version { [major, minor].reject(&:empty?).join(".") }
      end

      def major_minor_patch
        version { [major, minor, patch].reject(&:empty?).join(".") }
      end

      def before_comma
        version { split(",", 2)[0] }
      end

      def after_comma
        version { split(",", 2)[1] }
      end

      def before_colon
        version { split(":", 2)[0] }
      end

      def after_colon
        version { split(":", 2)[1] }
      end

      def no_dividers
        version { gsub(DIVIDER_REGEX, "") }
      end

      private

      def version
        return self if empty? || latest?
        self.class.new(yield)
      end
    end
  end
end


text:
#ifndef learnpnp_BasicController_h__guard
#define learnpnp_BasicController_h__guard

#include <pnp/learning_plan/algo/LoggingController.h>

namespace learnpnp {

class ExpPolicy;
class Learner;

/**
*\brief A simple controller that delegates learning to a Learner and exploration to a ExpPolicy
*
*Simple controllers can be built making use of this class to compose the available
*update rules and exploration strategies. A simple and common combination
*could be BasicController(learnpnp::TDLambda(), learnpnp::EGreedy()) (passing
*to both the appropriate parameters)
*
*\author Matteo Leonetti
*/
class BasicController: public LoggingController {

public:
	/**
	 * \brief Creates a BasicController from the given update rule and exploration strategies
	 *
	 * \param learner manages the value function and incapsulates the update rule
	 * \param policy makes decisions at choice points
	 */
	BasicController( Learner * learner, ExpPolicy *policy);

	/**
	 * \brief virtual dtor
	 */
	virtual ~BasicController();

	virtual int choose(const Marking& current, const std::vector<Marking> &states);

	virtual void updateV(const Marking &current, double reward,const Marking &next) ;

	virtual void tick();

protected:
	//owns
	/**
	 * The policy used to make decisions at choice points.
	 *
	 * The class owns this object (will be deleted by the destructor)
	 */
	ExpPolicy *policy;
};

}

#endif


text:
import unittest
import json
import requests
import os

from mock import Mock
from pyelp.pyelp import Pyelp

class TestPyelp(unittest.TestCase):

    def setUp(self):
        self.pyelp = Pyelp(consumer_key='consumer_key',
                           consumer_secret='consumer_secret',
                           token='token',
                           token_secret='token_secret')

    def test_search(self):
        search_json = None
        with open(os.getcwd() + '/tests/search.json') as fp:
            search_json = fp.read()

        resp = Mock()
        resp.content = search_json
        requests.get = Mock(return_value=resp)

        results =  self.pyelp.search(params={'term': 'sushi', 'location': 'Irvine, CA'})
        self.assertEqual(results['total'], 185)

    def test_business(self):
        business_json = None
        with open(os.getcwd() + '/tests/business.json') as fp:
            business_json = fp.read()

        resp = Mock()
        resp.content = business_json
        requests.get = Mock(return_value=resp)

        returned_business = self.pyelp.business('yelp-san-francisco')
        self.assertEqual(returned_business['name'], 'Yelp')
        self.assertEqual(returned_business['rating'], 3)


text:
<?php
/**
 * @author Krzysztof Gzocha <krzysztof.gzocha@xsolve.pl>
 */
namespace Team3\PayU\Serializer;

use JMS\Serializer\SerializationContext;

/**
 * This class is responsible for serialization and deserialization to and from JSON format.
 *
 * Interface SerializerInterface
 * @package Team3\PayU\Serializer
 */
interface SerializerInterface
{
    /**
     * @param SerializableInterface $serializable
     * @param SerializationContext  $serializationContext
     *
     * @return string
     */
    public function toJson(
        SerializableInterface $serializable,
        SerializationContext $serializationContext = null
    );

    /**
     * @param string $data
     * @param string $type
     *
     * @return mixed
     */
    public function fromJson($data, $type);
}