text:
<?php
require "HipChat.php";

require "configuration.php";

//HipChat API token.
$hcToken = "hipchat_api_token";

// WHMCS panelinizde kullanicinin telefonun bulundugu alan id'si.
$fieldID = 5;

// HipChat'te kullacagimiz oda ismi
$roomName = 'HIPCHAT ROOM NAME';

// Mesaj gonderen ismi.
$from = 'BULUTFON';

// Karsilama menusu id'si
$welcome = 8;

// WHMCS admin paneli urlsi
$url = 'http://www.adres.com/admin/';

// Adresinizi korumak icin basit bir rasgele deger.Bu değeri url
// degerinize hash parametresi olarak eklemeniz gerek.
// Ornegin http://adresiniz.com/bulutfon.php?hash=rgLvnZ76TuPqakVkZFve
$hashValue = 'rgLvnZ76TuPqakVkZFve';

function json($array){
	header('Content-Type: application/json');
	die(json_encode($array));
}

// Bulutfon uzerinden bize gonderilen telefon numaralari ulke kodu ile gonderilmekte
// veritabanimizda telefon numaralarinin benzer formatta olmadini varsayarak
// gonderilen telefon numarasindan 90 ibaresini kaldiralim.
$caller = isset($_POST['caller']) ? ltrim($_POST['caller'],'90') : false;

// BulutfonXM icin panelleri uzerinde yetkilendirme secenegi olsada basit
// bir hash ile guvenligimizi biraz daha artirabiliriz.
$hash = isset($_GET['hash']) ? $_GET['hash'] : false;

if($hash!=$hashValue || !$caller) json(['error'=>'parameters missing']);

$conn = new PDO("mysql:host=localhost;dbname={$db_name}",$db_username,$db_password);

// Gonderilen veriye bfxm formatinda cevap vermemiz gerekmekte.
// Herhangi bir zincirleme islem( kullanicidan bir tusa basmasini istemek ) yapmayacagimizdan
// kullaniciyi karsilama menu grubuna yonlendirebilirz.
$cevap = array(
	"bfxm"=>array("version"=>1),
	"seq"=>array(
		array(
			"action"=>"dial",
			// 8 bizim yonlendirecegimiz grup numarasi.
			"args"=>array("destination"=>$welcome)
		)
	)
);

// WHMCS uzerinden telefon numarasina gore kullaniciyi bulalim.
$query = $conn->prepare("SELECT tblclients.id,
		tblclients.firstname,
		tblclients.lastname,
		tblcustomfieldsvalues.value AS telefon
	FROM tblcustomfieldsvalues
	LEFT JOIN tblclients ON tblclients.id=tblcustomfieldsvalues.relid
	WHERE tblcustomfieldsvalues.value LIKE ? AND tblcustomfieldsvalues.fieldid=?");

$query->execute(["%$caller%",$fieldID]);

$profile = $query->fetch(PDO::FETCH_OBJ);

if($profile){

	// Kullanicimiz varsa kullanicinin son 5 destek biletine ulasalim.
	$query = $conn->prepare("SELECT id,title FROM tbltickets WHERE userid=? AND status!='Closed' ORDER BY id DESC LIMIT 5");

	$query->execute([$profile->id]);

	$tickets= $query->fetchAll(PDO::FETCH_OBJ);

	$liste= "";

	if($tickets){
		$liste = "
";

		foreach($tickets as $p){
			$liste.="

 id}'>{$p->title}
";
		}

		$liste .="
";
	}

	$hc = new HipChat\HipChat($hcToken);

	$hc->message_room($roomName,$from,"{$profile->firstname}  {$profile->lastname}  ({$caller}) arıyor. {$liste}",true,'random');
}

json($cevap);

redpajama_set_name: RedPajamaGithub


text:
package br.com.musd.converter;

import javax.faces.component.UIComponent;
import javax.faces.component.UISelectItems;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;
import java.util.ArrayList;
import java.util.List;

@SuppressWarnings("unchecked")
@FacesConverter("objConverter")
public class ObjConverter implements Converter {

	public Object getAsObject(FacesContext facesContext, UIComponent uicomp,
			String value) {
		if (value == null || value.trim().isEmpty())
			return null;
		List<Object> items = new ArrayList<Object>();
		List<UIComponent> uicompList = uicomp.getChildren();
		for (UIComponent comp : uicompList)
			if (comp instanceof UISelectItems)
				items.addAll((List<Object>) ((UISelectItems) comp).getValue());
		Object item = null;
		for (Object each : items)
			if (each.toString().equals(value))
				item = each;
		return item;
	}

	public String getAsString(FacesContext facesContext, UIComponent uicomp,
			Object value) {
		if (value == null || value == "")
			return "";
		return value.toString();
	}

}


text:
package net.cloudkit.flowportal.infrastructure.utilities;

import java.io.UnsupportedEncodingException;

/**
 * Base64Encrypt.java
 *
 * @author hongquanli <hongquanli@qq.com>
 * @version 1.0 2014年1月2日 上午9:57:57
 */
public class Base64Encrypt {

    public static void main(String[] args) throws UnsupportedEncodingException {
        // System.out.println(new String(encode("Coffee".getBytes())));
        // System.out.println(new String(decodeBase64("".getBytes("UTF-8"))));
    }

    /**
     * Chunk size per RFC 2045 section 6.8.
     */
    public static final int CHUNK_SIZE = 76;

    /**
     * Chunk separator per RFC 2045 section 2.1.
     */
    public static final byte[] CHUNK_SEPARATOR = "\r\n".getBytes();

    /**
     * The base length.
     */
    public static final int BASELENGTH = 255;

    /**
     * Lookup length.
     */
    public static final int LOOKUPLENGTH = 64;

    /**
     * Used to calculate the number of bits in a byte.
     */
    public static final int EIGHTBIT = 8;

    /**
     * Used when encoding something which has fewer than 24 bits.
     */
    public static final int SIXTEENBIT = 16;

    /**
     * Used to determine how many bits data contains.
     */
    public static final int TWENTYFOURBITGROUP = 24;

    /**
     * Used to get the number of Quadruples.
     */
    public static final int FOURBYTE = 4;

    /**
     * Used to test the sign of a byte.
     */
    public static final int SIGN = -128;

    /**
     * Byte used to pad output.
     */
    public static final byte PAD = (byte) '=';

    // Create arrays to hold the base64 characters and a
    // lookup for base64 chars
    private static byte[] base64Alphabet = new byte[BASELENGTH];
    private static byte[] lookUpBase64Alphabet = new byte[LOOKUPLENGTH];

    // Populating the lookup and character arrays
    static {
        for (int i = 0; i < BASELENGTH; i++) {
            base64Alphabet[i] = (byte) -1;
        }
        for (int i = 'Z'; i >= 'A'; i--) {
            base64Alphabet[i] = (byte) (i - 'A');
        }
        for (int i = 'z'; i >= 'a'; i--) {
            base64Alphabet[i] = (byte) (i - 'a' + 26);
        }
        for (int i = '9'; i >= '0'; i--) {
            base64Alphabet[i] = (byte) (i - '0' + 52);
        }

        base64Alphabet['+'] = 62;
        base64Alphabet['/'] = 63;

        for (int i = 0; i <= 25; i++) {
            lookUpBase64Alphabet[i] = (byte) ('A' + i);
        }

        for (int i = 26, j = 0; i <= 51; i++, j++) {
            lookUpBase64Alphabet[i] = (byte) ('a' + j);
        }

        for (int i = 52, j = 0; i <= 61; i++, j++) {
            lookUpBase64Alphabet[i] = (byte) ('0' + j);
        }

        lookUpBase64Alphabet[62] = (byte) '+';
        lookUpBase64Alphabet[63] = (byte) '/';
    }

    /**
     * Decodes a byte[] containing containing characters in the Base64 alphabet.
     *
     * @param array A byte array containing Base64 character data
     * @return a byte array containing binary data
     */
    public static byte[] decode(byte[] array) {
        return decodeBase64(array);
    }

    /**
     * Decodes an Object using the base64 algorithm. This method is provided in order to satisfy the requirements of the Decoder interface, and will throw a DecoderException if the supplied object is not of type byte[].
     *
     * @param object Object to decode
     * @return An object (of type byte[]) containing the binary data which corresponds to the byte[] supplied.
     * @throws DecoderException if the parameter supplied is not of type byte[]
     */
    public static Object decode(Object object) throws DecoderException {
        if (!(object instanceof byte[])) {
            throw new DecoderException("Parameter supplied to Base64 decode is not a byte[]");
        }
        return decode((byte[]) object);
    }

