text:
/*                           Revision History
 * 04/01/2012 - Minh Duc Cao: Created
 *
 ****************************************************************************/

package japsa.seq;

import japsa.seq.Alphabet;
import japsa.util.ByteArray;

import java.util.Arrays;
import java.util.Random;

/**
 * Implement a sequence in which the data are stored in a byte array, a byte for
 * a element of the sequence. The byte array object is not changleble, though the
 * value in each element (base) can be changed.
 *
 * @author Minh Duc Cao (minhduc \dot cao \at gmail \dot com) *
 */
public class Sequence extends AbstractSequence implements Cloneable {
	/**
	 * The array to hold the sequence
	 */
	private final byte[] byteSeq;

	/**
	 * Create an empty sequence with a specified length
	 *
	 * @param alphabet
	 *
	 */
	public Sequence(Alphabet alphabet, int length) {
		super(alphabet);
		byteSeq = new byte[length];
	}

	public Sequence(Alphabet alphabet, int length, String name) {
		super(alphabet, name);
		byteSeq = new byte[length];
	}

	/**
	 * Construct a sequence from a sequence of characters.
	 * @param alphabet
	 * @param charSeq
	 * @param name
	 */
	public Sequence(Alphabet alphabet, char[] charSeq, String name) {
		super(alphabet, name);
		byteSeq = new byte[charSeq.length];
		for (int i = 0; i < byteSeq.length; i++) {
			byteSeq[i] = (byte) alphabet.char2int(charSeq[i]);
		}
	}

	/**
	 * Construct a sequence from a ByteArray object.
	 * @param alphabet
	 * @param bArray
	 * @param name
	 */
	public Sequence(Alphabet alphabet, ByteArray bArray, String name) {
		super(alphabet, name);
		byteSeq = bArray.toArray();
	}

	/**
	 * Copy the byte array up to the length
	 *
	 * @param alphabet
	 * @param byteArray
	 * @param length
	 */

	public Sequence(Alphabet alphabet, byte[] byteArray, int length) {
		super(alphabet);
		byteSeq = Arrays.copyOf(byteArray, length);
	}

	public Sequence(Alphabet alphabet, byte[] byteArray, int length, String name) {
		super(alphabet, name);
		byteSeq = Arrays.copyOf(byteArray, length);
	}

	public Sequence(Alphabet alphabet, byte[] byteArray) {
		this(alphabet, byteArray, byteArray.length);
	}

	public Sequence(Alphabet alphabet, byte[] byteArray, String name) {
		this(alphabet, byteArray, byteArray.length, name);
	}

	//public Sequence(Alphabet dna, byte[] byteArray, String name, String desc) {
	//	this(dna, byteArray, byteArray.length, name);
	//	setDesc(desc);
	//}

	/**
	 * Construct a sequence with an dna from the string represent the
	 * sequence and the name
	 * @param alphabet
	 * @param seqString
	 * @param name
	 */

	public Sequence(Alphabet alphabet, String seqString, String name) {
		//this(dna, seqStr.toCharArray(),name);
		this(alphabet,seqString.length(),name);

		for (int i = 0; i < byteSeq.length; i++) {
			byteSeq[i] = (byte) alphabet.char2int(seqString.charAt(i));
		}
	}

	/**
	 * Return the length of the sequence
	 *
	 * @see japsa.seq.AbstractSequence#length()
	 */
	@Override
	public int length() {
		return byteSeq.length;
	}

	/*
	 * @see bio.seq.AbstractSequence#symbolAt(int)
	 */
	@Override
	public int symbolAt(int loc) {
		return byteSeq[loc];// This should convert into an int
	}

	public byte getBase(int loc) {
		return byteSeq[loc];
	}

	/**
	 * Concatenate a sequence with another
	 * @param anotherSeq
	 */

	public Sequence concatenate(Sequence anotherSeq) {
		if (this.alphabet() != anotherSeq.alphabet())
			throw new RuntimeException("The alphabets do not match");

		Sequence newSeq = new Sequence(alphabet(), length() + anotherSeq.length());

		for (int j = 0; j < anotherSeq.length(); j++) {
			newSeq.byteSeq[byteSeq.length + j] = anotherSeq.byteSeq[j];
		}

		return newSeq;
	}

	public byte[] toBytes() {
		return byteSeq;
	}

	/**
	 * @param loc
	 * @param base
	 */
	public byte setBase(int loc, byte base) {
		byteSeq[loc] = base;
		return base;
	}

	public void setSymbol(int loc, int symbol){
		byteSeq[loc] = (byte) symbol;
	}

	/**
	 * Clone the sequence
	 */
	public Sequence clone(){
		Sequence seq = new Sequence(alphabet(), byteSeq, getName());
		seq.setDesc(getDesc());
		return seq;
	}

	/**
	 * Create a random sequence with some length and some frequency distribution
	 * @param alphabet
	 * @param length
	 * @param freqs
	 * @param rand a random generator
	 * @return
	 */
	public static Sequence random(Alphabet alphabet, int length, double [] freqs, Random rand){
		if (freqs.length != alphabet.size()){
			throw new RuntimeException("Frequencies array should have the same size as dna");
		}
		Sequence seq = new Sequence(alphabet, length);

		//setting accumulation distribution
		double [] accum = new double[freqs.length];
		accum[0] = freqs[0];
		for (int i = 1; i < freqs.length;i++){
			accum[i] = accum[i-1] + freqs[i];
		}

		//normalise, just in case
		double sum = accum[accum.length-1];
		for (int i = 0; i < freqs.length;i++){
			accum[i] /= sum;
		}
		//java.util.Random rand = new java.util.Random();

		for (int x = 0; x < seq.length();x++){
			double r = rand.nextDouble();
			for (byte i = 0; i < accum.length; i++){
				if (accum[i] >= r){
					seq.byteSeq[x] = i;
					break;
				}
			}
		}

		return seq;
	}
	/**
	 * Create a random sequence
	 * @param alphabet
	 * @param length
	 * @param freqs
	 * @return
	 */
	public static Sequence random(Alphabet alphabet, int length, double [] freqs){
		return random(alphabet, length, freqs, new Random());
	}

	/* (non-Javadoc)
	 * @see java.lang.CharSequence#subSequence(int, int)
	 */
	@Override
	public Sequence subSequence(int start, int end) {
		byte [] newSeq = Arrays.copyOfRange(byteSeq, start, end);
		return new Sequence(alphabet(), newSeq);
	}
	/**
	 * Start: 0-index inclusive,
	 * end:0-index, exclusive
	 * @param start
	 * @param end
	 * @param flank
	 * @return
	 */
	public Sequence subsequenceWithFlank(int start, int end, int flank){
		Sequence featureSeq = new Sequence(alphabet(), end - start + 2 * flank);

		for (int i = 0; i < featureSeq.length();i++){
			int j = start - flank + i;
			if (j < 0 || j>= length())
				featureSeq.setSymbol(i, Alphabet.DNA.N);
			else
				featureSeq.setSymbol(i, getBase(j));
		}//for
		return featureSeq;
	}

}


text:
#region License Header
//
#endregion
namespace TestEHR
{
    #region Using Statements

    using System.Web.Optimization;

    #endregion

    public class BundleConfig
    {
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
  @module ember-flexberry-gis-dummy
*/

import ListMapController from 'ember-flexberry-gis/controllers/list-map';

/**
  Maps controller.

  @class MapsController
  @extends ListMapController
*/
export default ListMapController.extend({
  /**
    Name of related edit form route.

    @property editFormRoute
    @type String
    @default 'map'
  */
  editFormRoute: 'map'
});


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace DP.Data.Common
{
    public class DbColumnInfo
    {
        #region 变量
        protected PropertyInfo _Property;
        protected string _PropertyName;
        protected string _ColumnName;
        protected string _ColumnDescription;
        protected Type _Type;
        protected bool _PrimaryKey;
        protected bool _IncrementPrimaryKey;
        protected bool _Ignore;
        protected MethodInfo _SetMethod;
        protected MethodInfo _GetMethod;
        #endregion

        #region 属性
        /// <summary>
        /// Gets the property.
        /// </summary>
        public PropertyInfo Property
        {
            get { return _Property; }
        }
        /// <summary>
        /// Gets the name of the property.
        /// </summary>
        /// <value>
        /// The name of the property.
        /// </value>
        public string PropertyName
        {
            get { return _PropertyName; }
        }
        /// <summary>
        /// Gets the name of the column.
        /// </summary>
        /// <value>
        /// The name of the column.
        /// </value>
        public string ColumnName
        {
            get { return _ColumnName; }
        }
        /// <summary>
        /// Gets the column description.
        /// </summary>
        public string ColumnDescription
        {
            get { return _ColumnDescription; }
        }
        /// <summary>
        /// Gets the type.
        /// </summary>
        public Type Type
        {
            get { return _Type; }
        }
        /// <summary>
        /// Gets a value indicating whether [primary key].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [primary key]; otherwise, <c>false</c>.
        /// </value>
        public bool PrimaryKey
        {
            get { return _PrimaryKey; }
        }
        /// <summary>
        /// Gets a value indicating whether [increment primary key].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [increment primary key]; otherwise, <c>false</c>.
        /// </value>
        public bool IncrementPrimaryKey
        {
            get { return _IncrementPrimaryKey; }
        }
        /// <summary>
        /// Gets a value indicating whether this <see cref="DbColumnInfo"/> is ignore.
        /// </summary>
        /// <value>
        ///   <c>true</c> if ignore; otherwise, <c>false</c>.
        /// </value>
        public bool Ignore
        {
            get { return _Ignore; }
        }
        /// <summary>
        /// Gets the set method.
        /// </summary>
        public MethodInfo SetMethod
        {
            get { return _SetMethod; }
        }
        /// <summary>
        /// Gets the get method.
        /// </summary>
        public MethodInfo GetMethod
        {
            get { return _GetMethod; }
        }
        #endregion

        /// <summary>
        /// Initializes a new instance of the <see cref="DbColumnInfo"/> class.
        /// </summary>
        /// <param name="prop">The prop.</param>
        public DbColumnInfo(PropertyInfo prop)
        {
            _Property = prop;
            _PropertyName = prop.Name;
            _Type = prop.PropertyType;
            _SetMethod = prop.GetSetMethod(false);
            _GetMethod = prop.GetGetMethod(false);
        }
    }
}


text:
		 Truck Data

				<button type="button" class="btn btn-primary" id="tools-new"> New</button>

				<button type="button" class="btn btn-success disabled" id="tools-edit"> Edit</button>

				<button type="button" class="btn btn-danger disabled" id="tools-delete"> Delete</button>

					Truck ID
					Truck Code

				<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

 New Truck

				<form>

						Truck Code
						<input type="text" class="form-control" id="truck_code" placeholder="Enter Truck Code">

				</form>

				<button type="button" class="btn btn-primary" id="save-changes">Save Changes</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

				<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

 Edit Truck

				<form>

						Truck Code
						<input type="text" class="form-control" id="truck_code">

					<input type="hidden" id="truck_id">
				</form>

				<button type="button" class="btn btn-primary" id="save-changes">Save Changes</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>


text:
__author__ = 'vladimir'

import traceback

import ujson
from flask import Blueprint, request

from . import *
from .database import update_query, select_query
from .user import get_user_profile

thread_blueprint = Blueprint("thread_blueprint", __name__, url_prefix="thread")

@thread_blueprint.route("/create/", methods=["POST"])
def create():
    try:
        params = request.json
        # print "*"*50, "\nThread.Create got params: {0}\n".format(repr(params)), "*"*50
    except Exception:
        print "thread.create params exception:\n{0}".format(traceback.format_exc())
        return ujson.dumps({"code": c_BAD_REQUEST, "response": "invalid json"})
    # required
    forum_short_name = params.get("forum", None)
    title = params.get("title", None)
    isClosed = int(bool(params.get("isClosed")))
    user_email = params.get("user", None)
    date = params.get("date", None)
    message = params.get("message", None)
    slug = params.get("slug", None)
    # optional
    isDeleted = int(bool(params.get("isDeleted")))
    if forum_short_name and title and user_email and date and message and slug:
        # check if do not exists
        test_q = select_query(
            "SELECT t.`id` FROM `thread` t WHERE t.`title` = %s",
            (title, ),
            verbose=False
        )
        if len(test_q) == 0:
            th_id = update_query(
                "INSERT INTO `thread` (`forum`, `title`, `isClosed`, `user`, `date`, `message`, `slug`, `isDeleted`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
                (forum_short_name, title, isClosed, user_email, date, message, slug, isDeleted),
                verbose=False
            )
            thrd = {
                "id": th_id,
                "forum": forum_short_name,
                "title": title,
                "isClosed": isClosed,
                "user": user_email,
                "date": date,
                "message": message,
                "slug": slug,
                "isDeleted": isDeleted,
            }
            code = c_OK
        else:
            thrd = "This thread already exists"
            code = c_INVALID_REQUEST_PARAMS
    else:
        thrd = "Invalid params"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })

@thread_blueprint.route("/update/", methods=["POST"])
def update():
    try:
        params = request.json
    except Exception:
        print "thread.update params exception:\n{0}".format(traceback.format_exc())
        return ujson.dumps({"code": c_BAD_REQUEST, "response": "invalid json"})
    th_id = get_int_or_none(params.get("thread", None))
    message = params.get("message", None)
    slug = params.get("slug", None)
    if th_id and th_id > 0 and message and slug:
        thread_query = select_query(
            "SELECT * FROM `thread` t WHERE t.`id` = %s",
            (th_id, ),
            verbose=False
        )
        if len(thread_query) == 1:
            update_query(
                "UPDATE `thread` SET `slug` = %s, `message` = %s WHERE `id` = %s",
                (slug, message, th_id),
                verbose=False
            )
            thrd = thread_query[0]
            thrd["slug"] = slug
            thrd["message"] = message
            code = c_OK
        else:
            thrd = "Thread not found"
            code = c_NOT_FOUND
    elif th_id and th_id < 0:
        thrd = "Not found"
        code = c_NOT_FOUND
    else:
        thrd = "Invalid params"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })

@thread_blueprint.route("/details/", methods=["GET"])
def details():
    th_id = get_int_or_none(request.args.get("thread", None))
    related = request.values.getlist("related")
    if th_id and th_id > 0 and check_list(related, ("user", "forum")):
        if "forum" in related:
            thread = select_query(
                "SELECT * FROM `thread` t LEFT JOIN `forum` f ON f.`short_name` = t.`forum` WHERE t.`id` = %s",
                (th_id, ),
                verbose=False
            )
        else:
            thread = select_query(
                "SELECT * FROM `thread` t WHERE t.`id` = %s",  # t.`isDeleted` = FALSE AND
                (th_id, ),
                verbose=False
            )
        if len(thread) > 0:
            code = c_OK
            thrd = thread[0]
            thrd["date"] = get_date(thrd["date"])
            if "forum" in related:
                thrd["forum"] = {
                    "id": thrd["f.id"],
                    "user": thrd["f.user"],
                    "name": thrd["name"],
                    "short_name": thrd["short_name"],
                }
                del thrd["f.id"]
                del thrd["f.user"]
                del thrd["name"]
                del thrd["short_name"]
            if "user" in related:
                user = get_user_profile(thrd["user"])
                if user:
                    thrd["user"] = user
                else:
                    code = c_NOT_FOUND
            # hack
            if bool(thrd["isDeleted"]):
                thrd["posts"] = 0
        else:
            thrd = "Thread not found"
            code = c_NOT_FOUND
    elif th_id and th_id < 0:
        thrd = "Not found"
        code = c_NOT_FOUND
    else:
        thrd = "Invalid params"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })

@thread_blueprint.route("/list/", methods=["GET"])
def list_threads():
    email = request.args.get("user", None)
    forum = request.args.get("forum", None)
    # optional
    since = request.args.get("since", None)
    limit = get_int_or_none(request.args.get("limit", None))
    order = request.args.get("order", "desc")
    if (email or forum) and order in ("desc", "asc"):
        if email:
            SQL = "SELECT * FROM `thread` t WHERE t.`user` = %s"
            params = (email, )
        else:
            SQL = "SELECT * FROM `thread` t WHERE t.`forum` = %s"
            params = (forum, )

        if since:
            SQL += " AND t.`date` >= %s"
            params += (since, )
        SQL += " ORDER BY t.`date` {0}".format(order.upper())
        if limit and limit > 0:
            SQL += " LIMIT %s"
            params += (limit, )
        thrd = select_query(SQL, params, verbose=False)
        if len(thrd) > 0:
            for item in thrd:
                item["date"] = get_date(item["date"])
        code = c_OK
    else:
        thrd = "Invalid params"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })

# TODO: pass test
# TODO: thread.listPosts
@thread_blueprint.route("/listPosts/", methods=["GET"])
def list_posts():
    th_id = get_int_or_none(request.args.get("thread", None))
    # optional
    since = request.args.get("since", None)
    limit = get_int_or_none(request.args.get("limit", None))
    sort = request.args.get("sort", "flat")
    order = request.args.get("order", "desc")
    if th_id and th_id > 0 and sort in ("flat", "tree", "parent_tree") and order in ("asc", "desc"):
        if sort == "flat":
            # t.`isDeleted` = FALSE AND
            SQL = "SELECT p.* FROM `post` p LEFT JOIN `thread` t ON t.`id` = p.`thread` WHERE p.`thread` = %s"
            params = (th_id, )
            if since:
                SQL += " AND p.`date` >= %s"
                params += (since, )
            SQL += " ORDER BY p.`date` {0}".format(order.upper())
            if limit and limit > 0:
                SQL += " LIMIT %s"
                params += (limit, )
        elif sort == "tree":
            SQL = "SELECT p.* FROM `post` p LEFT JOIN `thread` t ON t.`id` = p.`thread` WHERE p.`thread` = %s"
            params = (th_id, )
            if since:
                SQL += " AND p.`date` >= %s"
                params += (since, )
            SQL += " ORDER BY p.`parent`, p.`date` {0}".format(order.upper())
            if limit and limit > 0:
                SQL += " LIMIT %s"
                params += (limit, )
        else:
            # TODO: parent tree sort
            SQL = None
            params = None
        thrd = select_query(SQL, params, verbose=False)  # posts query
        code = c_OK
        if len(thrd) > 0:
            for item in thrd:
                item["date"] = get_date(item["date"])
                item["isApproved"] = bool(item["isApproved"])
                item["isDeleted"] = bool(item["isDeleted"])
                item["isEdited"] = bool(item["isEdited"])
                item["isSpam"] = bool(item["isSpam"])
                item["isHighlighted"] = bool(item["isHighlighted"])
    elif th_id and th_id < 0:
        thrd = "Not found"
        code = c_NOT_FOUND
    else:
        thrd = "Invalid params"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })

@thread_blueprint.route("/subscribe/", methods=["POST"])
def subscribe():
    try:
        params = request.json
    except Exception:
        print "thread.close params exception:\n{0}".format(traceback.format_exc())
        return ujson.dumps({"code": c_BAD_REQUEST, "response": "invalid json"})
    th_id = get_int_or_none(params.get("thread", None))
    email = params.get("user", None)
    if th_id and th_id > 0 and email:
        user = get_user_profile(email)
        old_subs = select_query(
            "SELECT * FROM `subscription` s WHERE s.`user` = %s AND s.`thread` = %s",
            (email, th_id),
            verbose=False
        )
        if user and len(old_subs) == 0:
            update_query(
                "INSERT INTO `subscription` (`user`, `thread`) VALUES (%s, %s)",
                (email, th_id),
                verbose=False
            )
            thrd = {
                "user": email,
                "thread": th_id,
            }
            code = c_OK
        # elif user and len(old_subs) > 0:
        #     thread = "Already created"
        #     code = ?
        else:
            thrd = "No such thread"
            code = c_INVALID_REQUEST_PARAMS
    elif th_id and th_id < 0:
        thrd = "Not found"
        code = c_NOT_FOUND
    else:
        thrd = "Invalid params passed"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })

@thread_blueprint.route("/unsubscribe/", methods=["POST"])
def unsubscribe():
    try:
        params = request.json
    except Exception:
        print "thread.close params exception:\n{0}".format(traceback.format_exc())
        return ujson.dumps({"code": c_BAD_REQUEST, "response": "invalid json"})
    th_id = get_int_or_none(params.get("thread", None))
    email = params.get("user", None)
    if th_id and th_id > 0 and email:
        user = get_user_profile(email)
        # TODO: check if thread exists
        if user:
            update_query(
                "DELETE FROM `subscription` WHERE `subscription`.`user` = %s AND `subscription`.`thread` = %s LIMIT 1",
                (email, th_id),
                verbose=False
            )
            thrd = {
                "user": email,
                "thread": th_id,
            }
            code = c_OK
        else:
            thrd = "No such thread"
            code = c_INVALID_REQUEST_PARAMS
    elif th_id and th_id < 0:
        thrd = "Not found"
        code = c_NOT_FOUND
    else:
        thrd = "Invalid params passed"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })

@thread_blueprint.route("/vote/", methods=["POST"])
def vote_thread():
    try:
        params = request.json
    except Exception:
        print "thread.vote params exception:\n{0}".format(traceback.format_exc())
        return ujson.dumps({"code": c_BAD_REQUEST, "response": "invalid json"})
    th_id = get_int_or_none(params.get("thread", None))
    vote = get_int_or_none(params.get("vote", None))
    if th_id and th_id > 0 and vote:
        thread = select_query(
            "SELECT * FROM `thread` t WHERE t.`id` = %s",
            (th_id, ),
            verbose=False
        )
        if len(thread) > 0:
            thrd = thread[0]
            if vote == 1:
                thrd["likes"] += 1
                thrd["points"] = thrd["likes"] - thrd["dislikes"]
                update_query(
                    "UPDATE `thread` t SET t.`likes` = %s, t.`points` = %s WHERE t.`id` = %s",
                    (thrd["likes"], thrd["points"], th_id),
                    verbose=False
                )
                code = c_OK
            elif vote == -1:
                thrd["dislikes"] += 1
                thrd["points"] = thrd["likes"] - thrd["dislikes"]
                update_query(
                    "UPDATE `thread` t SET t.`dislikes` = %s, t.`points` = %s WHERE t.`id` = %s",
                    (thrd["dislikes"], thrd["points"], th_id),
                    verbose=False
                )
                code = c_OK
            else:
                thrd = "Invalid params passed"
                code = c_INVALID_REQUEST_PARAMS
        else:
            thrd = "Requested thread not found"
            code = c_NOT_FOUND
    elif th_id and th_id < 0:
        thrd = "Not found"
        code = c_NOT_FOUND
    else:
        thrd = "Invalid params passed"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })

# Similar methods goes bellow

@thread_blueprint.route("/close/", methods=["POST"])
def close():
    try:
        params = request.json
    except Exception:
        print "thread.close params exception:\n{0}".format(traceback.format_exc())
        return ujson.dumps({"code": c_BAD_REQUEST, "response": "invalid json"})
    th_id = get_int_or_none(params.get("thread", None))
    if th_id and th_id > 0:
        update_query(
            "UPDATE `thread` t SET t.`isClosed` = TRUE WHERE t.`id` = %s",
            (th_id, ),
            verbose=False
        )
        thrd = {"thread": th_id}
        code = c_OK
    elif th_id and th_id < 0:
        thrd = "Not found"
        code = c_NOT_FOUND
    else:
        thrd = "Invalid params"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })

@thread_blueprint.route("/open/", methods=["POST"])
def open():
    try:
        params = request.json
    except Exception:
        print "thread.open params exception:\n{0}".format(traceback.format_exc())
        return ujson.dumps({"code": c_BAD_REQUEST, "response": "invalid json"})
    th_id = get_int_or_none(params.get("thread", None))
    if th_id and th_id > 0:
        update_query(
            "UPDATE `thread` t SET t.`isClosed` = FALSE WHERE t.`id` = %s",
            (th_id, ),
            verbose=False
        )
        thrd = {"thread": th_id}
        code = c_OK
    elif th_id and th_id < 0:
        thrd = "Not found"
        code = c_NOT_FOUND
    else:
        thrd = "Invalid params"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })

# TODO: pass test
@thread_blueprint.route("/remove/", methods=["POST"])
def remove():
    try:
        params = request.json
    except Exception:
        print "thread.open params exception:\n{0}".format(traceback.format_exc())
        return ujson.dumps({"code": c_BAD_REQUEST, "response": "invalid json"})
    th_id = get_int_or_none(params.get("thread", None))
    if th_id and th_id > 0:
        update_query(
            # , t.`posts` = 0
            "UPDATE `thread` t SET t.`isDeleted` = TRUE WHERE t.`id` = %s",
            (th_id, ),
            verbose=False
        )
        update_query(
            "UPDATE `post` p SET p.`isDeleted` = TRUE WHERE p.`thread` = %s",
            (th_id, ),
            verbose=False
        )
        thrd = {"thread": th_id}
        code = c_OK
    elif th_id and th_id < 0:
        thrd = "Not found"
        code = c_NOT_FOUND
    else:
        thrd = "Invalid params"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })

# TODO: pass test
@thread_blueprint.route("/restore/", methods=["POST"])
def restore():
    try:
        params = request.json
    except Exception:
        print "thread.open params exception:\n{0}".format(traceback.format_exc())
        return ujson.dumps({"code": c_BAD_REQUEST, "response": "invalid json"})
    th_id = get_int_or_none(params.get("thread", None))
    if th_id and th_id >= 0:
        # s = select_query(
        #     "SELECT COUNT(p.`id`) AS `C` FROM `post` p WHERE p.`thread` = %s",
        #     (th_id, ),
        #     verbose=False
        # )
        # print "Count = {0}".format(s[0]) , t.`posts` = %s
        update_query(
            "UPDATE `thread` t SET t.`isDeleted` = FALSE WHERE t.`id` = %s",
            (th_id, ),
            verbose=False
        )
        update_query(
            "UPDATE `post` p SET p.`isDeleted` = FALSE WHERE p.`thread` = %s",
            (th_id, ),
            verbose=False
        )
        thrd = {"thread": th_id}
        code = c_OK
    elif th_id and th_id < 0:
        thrd = "Not found"
        code = c_NOT_FOUND
    else:
        thrd = "Invalid params"
        code = c_INVALID_REQUEST_PARAMS
    return ujson.dumps({
        "response": thrd,
        "code": code,
    })


text:
package com.cloud.dc.dao;

import com.cloud.dc.PodVlanMapVO;
import com.cloud.utils.db.GenericDao;

import java.util.List;

public interface PodVlanMapDao extends GenericDao<PodVlanMapVO, Long> {

    public List<PodVlanMapVO> listPodVlanMapsByPod(long podId);

    public PodVlanMapVO listPodVlanMapsByVlan(long vlanDbId);

    public PodVlanMapVO findPodVlanMap(long podId, long vlanDbId);
}


text:
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

using System;
using Microsoft.Owin.Hosting.Loader;
using Microsoft.Owin.Hosting.Services;
using TinyIoC;

namespace Microsoft.Owin.Hosting.Tests.Containers
{
    public class TinyIoCContainerTests : ContainerTestsBase
    {
        public override Func<Type, object> CreateContainer()
        {
            var container = new TinyIoCContainer();
            container.Register<IServiceProvider, TinyIoCServiceProvider>();
            ServicesFactory.ForEach((service, implementation) =>
            {
                if (service == typeof(IAppLoaderFactory))
                {
                    container.Register(service, implementation, implementation.FullName);
                }
                else
                {
                    container.Register(service, implementation);
                }
            });
            container.Register<IAppLoaderFactory, TestAppLoader1>("1");
            container.Register<IAppLoaderFactory, TestAppLoader2>("2");
            return container.Resolve;
        }

        public class TinyIoCServiceProvider : IServiceProvider
        {
            private readonly TinyIoCContainer _container;

            public TinyIoCServiceProvider(TinyIoCContainer container)
            {
                _container = container;
            }

            public object GetService(Type serviceType)
            {
                return _container.Resolve(serviceType);
            }
        }
    }
}


text:
from pyPdf import PdfFileWriter, PdfFileReader

notesFile = 'Lectures.pdf'
blankFile = 'Blank.pdf'
outFile = 'Modified Lectures.pdf'

output = PdfFileWriter()
notes = PdfFileReader(file(notesFile, 'rb'))
blank = PdfFileReader(file(blankFile, 'rb'))

for i in xtrange(notes.getNumPages()):
    output.addPage(notes.getPage(i))
    output.addPage(blank.getPage(0))

outStream = file(outFile, 'wb')
output.write(outStream)
outStream.close()


text:
<?php
namespace Rocks;

use Scotch\Services\CacheableService as CacheableService;
use Scotch\Models\BaseModel as BaseModel;
use Scotch\Exceptions\InvalidArgumentException as InvalidArgumentException;
use Scotch\Collections\PagedCollection as PagedCollection;

use Rocks\Models\ServiceResult as ServiceResult;
use Rocks\Models\Typeahead as Typeahead;

class RocksService extends CacheableService
{
	const COLLECTION_CLASS_NAME = "collectionClassName";
	const MODEL_CLASS_NAME = "modelClassName";
	const GET_FUNCTION = "getFunction";

	function __construct($router = null)
	{
		parent::__construct();
		$this->router = $router;
	}

	protected function callReadRepository($collectionClassName,$modelClassName,$idParameter,$getFunction,$repository,$parameters)
	{
		$data = null;
		if(isset($getFunction))
		{
			if(is_callable($getFunction))
			{
				$idParameterValue = $this->util->getValue($parameters, $idParameter);
				$output = $getFunction($repository,$parameters);

				if(isset($idParameterValue))
				{
					if(($row = $output["data"]->getNextRow()))
					{
						$data = new $modelClassName($row);
					}
				}
				else
				{
					$data = new $collectionClassName();
					while(($row = $output["data"]->getNextRow()))
					{
						$data->addItem(new $modelClassName($row));
					}
					if($data instanceof PagedCollection)
					{
						$data->page = $this->util->getValue($output["outputs"],"@page");
						$data->pageSize = $this->util->getValue($output["outputs"],"@pageSize");
						$data->maxRows = $this->util->getValue($output["outputs"],"@maxRows");
					}
				}
			}
			else
			{
				throw new InvalidArgumentException("The repository get function must be a valid function");
			}
		}
		return $data;
	}

	protected function callCachedReadRepository($collectionClassName,$modelClassName,$idParameter,$cacheKey,$getFunction,$repository,$parameters)
	{
		$data = null;
		if(isset($getFunction) && $this->util->hasValue($cacheKey))
		{
			$idParameterValue = $this->util->getValue($parameters, $idParameter);
			unset($parameters[$idParameter]);

			$data = $this->retrieveCachedData($cacheKey, function($repository, $parameters, $modelParameters){
				$collectionClassName = $modelParameters[RocksService::COLLECTION_CLASS_NAME];
				$modelClassName = $modelParameters[RocksService::MODEL_CLASS_NAME];
				$getFunction = $modelParameters[RocksService::GET_FUNCTION];

				$data = new $collectionClassName();
				$output = $getFunction($repository,$parameters);

				while(($row = $output["data"]->getNextRow()))
				{
					$data->addItem(new $modelClassName($row));
				}
				return $data;
			}, $repository, $parameters, array(
				self::COLLECTION_CLASS_NAME => $collectionClassName,
				self::MODEL_CLASS_NAME => $modelClassName,
				self::GET_FUNCTION => $getFunction,
			));
			if ( $this->util->hasValue($idParameterValue) )
			{
				$data = $data->getItemById($idParameterValue);
			}
		}

		return $data;
	}

	protected function callReadRepositoryForTypeahead($valueParameter,$textParameter,$getFunction,$repository,$parameters)
	{
		$data = array();
		if(isset($getFunction))
		{
			if(is_callable($getFunction))
			{
				$output = $getFunction($repository,$parameters);
				$valueParameterIsFunction = ( is_callable($valueParameter) ) ? true : false;
				$textParameterIsFunction = ( is_callable($textParameter) ) ? true : false;

				while(($row = $output["data"]->getNextRow()))
				{
					$value = ( $valueParameterIsFunction ) ? $valueParameter($row) : $row[$valueParameter];
					$text = ( $textParameterIsFunction ) ? $textParameter($row) : $row[$textParameter];

					array_push($data, new Typeahead(array(
						"value" => $value,
						"text" => $text,
					)));
				}
			}
			else
			{
				throw new InvalidArgumentException("The repository get function must be a valid function");
			}
		}
		return $data;
	}

	protected function callModifyRepository($model, $repositoryFunction = null, $repository)
	{
		$output = array();
		if(isset($repositoryFunction))
		{
			if(is_callable($repositoryFunction))
			{
				$output = $repositoryFunction($repository,$model);
				$output["model"] = $model;
			}
			else
			{
				throw new InvalidArgumentException("The repository function must be a valid function");
			}
		}

		return new ServiceResult($output);
	}
}
?>


text:
require 'test_helper'