    /**
     * Decodes Base64 data into octects
     *
     * @param base64Data Byte array containing Base64 data
     * @return Array containing decoded data.
     */
    public static byte[] decodeBase64(byte[] base64Data) {
        // RFC 2045 requires that we discard ALL non-Base64 characters
        base64Data = discardNonBase64(base64Data);

        // handle the edge case, so we don't have to worry about it later
        if (base64Data.length == 0) {
            return new byte[0];
        }

        int numberQuadruple = base64Data.length / FOURBYTE;
        byte decodedData[] = null;
        byte b1 = 0, b2 = 0, b3 = 0, b4 = 0, marker0 = 0, marker1 = 0;

        // Throw away anything not in base64Data

        int encodedIndex = 0;
        int dataIndex = 0;
        {
            // this sizes the output array properly - rlw
            int lastData = base64Data.length;
            // ignore the '=' padding
            while (base64Data[lastData - 1] == PAD) {
                if (--lastData == 0) {
                    return new byte[0];
                }
            }
            decodedData = new byte[lastData - numberQuadruple];
        }

        for (int i = 0; i < numberQuadruple; i++) {
            dataIndex = i * 4;
            marker0 = base64Data[dataIndex + 2];
            marker1 = base64Data[dataIndex + 3];

            b1 = base64Alphabet[base64Data[dataIndex]];
            b2 = base64Alphabet[base64Data[dataIndex + 1]];

            if (marker0 != PAD && marker1 != PAD) {
                // No PAD e.g 3cQl
                b3 = base64Alphabet[marker0];
                b4 = base64Alphabet[marker1];

                decodedData[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
                decodedData[encodedIndex + 1] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
                decodedData[encodedIndex + 2] = (byte) (b3 << 6 | b4);
            } else if (marker0 == PAD) {
                // Two PAD e.g. 3c[Pad][Pad]
                decodedData[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
            } else if (marker1 == PAD) {
                // One PAD e.g. 3cQ[Pad]
                b3 = base64Alphabet[marker0];

                decodedData[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
                decodedData[encodedIndex + 1] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
            }
            encodedIndex += 3;
        }
        return decodedData;
    }

    /**
     * Discards any characters outside of the base64 alphabet, per the requirements on page 25 of RFC 2045 - "Any characters outside of the base64 alphabet are to be ignored in base64 encoded data."
     *
     * @param data The base-64 encoded data to groom
     * @return The data, less non-base64 characters (see RFC 2045).
     */
    static byte[] discardNonBase64(byte[] data) {
        byte groomedData[] = new byte[data.length];
        int bytesCopied = 0;

        for (int i = 0; i < data.length; i++) {
            if (isBase64(data[i])) {
                groomedData[bytesCopied++] = data[i];
            }
        }

        byte packedData[] = new byte[bytesCopied];

        System.arraycopy(groomedData, 0, packedData, 0, bytesCopied);

        return packedData;
    }

    /**
     * Discards any whitespace from a base-64 encoded block.
     *
     * @param data The base-64 encoded data to discard the whitespace from.
     * @return The data, less whitespace (see RFC 2045).
     */
    static byte[] discardWhitespace(byte[] data) {
        byte groomedData[] = new byte[data.length];
        int bytesCopied = 0;

        for (int i = 0; i < data.length; i++) {
            switch (data[i]) {
                case (byte) ' ':
                case (byte) '\n':
                case (byte) '\r':
                case (byte) '\t':
                    break;
                default:
                    groomedData[bytesCopied++] = data[i];
            }
        }

        byte packedData[] = new byte[bytesCopied];

        System.arraycopy(groomedData, 0, packedData, 0, bytesCopied);

        return packedData;
    }

    /**
     * Encodes a byte[] containing binary data, into a byte[] containing characters in the Base64 alphabet.
     *
     * @param array a byte array containing binary data
     * @return A byte array containing only Base64 character data
     */
    public static byte[] encode(byte[] array) {
        return encodeBase64(array, false);
    }

    /**
     * Encodes an Object using the base64 algorithm. This method is provided in order to satisfy the requirements of the Encoder interface, and will throw an EncoderException if the supplied object is not of type byte[].
     *
     * @param object Object to encode
     * @return An object (of type byte[]) containing the base64 encoded data which corresponds to the byte[] supplied.
     * @throws EncoderException if the parameter supplied is not of type byte[]
     */
    public static Object encode(Object object) throws EncoderException {
        if (!(object instanceof byte[])) {
            throw new EncoderException("Parameter supplied to Base64 encode is not a byte[]");
        }
        return encode((byte[]) object);
    }

    /**
     * Encodes binary data using the base64 algorithm but does not chunk the output.
     *
     * @param binaryData binary data to encode
     * @return Base64 characters
     */
    public static byte[] encodeBase64(byte[] binaryData) {
        return encodeBase64(binaryData, false);
    }

    /**
     * Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks.
     *
     * @param binaryData Array containing binary data to encode.
     * @param isChunked if isChunked is true this encoder will chunk the base64 output into 76 character blocks
     * @return Base64-encoded data.
     */
    public static byte[] encodeBase64(byte[] binaryData, boolean isChunked) {
        int lengthDataBits = binaryData.length * EIGHTBIT;
        int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
        int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
        byte encodedData[] = null;
        int encodedDataLength = 0;
        int nbrChunks = 0;

        if (fewerThan24bits != 0) {
            // data not divisible by 24 bit
            encodedDataLength = (numberTriplets + 1) * 4;
        } else {
            // 16 or 8 bit
            encodedDataLength = numberTriplets * 4;
        }

        // If the output is to be "chunked" into 76 character sections,
        // for compliance with RFC 2045 MIME, then it is important to
        // allow for extra length to account for the separator(s)
        if (isChunked) {

            nbrChunks = (CHUNK_SEPARATOR.length == 0 ? 0 : (int) Math.ceil((float) encodedDataLength / CHUNK_SIZE));
            encodedDataLength += nbrChunks * CHUNK_SEPARATOR.length;
        }

        encodedData = new byte[encodedDataLength];

        byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;

        int encodedIndex = 0;
        int dataIndex = 0;
        int i = 0;
        int nextSeparatorIndex = CHUNK_SIZE;
        int chunksSoFar = 0;

        // log.debug("number of triplets = " + numberTriplets);
        for (i = 0; i < numberTriplets; i++) {
            dataIndex = i * 3;
            b1 = binaryData[dataIndex];
            b2 = binaryData[dataIndex + 1];
            b3 = binaryData[dataIndex + 2];

            // log.debug("b1= " + b1 +", b2= " + b2 + ", b3= " + b3);

            l = (byte) (b2 & 0x0f);
            k = (byte) (b1 & 0x03);

            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
            byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);

            encodedData[encodedIndex] = lookUpBase64Alphabet[val1];
            // log.debug( "val2 = " + val2 );
            // log.debug( "k4   = " + (k<<4) );
            // log.debug( "vak  = " + (val2 | (k<<4)) );
            encodedData[encodedIndex + 1] = lookUpBase64Alphabet[val2 | (k << 4)];
            encodedData[encodedIndex + 2] = lookUpBase64Alphabet[(l << 2) | val3];
            encodedData[encodedIndex + 3] = lookUpBase64Alphabet[b3 & 0x3f];

            encodedIndex += 4;

            // If we are chunking, let's put a chunk separator down.
            if (isChunked) {
                // this assumes that CHUNK_SIZE % 4 == 0
                if (encodedIndex == nextSeparatorIndex) {
                    System.arraycopy(CHUNK_SEPARATOR, 0, encodedData, encodedIndex, CHUNK_SEPARATOR.length);
                    chunksSoFar++;
                    nextSeparatorIndex = (CHUNK_SIZE * (chunksSoFar + 1)) + (chunksSoFar * CHUNK_SEPARATOR.length);
                    encodedIndex += CHUNK_SEPARATOR.length;
                }
            }
        }

        // form integral number of 6-bit groups
        dataIndex = i * 3;

        if (fewerThan24bits == EIGHTBIT) {
            b1 = binaryData[dataIndex];
            k = (byte) (b1 & 0x03);
            // log.debug("b1=" + b1);
            // log.debug("b1<<2 = " + (b1>>2) );
            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
            encodedData[encodedIndex] = lookUpBase64Alphabet[val1];
            encodedData[encodedIndex + 1] = lookUpBase64Alphabet[k << 4];
            encodedData[encodedIndex + 2] = PAD;
            encodedData[encodedIndex + 3] = PAD;
        } else if (fewerThan24bits == SIXTEENBIT) {

            b1 = binaryData[dataIndex];
            b2 = binaryData[dataIndex + 1];
            l = (byte) (b2 & 0x0f);
            k = (byte) (b1 & 0x03);

            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);

            encodedData[encodedIndex] = lookUpBase64Alphabet[val1];
            encodedData[encodedIndex + 1] = lookUpBase64Alphabet[val2 | (k << 4)];
            encodedData[encodedIndex + 2] = lookUpBase64Alphabet[l << 2];
            encodedData[encodedIndex + 3] = PAD;
        }

        if (isChunked) {
            // we also add a separator to the end of the final chunk.
            if (chunksSoFar < nbrChunks) {
                System.arraycopy(CHUNK_SEPARATOR, 0, encodedData, encodedDataLength - CHUNK_SEPARATOR.length, CHUNK_SEPARATOR.length);
            }
        }

        return encodedData;
    }

    /**
     * Encodes binary data using the base64 algorithm and chunks the encoded output into 76 character blocks
     *
     * @param binaryData binary data to encode
     * @return Base64 characters chunked in 76 character blocks
     */
    public static byte[] encodeBase64Chunked(byte[] binaryData) {
        return encodeBase64(binaryData, true);
    }

    // Implementation of the Encoder Interface

    /**
     * Tests a given byte array to see if it contains only valid characters within the Base64 alphabet.
     *
     * @param arrayOctect byte array to test
     * @return true if all bytes are valid characters in the Base64 alphabet or if the byte array is empty; false, otherwise
     */
    public static boolean isArrayByteBase64(byte[] arrayOctect) {

        arrayOctect = discardWhitespace(arrayOctect);

        int length = arrayOctect.length;
        if (length == 0) {
            // shouldn't a 0 length array be valid base64 data?
            // return false;
            return true;
        }
        for (int i = 0; i < length; i++) {
            if (!isBase64(arrayOctect[i])) {
                return false;
            }
        }
        return true;
    }

    private static boolean isBase64(byte octect) {
        if (octect == PAD) {
            return true;
        } else if (base64Alphabet[octect] == -1) {
            return false;
        } else {
            return true;
        }
    }
}

class DecoderException extends Exception {

    /**
     * Declares the Serial Version Uid.
     */
    private static final long serialVersionUID = 1L;

    /**
     * Constructs a new exception with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to {@link #initCause}.
     */
    public DecoderException() {
        super();
    }

    /**
     * Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to {@link #initCause}.
     *
     * @param message The detail message which is saved for later retrieval by the {@link #getMessage()} method.
     */
    public DecoderException(String message) {
        super(message);
    }

    /**
     * Constructsa new exception with the specified detail message and cause.
     *
     *

     * Note that the detail message associated with cause is not automatically incorporated into this exception's detail message.
     *

     *
     * @param message The detail message which is saved for later retrieval by the {@link #getMessage()} method.
     * @param cause The cause which is saved for later retrieval by the {@link #getCause()} method. A null value is permitted, and indicates that the cause is nonexistent or unknown.
     */
    public DecoderException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * Constructs a new exception with the specified cause and a detail message of (cause==null ?
     * null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for exceptions that are little more than wrappers for other throwables.
     *
     * @param cause The cause which is saved for later retrieval by the {@link #getCause()} method. A null value is permitted, and indicates that the cause is nonexistent or unknown.
     */
    public DecoderException(Throwable cause) {
        super(cause);
    }
}

class EncoderException extends Exception {

    /**
     * Declares the Serial Version Uid.
     */
    private static final long serialVersionUID = 1L;

    /**
     * Constructs a new exception with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to {@link #initCause}.
     *
     * @since 1.4
     */
    public EncoderException() {
        super();
    }

    /**
     * Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to {@link #initCause}.
     *
     * @param message a useful message relating to the encoder specific error.
     */
    public EncoderException(String message) {
        super(message);
    }

    /**
     * Constructs a new exception with the specified detail message and cause.
     *
     *

     * Note that the detail message associated with cause is not automatically incorporated into this exception's detail message.
     *

     *
     * @param message The detail message which is saved for later retrieval by the {@link #getMessage()} method.
     * @param cause The cause which is saved for later retrieval by the {@link #getCause()} method. A null value is permitted, and indicates that the cause is nonexistent or unknown.
     * @since 1.4
     */
    public EncoderException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * Constructs a new exception with the specified cause and a detail message of (cause==null ?
     * null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for exceptions that are little more than wrappers for other throwables.
     *
     * @param cause The cause which is saved for later retrieval by the {@link #getCause()} method. A null value is permitted, and indicates that the cause is nonexistent or unknown.
     * @since 1.4
     */
    public EncoderException(Throwable cause) {
        super(cause);
    }
}


text:
// CLASS HEADER
#include <dali-toolkit/internal/controls/scrollable/item-view/depth-layout.h>

// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/animation/constraint.h>
#include <algorithm>

// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout-property.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>

using namespace Dali;
using namespace Dali::Toolkit;

namespace // unnamed namespace
{
const unsigned int DEFAULT_NUMBER_OF_COLUMNS    = 3;
const float        DEFAULT_NUMBER_OF_ROWS       = 26.0f;
const float        DEFAULT_ROW_SPACING          = 55.0f;
const float        DEFAULT_BOTTOM_MARGIN_FACTOR = 0.2f;
const Radian       DEFAULT_TILT_ANGLE(Math::PI * 0.15f);
const Radian       DEFAULT_ITEM_TILT_ANGLE(-Math::PI * 0.025f);
const float        DEFAULT_SCROLL_SPEED_FACTOR           = 0.02f;
const float        DEFAULT_MAXIMUM_SWIPE_SPEED           = 50.0f;
const float        DEFAULT_ITEM_FLICK_ANIMATION_DURATION = 0.03f;

inline float GetColumnPosition(unsigned int numberOfColumns, unsigned int columnNumber, const Vector3& itemSize, float layoutWidth)
{
  // Share the available space between margins & column spacings
  float availableSpace = std::max(0.0f, (layoutWidth - itemSize.width * numberOfColumns));

  float leftMargin = availableSpace / numberOfColumns * 0.5f;

  float columnPosition = leftMargin + itemSize.width * 0.5f + columnNumber * (itemSize.width + availableSpace / numberOfColumns);

  return columnPosition - layoutWidth * 0.5f;
}

struct DepthPositionConstraint
{
  DepthPositionConstraint(unsigned int   itemId,
                          unsigned int   numberOfColumns,
                          unsigned int   columnNumber,
                          const Vector3& itemSize,
                          float          heightScale,
                          float          depthScale)
  : mItemSize(itemSize),
    mItemId(itemId),
    mNumberOfColumns(numberOfColumns),
    mColumnNumber(columnNumber),
    mHeightScale(heightScale),
    mDepthScale(depthScale)
  {
  }

  inline void Orientation0(Vector3& current, float layoutPosition, const Vector3& layoutSize)
  {
    float rowLayoutPositon = layoutPosition - static_cast<float>(mColumnNumber);

    current.x = GetColumnPosition(mNumberOfColumns, mColumnNumber, mItemSize, layoutSize.width);
    current.y = rowLayoutPositon * mHeightScale + layoutSize.height * 0.5f - DEFAULT_BOTTOM_MARGIN_FACTOR * layoutSize.height - mItemSize.height * 0.5f;
    current.z = -rowLayoutPositon * mDepthScale;
  }

  inline void Orientation90(Vector3& current, float layoutPosition, const Vector3& layoutSize)
  {
    float rowLayoutPositon = layoutPosition - static_cast<float>(mColumnNumber) + mNumberOfColumns * 0.5f;

    current.x = rowLayoutPositon * mHeightScale + layoutSize.width * 0.5f - DEFAULT_BOTTOM_MARGIN_FACTOR * layoutSize.width - mItemSize.height * 0.5f;
    current.y = -GetColumnPosition(mNumberOfColumns, mColumnNumber, mItemSize, layoutSize.height);
    current.z = -rowLayoutPositon * mDepthScale;
  }

  inline void Orientation180(Vector3& current, float layoutPosition, const Vector3& layoutSize)
  {
    float rowLayoutPositon = layoutPosition - static_cast<float>(mColumnNumber);

    current.x = -GetColumnPosition(mNumberOfColumns, mColumnNumber, mItemSize, layoutSize.width);
    current.y = -(rowLayoutPositon * mHeightScale + layoutSize.height * 0.5f - DEFAULT_BOTTOM_MARGIN_FACTOR * layoutSize.height - mItemSize.height * 0.5f);
    current.z = -rowLayoutPositon * mDepthScale;
  }

  inline void Orientation270(Vector3& current, float layoutPosition, const Vector3& layoutSize)
  {
    float rowLayoutPositon = layoutPosition - static_cast<float>(mColumnNumber) + mNumberOfColumns * 0.5f;

    current.x = -(rowLayoutPositon * mHeightScale + layoutSize.width * 0.5f - DEFAULT_BOTTOM_MARGIN_FACTOR * layoutSize.width - mItemSize.height * 0.5f);
    current.y = GetColumnPosition(mNumberOfColumns, mColumnNumber, mItemSize, layoutSize.height);
    current.z = -rowLayoutPositon * mDepthScale;
  }

  void Orientation0(Vector3& current, const PropertyInputContainer& inputs)
  {
    float          layoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
    const Vector3& layoutSize     = inputs[1]->GetVector3();
    Orientation0(current, layoutPosition, layoutSize);
  }

  void Orientation90(Vector3& current, const PropertyInputContainer& inputs)
  {
    float          layoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
    const Vector3& layoutSize     = inputs[1]->GetVector3();
    Orientation90(current, layoutPosition, layoutSize);
  }

  void Orientation180(Vector3& current, const PropertyInputContainer& inputs)
  {
    float          layoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
    const Vector3& layoutSize     = inputs[1]->GetVector3();
    Orientation180(current, layoutPosition, layoutSize);
  }

  void Orientation270(Vector3& current, const PropertyInputContainer& inputs)
  {
    float          layoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
    const Vector3& layoutSize     = inputs[1]->GetVector3();
    Orientation270(current, layoutPosition, layoutSize);
  }

  Vector3      mItemSize;
  unsigned int mItemId;
  unsigned int mNumberOfColumns;
  unsigned int mColumnNumber;
  float        mHeightScale;
  float        mDepthScale;
};

struct DepthRotationConstraint
{
  DepthRotationConstraint(Radian angleRadians, ControlOrientation::Type orientation)
  : mTiltAngle(angleRadians),
    mMultiplier(0.0f)
  {
    if(orientation == ControlOrientation::Up)
    {
      mMultiplier = 0.0f;
    }
    else if(orientation == ControlOrientation::Left)
    {
      mMultiplier = 1.5f;
    }
    else if(orientation == ControlOrientation::Down)
    {
      mMultiplier = -1.0f;
    }
    else // orientation == ControlOrientation::Right
    {
      mMultiplier = 0.5f;
    }
  }

  void operator()(Quaternion& current, const PropertyInputContainer& /* inputs */)
  {
    current = Quaternion(Radian(mMultiplier * Math::PI), Vector3::ZAXIS) * Quaternion(mTiltAngle, Vector3::XAXIS);
  }

  Radian mTiltAngle;
  float  mMultiplier;
};

struct DepthColorConstraint
{
  DepthColorConstraint(unsigned int itemId, unsigned int numberOfColumns, float numberOfRows, unsigned int columnNumber)
  : mItemId(itemId),
    mNumberOfColumns(numberOfColumns),
    mNumberOfRows(numberOfRows),
    mColumnNumber(columnNumber)
  {
  }

  void operator()(Vector4& current, const Dali::PropertyInputContainer& inputs)
  {
    float layoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
    float row            = (layoutPosition - static_cast<float>(mColumnNumber)) / mNumberOfColumns;

    float darkness(1.0f);
    float alpha(1.0f);

    if(row < 0.0f)
    {
      darkness = alpha = std::max(0.0f, 1.0f + row);
    }
    else
    {
      if(row > mNumberOfRows)
      {
        darkness = 0.0f;
      }
      else
      {
        darkness = 1.0f - (1.0f * (row / mNumberOfRows));
      }

      if(row > (mNumberOfRows - 1.0f))
      {
        alpha = std::max(0.0f, 1.0f - (row - (mNumberOfRows - 1.0f)));
      }
    }

    current.r = current.g = current.b = darkness;
    current.a *= alpha;
  }

  unsigned int mItemId;
  unsigned int mNumberOfColumns;
  float        mNumberOfRows;
  unsigned int mColumnNumber;
};

struct DepthVisibilityConstraint
{
  DepthVisibilityConstraint(unsigned int itemId, unsigned int numberOfColumns, float numberOfRows, unsigned int columnNumber)
  : mItemId(itemId),
    mNumberOfColumns(numberOfColumns),
    mNumberOfRows(numberOfRows),
    mColumnNumber(columnNumber)
  {
  }

  void operator()(bool& current, const Dali::PropertyInputContainer& inputs)
  {
    float layoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
    float row            = (layoutPosition - static_cast<float>(mColumnNumber)) / mNumberOfColumns;

    current = (row > -1.0f) && (row < mNumberOfRows);
  }

  unsigned int mItemId;
  unsigned int mNumberOfColumns;
  float        mNumberOfRows;
  unsigned int mColumnNumber;
};

} // unnamed namespace

namespace Dali
{
namespace Toolkit
{
namespace Internal
{
struct DepthLayout::Impl
{
  Impl()
  : mNumberOfColumns(DEFAULT_NUMBER_OF_COLUMNS),
    mNumberOfRows(DEFAULT_NUMBER_OF_ROWS),
    mRowSpacing(DEFAULT_ROW_SPACING),
    mTiltAngle(DEFAULT_TILT_ANGLE),
    mItemTiltAngle(DEFAULT_ITEM_TILT_ANGLE),
    mScrollSpeedFactor(DEFAULT_SCROLL_SPEED_FACTOR),
    mMaximumSwipeSpeed(DEFAULT_MAXIMUM_SWIPE_SPEED),
    mItemFlickAnimationDuration(DEFAULT_ITEM_FLICK_ANIMATION_DURATION)
  {
  }

  unsigned int mNumberOfColumns;
  unsigned int mNumberOfRows;

  float mRowSpacing;

  Radian mTiltAngle;
  Radian mItemTiltAngle;

  float mScrollSpeedFactor;
  float mMaximumSwipeSpeed;
  float mItemFlickAnimationDuration;
};

DepthLayoutPtr DepthLayout::New()
{
  return DepthLayoutPtr(new DepthLayout());
}

DepthLayout::~DepthLayout()
{
  delete mImpl;
}

void DepthLayout::SetNumberOfColumns(unsigned int columns)
{
  mImpl->mNumberOfColumns = columns;
}

unsigned int DepthLayout::GetNumberOfColumns() const
{
  return mImpl->mNumberOfColumns;
}

void DepthLayout::SetNumberOfRows(unsigned int rows)
{
  mImpl->mNumberOfRows = rows;
}

unsigned int DepthLayout::GetNumberOfRows() const
{
  return mImpl->mNumberOfRows;
}

void DepthLayout::SetRowSpacing(float spacing)
{
  mImpl->mRowSpacing = spacing;
}

float DepthLayout::GetRowSpacing() const
{
  return mImpl->mRowSpacing;
}

void DepthLayout::SetTiltAngle(Degree angle)
{
  mImpl->mTiltAngle = Degree(Clamp(angle, -45.0f, 45.0f));
}

Degree DepthLayout::GetTiltAngle() const
{
  return Degree(mImpl->mTiltAngle);
}

void DepthLayout::SetItemTiltAngle(Degree angle)
{
  mImpl->mItemTiltAngle = angle;
}

Degree DepthLayout::GetItemTiltAngle() const
{
  return Degree(mImpl->mItemTiltAngle);
}

void DepthLayout::SetScrollSpeedFactor(float scrollSpeed)
{
  mImpl->mScrollSpeedFactor = scrollSpeed;
}

void DepthLayout::SetMaximumSwipeSpeed(float speed)
{
  mImpl->mMaximumSwipeSpeed = speed;
}

void DepthLayout::SetItemFlickAnimationDuration(float durationSeconds)
{
  mImpl->mItemFlickAnimationDuration = durationSeconds;
}

float DepthLayout::GetScrollSpeedFactor() const
{
  return mImpl->mScrollSpeedFactor;
}

float DepthLayout::GetMaximumSwipeSpeed() const
{
  return mImpl->mMaximumSwipeSpeed;
}

float DepthLayout::GetItemFlickAnimationDuration() const
{
  return mImpl->mItemFlickAnimationDuration;
}

float DepthLayout::GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
{
  return static_cast<float>(mImpl->mNumberOfColumns) - static_cast<float>(numberOfItems);
}

float DepthLayout::GetClosestAnchorPosition(float layoutPosition) const
{
  float rowIndex = static_cast<float>(round(layoutPosition / mImpl->mNumberOfColumns));
  return rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
}

float DepthLayout::GetItemScrollToPosition(unsigned int itemId) const
{
  float rowIndex = static_cast<float>(itemId) / mImpl->mNumberOfColumns;
  return -rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
}

ItemRange DepthLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
{
  float firstRow = -(firstItemPosition / mImpl->mNumberOfColumns);
  float lastRow  = firstRow + mImpl->mNumberOfRows * 0.5f;

  unsigned int firstItem = static_cast<unsigned int>(std::max(0.0f, firstRow * mImpl->mNumberOfColumns));
  unsigned int lastItem  = static_cast<unsigned int>(std::max(0.0f, lastRow * mImpl->mNumberOfColumns));

  return ItemRange(firstItem, lastItem + 1);
}

unsigned int DepthLayout::GetReserveItemCount(Vector3 layoutSize) const
{
  float itemsWithinLayout = (layoutSize.depth * mImpl->mNumberOfColumns) / (cosf(mImpl->mTiltAngle) * mImpl->mRowSpacing);

  return static_cast<unsigned int>(itemsWithinLayout);
}

void DepthLayout::GetDefaultItemSize(unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize) const
{
  // 1x1 aspect ratio
  itemSize.width = itemSize.height = itemSize.depth = (IsVertical(GetOrientation()) ? layoutSize.width : layoutSize.height) / static_cast<float>(mImpl->mNumberOfColumns + 1);
}

Degree DepthLayout::GetScrollDirection() const
{
  Degree                   scrollDirection(0.0f);
  ControlOrientation::Type orientation = GetOrientation();

  if(orientation == ControlOrientation::Up)
  {
    scrollDirection = Degree(180.0f);
  }
  else if(orientation == ControlOrientation::Left)
  {
    scrollDirection = Degree(270.0f);
  }
  else if(orientation == ControlOrientation::Down)
  {
    scrollDirection = Degree(0.0f);
  }
  else // orientation == ControlOrientation::Right
  {
    scrollDirection = Degree(90.0f);
  }

  return scrollDirection;
}

void DepthLayout::ApplyConstraints(Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor)
{
  Dali::Toolkit::ItemView itemView = Dali::Toolkit::ItemView::DownCast(itemViewActor);
  if(itemView)
  {
    Vector3 itemSize;
    GetItemSize(itemId, layoutSize, itemSize);

    ControlOrientation::Type orientation = GetOrientation();

    // Position constraint
    Constraint              constraint;
    DepthPositionConstraint depthPositionStruct(itemId,
                                                mImpl->mNumberOfColumns,
                                                itemId % mImpl->mNumberOfColumns,
                                                itemSize,
                                                -sinf(mImpl->mTiltAngle) * mImpl->mRowSpacing,
                                                cosf(mImpl->mTiltAngle) * mImpl->mRowSpacing);
    if(orientation == ControlOrientation::Up)
    {
      constraint = Constraint::New<Vector3>(actor, Actor::Property::POSITION, depthPositionStruct, &DepthPositionConstraint::Orientation0);
    }
    else if(orientation == ControlOrientation::Left)
    {
      constraint = Constraint::New<Vector3>(actor, Actor::Property::POSITION, depthPositionStruct, &DepthPositionConstraint::Orientation90);
    }
    else if(orientation == ControlOrientation::Down)
    {
      constraint = Constraint::New<Vector3>(actor, Actor::Property::POSITION, depthPositionStruct, &DepthPositionConstraint::Orientation180);
    }
    else // orientation == ControlOrientation::Right
    {
      constraint = Constraint::New<Vector3>(actor, Actor::Property::POSITION, depthPositionStruct, &DepthPositionConstraint::Orientation270);
    }
    constraint.AddSource(ParentSource(Toolkit::ItemView::Property::LAYOUT_POSITION));
    constraint.AddSource(ParentSource(Actor::Property::SIZE));
    constraint.Apply();

    // Rotation constraint
    constraint = Constraint::New<Quaternion>(actor, Actor::Property::ORIENTATION, DepthRotationConstraint(mImpl->mItemTiltAngle, orientation));
    constraint.Apply();

    // Color constraint
    constraint = Constraint::New<Vector4>(actor, Actor::Property::COLOR, DepthColorConstraint(itemId, mImpl->mNumberOfColumns, mImpl->mNumberOfRows * 0.5f, itemId % mImpl->mNumberOfColumns));
    constraint.AddSource(ParentSource(Toolkit::ItemView::Property::LAYOUT_POSITION));
    constraint.SetRemoveAction(Dali::Constraint::DISCARD);
    constraint.Apply();

    // Visibility constraint
    constraint = Constraint::New<bool>(actor, Actor::Property::VISIBLE, DepthVisibilityConstraint(itemId, mImpl->mNumberOfColumns, mImpl->mNumberOfRows * 0.5f, itemId % mImpl->mNumberOfColumns));
    constraint.AddSource(ParentSource(Toolkit::ItemView::Property::LAYOUT_POSITION));
    constraint.SetRemoveAction(Dali::Constraint::DISCARD);
    constraint.Apply();
  }
}

void DepthLayout::SetDepthLayoutProperties(const Property::Map& properties)
{
  // Set any properties specified for DepthLayout.
  for(unsigned int idx = 0, mapCount = properties.Count(); idx < mapCount; ++idx)
  {
    KeyValuePair propertyPair = properties.GetKeyValue(idx);
    switch(DefaultItemLayoutProperty::Property(propertyPair.first.indexKey))
    {
      case DefaultItemLayoutProperty::DEPTH_COLUMN_NUMBER:
      {
        SetNumberOfColumns(propertyPair.second.Get<int>());
        break;
      }
      case DefaultItemLayoutProperty::DEPTH_ROW_NUMBER:
      {
        SetNumberOfRows(propertyPair.second.Get<int>());
        break;
      }
      case DefaultItemLayoutProperty::DEPTH_ROW_SPACING:
      {
        SetRowSpacing(propertyPair.second.Get<float>());
        break;
      }
      case DefaultItemLayoutProperty::DEPTH_MAXIMUM_SWIPE_SPEED:
      {
        SetMaximumSwipeSpeed(propertyPair.second.Get<float>());
        break;
      }
      case DefaultItemLayoutProperty::DEPTH_SCROLL_SPEED_FACTOR:
      {
        SetScrollSpeedFactor(propertyPair.second.Get<float>());
        break;
      }
      case DefaultItemLayoutProperty::DEPTH_TILT_ANGLE:
      {
        SetTiltAngle(Degree(Radian(propertyPair.second.Get<float>())));
        break;
      }
      case DefaultItemLayoutProperty::DEPTH_ITEM_TILT_ANGLE:
      {
        SetItemTiltAngle(Degree(Radian(propertyPair.second.Get<float>())));
        break;
      }
      case DefaultItemLayoutProperty::DEPTH_ITEM_FLICK_ANIMATION_DURATION:
      {
        SetItemFlickAnimationDuration(propertyPair.second.Get<float>());
        break;
      }
      default:
      {
        break;
      }
    }
  }
}

Vector3 DepthLayout::GetItemPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) const
{
  Vector3 itemPosition = Vector3::ZERO;

  const float heightScale = -sinf(mImpl->mTiltAngle) * mImpl->mRowSpacing;
  const float depthScale  = cosf(mImpl->mTiltAngle) * mImpl->mRowSpacing;

  Vector3 itemSize;
  GetItemSize(itemID, layoutSize, itemSize);
  DepthPositionConstraint  positionFunctor = DepthPositionConstraint(itemID,
                                                                    mImpl->mNumberOfColumns,
                                                                    itemID % mImpl->mNumberOfColumns,
                                                                    itemSize,
                                                                    heightScale,
                                                                    depthScale);
  ControlOrientation::Type orientation     = GetOrientation();
  if(orientation == ControlOrientation::Up)
  {
    positionFunctor.Orientation0(itemPosition, currentLayoutPosition + itemID, layoutSize);
  }
  else if(orientation == ControlOrientation::Left)
  {
    positionFunctor.Orientation90(itemPosition, currentLayoutPosition + itemID, layoutSize);
  }
  else if(orientation == ControlOrientation::Down)
  {
    positionFunctor.Orientation180(itemPosition, currentLayoutPosition + itemID, layoutSize);
  }
  else // orientation == ControlOrientation::Right
  {
    positionFunctor.Orientation270(itemPosition, currentLayoutPosition + itemID, layoutSize);
  }

  return itemPosition;
}

DepthLayout::DepthLayout()
: mImpl(NULL)
{
  mImpl = new Impl();
}

float DepthLayout::GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize)
{
  float scrollTo = currentLayoutPosition;
  float row      = (currentLayoutPosition + itemID - static_cast<float>(itemID % mImpl->mNumberOfColumns)) / mImpl->mNumberOfColumns;

  // Check whether item is not within viewable area
  if(row <= -1.0f)
  {
    scrollTo = GetItemScrollToPosition(itemID);
  }
  else if(row > mImpl->mNumberOfRows * 0.5f - 1.0f)
  {
    scrollTo = GetItemScrollToPosition(itemID) + (mImpl->mNumberOfRows - 1.0f) * 0.5f * mImpl->mNumberOfColumns;
  }

  return scrollTo;
}

int DepthLayout::GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled)
{
  switch(direction)
  {
    case Toolkit::Control::KeyboardFocus::LEFT:
    {
      itemID--;
      if(itemID < 0)
      {
        itemID = loopEnabled ? maxItems - 1 : 0;
      }
      break;
    }
    case Toolkit::Control::KeyboardFocus::UP:
    {
      itemID += mImpl->mNumberOfColumns;
      if(itemID >= maxItems)
      {
        itemID = loopEnabled ? 0 : itemID - mImpl->mNumberOfColumns;
      }
      break;
    }
    case Toolkit::Control::KeyboardFocus::RIGHT:
    {
      itemID++;
      if(itemID >= maxItems)
      {
        itemID = loopEnabled ? 0 : maxItems - 1;
      }
      break;
    }
    case Toolkit::Control::KeyboardFocus::DOWN:
    {
      itemID -= mImpl->mNumberOfColumns;
      if(itemID < 0)
      {
        itemID = loopEnabled ? itemID + maxItems : itemID + mImpl->mNumberOfColumns;
      }
      break;
    }
    default:
    {
      break;
    }
  }
  return itemID;
}

} // namespace Internal

} // namespace Toolkit

} // namespace Dali


text:
using UnityEngine;

namespace GracesGames._2DTileMapLevelEditor.Scripts {