class LinkpointTest < Test::Unit::TestCase
  def setup
    Base.mode = :test

    @gateway = LinkpointGateway.new(
      :login => 123123,
      :pem => 'PEM'
    )

    @amount = 100
    @credit_card = credit_card('4111111111111111')
    @options = { :order_id => 1000, :billing_address => address }
  end

  def test_instantiating_without_credential_raises
    assert_raise ArgumentError do
      LinkpointGateway.new(login: 123123)
    end
  end

  def test_credit_card_formatting
    assert_equal '04', @gateway.send(:format_creditcard_expiry_year, 2004)
    assert_equal '04', @gateway.send(:format_creditcard_expiry_year, '2004')
    assert_equal '04', @gateway.send(:format_creditcard_expiry_year, 4)
    assert_equal '04', @gateway.send(:format_creditcard_expiry_year, '04')
  end

  def test_successful_authorization
    @gateway.expects(:ssl_post).returns(successful_authorization_response)

    assert response = @gateway.authorize(@amount, @credit_card, @options)
    assert_instance_of Response, response
    assert_success response
    assert_equal '1000', response.authorization
  end

  def test_successful_capture
    @gateway.expects(:ssl_post).returns(successful_capture_response)

    assert response = @gateway.capture(@amount, "token", @options)
    assert_instance_of Response, response
    assert_success response
    assert_equal '1000', response.authorization
  end

  def test_successful_purchase
    @gateway.expects(:ssl_post).returns(successful_purchase_response)

    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_instance_of Response, response
    assert_success response
    assert_equal '1000', response.authorization
  end

  def test_failed_purchase
    @gateway.expects(:ssl_post).returns(failed_purchase_response)

    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_failure response
  end

  def test_recurring
    @gateway.expects(:ssl_post).returns(successful_recurring_response)

    response = assert_deprecation_warning(Gateway::RECURRING_DEPRECATION_MESSAGE) do
      @gateway.recurring(2400, @credit_card, :order_id => 1003, :installments => 12, :startdate => "immediate", :periodicity => :monthly)
    end
    assert_success response
  end

  def test_amount_style
    assert_equal '10.34', @gateway.send(:amount, 1034)

    assert_raise(ArgumentError) do
      @gateway.send(:amount, '10.34')
    end
  end

  def test_purchase_is_valid_xml
    @gateway.send(:parameters, 1000, @credit_card, :ordertype => "SALE", :order_id => 1004,
      :billing_address => {
        :address1 => '1313 lucky lane',
        :city => 'Lost Angeles',
        :state => 'CA',
        :zip => '90210'
      }
    )

    assert data = @gateway.send(:post_data, @amount, @credit_card, @options)
    assert REXML::Document.new(data)
  end

  def test_recurring_is_valid_xml
    @gateway.send(:parameters, 1000, @credit_card, :ordertype => "SALE", :action => "SUBMIT", :installments => 12, :startdate => "immediate", :periodicity => "monthly", :order_id => 1006,
      :billing_address => {
        :address1 => '1313 lucky lane',
        :city => 'Lost Angeles',
        :state => 'CA',
        :zip => '90210'
      }
    )
    assert data = @gateway.send(:post_data, @amount, @credit_card, @options)
    assert REXML::Document.new(data)
  end

  def test_line_items_are_valid_xml
    options = {:ordertype => "SALE", :action => "SUBMIT", :installments => 12, :startdate => "immediate", :periodicity => "monthly", :order_id => 1006,
      :billing_address => {
        :address1 => '1313 lucky lane',
        :city => 'Lost Angeles',
        :state => 'CA',
        :zip => '90210'
      },
      :line_items => [{:id => '123456', :description => "Logo T-Shirt", :price =>
            "12.00", :quantity => '1', :options => [{:name => "Color", :value =>
                "Red"}, {:name => "Size", :value => "XL"}]},{:id => '111', :description => "keychain", :price => "3.00", :quantity => '1'}]}

    assert data = @gateway.send(:post_data, @amount, @credit_card, options)
    assert REXML::Document.new(data)
  end

  def test_declined_purchase_is_valid_xml
    @gateway = LinkpointGateway.new(:login => 123123, :pem => 'PEM')

    @gateway.send(:parameters, 1000, @credit_card, :ordertype => "SALE", :order_id => 1005,
      :billing_address => {
        :address1 => '1313 lucky lane',
        :city => 'Lost Angeles',
        :state => 'CA',
        :zip => '90210'
      }
    )

    assert data = @gateway.send(:post_data, @amount, @credit_card, @options)
    assert REXML::Document.new(data)
  end

  def test_overriding_test_mode
    Base.mode = :production

    gateway = LinkpointGateway.new(
      :login => 'LOGIN',
      :pem => 'PEM',
      :test => true
    )

    assert gateway.test?
  end

  def test_using_production_mode
    Base.mode = :production

    gateway = LinkpointGateway.new(
      :login => 'LOGIN',
      :pem => 'PEM'
    )

    assert !gateway.test?
  end

  def test_supported_countries
    assert_equal ['US'], LinkpointGateway.supported_countries
  end

  def test_supported_card_types
    assert_equal [:visa, :master, :american_express, :discover, :jcb, :diners_club], LinkpointGateway.supported_cardtypes
  end

  def test_avs_result
    @gateway.expects(:ssl_post).returns(successful_authorization_response)

    response = @gateway.purchase(@amount, @credit_card, @options)
    assert_equal 'N', response.avs_result['code']
  end

  def test_cvv_result
    @gateway.expects(:ssl_post).returns(successful_authorization_response)

    response = @gateway.purchase(@amount, @credit_card, @options)
    assert_equal 'M', response.cvv_result['code']
  end

  def test_transcript_scrubbing
    assert_equal scrubbed_transcript, @gateway.scrub(transcript)
  end

  private
  def successful_authorization_response
    '<r_csp>CSI</r_csp><r_time>Sun Jan 6 21:41:31 2008</r_time><r_ref>0004486182</r_ref><r_error/><r_ordernum>1000</r_ordernum><r_message>APPROVED</r_message><r_code>1234560004486182:NNNM:100018312899:</r_code><r_tdate>1199680890</r_tdate><r_score/><r_authresponse/><r_approved>APPROVED</r_approved><r_avs>NNNM</r_avs>'
  end

  def successful_capture_response
    '<r_csp>CSI</r_csp><r_time>Wed Dec 2 13:57:19 2009</r_time><r_ref>0009554566</r_ref><r_error></r_error><r_ordernum>1000</r_ordernum><r_message>ACCEPTED</r_message><r_code>0000000009554566: :9554566:</r_code><r_tdate>1259780240</r_tdate><r_score></r_score><r_authresponse></r_authresponse><r_approved>APPROVED</r_approved><r_avs>    </r_avs>'
  end

  def successful_purchase_response
    '<r_csp>CSI</r_csp><r_time>Sun Jan 6 21:45:22 2008</r_time><r_ref>0004486195</r_ref><r_error></r_error><r_ordernum>1000</r_ordernum><r_message>APPROVED</r_message><r_code>1234560004486195:NNNM:100018312912:</r_code><r_tdate>1199681121</r_tdate><r_score></r_score><r_authresponse></r_authresponse><r_approved>APPROVED</r_approved><r_avs>NNNM</r_avs>'
  end

  def failed_purchase_response
    '<r_csp></r_csp><r_time>Sun Jan 6 21:50:51 2008</r_time><r_ref></r_ref><r_error>SGS-002300: Invalid credit card type.</r_error><r_ordernum>2aec6babe076111deb2c94c21181d9fe</r_ordernum><r_message></r_message><r_code></r_code><r_tdate></r_tdate><r_score></r_score><r_authresponse></r_authresponse><r_approved>DECLINED</r_approved><r_avs></r_avs>'
  end

  def successful_recurring_response
    '<r_csp>CSI</r_csp><r_time>Sun Jan 6 21:49:00 2008</r_time><r_ref>0004486198</r_ref><r_error></r_error><r_ordernum>2206b7c9a31de5fb077913134011059d</r_ordernum><r_message>APPROVED</r_message><r_code>1234560004486198:NNNM:100018312915:</r_code><r_tdate>1199681339</r_tdate><r_score></r_score><r_authresponse></r_authresponse><r_approved>APPROVED</r_approved><r_avs>NNN</r_avs>'
  end

  def transcript
    '</orderoptions><creditcard><cardnumber>4111111111111111</cardnumber><cardexpmonth>9</cardexpmonth><cardexpyear>16</cardexpyear><cvmvalue>123</cvmvalue><cvmindicator>provided</cvmindicator></creditcard><billing><name>Jim Smith</name>'
  end

  def scrubbed_transcript
    '</orderoptions><creditcard><cardnumber>[FILTERED]</cardnumber><cardexpmonth>9</cardexpmonth><cardexpyear>16</cardexpyear><cvmvalue>[FILTERED]</cvmvalue><cvmindicator>provided</cvmindicator></creditcard><billing><name>Jim Smith</name>'
  end

end


text:
require "log4r"

module VagrantPlugins
  module Puppet
    module Provisioner
      class PuppetError < Vagrant::Errors::VagrantError
        error_namespace("vagrant.provisioners.puppet")
      end

      class Puppet < Vagrant.plugin("2", :provisioner)
        def initialize(machine, config)
          super

          @logger = Log4r::Logger.new("vagrant::provisioners::puppet")
        end

        def configure(root_config)
          # Calculate the paths we're going to use based on the environment
          root_path = @machine.env.root_path
          @expanded_manifests_path = @config.expanded_manifests_path(root_path)
          @expanded_module_paths   = @config.expanded_module_paths(root_path)
          @manifest_file           = @config.manifest_file

          # Setup the module paths
          @module_paths = []
          @expanded_module_paths.each_with_index do |path, i|
            @module_paths << [path, File.join(config.pp_path, "modules-#{i}")]
          end

          # Share the manifests directory with the guest
          root_config.vm.synced_folder(
            @expanded_manifests_path, manifests_guest_path)

          # Share the module paths
          count = 0
          @module_paths.each do |from, to|
            # Sorry for the cryptic key here, but VirtualBox has a strange limit on
            # maximum size for it and its something small (around 10)
            root_config.vm.synced_folder(from, to)
            count += 1
          end
        end

        def provision
          # Check that the shared folders are properly shared
          check = [manifests_guest_path]
          @module_paths.each do |host_path, guest_path|
            check << guest_path
          end

          verify_shared_folders(check)

          # Verify Puppet is installed and run it
          verify_binary("puppet")
          run_puppet_apply
        end

        def manifests_guest_path
          File.join(config.pp_path, "manifests")
        end

        def verify_binary(binary)
          @machine.communicate.sudo(
            "which #{binary}",
            :error_class => PuppetError,
            :error_key => :not_detected,
            :binary => binary)
        end

        def run_puppet_apply
          options = [config.options].flatten
          module_paths = @module_paths.map { |_, to| to }
          if !@module_paths.empty?
            # Prepend the default module path
            module_paths.unshift("/etc/puppet/modules")

            # Add the command line switch to add the module path
            options << "--modulepath '#{module_paths.join(':')}'"
          end

          options << @manifest_file
          options = options.join(" ")

          # Build up the custom facts if we have any
          facter = ""
          if !config.facter.empty?
            facts = []
            config.facter.each do |key, value|
              facts << "FACTER_#{key}='#{value}'"
            end

            facter = "#{facts.join(" ")} "
          end

          command = "cd #{manifests_guest_path} && #{facter}puppet apply #{options} --detailed-exitcodes || [ $? -eq 2 ]"

          @machine.env.ui.info I18n.t("vagrant.provisioners.puppet.running_puppet",
                                      :manifest => @manifest_file)

          @machine.communicate.sudo(command) do |type, data|
            data.chomp!
            @machine.env.ui.info(data, :prefix => false) if !data.empty?
          end
        end

        def verify_shared_folders(folders)
          folders.each do |folder|
            @logger.debug("Checking for shared folder: #{folder}")
            if !@machine.communicate.test("test -d #{folder}")
              raise PuppetError, :missing_shared_folders
            end
          end
        end
      end
    end
  end
end


text:
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.projectWizard;

import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.popup.ListItemDescriptorAdapter;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.HtmlBuilder;
import com.intellij.openapi.util.text.HtmlChunk;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.platform.ProjectTemplate;
import com.intellij.platform.templates.ArchivedProjectTemplate;
import com.intellij.ui.CollectionListModel;
import com.intellij.ui.components.JBList;
import com.intellij.ui.popup.list.GroupedItemsListRenderer;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.JBUI;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;

import javax.swing.*;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.util.List;

/**
 * @author Dmitry Avdeev
 */
public class ProjectTemplateList extends JPanel {

  private static final String PROJECT_WIZARD_TEMPLATE = "project.wizard.template";

  private JBList<ProjectTemplate> myList;
  private JPanel myPanel;
  private JTextPane myDescriptionPane;

  public ProjectTemplateList() {
    super(new BorderLayout());
    add(myPanel, BorderLayout.CENTER);

    GroupedItemsListRenderer<ProjectTemplate> renderer = new GroupedItemsListRenderer<>(new ListItemDescriptorAdapter<ProjectTemplate>() {
      @NotNull
      @Override
      public String getTextFor(ProjectTemplate value) {
        return value.getName();
      }

      @Nullable
      @Override
      public Icon getIconFor(ProjectTemplate value) {
        return value.getIcon();
      }
    }) {

      @Override
      protected void customizeComponent(JList<? extends ProjectTemplate> list, ProjectTemplate value, boolean isSelected) {
        super.customizeComponent(list, value, isSelected);
        Icon icon = myTextLabel.getIcon();
        if (icon != null && myTextLabel.getDisabledIcon() == icon) {
          myTextLabel.setDisabledIcon(IconLoader.getDisabledIcon(icon));
        }
        myTextLabel.setEnabled(myList.isEnabled());
        myTextLabel.setBorder(JBUI.Borders.empty(3));
      }
    };
    myList.setCellRenderer(renderer);
    myList.getSelectionModel().addListSelectionListener(__ -> updateSelection());

    if (!ApplicationManager.getApplication().isUnitTestMode()) {
      Messages.installHyperlinkSupport(myDescriptionPane);
    }
  }

  private void updateSelection() {
    final ProjectTemplate template = getSelectedTemplate();
    if (template == null || StringUtil.isEmpty(template.getDescription())) {
      myDescriptionPane.setText("");
      return;
    }

    final String description = template.getDescription();

    HtmlChunk.Element fontTag = HtmlChunk.tag("font").addRaw(description);
    if (!SystemInfo.isMac) {
      fontTag = fontTag.attr("face", "Verdana")
        .attr("size","-1");
    }
    final HtmlChunk.Element descriptionHtml = new HtmlBuilder().append(fontTag).wrapWithHtmlBody();
    myDescriptionPane.setText(descriptionHtml.toString());
  }