	public class GridOverlay : MonoBehaviour {

		public static GridOverlay Instance;

		// Sizes of the grid
		private int _gridSizeX = 10;

		private int _gridSizeY = 10;
		private const int GridSizeZ = 0;

		// Steps taken when moving the grid
		public float SmallStep = 0.5f;

		// Steps to define the dimensions of each square
		public float LargeStep = 1;

		// Starting position
		public float StartX;

		public float StartY;
		public float StartZ;

		// Offsets
		private float _offsetX = -0.5f;

		private float _offsetY = -0.5f;

		// Material of the grid
		public Material LineMaterial;

		// Color of the grid
		public Color MainColor = new Color(1f, 1f, 1f, 1f);

		// Method to Instantiate the GridOverlay instance and keep it from destroying
		void Awake() {
			if (Instance == null) {
				Instance = this;
			} else if (Instance != this) {
				Destroy(gameObject);
			}
		}

		// Changes the width size of the grid
		public void SetGridSizeX(int x) {
			_gridSizeX = x;
		}

		// Changes the height size of the grid
		public void SetGridSizeY(int y) {
			_gridSizeY = y;
		}

		// Updates the dimensions per square with 0.5
		public void GridSizeUp() {
			LargeStep += 0.5f;
		}

		// Update the dimensions per square with -0.5
		public void GridSizeDown() {
			LargeStep -= 0.5f;
		}

		// Move the grid up by smallStep amount
		public void GridUp() {
			_offsetY += SmallStep;
		}

		// Move the grid down by smallStep amount
		public void GridDown() {
			_offsetY -= SmallStep;
		}

		// Move the grid left by smallStep amount
		public void GridLeft() {
			_offsetX -= SmallStep;
		}

		// Move the grid right by smallStep amount
		public void GridRight() {
			_offsetX += SmallStep;
		}

		// Draws the grid
		void OnPostRender() {
			// Make sure largeStep never <= 0, since then the program crashes
			LargeStep = Mathf.Max(LargeStep, 0.5f);
			// set the current material
			LineMaterial.SetPass(0);

			GL.Begin(GL.LINES);

			GL.Color(MainColor);

			//Layers
			for (float j = 0; j <= _gridSizeY; j += LargeStep) {
				//X axis lines
				for (float i = 0; i <= GridSizeZ; i += LargeStep) {
					GL.Vertex3(StartX + _offsetX, j + _offsetY, StartZ + i);
					GL.Vertex3(_gridSizeX + _offsetX, j + _offsetY, StartZ + i);
				}

				//Z axis lines
				for (float i = 0; i <= _gridSizeX; i += LargeStep) {
					GL.Vertex3(StartX + i + _offsetX, j + _offsetY, StartZ);
					GL.Vertex3(StartX + i + _offsetX, j + _offsetY, GridSizeZ);
				}
			}

			//Y axis lines
			for (float i = 0; i <= GridSizeZ; i += LargeStep) {
				for (float k = 0; k <= _gridSizeX; k += LargeStep) {
					GL.Vertex3(StartX + k + _offsetX, StartY + _offsetY, StartZ + i);
					GL.Vertex3(StartX + k + _offsetX, _gridSizeY + _offsetY, StartZ + i);
				}
			}

			GL.End();
		}
	}
}


text:
#import <Foundation/Foundation.h>

@class JavaScriptDocument;

@interface JavaScriptSyntaxChecker : NSObject
{
    NSTask* syntaxTask;
}

@property (nonatomic,assign) JavaScriptDocument* document;

- (void) checkText:(NSString*)text;

@end


text:
using BankManagementBO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BankManagementDAL;

namespace BankManagementBLL
{
    public class AccountBLL
    {
        long n;
        AccountDAL accountAdd = new AccountDAL();
        /// <summary>
        /// This method is used to add account details
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        public long AccountAdd(AccountBO account)
        {
            try
            {
                n = accountAdd.AccountInsert(account);

            }

            catch (Exception ex)
            {
                n = 0;
                throw ex;
            }

            return n;

        }

        /// <summary>
        /// This account is used to view account by id
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public List<AccountBO> ViewAccountById(long Id)
        {
            List<AccountBO> AllAccount = new List<AccountBO>();
            AccountDAL GetAllAccount = new AccountDAL();
            AllAccount = GetAllAccount.AccountViewById(Id);
            return AllAccount;
        }

        /// <summary>
        ///
        /// This method is used to deactivate/soft delete account
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeactiveAccount(long id)
        {
            AccountDAL Deactive = new AccountDAL();
            int n = 0;

            try
            {
                n = Deactive.DeactiveAccount(id);
            }
            catch (Exception ex)
            {
                n = -1;
                return n;
            }

            return n;

        }

        /// <summary>
        /// This method is used to view Account details
        /// </summary>
        /// <returns></returns>
        public List<AccountBO> AccountView()
        {
            List<AccountBO> AllAccount = new List<AccountBO>();
            AccountDAL GetAllAccount = new AccountDAL();
            AllAccount = GetAllAccount.ViewAccount();
            return AllAccount;
        }

        /// <summary>
        /// This method is used to view Account details by id
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public List<AccountBO> ViewAccountDetailsById(long Id)
        {
            List<AccountBO> AllAccountDetails = new List<AccountBO>();
            AccountDAL GetAllAccount = new AccountDAL();
            AllAccountDetails = GetAllAccount.ViewAccountDetailsById(Id);
            return AllAccountDetails;
        }

        /// <summary>
        /// This method is used to view Account status
        /// </summary>
        /// <returns></returns>
        public List<AccountBO> ViewAccountStatus()
        {
            List<AccountBO> AllAccountStatus= new List<AccountBO>();
            AccountDAL GetAllAccount = new AccountDAL();
            AllAccountStatus = GetAllAccount.ViewAccountStatus();
            return AllAccountStatus;
        }

    }
}


text:
import {Component,OnInit,Inject} from 'angular2/core';
import {Router} from 'angular2/router';
import {DataProviderService} from '../DataProviderService';
import {ListComponent} from '../list/list-abstract.component';
import {PlaceUtil} from './place-util';
@Component({
    selector: 'places-list',
    templateUrl:"app/list/list-template.html",
    styleUrls:["app/list/list.css"],
    pipes: []
})
export class PlacesComponent extends ListComponent implements OnInit {
  constructor(@Inject('DataProviderService')_dataProviderService: DataProviderService, _router: Router) {
    super(_dataProviderService,_router);
  }
  ngOnInit() {
    this.getValues();
  }
  protected getCreateMethodName():string{return "createPlace";};
  protected getValuesMethodName():string{return "getPlaces";};
  protected getDetailName():string{return "PlaceDetail";};
  protected getName(value:any):string{return PlaceUtil.getPlaceName(value);};
  protected getHeader():string{return "All Places";};
  protected getAddValue():string{return "Add Place";};
}


text:
require 'spec_helper'

describe BlueprintsBoy::Blueprint do
  describe '#initialize' do
    specify do
      expect(subject.name).to be_nil
      expect(subject.dependencies).to eq([]).and be_frozen
      expect(subject.attributes).to eq({}).and be_frozen
      expect(subject.factory_class).to be_nil
      expect(subject.strategies).to match(attributes: instance_of(Proc)).and be_frozen
    end
  end
end


text:
<?php

//May the help of God be with that who tries to understand this code.

namespace Controller;

class AboutController extends GenericController implements AboutControllerInterface {

	public function index() {

		$myView = new \View\AboutView();
		$myView->setAvatarLink($this->AvatarLink);
		$myView->initContent();
		echo $myView->run();
	}
}

?>


text:
namespace aXon.Warehouse.Modules.HR.Models
{
    public class EmployeeType : BaseDictionaryModel
    {
    }
}


text:
package scouter.javassist.compiler.ast;

import scouter.javassist.compiler.CompileError;

/**
 * The visitor pattern.
 *
 * @see ASTree#accept(Visitor)
 */
public class Visitor {
    public void atASTList(ASTList n) throws CompileError {}
    public void atPair(Pair n) throws CompileError {}

    public void atFieldDecl(FieldDecl n) throws CompileError {}
    public void atMethodDecl(MethodDecl n) throws CompileError {}
    public void atStmnt(Stmnt n) throws CompileError {}
    public void atDeclarator(Declarator n) throws CompileError {}

    public void atAssignExpr(AssignExpr n) throws CompileError {}
    public void atCondExpr(CondExpr n) throws CompileError {}
    public void atBinExpr(BinExpr n) throws CompileError {}
    public void atExpr(Expr n) throws CompileError {}
    public void atCallExpr(CallExpr n) throws CompileError {}
    public void atCastExpr(CastExpr n) throws CompileError {}
    public void atInstanceOfExpr(InstanceOfExpr n) throws CompileError {}
    public void atNewExpr(NewExpr n) throws CompileError {}

    public void atSymbol(Symbol n) throws CompileError {}
    public void atMember(Member n) throws CompileError {}
    public void atVariable(Variable n) throws CompileError {}
    public void atKeyword(Keyword n) throws CompileError {}
    public void atStringL(StringL n) throws CompileError {}
    public void atIntConst(IntConst n) throws CompileError {}
    public void atDoubleConst(DoubleConst n) throws CompileError {}
    public void atArrayInit(ArrayInit n) throws CompileError {}
}


text:
\hypertarget{struct_unix_unused_fd}{\section{Unix\-Unused\-Fd Struct Reference}
\label{dd/d77/struct_unix_unused_fd}\index{Unix\-Unused\-Fd@{Unix\-Unused\-Fd}}
}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item
int \hyperlink{struct_unix_unused_fd_a3f1a6127218af971aeb7b131c9c1600d}{fd}
\item
int \hyperlink{struct_unix_unused_fd_a744cd118bd91ec2019108e8205708684}{flags}
\item
\hyperlink{struct_unix_unused_fd}{Unix\-Unused\-Fd} $\ast$ \hyperlink{struct_unix_unused_fd_a6bbcba75beeabdd2df126638bc1d8bc0}{p\-Next}
\end{DoxyCompactItemize}

\subsection{Member Data Documentation}
\hypertarget{struct_unix_unused_fd_a3f1a6127218af971aeb7b131c9c1600d}{\index{Unix\-Unused\-Fd@{Unix\-Unused\-Fd}!fd@{fd}}
\index{fd@{fd}!UnixUnusedFd@{Unix\-Unused\-Fd}}
\subsubsection[{fd}]{\setlength{\rightskip}{0pt plus 5cm}int Unix\-Unused\-Fd\-::fd}}\label{dd/d77/struct_unix_unused_fd_a3f1a6127218af971aeb7b131c9c1600d}
\hypertarget{struct_unix_unused_fd_a744cd118bd91ec2019108e8205708684}{\index{Unix\-Unused\-Fd@{Unix\-Unused\-Fd}!flags@{flags}}
\index{flags@{flags}!UnixUnusedFd@{Unix\-Unused\-Fd}}
\subsubsection[{flags}]{\setlength{\rightskip}{0pt plus 5cm}int Unix\-Unused\-Fd\-::flags}}\label{dd/d77/struct_unix_unused_fd_a744cd118bd91ec2019108e8205708684}
\hypertarget{struct_unix_unused_fd_a6bbcba75beeabdd2df126638bc1d8bc0}{\index{Unix\-Unused\-Fd@{Unix\-Unused\-Fd}!p\-Next@{p\-Next}}
\index{p\-Next@{p\-Next}!UnixUnusedFd@{Unix\-Unused\-Fd}}
\subsubsection[{p\-Next}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Unix\-Unused\-Fd}$\ast$ Unix\-Unused\-Fd\-::p\-Next}}\label{dd/d77/struct_unix_unused_fd_a6bbcba75beeabdd2df126638bc1d8bc0}

The documentation for this struct was generated from the following file\-:\begin{DoxyCompactItemize}
\item
src/\hyperlink{unqlite_8c}{unqlite.\-c}\end{DoxyCompactItemize}


text:
package com.plugin.commons.service;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import android.app.IntentService;
import android.content.Intent;

import com.plugin.commons.ComApp;
import com.plugin.commons.CoreContants;
import com.plugin.commons.helper.ComUtil;
import com.plugin.commons.helper.DingLog;
import com.plugin.commons.helper.FuncUtil;
import com.plugin.commons.model.NewsInfoModel;
import com.plugin.commons.model.RspResultModel;
import com.zq.util.StCacheHelper;

public class ComService extends IntentService {
	DingLog log = new DingLog(ComService.class);
	public ComService() {
		super("ComService");
		log.debug("******************后台服务ComService******************");
	}

	@Override
	public void onCreate() {
		log.debug("******************后台服务onCreate******************");
		super.onCreate();
	}

	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		log.debug("******************后台服务onStartCommand******************");
		return super.onStartCommand(intent, flags, startId);
	}