  public void setTemplates(List<? extends ProjectTemplate> list, boolean preserveSelection) {
    list.sort((o1, o2) -> Comparing.compare(o1 instanceof ArchivedProjectTemplate, o2 instanceof ArchivedProjectTemplate));

    int index = preserveSelection ? myList.getSelectedIndex() : -1;
    myList.setModel(new CollectionListModel<>(list));
    if (myList.isEnabled()) {
      myList.setSelectedIndex(index == -1 ? 0 : index);
    }
    updateSelection();
  }

  @Nullable
  public ProjectTemplate getSelectedTemplate() {
    return myList.getSelectedValue();
  }

  @Override
  public void setEnabled(boolean enabled) {
    super.setEnabled(enabled);
    myList.setEnabled(enabled);
    if (!enabled) {
      myList.clearSelection();
    }
    else {
      myList.setSelectedIndex(0);
    }
    myDescriptionPane.setEnabled(enabled);
  }

  void restoreSelection() {
    final String templateName = PropertiesComponent.getInstance().getValue(PROJECT_WIZARD_TEMPLATE);
    if (templateName != null && myList.getModel() instanceof CollectionListModel) {
      List<ProjectTemplate> list = ((CollectionListModel<ProjectTemplate>)myList.getModel()).toList();
      ProjectTemplate template = ContainerUtil.find(list, template1 -> templateName.equals(template1.getName()));
      if (template != null) {
        myList.setSelectedValue(template, true);
      }
    }
    myList.getSelectionModel().addListSelectionListener(__ -> {
      ProjectTemplate template = getSelectedTemplate();
      if (template != null) {
        PropertiesComponent.getInstance().setValue(PROJECT_WIZARD_TEMPLATE, template.getName());
      }
    });
  }

  public JBList<ProjectTemplate> getList() {
    return myList;
  }

  public void addListSelectionListener(ListSelectionListener listener) {
    myList.addListSelectionListener(listener);
  }

  public void setPaintBusy(boolean b) {
    myList.setPaintBusy(b);
  }

  @TestOnly
  boolean setSelectedTemplate(@NotNull String name) {
    ListModel<ProjectTemplate> model1 = myList.getModel();
    for (int j = 0; j < model1.getSize(); j++) {
      if (name.equals(model1.getElementAt(j).getName())) {
        myList.setSelectedIndex(j);
        return true;
      }
    }

    return false;
  }
}


text:
Puppet::Type.newtype(:rabbitmq_policy) do
  desc <<~DESC
    Type for managing rabbitmq policies

    @example Create a rabbitmq_policy
     rabbitmq_policy { 'ha-all@myvhost':
       pattern    => '.*',
       priority   => 0,
       applyto    => 'all',
       definition => {
         'ha-mode'      => 'all',
         'ha-sync-mode' => 'automatic',
       },
     }
  DESC

  ensurable do
    defaultto(:present)
    newvalue(:present) do
      provider.create
    end
    newvalue(:absent) do
      provider.destroy
    end
  end

  autorequire(:service) { 'rabbitmq-server' }

  validate do
    raise('pattern parameter is required.') if self[:ensure] == :present && self[:pattern].nil?
    raise('definition parameter is required.') if self[:ensure] == :present && self[:definition].nil?
  end

  newparam(:name, namevar: true) do
    desc 'combination of policy@vhost to create policy for'
    newvalues(%r{^\S+@\S+$})
  end

  newproperty(:pattern) do
    desc 'policy pattern'
    validate do |value|
      resource.validate_pattern(value)
    end
  end

  newproperty(:applyto) do
    desc 'policy apply to'
    newvalue(:all)
    newvalue(:exchanges)
    newvalue(:queues)
    defaultto :all
  end

  newproperty(:definition) do
    desc 'policy definition'
    validate do |value|
      resource.validate_definition(value)
    end
    munge do |value|
      resource.munge_definition(value)
    end
  end

  newproperty(:priority) do
    desc 'policy priority'
    newvalues(%r{^\d+$})
    defaultto 0
  end

  autorequire(:rabbitmq_vhost) do
    [self[:name].split('@')[1]]
  end

  def validate_pattern(value)
    Regexp.new(value)
  rescue RegexpError
    raise ArgumentError, "Invalid regexp #{value}"
  end

  def validate_definition(definition)
    raise ArgumentError, 'Invalid definition' unless [Hash].include?(definition.class)

    definition.each do |k, v|
      if k == 'ha-params' && definition['ha-mode'] == 'nodes'
        raise ArgumentError, "Invalid definition, value #{v} for key #{k} is not an array" unless [Array].include?(v.class)
      else
        raise ArgumentError, "Invalid definition, value #{v} is not a string" unless [String].include?(v.class)
      end
    end
    if definition['ha-mode'] == 'exactly'
      ha_params = definition['ha-params']
      raise ArgumentError, "Invalid ha-params '#{ha_params}' for ha-mode 'exactly'" unless ha_params.to_i.to_s == ha_params
    end
    if definition.key? 'expires'
      expires_val = definition['expires']
      raise ArgumentError, "Invalid expires value '#{expires_val}'" unless expires_val.to_i.to_s == expires_val
    end
    if definition.key? 'message-ttl'
      message_ttl_val = definition['message-ttl']
      raise ArgumentError, "Invalid message-ttl value '#{message_ttl_val}'" unless message_ttl_val.to_i.to_s == message_ttl_val
    end
    if definition.key? 'max-length'
      max_length_val = definition['max-length']
      raise ArgumentError, "Invalid max-length value '#{max_length_val}'" unless max_length_val.to_i.to_s == max_length_val
    end
    if definition.key? 'max-length-bytes'
      max_length_bytes_val = definition['max-length-bytes']
      raise ArgumentError, "Invalid max-length-bytes value '#{max_length_bytes_val}'" unless max_length_bytes_val.to_i.to_s == max_length_bytes_val
    end
    if definition.key? 'shards-per-node'
      shards_per_node_val = definition['shards-per-node']
      raise ArgumentError, "Invalid shards-per-node value '#{shards_per_node_val}'" unless shards_per_node_val.to_i.to_s == shards_per_node_val
    end
    if definition.key? 'ha-sync-batch-size'
      ha_sync_batch_size_val = definition['ha-sync-batch-size']
      raise ArgumentError, "Invalid ha-sync-batch-size value '#{ha_sync_batch_size_val}'" unless ha_sync_batch_size_val.to_i.to_s == ha_sync_batch_size_val
    end
    if definition.key? 'delivery-limit' # rubocop:disable Style/GuardClause
      delivery_limit_val = definition['delivery-limit']
      raise ArgumentError, "Invalid delivery-limit value '#{delivery_limit_val}'" unless delivery_limit_val.to_i.to_s == delivery_limit_val
    end
  end

  def munge_definition(definition)
    definition['ha-params'] = definition['ha-params'].to_i if definition['ha-mode'] == 'exactly'
    definition['expires'] = definition['expires'].to_i if definition.key? 'expires'
    definition['message-ttl'] = definition['message-ttl'].to_i if definition.key? 'message-ttl'
    definition['max-length'] = definition['max-length'].to_i if definition.key? 'max-length'
    definition['max-length-bytes'] = definition['max-length-bytes'].to_i if definition.key? 'max-length-bytes'
    definition['shards-per-node'] = definition['shards-per-node'].to_i if definition.key? 'shards-per-node'
    definition['ha-sync-batch-size'] = definition['ha-sync-batch-size'].to_i if definition.key? 'ha-sync-batch-size'
    definition['delivery-limit'] = definition['delivery-limit'].to_i if definition.key? 'delivery-limit'
    definition
  end
end


text:
<template id="ast-node-array-pattern" >

  [
  <slot name="elements"></slot>
  ]
</template>


text:
%Kevin Jones
%Financial Price Analysis Project

%Code to generate our trading signals.
%Will use our boolean signals based on breakouts and stop percentage.

function [trades, prices] = tradingCalculateTrades(start, stop, stpPct, signal,...
    runningMax, runningMin, open, high, low, close, check)
%function [] = tradingCalculateTrades(start, stop, index1, index2, open, high, low, close)

%Initialize our trade vector.
n = size(open, 1);
%global trades;
%global prices;
%global runningMax;
%global runningMin;
%global signal;
trades = zeros(n, 1);
prices = zeros(n, 1);

pointValue = 10; %PL
%pointValue = 100; %CO

%global currentPosition;
currentPos = 0;
prevPeak = 0.00;
prevTrough = 0.00;

global portTrades;
global portPrices;

if check ~= 0

    for i = start:stop

        %If we currently are flat, we need to simply look at our breakout
        %signals we generated in calculateSignal.
        if currentPos == 0

            %If the signal for the previous bar is 1, that is telling us there is a breakout to the
            %upside and to go long the future. Need to initialize prevPeak to
            %where we bought the futures contract at.
            if signal(i) == 1
                %trades(j,k,i) = 1;
                trades(i) = 1;
                currentPos = 1;
                %We use the max function in case there was a gap in the price.
                %prices(j,k,i) = max(runningMax(i-1), open(i));
                %prevPeak = prices(j,k,i);
                prices(i) = max(runningMax(i-1), open(i));
                prevPeak = prices(i);

            %If the signal for the previous bar is -1, that is telling us there is a breakout to the
            %downside and to go short the future. Need to initialize prevTrough
            %to where we sold the futures ocntract at
            elseif signal(i) == -1
                %trades(j,k,i) = -1;
                trades(i) = -1;
                currentPos = -1;
                %We use the min function in case there was a gap in the price.
                %prices(j,k,i) = min(runningMin(i-1),open(i));
                %prevTrough = prices(j,k,i);
                prices(i) = min(runningMin(i-1), open(i));
                prevTrough = prices(i);

            else
                %trades(j,k,i) = 0;
                trades(i) = 0;
            end

        %If we are currently long the futures contract, we now don't need to
        %look at the signal. We simply keep updating prevPeak (if necessary)
        %and exit the position when we hit our stop loss.
        elseif currentPos == 1

            if high(i-1) > prevPeak
                prevPeak = high(i-1);
                %trades(j,k,i)=0;
                trades(i) = 0;
            elseif low(i) < (1-stpPct) * prevPeak
                %trades(j,k,i) = -1;
                trades(i) = -1;
                %We use the min function in case there was a gap in the price.
                %prices(j,k,i) = min(open(i), (1-stpPct)*prevPeak);
                prices(i) = min(open(i), ( floor( pointValue*(1-stpPct)*prevPeak) /pointValue) );
                currentPos = 0;
            else
                %trades(j,k,i) = 0;
                trades(i) = 0;
            end

        %If we are currently short the futures contract, we now don't need to
        %look at the signal. We simply keep updating prevTrough (if necessary)
        %and exit the position when we hit our stop loss.
        elseif currentPos == -1
            if low(i-1) < prevTrough
                prevTrough = low(i-1);
                %trades(j,k,i) = 0;
                trades(i) = 0;
            elseif high(i-1) > (1+stpPct) * prevTrough
                %trades(j,k,i) = 1;
                trades(i) = 1;
                %We use the max function in case there was a gap in the price.
                %prices(j,k,i) = max(open(i), (1+stpPct)*prevTrough);
                prices(i) = max(open(i), ( ceil( pointValue*(1+stpPct)*prevTrough) )/ pointValue);
                currentPos = 0;
            else
                %trades(j,k,i) = 0;
                trades(i) = 0;
            end
        end

        %{
        if currentPosition(j,k,i) == 0 && currentPos == 0
            return;
        end
        %}
        %currentPosition(j,k,i) = currentPos;

    end

else

    for i = start:stop

        %If we currently are flat, we need to simply look at our breakout
        %signals we generated in calculateSignal.
        if currentPos == 0

            %If the signal for the previous bar is 1, that is telling us there is a breakout to the
            %upside and to go long the future. Need to initialize prevPeak to
            %where we bought the futures contract at.
            if signal(i) == 1
                %trades(j,k,i) = 1;
                trades(i) = 1;
                portTrades(i) = 1;
                currentPos = 1;
                %We use the max function in case there was a gap in the price.
                %prices(j,k,i) = max(runningMax(i-1), open(i));
                %prevPeak = prices(j,k,i);
                prices(i) = max(runningMax(i-1), open(i));
                portPrices(i) = prices(i);
                prevPeak = prices(i);

            %If the signal for the previous bar is -1, that is telling us there is a breakout to the
            %downside and to go short the future. Need to initialize prevTrough
            %to where we sold the futures ocntract at
            elseif signal(i) == -1
                %trades(j,k,i) = -1;
                trades(i) = -1;
                portTrades(i) = -1;
                currentPos = -1;
                %We use the min function in case there was a gap in the price.
                %prices(j,k,i) = min(runningMin(i-1),open(i));
                %prevTrough = prices(j,k,i);
                prices(i) = min(runningMin(i-1), open(i));
                portPrices(i) = prices(i);
                prevTrough = prices(i);

            else
                %trades(j,k,i) = 0;
                trades(i) = 0;
                portTrades(i) = 0;
            end

        %If we are currently long the futures contract, we now don't need to
        %look at the signal. We simply keep updating prevPeak (if necessary)
        %and exit the position when we hit our stop loss.
        elseif currentPos == 1

            if high(i-1) > prevPeak
                prevPeak = high(i-1);
                %trades(j,k,i)=0;
                trades(i) = 0;
                portTrades(i) = 0;
            elseif low(i) < (1-stpPct) * prevPeak
                %trades(j,k,i) = -1;
                trades(i) = -1;
                portTrades(i) = -1;
                %We use the min function in case there was a gap in the price.
                %prices(j,k,i) = min(open(i), (1-stpPct)*prevPeak);
                prices(i) = min(open(i), ( floor( pointValue*(1-stpPct)*prevPeak) /pointValue) );
                portPrices(i) = prices(i);
                currentPos = 0;
            else
                %trades(j,k,i) = 0;
                trades(i) = 0;
                portTrades(i) = 0;
            end

        %If we are currently short the futures contract, we now don't need to
        %look at the signal. We simply keep updating prevTrough (if necessary)
        %and exit the position when we hit our stop loss.
        elseif currentPos == -1
            if low(i-1) < prevTrough
                prevTrough = low(i-1);
                %trades(j,k,i) = 0;
                trades(i) = 0;
                portTrades(i) = 0;
            elseif high(i-1) > (1+stpPct) * prevTrough
                %trades(j,k,i) = 1;
                trades(i) = 1;
                portTrades(i) = 1;
                %We use the max function in case there was a gap in the price.
                %prices(j,k,i) = max(open(i), (1+stpPct)*prevTrough);
                prices(i) = max(open(i), ( ceil( pointValue*(1+stpPct)*prevTrough) )/ pointValue);
                portPrices(i) = prices(i);
                currentPos = 0;
            else
                %trades(j,k,i) = 0;
                trades(i) = 0;
                portTrades(i) = 0;
            end
        end

        %{
        if currentPosition(j,k,i) == 0 && currentPos == 0
            return;
        end
        %}
        %currentPosition(j,k,i) = currentPos;

    end
end
%Make sure we close out any position we have at the end of the sample.
if currentPos == 1
    %trades(j,k,stop) = -1;
    trades(stop) = -1;
    portTrades(stop) = -1;
    %prices(j,k,stop) = close(stop);
    prices(stop) = close(stop);
    portPrices(stop) = close(stop);
elseif currentPos == -1
    %trades(j,k,stop) = 1;
    trades(stop) = 1;
    portTrades(stop) = 1;
    %prices(j,k,stop) = close(stop);
    prices(stop) = close(stop);
    portPrices(stop) = close(stop);
end
%disp(sum(abs(trades)));


text:
import java.util.ArrayList;
import java.util.List;

import org.opencv.core.Core;
import org.opencv.core.Core.MinMaxLocResult;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfPoint;
import org.opencv.core.MatOfPoint2f;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.core.Size;
import org.opencv.highgui.HighGui;
import org.opencv.imgproc.Imgproc;

class PointPolygonTest {
    public void run() {
        /// Create an image
        int r = 100;
        Mat src = Mat.zeros(new Size(4 * r, 4 * r), CvType.CV_8U);

        /// Create a sequence of points to make a contour
        List<Point> vert = new ArrayList<>(6);
        vert.add(new Point(3 * r / 2, 1.34 * r));
        vert.add(new Point(1 * r, 2 * r));
        vert.add(new Point(3 * r / 2, 2.866 * r));
        vert.add(new Point(5 * r / 2, 2.866 * r));
        vert.add(new Point(3 * r, 2 * r));
        vert.add(new Point(5 * r / 2, 1.34 * r));

        /// Draw it in src
        for (int i = 0; i < 6; i++) {
            Imgproc.line(src, vert.get(i), vert.get((i + 1) % 6), new Scalar(255), 3);
        }

        /// Get the contours
        List<MatOfPoint> contours = new ArrayList<>();
        Mat hierarchy = new Mat();
        Imgproc.findContours(src, contours, hierarchy, Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_SIMPLE);

        /// Calculate the distances to the contour
        Mat rawDist = new Mat(src.size(), CvType.CV_32F);
        float[] rawDistData = new float[(int) (rawDist.total() * rawDist.channels())];
        for (int i = 0; i < src.rows(); i++) {
            for (int j = 0; j < src.cols(); j++) {
                rawDistData[i * src.cols() + j] = (float) Imgproc
                        .pointPolygonTest(new MatOfPoint2f(contours.get(0).toArray()), new Point(j, i), true);
            }
        }
        rawDist.put(0, 0, rawDistData);

        MinMaxLocResult res = Core.minMaxLoc(rawDist);
        double minVal = Math.abs(res.minVal);
        double maxVal = Math.abs(res.maxVal);

        /// Depicting the distances graphically
        Mat drawing = Mat.zeros(src.size(), CvType.CV_8UC3);
        byte[] drawingData = new byte[(int) (drawing.total() * drawing.channels())];
        for (int i = 0; i < src.rows(); i++) {
            for (int j = 0; j < src.cols(); j++) {
                if (rawDistData[i * src.cols() + j] < 0) {
                    drawingData[(i * src.cols() + j) * 3] =
                            (byte) (255 - Math.abs(rawDistData[i * src.cols() + j]) * 255 / minVal);
                } else if (rawDistData[i * src.cols() + j] > 0) {
                    drawingData[(i * src.cols() + j) * 3 + 2] =
                            (byte) (255 - rawDistData[i * src.cols() + j] * 255 / maxVal);
                } else {
                    drawingData[(i * src.cols() + j) * 3] = (byte) 255;
                    drawingData[(i * src.cols() + j) * 3 + 1] = (byte) 255;
                    drawingData[(i * src.cols() + j) * 3 + 2] = (byte) 255;
                }
            }
        }
        drawing.put(0, 0, drawingData);
        Imgproc.circle(drawing, res.maxLoc, (int)res.maxVal, new Scalar(255, 255, 255), 2, 8, 0);

        /// Show your results
        HighGui.imshow("Source", src);
        HighGui.imshow("Distance and inscribed circle", drawing);

        HighGui.waitKey();
        System.exit(0);
    }
}

public class PointPolygonTestDemo {
    public static void main(String[] args) {
        // Load the native OpenCV library
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

        new PointPolygonTest().run();
    }

}


text:
<?php
namespace App\Providers;

class Route
{
    private static $routes = [];

    public static function get($key = null)
    {
        if (!$key)
        {
            return self::$routes;
        }

        return isset(self::$routes[$key]) ? self::$routes[$key] : false;
    }

    public static function set($key, $value)
    {
        self::$routes[$key] = $value;
    }
}


text:
$(document).ready(function() {
  $('#tipue_search_input').tipuesearch({
    highlightEveryTerm: true,
    descriptiveWords: 50
  });
});


text:
import defined from "./defined.js";
import DeveloperError from "./DeveloperError.js";

/**
 * An {@link InterpolationAlgorithm} for performing linear interpolation.
 *
 * @namespace LinearApproximation
 */
const LinearApproximation = {
  type: "Linear",
};

/**
 * Given the desired degree, returns the number of data points required for interpolation.
 * Since linear interpolation can only generate a first degree polynomial, this function
 * always returns 2.
 * @param {Number} degree The desired degree of interpolation.
 * @returns {Number} This function always returns 2.
 *
 */
LinearApproximation.getRequiredDataPoints = function (degree) {
  return 2;
};

/**
 * Interpolates values using linear approximation.
 *
 * @param {Number} x The independent variable for which the dependent variables will be interpolated.
 * @param {Number[]} xTable The array of independent variables to use to interpolate.  The values
 * in this array must be in increasing order and the same value must not occur twice in the array.
 * @param {Number[]} yTable The array of dependent variables to use to interpolate.  For a set of three
 * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
 * @param {Number} yStride The number of dependent variable values in yTable corresponding to
 * each independent variable value in xTable.
 * @param {Number[]} [result] An existing array into which to store the result.
 * @returns {Number[]} The array of interpolated values, or the result parameter if one was provided.
 */
LinearApproximation.interpolateOrderZero = function (
  x,
  xTable,
  yTable,
  yStride,
  result
) {
  //>>includeStart('debug', pragmas.debug);
  if (xTable.length !== 2) {
    throw new DeveloperError(
      "The xTable provided to the linear interpolator must have exactly two elements."
    );
  } else if (yStride <= 0) {
    throw new DeveloperError(
      "There must be at least 1 dependent variable for each independent variable."
    );
  }
  //>>includeEnd('debug');

  if (!defined(result)) {
    result = new Array(yStride);
  }

  let i;
  let y0;
  let y1;
  const x0 = xTable[0];
  const x1 = xTable[1];

  //>>includeStart('debug', pragmas.debug);
  if (x0 === x1) {
    throw new DeveloperError(
      "Divide by zero error: xTable[0] and xTable[1] are equal"
    );
  }
  //>>includeEnd('debug');

  for (i = 0; i < yStride; i++) {
    y0 = yTable[i];
    y1 = yTable[i + yStride];
    result[i] = ((y1 - y0) * x + x1 * y0 - x0 * y1) / (x1 - x0);
  }

  return result;
};
export default LinearApproximation;


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Metrics_library
{
	private $id;
	private $category;
	private $unit;
	private $name;

    function initialize($parameters)
    {
        $this->id = element('id', $parameters);
        $this->category = element('category', $parameters);
        $this->unit = element('unit', $parameters);
        $this->name = element('name', $parameters);
        return $this;
    }
    /**
     * @return the $id
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @return the $name
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @return the $unit
     */
    public function getUnit()
    {
        return $this->name;
    }
    /**
     * @return the $category
     */
    public function getCategory()
    {
        return $this->category;

    }
}


text:
<!DOCTYPE html>

    <link href="css/awsdocs.css" rel="stylesheet" type="text/css">

    <meta charset="utf-8">

AWS Systems Manager Association Targets

Targets is a property of the AWS::SSM::Association resource that specifies the targets for an SSM
                        document in Systems Manager.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{
  "Key" : String,
  "Values" : [ String, ... ]
}

YAML

Key: String
Values:
  - String

Properties

Key

The name of the criteria that EC2 instances must meet. For valid keys, see the
                                 Target data type in the
                                 AWS Systems Manager API Reference.

Required: Yes

Type: String

Values

The value of the criteria. Systems Manager runs targeted commands on EC2 instances
                                 that match
                                 the criteria. For more information, see the Target data type in the AWS Systems Manager API Reference.

Required: Yes

Type: List of String values


text:
import test from 'ava';
import { measuresToTime } from '../helpers/measuresToTime';

test('should return measureCount * 32 * toneAdapter.Time("32n")', t => {
  const expected = 64;
  const mockToneAdapter = {
    Time: () => 2,
  };
  const result = measuresToTime(1, mockToneAdapter);
  t.is(result, expected);
});