	@SuppressWarnings("unchecked")
	@Override
	protected void onHandleIntent(Intent arg0) {
		// TODO Auto-generated method stub
		log.debug("service线程号:"+Thread.currentThread().getId());
		log.debug("******************后台服务正确进行中******************");
		Map<String,NewsInfoModel> newsView = null;
		NewsInfoModel ns=(NewsInfoModel) arg0.getExtras().get(CoreContants.PARAMS_NEWS);
		String type=(String) arg0.getExtras().get(CoreContants.PARAMS_TYPE);

		newsView = (Map<String, NewsInfoModel>) StCacheHelper.getCacheObj(ComApp.getInstance(), CoreContants.CACHE_ART_VIEW,"1");
		if(newsView==null){
			newsView=new HashMap<String, NewsInfoModel>();
		}
		if(ns!=null){
			NewsInfoModel tem = newsView.get(ns.getArttype()+"_"+ns.getId());
			if(tem!=null){
				if(!FuncUtil.isEmpty(ns.getArttype())){
					tem.setViewTimes(tem.getViewTimes()+1);
					newsView.put(ns.getArttype()+"_"+ns.getId(),tem);
				}else{
					log.debug("栏目id为空,不统计");
				}
			}else{
				if(!FuncUtil.isEmpty(ns.getArttype())){
					ns.setViewTimes(1);
					newsView.put(ns.getArttype()+"_"+ns.getId(),ns);
				}else{
					log.debug("栏目id为空,不统计");
				}
			}

			StCacheHelper.setCacheObj(ComApp.getInstance(), CoreContants.CACHE_ART_VIEW,"1", newsView);
		}

		if(newsView.size()>0){
			Iterator<Entry<String, NewsInfoModel>> iter = newsView.entrySet().iterator();
			Entry<String, NewsInfoModel> entry;
			int count=0;
			StringBuffer reqstr=new StringBuffer();
			while (iter.hasNext()) {
			    entry = iter.next();
			    count+=entry.getValue().getViewTimes();
			    if(entry.getValue().getViewTimes()>0){
			    	 reqstr.append(entry.getKey()).append("_").append(entry.getValue().getViewTimes()).append(",");
			    }
			}
			log.debug("统计数:"+count);
			if(CoreContants.PUSH_TYPE.equals(type)||count>=CoreContants.MAXREQ_TIMES){
				String req=reqstr.substring(0, reqstr.length()-1);
				log.debug("统计推送请求:"+req);
				RspResultModel rsp=ComApp.getInstance().getApi().pushArtViewTimes(req);
				if(ComUtil.checkRsp(ComApp.getInstance(), rsp,false)){
					log.debug("推送结果成功,删除缓存");
					newsView.clear();
					StCacheHelper.deleteCacheObj(ComApp.getInstance(), CoreContants.CACHE_ART_VIEW,"1");
				}else{
					log.debug("推送统计结果失败,下次继续");
				}
			}else{
				log.debug("不满足上送条件,待下次继续");
			}
		}else{
			log.debug("newsView.size()==0,不满足上送条件,待下次继续");
		}
	}

}


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

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
        xmlns:android="http://schemas.android.com/apk/res/android"
        id="co.c80.lab.cordova.EmailComposer"
        version="0.0.1">

    <name>EmailComposer</name>

    <description>Email Composer plugins for Cordova 3.x.x</description>
    <repo>https://github.com/cre80vty/CordovaEmailComposer.git</repo>
    <keywords>email, email intent, email composer, ios, android</keywords>
    <license>Apache 2.0</license>

    <author>Muyiwa Ibraheem</author>

    <engines>
        <engine name="cordova" version=">=3.0.0" />
    </engines>

    <!-- interface -->
    <js-module src="www/EmailComposer.js" name="EmailComposer">
        <clobbers target="plugin.email" />
    </js-module>

    <!-- ios -->
    <platform name="ios">
        <config-file target="config.xml" parent="/*">
		<feature name="EmailComposer">
			<param name="ios-package" value="EmailComposer"/>
		</feature>
        </config-file>

    	<header-file src="src/ios/EmailComposer.h" />
    	<source-file src="src/ios/EmailComposer.m" />

        <framework src="MessageUI.framework" weak="true" />
    </platform>

    <!-- android -->
    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="EmailComposer">
                <param name="android-package" value="co.c80.lab.cordova.EmailComposer"/>
            </feature>
        </config-file>

        <source-file src="src/android/EmailComposer.java" target-dir="src/co/c80/lab/cordova" />
    </platform>

</plugin>


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
 * @file persistence.h
 *
 * Persistence related commands, like put, get & remove
 */
#pragma once

#include <vespa/storageapi/messageapi/bucketinforeply.h>
#include <vespa/storageapi/defs.h>
#include <vespa/document/base/documentid.h>
#include <vespa/documentapi/messagebus/messages/testandsetcondition.h>

namespace document {
    class DocumentUpdate;
    class Document;
}
namespace storage::api {

using documentapi::TestAndSetCondition;
using DocumentSP = std::shared_ptr<document::Document>;

class TestAndSetCommand : public BucketInfoCommand {
    TestAndSetCondition _condition;
public:
    TestAndSetCommand(const MessageType & messageType, const document::Bucket &bucket);
    ~TestAndSetCommand() override;

    void setCondition(const TestAndSetCondition & condition) { _condition = condition; }
    const TestAndSetCondition & getCondition() const { return _condition; }

    /**
     * Uniform interface to get document id
     * Used by test and set to retrieve already existing document
     */
    virtual const document::DocumentId & getDocumentId() const = 0;
    virtual const document::DocumentType * getDocumentType() const { return nullptr; }
};

/**
 * @class PutCommand
 * @ingroup message
 *
 * @brief Command for adding a document to the storage system.
 */
class PutCommand : public TestAndSetCommand {
    DocumentSP _doc;
    Timestamp  _timestamp;
    Timestamp  _updateTimestamp;

public:
    PutCommand(const document::Bucket &bucket, const DocumentSP&, Timestamp);
    ~PutCommand() override;

    void setTimestamp(Timestamp ts) { _timestamp = ts; }

    /**
     * If set, this PUT will only update the header of an existing document,
     * rather than writing an entire new PUT. It will only perform the write if
     * there exists a document already with the given timestamp.
     */
    void setUpdateTimestamp(Timestamp ts) { _updateTimestamp = ts; }
    Timestamp getUpdateTimestamp() const { return _updateTimestamp; }

    const DocumentSP& getDocument() const { return _doc; }
    const document::DocumentId& getDocumentId() const override;
    Timestamp getTimestamp() const { return _timestamp; }
    const document::DocumentType * getDocumentType() const override;

    vespalib::string getSummary() const override;
    void print(std::ostream& out, bool verbose, const std::string& indent) const override;

    DECLARE_STORAGECOMMAND(PutCommand, onPut);
};

/**
 * @class PutReply
 * @ingroup message
 *
 * @brief Reply of a put command.
 */
class PutReply : public BucketInfoReply {
    document::DocumentId _docId;
    DocumentSP _document; // Not serialized
    Timestamp _timestamp;
    Timestamp _updateTimestamp;
    bool _wasFound;

public:
    explicit PutReply(const PutCommand& cmd, bool wasFound = true);
    ~PutReply() override;

    const document::DocumentId& getDocumentId() const { return _docId; }
    bool hasDocument() const { return _document.get(); }
    const DocumentSP& getDocument() const { return _document; }
    Timestamp getTimestamp() const { return _timestamp; };
    Timestamp getUpdateTimestamp() const { return _updateTimestamp; }

    bool wasFound() const { return _wasFound; }

    void print(std::ostream& out, bool verbose, const std::string& indent) const override;

    DECLARE_STORAGEREPLY(PutReply, onPutReply)
};

/**
 * @class UpdateCommand
 * @ingroup message
 *
 * @brief Command for updating a document to the storage system.
 */
class UpdateCommand : public TestAndSetCommand {
    std::shared_ptr<document::DocumentUpdate> _update;
    Timestamp _timestamp;
    Timestamp _oldTimestamp;

public:
    UpdateCommand(const document::Bucket &bucket,
                  const std::shared_ptr<document::DocumentUpdate>&, Timestamp);
    ~UpdateCommand() override;

    void setTimestamp(Timestamp ts) { _timestamp = ts; }
    void setOldTimestamp(Timestamp ts) { _oldTimestamp = ts; }

    const std::shared_ptr<document::DocumentUpdate>& getUpdate() const { return _update; }
    const document::DocumentId& getDocumentId() const override;
    Timestamp getTimestamp() const { return _timestamp; }
    Timestamp getOldTimestamp() const { return _oldTimestamp; }

    const document::DocumentType * getDocumentType() const override;
    vespalib::string getSummary() const override;

    void print(std::ostream& out, bool verbose, const std::string& indent) const override;

    DECLARE_STORAGECOMMAND(UpdateCommand, onUpdate);
};

/**
 * @class UpdateReply
 * @ingroup message
 *
 * @brief Reply of a update command.
 */
class UpdateReply : public BucketInfoReply {
    document::DocumentId _docId;
    Timestamp _timestamp;
    Timestamp _oldTimestamp;
    uint16_t _consistentNode;

public:
    UpdateReply(const UpdateCommand& cmd, Timestamp oldTimestamp = 0);
    ~UpdateReply() override;

    void setOldTimestamp(Timestamp ts) { _oldTimestamp = ts; }

    const document::DocumentId& getDocumentId() const { return _docId; }
    Timestamp getTimestamp() const { return _timestamp; }
    Timestamp getOldTimestamp() const { return _oldTimestamp; }

    bool wasFound() const { return (_oldTimestamp != 0); }

    void print(std::ostream& out, bool verbose, const std::string& indent) const override;

    /**
     * If this update was inconsistent (multiple different timestamps returned),
     * set the "best" node.
     */
    void setNodeWithNewestTimestamp(uint16_t node) { _consistentNode = node; }

    uint16_t getNodeWithNewestTimestamp() { return _consistentNode; }

    DECLARE_STORAGEREPLY(UpdateReply, onUpdateReply)
};

/**
 * @class GetCommand
 * @ingroup message
 *
 * @brief Command for returning a single document.
 *
 * Normally, the newest version of a document is retrieved. The timestamp can
 * be used to retrieve the newest copy, which is not newer than the given
 * timestamp.
 */
class GetCommand : public BucketInfoCommand {
    document::DocumentId _docId;
    Timestamp _beforeTimestamp;
    vespalib::string _fieldSet;
    InternalReadConsistency _internal_read_consistency;
public:
    GetCommand(const document::Bucket &bucket, const document::DocumentId&,
               vespalib::stringref fieldSet, Timestamp before = MAX_TIMESTAMP);
    ~GetCommand() override;
    void setBeforeTimestamp(Timestamp ts) { _beforeTimestamp = ts; }
    const document::DocumentId& getDocumentId() const { return _docId; }
    Timestamp getBeforeTimestamp() const { return _beforeTimestamp; }
    const vespalib::string& getFieldSet() const { return _fieldSet; }
    void setFieldSet(vespalib::stringref fieldSet) { _fieldSet = fieldSet; }
    InternalReadConsistency internal_read_consistency() const noexcept {
        return _internal_read_consistency;
    }
    void set_internal_read_consistency(InternalReadConsistency consistency) noexcept {
        _internal_read_consistency = consistency;
    }

    vespalib::string getSummary() const override;
    void print(std::ostream& out, bool verbose, const std::string& indent) const override;

    api::LockingRequirements lockingRequirements() const noexcept override {
        return api::LockingRequirements::Shared;
    }

    DECLARE_STORAGECOMMAND(GetCommand, onGet)
};

/**
 * @class GetReply
 * @ingroup message
 *
 * @brief Reply for a get command.
 */
class GetReply : public BucketInfoReply {
    document::DocumentId _docId; // In case of not found, we want id still
    vespalib::string _fieldSet;
    DocumentSP _doc; // Null pointer if not found
    Timestamp _beforeTimestamp;
    Timestamp _lastModifiedTime;
    bool _had_consistent_replicas;
    bool _is_tombstone;
public:
    explicit GetReply(const GetCommand& cmd,
                      const DocumentSP& doc = DocumentSP(),
                      Timestamp lastModified = 0,
                      bool had_consistent_replicas = false,
                      bool is_tombstone = false);

    ~GetReply() override;

    const DocumentSP& getDocument() const { return _doc; }
    const document::DocumentId& getDocumentId() const { return _docId; }
    const vespalib::string& getFieldSet() const { return _fieldSet; }

    Timestamp getLastModifiedTimestamp() const noexcept { return _lastModifiedTime; }
    Timestamp getBeforeTimestamp() const noexcept { return _beforeTimestamp; }

    [[nodiscard]] bool had_consistent_replicas() const noexcept { return _had_consistent_replicas; }
    [[nodiscard]] bool is_tombstone() const noexcept { return _is_tombstone; }

    bool wasFound() const { return (_doc.get() != nullptr); }
    void print(std::ostream& out, bool verbose, const std::string& indent) const override;
    DECLARE_STORAGEREPLY(GetReply, onGetReply)
};

/**
 * @class RemoveCommand
 * @ingroup message
 *
 * @brief Command for removing a document.
 */
class RemoveCommand : public TestAndSetCommand {
    document::DocumentId _docId;
    Timestamp _timestamp;

public:
    RemoveCommand(const document::Bucket &bucket, const document::DocumentId& docId, Timestamp timestamp);
    ~RemoveCommand() override;