text:
//
//  MDCodeSyntacticSugar.h
//  iOS-Common-Demo
//
//  Created by 杨晨 on 2019/7/10.
//  Copyright © 2019 allride.ai. All rights reserved.
//

#ifndef MDCodeSyntacticSugar_h
#define MDCodeSyntacticSugar_h

#define elif else if

#define ifValueInCloseRange(min, v, max) if(MDValueInCloseRange(min, v, max))
#define ifValueInOpenRange(min, v, max) if(MDValueInOpenRange(min, v, max))
#define ifValueInLCRORange(min, v, max) if(MDValueInLCRORange(min, v, max))
#define ifValueInLORCRange(min, v, max) if(MDValueInLORCRange(min, v, max))

#define ifNotValueInCloseRange(min, v, max) if(!MDValueInCloseRange(min, v, max))
#define ifNotValueInOpenRange(min, v, max) if(!MDValueInOpenRange(min, v, max))
#define ifNotValueInLCRORange(min, v, max) if(!MDValueInLCRORange(min, v, max))
#define ifNotValueInLORCRange(min, v, max) if(!MDValueInLORCRange(min, v, max))

#define elifValueInCloseRange(min, v, max) else if(MDValueInCloseRange(min, v, max))
#define elifValueInOpenRange(min, v, max) else if(MDValueInOpenRange(min, v, max))
#define elifValueInLCRORange(min, v, max) else if(MDValueInLCRORange(min, v, max))
#define elifValueInLORCRange(min, v, max) else if(MDValueInLORCRange(min, v, max))

#define elifNotValueInCloseRange(min, v, max) else if(!MDValueInCloseRange(min, v, max))
#define elifNotValueInOpenRange(min, v, max) else if(!MDValueInOpenRange(min, v, max))
#define elifNotValueInLCRORange(min, v, max) else if(!MDValueInLCRORange(min, v, max))
#define elifNotValueInLORCRange(min, v, max) else if(!MDValueInLORCRange(min, v, max))

#define whileValueInCloseRange(min, v, max) while(MDValueInCloseRange(min, v, max))
#define whileValueInOpenRange(min, v, max) while(MDValueInOpenRange(min, v, max))
#define whileValueInLCRORange(min, v, max) while(MDValueInLCRORange(min, v, max))
#define whileValueInLORCRange(min, v, max) while(MDValueInLORCRange(min, v, max))

#define whileNotValueInCloseRange(min, v, max) while(!MDValueInCloseRange(min, v, max))
#define whileNotValueInOpenRange(min, v, max) while(!MDValueInOpenRange(min, v, max))
#define whileNotValueInLCRORange(min, v, max) while(!MDValueInLCRORange(min, v, max))
#define whileNotValueInLORCRange(min, v, max) while(!MDValueInLORCRange(min, v, max))

#define MDLogMethod NSLog(@"%s",__FUNCTION__)

static void md_blockCleanUp(__strong void(^*block)(void)) {
    (*block)();
}
#define onExitAt(__BLOCK_NAME__) \
    __strong void(^__BLOCK_NAME__)(void) __attribute__((cleanup(md_blockCleanUp), unused)) = ^

#define onExit onExitAt(_md_block_name_)

#endif /* MDCodeSyntacticSugar_h */


text:
const {
  assertSame, assertTrue
} = Assert;

// Require that the mandatory parameter to object literal setter syntax not have an overall default
// https://bugs.ecmascript.org/show_bug.cgi?id=3385

var o = {
  set property(value = null) {
    o._property = value;
  }
};

o.property = void 0;
assertSame(null, o._property);

o.property = null;
assertSame(null, o._property);

o.property = 0;
assertSame(0, o._property);


text:
using NAME.Core.Exceptions;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;

namespace NAME.Core.Utils
{
    /// <summary>
    /// Provides mechanisms to parse <see cref="DependencyVersion"/>s from strings.
    /// </summary>
    public static class DependencyVersionParser
    {
        /// <summary>
        /// The pattern to match a semver
        /// </summary>
        private const string Pattern = @"^((?<majorWildcard>\*)|(?<major>\d+)((?<minorWildcard>\.\*)|(\.(?<minor>\d+)((?<patchWildcard>\.\*)|(\.(?<patch>\d+)))?))?)$";

        /// <summary>
        /// The version matcher
        /// </summary>
        private static readonly Regex VersionMatcher = new Regex(Pattern, RegexOptions.Compiled | RegexOptions.Singleline);

        /// <summary>
        /// Parses a <see cref="DependencyVersion"/> from the specified version string.
        /// </summary>
        /// <param name="version">The version string.</param>
        /// <param name="acceptWildcards">if set to <c>true</c> the parsing will take into account wildcard parts and possibly return a <see cref="WildcardDependencyVersion"/>.</param>
        /// <returns>Returns a new instance of <see cref="DependencyVersion"/>.</returns>
        /// <exception cref="VersionParsingException">Happens when the version parts could not be parsed.</exception>
        public static DependencyVersion Parse(string version, bool acceptWildcards)
        {
            if (!TryParse(version, acceptWildcards, out DependencyVersion result))
                throw new VersionParsingException(version, $"The version ({version}) parts could not be parsed.");

            return result;
        }

        /// <summary>
        /// Tries to parse a <see cref="DependencyVersion" /> from the specified version string.
        /// </summary>
        /// <param name="version">The version.</param>
        /// <param name="acceptWildcards">if set to <c>true</c> the parsing will take into account wildcard parts and possibly return a <see cref="WildcardDependencyVersion"/>.</param>
        /// <param name="outVersion">The parsed version.</param>
        /// <returns>
        /// Returns true if the parsing was successfuly. Otherwise, returns false.
        /// </returns>
        /// <exception cref="NAMEException">The JSON returned from the service is not a valid manifest.</exception>
        public static bool TryParse(string version, bool acceptWildcards, out DependencyVersion outVersion)
        {
            outVersion = null;
            if (version == null)
                return false;

            var parsedVersion = ParseVersion(version);
            if (parsedVersion == null)
            {
                outVersion = default(DependencyVersion);
                return false;
            }

            if (!parsedVersion.Item1.HasValue || !parsedVersion.Item2.HasValue || !parsedVersion.Item3.HasValue)
            {
                if (acceptWildcards == false)
                    return false;
                if (!parsedVersion.Item1.HasValue)
                    outVersion = new WildcardDependencyVersion();
                else if (!parsedVersion.Item2.HasValue)
                    outVersion = new WildcardDependencyVersion(parsedVersion.Item1.Value);
                else
                    outVersion = new WildcardDependencyVersion(parsedVersion.Item1.Value, parsedVersion.Item2.Value);

                return true;
            }

            outVersion = new DependencyVersion(parsedVersion.Item1.Value, parsedVersion.Item2.Value, parsedVersion.Item3.Value);

            return true;
        }

        /// <summary>
        /// Parses the version.
        /// </summary>
        /// <param name="version">The version.</param>
        /// <returns>the parsed version as anonymous type</returns>
        private static Tuple<uint?, uint?, uint?> ParseVersion(string version)
        {
            var match = VersionMatcher.Match(version);

            if (!match.Success)
                return null;

            if (match.Groups["majorWildcard"].Success)
                return Tuple.Create<uint?, uint?, uint?>(null, null, null);

            uint major = ParseVersionValue(match.Groups[nameof(major)]);

            if (match.Groups["minorWildcard"].Success)
                return Tuple.Create<uint?, uint?, uint?>(major, null, null);

            uint minor = ParseVersionValue(match.Groups[nameof(minor)]);

            if (match.Groups["patchWildcard"].Success)
                return Tuple.Create<uint?, uint?, uint?>(major, minor, null);

            uint patch = ParseVersionValue(match.Groups[nameof(patch)]);
            // I dream the day multiple returns are a thing
            return Tuple.Create<uint?, uint?, uint?>(major, minor, patch);
        }

        /// <summary>
        /// Parses the version value.
        /// </summary>
        /// <param name="group">The regex group.</param>
        /// <returns>the parsed number</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        private static uint ParseVersionValue(Group group)
        {
            return group.Success ? uint.Parse(@group.Value) : 0u;
        }
    }
}


text:
/*
 *  Bootstrap Duallistbox - v4.0.2
 *  A responsive dual listbox widget optimized for Twitter Bootstrap. It works on all modern browsers and on touch devices.
 *  http://www.virtuosoft.eu/code/bootstrap-duallistbox/
 *
 *  Made by István Ujj-Mészáros
 *  Under Apache License v2.0 License
 */
.bootstrap-duallistbox-container .buttons {
  width: 100%;
  margin-bottom: -1px;
}

.bootstrap-duallistbox-container label {
  display: block;
}

.bootstrap-duallistbox-container .info {
  display: inline-block;
  margin-bottom: 5px;
  font-size: 11px;
}

.bootstrap-duallistbox-container .clear1,
.bootstrap-duallistbox-container .clear2 {
  display: none;
  font-size: 10px;
}

.bootstrap-duallistbox-container .box1.filtered .clear1,
.bootstrap-duallistbox-container .box2.filtered .clear2 {
  display: inline-block;
}

.bootstrap-duallistbox-container .move,
.bootstrap-duallistbox-container .remove {
  width: 50%;
  box-sizing: content-box;
}

.bootstrap-duallistbox-container .btn-group .btn {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.bootstrap-duallistbox-container:not(.moveonselect) select {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.bootstrap-duallistbox-container .moveall,
.bootstrap-duallistbox-container .removeall {
  width: 50%;
  box-sizing: content-box;
}

.bootstrap-duallistbox-container.bs2compatible .btn-group > .btn + .btn {
  margin-left: 0;
}

.bootstrap-duallistbox-container select {
  width: 100%;
  height: 300px;
  padding: 0;
}

.bootstrap-duallistbox-container .filter {
  display: inline-block;
  width: 100%;
  height: 31px;
  margin: 0 0 5px 0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.bootstrap-duallistbox-container .filter.placeholder {
  color: #aaa;
}

.bootstrap-duallistbox-container.moveonselect .move,
.bootstrap-duallistbox-container.moveonselect .remove {
  display:none;
}

.bootstrap-duallistbox-container.moveonselect .moveall,
.bootstrap-duallistbox-container.moveonselect .removeall {
  width: 100%;
}


text:
$(document).on("ready", main);

$("#checkTodos").change(function () {
      $("input:checkbox").prop('checked', $(this).prop("checked"));
  });

function main(){
	mostrarDatos("",1);
  mostrarDatos2("",1);

	$("input[name=busqueda]").keyup(function(){
		valorBuscar = $(this).val();
		mostrarDatos(valorBuscar,1);
	});

$("select[name=categoria]").change(function(){
		valorBuscar = $(this).val();
		mostrarDatos2(valorBuscar,1);
	});

}

function mostrarDatos2(valorBuscar){

	$.ajax({
		url : "http://localhost/empresa/CategoriaC/mostrarCat",
		type: "POST",
		data: {categoria: valorBuscar},
		dataType:"json",

		success:function(response){
      if(typeof response.cat == "object" ){
        filas = "";
        $.each(response.cat,function(key,item){
          filas+="
<input type='checkbox' id='check' value="+item.correo+">	"+item.contacto+"
"+item.correo+"
"+item.nombre_empresa+"
";
        });
        $("#tbclientes tbody").html(filas);

      }
      }
	});

}

function mostrarDatos(valorBuscar){

	$.ajax({
		url : "http://localhost/empresa/Cpersona/mostrar",
		type: "POST",
		data: {buscar: valorBuscar, categoria: valorBuscar},
		dataType:"json",
		success:function(response){
			filas = "";
			$.each(response.clientes,function(key,item){
				filas+="
<input type='checkbox' id='check' value="+item.correo+">	"+item.contacto+"
"+item.correo+"
"+item.nombre_empresa+"
";
			});
			$("#tbclientes tbody").html(filas);

		}
	});

}

function llenarDestino(){
    // Comprobar los checkbox seleccionados
    var seleccion = new Array();
	    $('input[type=checkbox][id=check]:checked').each(function() {
	      seleccion.push($(this).val());
	    });

	    //$("#email").val(seleccion);

	    $("#email").val( function( index, val ) {
	    return val + seleccion + ",";
			});

}


text:
<?php
if(!defined("IN_SA")) exit();
$db = new DBConnect;
$u = @$_GET['u'];
if($u)
{
	$u = mysql_real_escape_string($u);
	$q = mysql_query("SELECT * FROM users WHERE username='$u'");
	if(mysql_num_rows($q) > 0)
	{
		$f = mysql_fetch_array($q);
		$smarty->assign('profile_username',htmlspecialchars($f['username']));
		$smarty->assign('profile_date',$f['date']);
		$smarty->assign('profile_exists',true);
		$smarty->assign('profile_rank',$f['rank']);
		$smarty->assign('profile_rank_symbol',rankSymbol($f['rank']));
		$smarty->assign('profile_rank_string',rankString($f['rank']));
		$q = mysql_query("SELECT * FROM profile WHERE userid='{$f['userid']}'");
		$pf = array();
		while($p = mysql_fetch_array($q))
		{
			$pf[$p['field']] = $p['value'];
		}
		$avatar = (isset($pf['avatar'])) ? $pf['avatar'] : 'img/avatar.png';
		$smarty->assign('profile_avatar',$avatar);
	}
	else
	{
		none();
	}
}
else
{
	none();
}
function none()
{
	$smarty->assign('profile_username','');
	$smarty->assign('profile_exists',false);
}
function rankSymbol($rank)
{
	switch($rank)
	{
		case 100:
			return '$'; //'Staff'
			break;
		case 99:
			return '+'; //Admins
			break;
		case 98:
			return '£'; //Official Accounts
			break;
		case 97:
			return '^'; //Community Volunteers
			break;
		case 96:
			return '¢'; //Creative Team
			break;
		case 95:
			return '©'; //Policy Enforcement
			break;
		case 94:
			return '%'; //Prints Team
			break;
		case 93:
			return '°'; //Alumni
			break;
		case 92:
			return '`'; //Senior Member
			break;
		case 91:
			return '='; //Beta Tester
			break;
		case 90:
			return '*'; //Premium User
			break;
		case 2:
			return '~'; //Regular Member
			break;
		case 1:
		case 0:
			return '!'; //Banned Member/Deactivated Account
			break;
		default:
			return '?'; //I dunno
			break;
	}
}
function rankString($rank)
{
	switch($rank)
	{
		case 100:
			return 'StandArt Staff';
			break;
		case 99:
			return 'General Administrator';
			break;
		case 98:
			return 'Official Account';
			break;
		case 97:
			return 'Community Volunteer';
			break;
		case 96:
			return 'Creative Team';
			break;
		case 95:
			return 'Policy Enforcement';
			break;
		case 94:
			return 'Prints Team';
			break;
		case 93:
			return 'standardArt Alumni';
			break;
		case 92:
			return 'Senior Member';
			break;
		case 91:
			return 'Official Beta Tester';
			break;
		case 90:
			return 'Premium User';
			break;
		case 2:
			return 'Member';
			break;
		case 1:
			return 'Deactivated Member';
			break;
		case 0:
			return 'Banned Member';
			break;
		default:
			return '?';
			break;
	}
}
?>


text:
require 'tsort'
require 'distribot/plan'
require 'distribot/task'
require 'distribot/task_group'

module Distribot
  class TaskConfigError < StandardError; end

  def self.plan(name, &block)
    plan = Plan.new(name)
    plan.instance_eval(&block)
    Plan.all << plan
    plan
  end

end


text:
function imageThumbnailTag(ENV, uri, alt) {
  if (uri && btoa) {
    const base64 = btoa(uri);
    const uriEncoded = encodeURIComponent(base64);
    const url = `${ENV.IMAGES.host}/${uriEncoded}/thumbnail.jpg`;
    return `<img class="project-logo" src="${url}" alt="${alt}">`;
  }
}

export {
  imageThumbnailTag
};


text:
package extracells.render.model;

import net.minecraft.block.Block;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;

import org.lwjgl.opengl.GL11;

import extracells.tileentity.TileEntityCertusTank;

public class ModelCertusTank extends ModelBase
{
	ModelRenderer Shape1;

	public ModelCertusTank()
	{
		textureWidth = 64;
		textureHeight = 64;

		Shape1 = new ModelRenderer(this, 0, 0);
		Shape1.addBox(0F, 0F, 0F, 14, 16, 14);
		Shape1.setRotationPoint(-7F, -8F, -7F);
		Shape1.setTextureSize(textureWidth, textureHeight);
		Shape1.mirror = true;
		setRotation(Shape1, 0F, 0F, 0F);

	}

	public void render(float f)
	{
		Shape1.render(f);
	}

	public void renderOuterBlock(Block block, int x, int y, int z, RenderBlocks renderer, IBlockAccess world)
	{

		Tessellator tessellator = Tessellator.instance;
		boolean tankUp = world.getBlockTileEntity(x, y + 1, z) instanceof TileEntityCertusTank;
		boolean tankDown = world.getBlockTileEntity(x, y - 1, z) instanceof TileEntityCertusTank;
		int meta = 0;
		if (tankUp && tankDown)
			meta = 3;
		else if (tankUp)
			meta = 2;
		else if (tankDown)
			meta = 1;
		if (!tankDown)
		{
			tessellator.setNormal(0.0F, -1F, 0.0F);
			renderer.renderFaceYNeg(block, x, y, z, block.getIcon(0, 0));
		}
		if (!(tankUp))
		{
			tessellator.setNormal(0.0F, 1.0F, 0.0F);
			renderer.renderFaceYPos(block, x, y, z, block.getIcon(1, 0));
		}

		Icon sideIcon = block.getIcon(3, meta);
		tessellator.setNormal(0.0F, 0.0F, -1F);
		renderer.renderFaceZNeg(block, x, y, z, sideIcon);
		tessellator.setNormal(0.0F, 0.0F, 1.0F);
		renderer.renderFaceZPos(block, x, y, z, sideIcon);
		tessellator.setNormal(-1F, 0.0F, 0.0F);
		renderer.renderFaceXNeg(block, x, y, z, sideIcon);
		tessellator.setNormal(1.0F, 0.0F, 0.0F);
		renderer.renderFaceXPos(block, x, y, z, sideIcon);

	}

	public void renderInnerBlock(Block block, int x, int y, int z, RenderBlocks renderer, IBlockAccess world)
	{
		Tessellator tessellator = Tessellator.instance;
		boolean tankUp = world.getBlockTileEntity(x, y + 1, z) instanceof TileEntityCertusTank;
		boolean tankDown = world.getBlockTileEntity(x, y - 1, z) instanceof TileEntityCertusTank;
		int meta = 0;
		if (tankUp && tankDown)
			meta = 3;
		else if (tankUp)
			meta = 2;
		else if (tankDown)
			meta = 1;
		if (!tankDown)
		{
			tessellator.setNormal(0.0F, -1F, 0.0F);
			renderer.renderFaceYNeg(block, x, y + 0.001D, z, block.getIcon(0, 0));
		}
		if (!(tankUp))
		{
			tessellator.setNormal(0.0F, 1.0F, 0.0F);
			renderer.renderFaceYPos(block, x, y - 0.001D, z, block.getIcon(1, 0));
		}
		Icon sideIcon = block.getIcon(3, meta);
		tessellator.setNormal(0.0F, 0.0F, -1F);
		renderer.renderFaceZNeg(block, x, y, z + 0.001D, sideIcon);
		tessellator.setNormal(0.0F, 0.0F, 1.0F);
		renderer.renderFaceZPos(block, x, y, z - 0.001D, sideIcon);
		tessellator.setNormal(-1F, 0.0F, 0.0F);
		renderer.renderFaceXNeg(block, x + 0.001D, y, z, sideIcon);
		tessellator.setNormal(1.0F, 0.0F, 0.0F);
		renderer.renderFaceXPos(block, x - 0.001D, y, z, sideIcon);

	}

	public void renderFluid(TileEntity tileEntity, double x, double y, double z, RenderBlocks renderer)
	{
		Tessellator tessellator = Tessellator.instance;
		tessellator.setColorOpaque(255, 255, 255);
		if (tileEntity != null && ((TileEntityCertusTank) tileEntity).getTankInfo(ForgeDirection.UNKNOWN)[0].fluid != null)
		{
			Fluid storedFluid = ((TileEntityCertusTank) tileEntity).getRenderFluid();
			float scale = ((TileEntityCertusTank) tileEntity).getRenderScale();
			if (storedFluid != null && scale > 0)
			{
				GL11.glEnable(GL11.GL_BLEND);
				GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
				Block id = Block.blocksList[FluidRegistry.WATER.getBlockID()];
				Icon fluidIcon = storedFluid.getIcon();
				if (fluidIcon == null)
					fluidIcon = FluidRegistry.LAVA.getIcon();
				renderer.setRenderBounds(0.08F, 0.001F, 0.08F, 0.92, scale * 0.999F, 0.92F);
				tessellator.setNormal(0.0F, -1F, 0.0F);
				renderer.renderFaceYNeg(id, x, y, z, fluidIcon);
				tessellator.setNormal(0.0F, 1.0F, 0.0F);
				renderer.renderFaceYPos(id, x, y, z, fluidIcon);
				tessellator.setNormal(0.0F, 0.0F, -1F);
				renderer.renderFaceZNeg(id, x, y, z, fluidIcon);
				tessellator.setNormal(0.0F, 0.0F, 1.0F);
				renderer.renderFaceZPos(id, x, y, z, fluidIcon);
				tessellator.setNormal(-1F, 0.0F, 0.0F);
				renderer.renderFaceXNeg(id, x, y, z, fluidIcon);
				tessellator.setNormal(1.0F, 0.0F, 0.0F);
				renderer.renderFaceXPos(id, x, y, z, fluidIcon);
			}
		}
	}

	private void setRotation(ModelRenderer model, float x, float y, float z)
	{
		model.rotateAngleX = x;
		model.rotateAngleY = y;
		model.rotateAngleZ = z;
	}

}


text:
local cFunc = {};		-- Local Functions
local cSetting = {};	-- Local Settings

HudComponent_Ping = {};
HudComponent_Ping.__index = HudComponent_Ping;

--[[

]]

-- ///////////////////////////////
-- ///// New 				//////
-- ///// Returns: Object	//////
-- ///////////////////////////////

function HudComponent_Ping:New(...)
	local obj = setmetatable({}, {__index = self});
	if obj.Constructor then
		obj:Constructor(...);
	end
	return obj;
end

-- ///////////////////////////////
-- ///// Toggle		 		//////
-- ///// Returns:	void	//////
-- ///////////////////////////////

function HudComponent_Ping:Toggle(bBool)
	local component_name = "ping"

	if (bBool == nil) then
		hud.components[component_name].enabled = not (hud.components[component_name].enabled);
	else
		hud.components[component_name].enabled = bBool;
	end
end

-- ///////////////////////////////
-- ///// Render				//////
-- ///// Returns: void		//////
-- ///////////////////////////////

function HudComponent_Ping:Render()
	local component_name = "ping"

	local x, y = hud.components[component_name].sx, hud.components[component_name].sy;
	local w, h = hud.components[component_name].width*hud.components[component_name].zoom, hud.components[component_name].height*hud.components[component_name].zoom;

	local alpha = hud.components[component_name].alpha

	local ping = getPlayerPing(localPlayer)

	dxDrawImage(x, y, w, h, hud.pfade.images.."component_ping/background.png", 0, 0, 0, tocolor(0, 200, 200, alpha));

	dxDrawText("PING: "..ping.." MS", x, y, x+w, y+h, tocolor(200, 200, 200, alpha), 0.2*hud.components[component_name].zoom, hud.fonts.clock, "center", "center")

end

-- ///////////////////////////////
-- ///// Constructor 		//////
-- ///// Returns: void		//////
-- ///////////////////////////////

function HudComponent_Ping:Constructor(...)

-- 	outputDebugString("[CALLING] HudComponent_Ping: Constructor");
end

-- EVENT HANDLER --