    void setTimestamp(Timestamp ts) { _timestamp = ts; }
    const document::DocumentId& getDocumentId() const override { return _docId; }
    Timestamp getTimestamp() const { return _timestamp; }
    vespalib::string getSummary() const override;
    void print(std::ostream& out, bool verbose, const std::string& indent) const override;
    DECLARE_STORAGECOMMAND(RemoveCommand, onRemove)
};

/**
 * @class RemoveReply
 * @ingroup message
 *
 * @brief Reply for a remove command.
 */
class RemoveReply : public BucketInfoReply {
    document::DocumentId _docId;
    Timestamp _timestamp;
    Timestamp _oldTimestamp;
public:
    explicit RemoveReply(const RemoveCommand& cmd, Timestamp oldTimestamp = 0);
    ~RemoveReply() override;

    const document::DocumentId& getDocumentId() const { return _docId; }
    Timestamp getTimestamp() { return _timestamp; };
    Timestamp getOldTimestamp() const { return _oldTimestamp; }
    void setOldTimestamp(Timestamp oldTimestamp) { _oldTimestamp = oldTimestamp; }
    bool wasFound() const { return (_oldTimestamp != 0); }
    void print(std::ostream& out, bool verbose, const std::string& indent) const override;
    DECLARE_STORAGEREPLY(RemoveReply, onRemoveReply)
};

/**
 * @class RevertCommand
 * @ingroup message
 *
 * @brief Command for reverting a write or remove operation.
 */
class RevertCommand : public BucketInfoCommand {
    std::vector<Timestamp> _tokens;
public:
    RevertCommand(const document::Bucket &bucket,
                  const std::vector<Timestamp>& revertTokens);
    ~RevertCommand() override;
    const std::vector<Timestamp>& getRevertTokens() const { return _tokens; }
    void print(std::ostream& out, bool verbose, const std::string& indent) const override;
    DECLARE_STORAGECOMMAND(RevertCommand, onRevert)
};

/**
 * @class RevertReply
 * @ingroup message
 *
 * @brief Reply for a revert command.
 */
class RevertReply : public BucketInfoReply {
    std::vector<Timestamp> _tokens;
public:
    explicit RevertReply(const RevertCommand& cmd);
    ~RevertReply() override;
    const std::vector<Timestamp>& getRevertTokens() const { return _tokens; }
    void print(std::ostream& out, bool verbose, const std::string& indent) const override;
    DECLARE_STORAGEREPLY(RevertReply, onRevertReply)
};

}


text:
title: "arduino"
bg: red
color: white
fa-icon: rocket
---

### Arduino informatie
{: .left}

Arduino is een opensource-computerplatform dat is opgebouwd rond de ATmega168-microcontroller van Atmel en het softwareontwikkelplatform Processing. Dit platform is bedoeld voor hobbyisten, artiesten, kunstenaars en iedereen die geïnteresseerd is in het maken en ontwerpen van slimme en creatieve objecten die kunnen reageren op hun omgeving.

Met Arduino is het mogelijk apparaten en objecten te creëren die reageren op hun omgeving door middel van digitale en analoge inputsignalen. Op basis van deze input kan een Arduinoschakeling autonome actie initiëren door het afgeven van digitale en analoge outputsignalen. Input kan bijvoorbeeld worden gegenereerd door schakelaars, lichtsensoren, bewegingsmeters, afstandsmeters, temperatuursensoren, of op basis van commando's afkomstig van internet, een radiomodule of een ander apparaat met een seriële interface. Outputsignalen kunnen bijvoorbeeld motoren, lampjes, pompjes en beeldschermen aansturen, maar ook input genereren voor een andere Arduinomodule.

Daarnaast bestaan ook zogenaamde "shields". Deze integreren vaak verschillende sensoren en modules in één printplaat. Deze kan dan gemakkelijk op de Arduino aangesloten worden door hem te plaatsen op de input-/outputpinnen van de Arduino. Vele van deze shields worden verkocht als kit en dienen dus zelf nog gesoldeerd te worden. Veelvoorkomend zijn de wifi- en gps-kits. Naast deze kits kan ook een ProtoShield gekocht worden die dienstdoet als breadboard om op te experimenteren.


text:
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Text.RegularExpressions;

using Microsoft.Recognizers.Definitions.Chinese;

namespace Microsoft.Recognizers.Text.Number.Chinese
{
    public class IntegerExtractor : BaseNumberExtractor
    {
        internal sealed override ImmutableDictionary<Regex, string> Regexes { get; }

        protected sealed override string ExtractType { get; } = Constants.SYS_NUM_INTEGER;

        public IntegerExtractor(ChineseNumberMode mode = ChineseNumberMode.Default)
        {
            var regexes = new Dictionary<Regex, string>()
            {
                {
                    // 123456,  -123456
                    new Regex(NumbersDefinitions.NumbersSpecialsChars, RegexOptions.IgnoreCase | RegexOptions.Singleline)
                    , "IntegerNum"
                },
                {
                    //15k,  16 G
                    new Regex(NumbersDefinitions.NumbersSpecialsCharsWithSuffix, RegexOptions.Singleline)
                    , "IntegerNum"
                },
                {
                    //1,234,  2,332,111
                    new Regex(NumbersDefinitions.DottedNumbersSpecialsChar, RegexOptions.IgnoreCase | RegexOptions.Singleline),
                    "IntegerNum"
                },
                {
                    //半百  半打
                    new Regex(NumbersDefinitions.NumbersWithHalfDozen, RegexOptions.Singleline)
                    , "IntegerChs"
                },
                {
                    //一打  五十打
                    new Regex(NumbersDefinitions.NumbersWithDozen, RegexOptions.Singleline)
                    , "IntegerChs"
                }
            };
            switch (mode)
            {
                case ChineseNumberMode.Default:
                    //一百五十五,  负一亿三百二十二, avoid 五十五点五个百分点
                    regexes.Add(
                        new Regex(NumbersDefinitions.NumbersWithoutPercent, RegexOptions.Singleline),
                        "IntegerChs");
                    break;
                case ChineseNumberMode.ExtractAll:
                    //一百五十五,  负一亿三百二十二, avoid 五十五点五个百分点
                    regexes.Add(
                        new Regex(NumbersDefinitions.NumbersWithPercent, RegexOptions.Singleline),
                        "IntegerChs");
                    break;
            }

            Regexes = regexes.ToImmutableDictionary();
        }
    }
}


text:
package football;

public abstract class  Acteur {
	protected final String nom;
	protected final String prenom;
	protected int age;

	abstract double getSalaire();

	public Acteur(String nom, String prenom, int age){
		this.nom = nom;
		this.prenom = prenom;
		this.age = age;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getNom() {
		return nom;
	}

	@Override
	public String toString() {
		return "Acteur [nom=" + nom + ", prenom=" + prenom + ", age=" + age
				+ "]";
	}

	public String getPrenom() {
		return prenom;
	}

}


text:
package org.jetbrains.jps;

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.EmptyRunnable;

import java.util.concurrent.TimeUnit;

public final class TimingLog {
  public static final Logger LOG = Logger.getInstance(TimingLog.class);

  public static Runnable startActivity(final String name) {
    if (!LOG.isDebugEnabled()) {
      return EmptyRunnable.INSTANCE;
    }

    long start = System.nanoTime();
    return () -> LOG.debug(name + " in " + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start) + "ms");
  }
}


text:
// Copyright 2007-2016 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
namespace MassTransit.Containers.Tests
{
    using System;
    using System.Threading.Tasks;
    using Autofac;
    using NUnit.Framework;
    using Scenarios;
    using Shouldly;
    using TestFramework;
    using Testing;

    [TestFixture]
    public class AutofacContainer_Setup :
        AsyncTestFixture
    {
        [Test]
        public async Task Should_work_with_lifecycle_managed_bus()
        {
            var bus = _container.Resolve<IBusControl>();

            BusHandle busHandle = await bus.StartAsync();
            try
            {
                ISendEndpoint endpoint = await bus.GetSendEndpoint(new Uri("loopback://localhost/input_queue"));

                const string name = "Joe";

                await endpoint.Send(new SimpleMessageClass(name));

                SimpleConsumer lastConsumer = await SimpleConsumer.LastConsumer;
                lastConsumer.ShouldNotBe(null);

                SimpleMessageInterface last = await lastConsumer.Last;
                last.Name
                    .ShouldBe(name);

                bool wasDisposed = await lastConsumer.Dependency.WasDisposed;
                wasDisposed
                    .ShouldBe(true); //Dependency was not disposed");

                lastConsumer.Dependency.SomethingDone
                    .ShouldBe(true); //Dependency was disposed before consumer executed");
            }
            finally
            {
                await busHandle.StopAsync();
            }
        }

        public AutofacContainer_Setup()
            : base(new InMemoryTestHarness())
        {
        }

        IContainer _container;

        [OneTimeSetUp]
        public void Setup()
        {
            var builder = new ContainerBuilder();

            builder.RegisterModule<BusModule>();
            builder.RegisterModule<ConsumerModule>();

            _container = builder.Build();
        }

        class ConsumerModule :
            Module
        {
            protected override void Load(ContainerBuilder builder)
            {
                builder.RegisterType<SimpleConsumer>();
                builder.RegisterType<SimpleConsumerDependency>()
                    .As<ISimpleConsumerDependency>();
                builder.RegisterType<AnotherMessageConsumerImpl>()
                    .As<AnotherMessageConsumer>();
            }
        }

        class BusModule :
            Module
        {
            protected override void Load(ContainerBuilder builder)
            {
                builder.Register(context =>
                {
                    return Bus.Factory.CreateUsingInMemory(x => x.ReceiveEndpoint("input_queue", e => e.LoadFrom(context)));
                })
                    .As<IBus>()
                    .As<IBusControl>()
                    .OnRelease(control => control.Stop())
                    .SingleInstance();
            }
        }

        [OneTimeTearDown]
        public void Teardown()
        {
            _container.Dispose();
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>SVMAttributeEval</title>
<meta name="date" content="2014-12-16">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

weka.attributeSelection

Class SVMAttributeEval

java.lang.Object

weka.attributeSelection.ASEvaluation

weka.attributeSelection.SVMAttributeEval

All Implemented Interfaces:

java.io.Serializable, AttributeEvaluator, CapabilitiesHandler, OptionHandler, RevisionHandler, TechnicalInformationHandler

public class SVMAttributeEval
extends ASEvaluation
implements AttributeEvaluator, OptionHandler, TechnicalInformationHandler

 SVMAttributeEval :

 Evaluates the worth of an attribute by using an SVM classifier. Attributes are ranked by the square of the weight assigned by the SVM. Attribute selection for multiclass problems is handled by ranking attributes for each class seperately using a one-vs-all method and then "dealing" from the top of each pile to give a final ranking.

 For more information see:

 I. Guyon, J. Weston, S. Barnhill, V. Vapnik (2002). Gene selection for cancer classification using support vector machines. Machine Learning. 46:389-422.

 BibTeX:

 @article{Guyon2002,
    author = {I. Guyon and J. Weston and S. Barnhill and V. Vapnik},
    journal = {Machine Learning},
    pages = {389-422},
    title = {Gene selection for cancer classification using support vector machines},
    volume = {46},
    year = {2002}
 }

 Valid options are:

 -X <constant rate of elimination>
  Specify the constant rate of attribute
  elimination per invocation of
  the support vector machine.
  Default = 1.

 -Y <percent rate of elimination>
  Specify the percentage rate of attributes to
  elimination per invocation of
  the support vector machine.
  Trumps constant rate (above threshold).
  Default = 0.

 -Z <threshold for percent elimination>
  Specify the threshold below which
  percentage attribute elimination
  reverts to the constant method.

 -P <epsilon>
  Specify the value of P (epsilon
  parameter) to pass on to the
  support vector machine.
  Default = 1.0e-25

 -T <tolerance>
  Specify the value of T (tolerance
  parameter) to pass on to the
  support vector machine.
  Default = 1.0e-10

 -C <complexity>
  Specify the value of C (complexity
  parameter) to pass on to the
  support vector machine.
  Default = 1.0

 -N
  Whether the SVM should 0=normalize/1=standardize/2=neither.
  (default 0=normalize)

Version:

$Revision: 1.28 $

Author:

Eibe Frank (eibe@cs.waikato.ac.nz), Mark Hall (mhall@cs.waikato.ac.nz), Kieran Holland

See Also:

Serialized Form

Constructor Summary

Constructors

Constructor and Description

SVMAttributeEval()

Constructor

Method Summary

Methods

Modifier and Type
Method and Description

java.lang.String
attsToEliminatePerIterationTipText()

Returns a tip text for this property suitable for display in the
 GUI

void
buildEvaluator(Instances data)

Initializes the evaluator.

java.lang.String
complexityParameterTipText()

Returns a tip text for this property suitable for display in the
 GUI

java.lang.String
epsilonParameterTipText()

Returns a tip text for this property suitable for display in the
 GUI

double
evaluateAttribute(int attribute)

Evaluates an attribute by returning the rank of the square of its coefficient in a
 linear support vector machine.

java.lang.String
filterTypeTipText()

Returns a tip text for this property suitable for display in the
 GUI

int
getAttsToEliminatePerIteration()

Get the constant rate of attribute elimination per iteration

Capabilities
getCapabilities()

Returns the capabilities of this evaluator.

double
getComplexityParameter()

Get the value of C used with SMO

double
getEpsilonParameter()

Get the value of P used with SMO

SelectedTag
getFilterType()

Get the filtering mode passed to SMO

java.lang.String[]
getOptions()

Gets the current settings of SVMAttributeEval

int
getPercentThreshold()

Get the threshold below which percentage elimination reverts to
 constant elimination.

int
getPercentToEliminatePerIteration()

Get the percentage rate of attribute elimination per iteration

java.lang.String
getRevision()

Returns the revision string.

TechnicalInformation
getTechnicalInformation()

Returns an instance of a TechnicalInformation object, containing
 detailed information about the technical background of this class,
 e.g., paper reference or book this class is based on.

double
getToleranceParameter()

Get the value of T used with SMO

java.lang.String
globalInfo()

Returns a string describing this attribute evaluator

java.util.Enumeration
listOptions()

Returns an enumeration describing all the available options

static void
main(java.lang.String[] args)

Main method for testing this class.

java.lang.String
percentThresholdTipText()

Returns a tip text for this property suitable for display in the
 GUI

java.lang.String
percentToEliminatePerIterationTipText()

Returns a tip text for this property suitable for display in the
 GUI

void
setAttsToEliminatePerIteration(int cRate)

Set the constant rate of attribute elimination per iteration

void
setComplexityParameter(double svmC)

Set the value of C for SMO

void
setEpsilonParameter(double svmP)

Set the value of P for SMO

void
setFilterType(SelectedTag newType)

The filtering mode to pass to SMO

void
setOptions(java.lang.String[] options)

Parses a given list of options.

void
setPercentThreshold(int pThresh)

Set the threshold below which percentage elimination reverts to
 constant elimination.

void
setPercentToEliminatePerIteration(int pRate)

Set the percentage of attributes to eliminate per iteration

void
setToleranceParameter(double svmT)

Set the value of T for SMO

java.lang.String
toleranceParameterTipText()

Returns a tip text for this property suitable for display in the
 GUI

java.lang.String
toString()

Return a description of the evaluator

Methods inherited from class weka.attributeSelection.ASEvaluation

forName, makeCopies, postProcess

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SVMAttributeEval

public SVMAttributeEval()

Constructor

Method Detail

globalInfo

public java.lang.String globalInfo()

Returns a string describing this attribute evaluator

Returns:

a description of the evaluator suitable for
 displaying in the explorer/experimenter gui

getTechnicalInformation

public TechnicalInformation getTechnicalInformation()

Returns an instance of a TechnicalInformation object, containing
 detailed information about the technical background of this class,
 e.g., paper reference or book this class is based on.

Specified by:

getTechnicalInformation in interface TechnicalInformationHandler

Returns:

the technical information about this class

listOptions

public java.util.Enumeration listOptions()

Returns an enumeration describing all the available options

Specified by:

listOptions in interface OptionHandler

Returns:

an enumeration of options

setOptions

public void setOptions(java.lang.String[] options)
                throws java.lang.Exception

Parses a given list of options.

 Valid options are:

 -X <constant rate of elimination>
  Specify the constant rate of attribute
  elimination per invocation of
  the support vector machine.
  Default = 1.

 -Y <percent rate of elimination>
  Specify the percentage rate of attributes to
  elimination per invocation of
  the support vector machine.
  Trumps constant rate (above threshold).
  Default = 0.

 -Z <threshold for percent elimination>
  Specify the threshold below which
  percentage attribute elimination
  reverts to the constant method.

 -P <epsilon>
  Specify the value of P (epsilon
  parameter) to pass on to the
  support vector machine.
  Default = 1.0e-25

 -T <tolerance>
  Specify the value of T (tolerance
  parameter) to pass on to the
  support vector machine.
  Default = 1.0e-10

 -C <complexity>
  Specify the value of C (complexity
  parameter) to pass on to the
  support vector machine.
  Default = 1.0

 -N
  Whether the SVM should 0=normalize/1=standardize/2=neither.
  (default 0=normalize)

Specified by:

setOptions in interface OptionHandler

Parameters:

options - the list of options as an array of strings

Throws:

java.lang.Exception - if an error occurs

getOptions

public java.lang.String[] getOptions()

Gets the current settings of SVMAttributeEval

Specified by:

getOptions in interface OptionHandler

Returns:

an array of strings suitable for passing to setOptions()

attsToEliminatePerIterationTipText

public java.lang.String attsToEliminatePerIterationTipText()

Returns a tip text for this property suitable for display in the
 GUI

Returns:

tip text string describing this property

percentToEliminatePerIterationTipText

public java.lang.String percentToEliminatePerIterationTipText()

Returns a tip text for this property suitable for display in the
 GUI

Returns:

tip text string describing this property

percentThresholdTipText

public java.lang.String percentThresholdTipText()

Returns a tip text for this property suitable for display in the
 GUI

Returns:

tip text string describing this property

epsilonParameterTipText

public java.lang.String epsilonParameterTipText()

Returns a tip text for this property suitable for display in the
 GUI

Returns:

tip text string describing this property

toleranceParameterTipText

public java.lang.String toleranceParameterTipText()

Returns a tip text for this property suitable for display in the
 GUI

Returns:

tip text string describing this property

complexityParameterTipText

public java.lang.String complexityParameterTipText()

Returns a tip text for this property suitable for display in the
 GUI

Returns:

tip text string describing this property

filterTypeTipText

public java.lang.String filterTypeTipText()

Returns a tip text for this property suitable for display in the
 GUI

Returns:

tip text string describing this property

setAttsToEliminatePerIteration

public void setAttsToEliminatePerIteration(int cRate)

Set the constant rate of attribute elimination per iteration

Parameters:

cRate - the constant rate of attribute elimination per iteration

getAttsToEliminatePerIteration

public int getAttsToEliminatePerIteration()

Get the constant rate of attribute elimination per iteration

Returns:

the constant rate of attribute elimination per iteration

setPercentToEliminatePerIteration

public void setPercentToEliminatePerIteration(int pRate)

Set the percentage of attributes to eliminate per iteration

Parameters:

pRate - percent of attributes to eliminate per iteration

getPercentToEliminatePerIteration

public int getPercentToEliminatePerIteration()

Get the percentage rate of attribute elimination per iteration

Returns:

the percentage rate of attribute elimination per iteration

setPercentThreshold

public void setPercentThreshold(int pThresh)

Set the threshold below which percentage elimination reverts to
 constant elimination.

Parameters:

pThresh - percent of attributes to eliminate per iteration

getPercentThreshold

public int getPercentThreshold()

Get the threshold below which percentage elimination reverts to
 constant elimination.

Returns:

the threshold below which percentage elimination stops

setEpsilonParameter

public void setEpsilonParameter(double svmP)

Set the value of P for SMO

Parameters:

svmP - the value of P

getEpsilonParameter

public double getEpsilonParameter()

Get the value of P used with SMO

Returns:

the value of P

setToleranceParameter

public void setToleranceParameter(double svmT)

Set the value of T for SMO

Parameters:

svmT - the value of T

getToleranceParameter

public double getToleranceParameter()

Get the value of T used with SMO

Returns:

the value of T

setComplexityParameter

public void setComplexityParameter(double svmC)

Set the value of C for SMO

Parameters:

svmC - the value of C

getComplexityParameter

public double getComplexityParameter()

Get the value of C used with SMO

Returns:

the value of C

setFilterType

public void setFilterType(SelectedTag newType)

The filtering mode to pass to SMO

Parameters:

newType - the new filtering mode

getFilterType

public SelectedTag getFilterType()

Get the filtering mode passed to SMO

Returns:

the filtering mode

getCapabilities

public Capabilities getCapabilities()

Returns the capabilities of this evaluator.

Specified by:

getCapabilities in interface CapabilitiesHandler

Overrides:

getCapabilities in class ASEvaluation

Returns:

the capabilities of this evaluator

See Also:

Capabilities

buildEvaluator

public void buildEvaluator(Instances data)
                    throws java.lang.Exception

Initializes the evaluator.

Specified by:

buildEvaluator in class ASEvaluation

Parameters:

data - set of instances serving as training data

Throws:

java.lang.Exception - if the evaluator has not been
 generated successfully

evaluateAttribute

public double evaluateAttribute(int attribute)
                         throws java.lang.Exception

Evaluates an attribute by returning the rank of the square of its coefficient in a
 linear support vector machine.

Specified by:

evaluateAttribute in interface AttributeEvaluator

Parameters:

attribute - the index of the attribute to be evaluated

Returns:

the "merit" of the attribute

Throws:

java.lang.Exception - if the attribute could not be evaluated

toString

public java.lang.String toString()

Return a description of the evaluator

Overrides:

toString in class java.lang.Object

Returns:

description as a string

getRevision

public java.lang.String getRevision()

Returns the revision string.

Specified by:

getRevision in interface RevisionHandler

Overrides:

getRevision in class ASEvaluation

Returns:

the revision

main

public static void main(java.lang.String[] args)

Main method for testing this class.

Parameters:

args - the options

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
'use strict';

angular.module('app')

.controller('SurveyCtrl', function(SurveySvc, NgTableParams) {
	var o = this;

    o.tableSurvey = new NgTableParams({}, { dataset: data});

    o.detail = function(id) {
        $state.go('app.surveyform', {
            id: id
        });
    }
})

.controller('SurveyFormCtrl', function($scope, $state, $stateParams, SurveySvc) {
    var o = this;
    o.Survey = {};
    o.isEdit = false;
    var id = $stateParams.id;

    var reload = function() {

    }
    reload();

    o.save = function() {

    }

    o.delete = function() {
        SurveySvc.delete(id).then(success, error);
    }

    var success = function() {
        $state.go('app.Survey');
    }

    var error = function(res) {
        alert(res.data.error.message)
    }
});


text:
using System;

namespace ReMi.BusinessEntities.Exceptions
{
    public class MoreThanOnePackageAssignToReleaseException : Exception
    {
        public MoreThanOnePackageAssignToReleaseException(Guid releaseWindowId)
            : base(FormatMessage(releaseWindowId))
        {
        }

        public MoreThanOnePackageAssignToReleaseException(Guid releaseWindowId, Exception innerException)
            : base(FormatMessage(releaseWindowId), innerException)
        {
        }

        private static string FormatMessage(Guid releaseWindowId)
        {
            return string.Format("This release type should not have more than one package associated. ReleaseWindowId: {0}", releaseWindowId);
        }
    }
}