text:
layout: page
title: About
---
A curated list of awesome SSHConfig hacks, maintained by [@mgarces](https://twitter.com/mgarces).

redpajama_set_name: RedPajamaGithub


text:
package queue

import (
	"math"
	"sync"
)

// Queuer interface
type Queuer interface {
	Enqueue(item interface{}) error
	Dequeue() (interface{}, bool)
	Peek() (interface{}, bool)
	IsEmpty() bool
	IsFull() bool
	Len() int
	Cap() int
	Reset()
	Resize(int) int
}

// shiftPercent is the default value for shifting the queue items to the
// front of the queue instead of growing the queue.  If at least the % of
// the items have been removed from the queue, the items in the queue will
// be shifted to make room; otherwise the queue will grow.  This only applies
// to unbounded queues and can be set per queue.
var shiftPercent = 50

// Queue represents an unbounded queue and everything needed to manage it.
// The preferred method for creating a new Queue is to use either NewQ()
// or its alias, NewQueue().
type Queue struct {
	sync.Mutex
	InitCap      int
	Items        []interface{}
	Head         int // current item in queue
	shiftPercent int // the % of items that need to be removed before shifting occurs
}

// NewQ is a convenience wrapper to NewQ().
func NewQ(size int) *Queue {
	return NewQueue(size)
}

// NewQueue returns an empty queue with an initial capacity equal to the
// recieved size.
func NewQueue(size int) *Queue {
	return &Queue{InitCap: size, Items: make([]interface{}, 0, size), shiftPercent: shiftPercent}
}

// SetShiftPercent sets the queue's shiftPercent: the percentage of the queue
// that must be empty before the remaining items will be shifted to the
// the beginning of the slice. This occurs when the slice is set to grow.
//
// Valid range of values are 0-100, inclusive. Vaues < 0 are set to 0 and
// values > 100 are set to 100.
func (q *Queue) SetShiftPercent(i int) {
	q.Lock()
	defer q.Unlock()
	if i < 0 {
		q.shiftPercent = 0
		return
	}
	if i > 100 {
		q.shiftPercent = 100
		return
	}
	q.shiftPercent = i
}

// Enqueue adds an item to the queue. If adding the item requires growing
// the queue, the queue will either be shifted, to make room at the end of
// the queue, or it will grow.
func (q *Queue) Enqueue(item interface{}) error {
	q.Lock()
	defer q.Unlock()
	// See if it needs to grow
	if len(q.Items) == cap(q.Items) {
		_ = q.shift()
	}
	q.Items = append(q.Items, item)
	return nil
}

// Dequeue removes an item from the queue. If the removal of the item empties
// the queue, the head and tail will be set to 0. If the queue is empty, a
// false will be returned, else true.
func (q *Queue) Dequeue() (interface{}, bool) {
	q.Lock()
	defer q.Unlock()
	if q.isEmpty() {
		return nil, false
	}
	q.Head++
	return q.Items[q.Head-1], true
}

// Peek returns the next item in the queue. Post-peek, the queue remains the
// same.
func (q *Queue) Peek() (interface{}, bool) {
	q.Lock()
	defer q.Unlock()
	if q.isEmpty() {
		return nil, false
	}
	return q.Items[q.Head], true
}

// IsEmpty returns whether or not the queue is empty
func (q *Queue) IsEmpty() bool {
	q.Lock()
	defer q.Unlock()
	return q.isEmpty()
}

// isEmpty is an unexported version that doesn't lock because the caller
// will have handled that. Reduces multiple locks/unlocks during operations
// that need to check for emptiness and have already obtained a lock
func (q *Queue) isEmpty() bool {
	if q.Head == len(q.Items) {
		return true
	}
	return false
}

// IsFull returns false; this is implemented to fulfill Queuer but a dynamic
// queue will never be full.
func (q *Queue) IsFull() bool {
	return false
}

// Len returns the current number of items in the queue
func (q *Queue) Len() int {
	q.Lock()
	defer q.Unlock()
	return len(q.Items) - q.Head
}

// Cap returns the current size of the queue
func (q *Queue) Cap() int {
	q.Lock()
	defer q.Unlock()
	return cap(q.Items)
}

// shift: if shiftPercent Items have been removed from the queue,, the
// remaining items in the queue will be shifted to the beginning of the
// queue. Returns whether or not a shift occurred.
func (q *Queue) shift() bool {
	if q.Head < (cap(q.Items)*q.shiftPercent)/100 {
		return false
	}
	q.Items = append(q.Items[:0], q.Items[q.Head:]...)
	// set the pointers to the correct position
	q.Head = 0
	return true
}

// Reset resets the queue; Head and tail point to element 0. This does not
// shrink the queue; for that use Resize(). Any items in the queue will be
// lost.
func (q *Queue) Reset() {
	q.Lock()
	q.Head = 0
	q.Items = q.Items[:0]
	q.Unlock()
}

// Resize resizes the queue to the received size, or, either its original
// capacity or to 1,25 * the number of items in the queue, whichever is larger.
// When a size of 0 is received, the queue will be set to either 1.25 * the
// number of items in the queue or its initial capacity, whichever is larger.
// Queues with space at the front are shifted to the front.
func (q *Queue) Resize(size int) int {
	q.Lock()
	i := int(math.Mod(float64(len(q.Items)), float64(cap(q.Items)))*1.25) - q.Head
	if i < q.InitCap {
		i = q.InitCap
	}
	if size > i {
		i = size
	}
	tmp := make([]interface{}, 0, i)
	// if necessary, shift Items to front.
	if q.Head > 0 || len(q.Items) > 0 {
		tmp = append(tmp, q.Items[q.Head:]...)
		q.Head = 0
	}
	q.Items = tmp
	q.Unlock()
	return i
}


text:
local S = ethereal.intllib

-- bone item
minetest.register_craftitem("ethereal:bone", {
	description = S("Bone"),
	inventory_image = "bone.png",
})

-- bonemeal recipes
minetest.register_craft({
	type = "shapeless",
	output = 'ethereal:bonemeal 2',
	recipe = {'ethereal:bone'},
})

minetest.register_craft({
	type = "shapeless",
	output = 'ethereal:bonemeal 4',
	recipe = {'bones:bones'},
})

minetest.register_craft( {
	type = "shapeless",
	output = "dye:white 2",
	recipe = {"ethereal:bonemeal"},
})

-- have animalmaterials bone craft into bonemeal if found
if minetest.get_modpath('animalmaterials') then

	minetest.register_craft({
		type = "shapeless",
		output = 'ethereal:bonemeal 2',
		recipe = {'animalmaterials:bone'},
	})
end

-- add bones to dirt
minetest.override_item("default:dirt", {
	drop = {
		max_items = 1,
		items = {
			{
				items = {'ethereal:bone', 'default:dirt'},
				rarity = 30,
			},
			{
				items = {'default:dirt'},
			}
		}
	},
})

local plants = {
	"flowers:dandelion_white",
	"flowers:dandelion_yellow",
	"flowers:geranium",
	"flowers:rose",
	"flowers:tulip",
	"flowers:viola",
}

local crops = {
	{"farming:cotton_", 8},
	{"farming:wheat_", 8},
	{"farming:tomato_", 8},
	{"farming:corn_", 8},
	{"farming:melon_", 8},
	{"farming:pumpkin_", 8},
	{"farming:beanpole_", 5},
	{"farming:blueberry_", 4},
	{"farming:raspberry_", 4},
	{"farming:carrot_", 8},
	{"farming:cocoa_", 3},
	{"farming:coffee_", 5},
	{"farming:cucumber_", 4},
	{"farming:potato_", 4},
	{"farming:grapes_", 8},
	{"farming:rhubarb_", 3},
	{"ethereal:strawberry_", 8},
	{"ethereal:onion_", 5},
	{"farming:barley_", 7},
}

-- check if sapling has enough height room to grow
local function enough_height(pos, height)

	local nod = minetest.line_of_sight(
		{x = pos.x, y = pos.y + 1, z = pos.z},
		{x = pos.x, y = pos.y + height, z = pos.z})

	if not nod then
		return false -- obstructed
	else
		return true -- can grow
	end
end

-- moretrees specific function
local function more_tree(pos, object)

	if type(object) == "table" and object.axiom then
		-- grow L-system tree
		minetest.remove_node(pos)
		minetest.spawn_tree(pos, object)

	elseif type(object) == "string" and minetest.registered_nodes[object] then
		-- place node
		minetest.set_node(pos, {name = object})

	elseif type(object) == "function" then
		-- function
		object(pos)

	end
end

-- growing routine
local function growth(pointed_thing)

	local pos = pointed_thing.under
	local node = minetest.get_node(pos)

	if node.name == "ignore" then
		return
	end

	minetest.add_particlespawner({
		amount = 4,
		time = 0.15,
		minpos = pos,
		maxpos = pos,
		minvel = {x = -1, y = 2, z = -1},
		maxvel = {x = 1, y = 4, z = 1},
		minacc = {x = -1, y = -1, z = -1},
		maxacc = {x = 1, y = 1, z = 1},
		minexptime = 1,
		maxexptime = 1,
		minsize = 1,
		maxsize = 3,
		texture = "bonemeal_particle.png",
	})

	-- 50/50 chance of growing a sapling
	if minetest.get_item_group(node.name, "sapling") > 0
	or minetest.get_item_group(node.name, "ethereal_sapling") > 0 then

		if math.random(1, 2) == 1 then
			return
		end

		local under =  minetest.get_node({
			x = pos.x,
			y = pos.y - 1,
			z = pos.z
		})

		local height = minetest.registered_nodes[node.name].grown_height

		-- do we have enough height to grow sapling into tree?
		if height and not enough_height(pos, height) then
			return
		end

		-- specific check for palm tree's, so they grow on sand
		if node.name == "ethereal:palm_sapling"
		and under.name == "default:sand" then
			ethereal.grow_palm_tree(pos)
			return
		end

		-- check for soil under sapling
		if minetest.get_item_group(under.name, "soil") == 0 then
			return
		end

		-- grow ethereal tree
		if node.name == "ethereal:palm_sapling" then
			ethereal.grow_palm_tree(pos)

		elseif node.name == "ethereal:yellow_tree_sapling" then
			ethereal.grow_yellow_tree(pos)

		elseif node.name == "ethereal:big_tree_sapling" then
			ethereal.grow_big_tree(pos)

		elseif node.name == "ethereal:banana_tree_sapling" then
			ethereal.grow_banana_tree(pos)

		elseif node.name == "ethereal:frost_tree_sapling" then
			ethereal.grow_frost_tree(pos)

		elseif node.name == "ethereal:mushroom_sapling" then
			ethereal.grow_mushroom_tree(pos)

		elseif node.name == "ethereal:willow_sapling" then
			ethereal.grow_willow_tree(pos)

		elseif node.name == "ethereal:redwood_sapling" then
			ethereal.grow_redwood_tree(pos)

		elseif node.name == "ethereal:orange_tree_sapling" then
			ethereal.grow_orange_tree(pos)

		elseif node.name == "ethereal:bamboo_sprout" then
			ethereal.grow_bamboo_tree(pos)

		elseif node.name == "ethereal:birch_sapling" then
			ethereal.grow_birch_tree(pos)

-- grow moretree's sapling
elseif node.name == "moretrees:beech_sapling" then
	more_tree(pos, moretrees.spawn_beech_object)
elseif node.name == "moretrees:apple_tree_sapling" then
	more_tree(pos, moretrees.spawn_apple_tree_object)
elseif node.name == "moretrees:oak_sapling" then
	more_tree(pos, moretrees.spawn_oak_object)
elseif node.name == "moretrees:sequoia_sapling" then
	more_tree(pos, moretrees.spawn_sequoia_object)
elseif node.name == "moretrees:birch_sapling" then
	--more_tree(pos, moretrees.spawn_birch_object)
	moretrees.grow_birch(pos)
elseif node.name == "moretrees:palm_sapling" then
	more_tree(pos, moretrees.spawn_palm_object)
elseif node.name == "moretrees:date_palm_sapling" then
	more_tree(pos, moretrees.spawn_date_palm_object)
elseif node.name == "moretrees:spruce_sapling" then
	--more_tree(pos, moretrees.spawn_spruce_object)
	moretrees.grow_spruce(pos)
elseif node.name == "moretrees:cedar_sapling" then
	more_tree(pos, moretrees.spawn_cedar_object)
elseif node.name == "moretrees:poplar_sapling" then
	more_tree(pos, moretrees.spawn_poplar_object)
elseif node.name == "moretrees:willow_sapling" then
	more_tree(pos, moretrees.spawn_willow_object)
elseif node.name == "moretrees:rubber_tree_sapling" then
	more_tree(pos, moretrees.spawn_rubber_tree_object)
elseif node.name == "moretrees:fir_sapling" then
	--more_tree(pos, moretrees.spawn_fir_object)
	if minetest.find_node_near(pos, 1, {"default:snow"}) then
		moretrees.grow_fir_snow(pos)
	else
		moretrees.grow_fir(pos)
	end

		-- grow default tree
		elseif node.name == "default:sapling"
		and enough_height(pos, 7) then
			default.grow_new_apple_tree(pos)

		elseif node.name == "default:junglesapling"
		and enough_height(pos, 15) then
			default.grow_new_jungle_tree(pos)

		elseif node.name == "default:pine_sapling"
		and enough_height(pos, 11) then

			if minetest.find_node_near(pos, 1,
				{"default:snow", "default:snowblock", "default:dirt_with_snow"}) then

				default.grow_new_snowy_pine_tree(pos)
			else
				default.grow_new_pine_tree(pos)
			end

		elseif node.name == "default:acacia_sapling"
		and enough_height(pos, 7) then
			default.grow_new_acacia_tree(pos)

		elseif node.name == "default:aspen_sapling"
		and enough_height(pos, 11) then
			default.grow_new_aspen_tree(pos)
		end

		return
	end

	local stage = ""

	-- grow registered crops
	for n = 1, #crops do

		if string.find(node.name, crops[n][1]) then

			stage = tonumber( node.name:split("_")[2] )
			stage = math.min(stage + math.random(1, 4), crops[n][2])

			minetest.set_node(pos, {name = crops[n][1] .. stage})

			return

		end

	end

	-- grow grass and flowers
	if minetest.get_item_group(node.name, "soil") > 0 then

		local dirt = minetest.find_nodes_in_area_under_air(
			{x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
			{x = pos.x + 2, y = pos.y + 1, z = pos.z + 2},
			{"group:soil"})

		for _,n in pairs(dirt) do

			local pos2 = n

			pos2.y = pos2.y + 1

			if math.random(0, 5) > 3 then

				minetest.swap_node(pos2,
					{name = plants[math.random(1, #plants)]})
			else

				if node.name == "default:dirt_with_dry_grass" then
					minetest.swap_node(pos2,
						{name = "default:dry_grass_" .. math.random(1, 5)})
				else
					minetest.swap_node(pos2,
						{name = "default:grass_" .. math.random(1, 5)})
				end

			end
		end
	end
end

-- bonemeal item
minetest.register_craftitem("ethereal:bonemeal", {
	description = S("Bone Meal"),
	inventory_image = "bonemeal.png",

	on_use = function(itemstack, user, pointed_thing)

		if pointed_thing.type == "node" then

			-- Check if node protected
			if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
				return
			end

			if not minetest.setting_getbool("creative_mode") then

				local item = user:get_wielded_item()

				item:take_item()
				user:set_wielded_item(item)
			end

			growth(pointed_thing)

			itemstack:take_item()

			return itemstack
		end
	end,
})


text:
namespace binpac {

class CompilerContext;

namespace passes {

/// Populates the scopes inside units. This can only run after IDs have been
/// resolved and hence it split into a separate pass.
class UnitScopeBuilder : public ast::Pass<AstInfo>
{
public:
    /// Constructor.
    ///
    /// context: The context the AST is part of.
    UnitScopeBuilder();
    virtual ~UnitScopeBuilder();

    /// Populates an AST's units.
    ///
    /// module: The AST to process.
    ///
    /// Returns: True if no error were encountered.
    bool run(shared_ptr<ast::NodeBase> ast) override;

protected:
    void visit(declaration::Type* t) override;
};

}

}

#endif


text:
This repo contains a collection of examples that use camera streams
together with the [TensorFlow Lite API](https://tensorflow.org/lite) with a
Coral device such as the
[USB Accelerator](https://coral.withgoogle.com/products/accelerator) or
[Dev Board](https://coral.withgoogle.com/products/dev-board).

## Installation

1.  First, be sure you have completed the [setup instructions for your Coral
    device](https://coral.ai/docs/setup/). If it's been a while, repeat to be sure
    you have the latest software.

    Importantly, you should have the latest TensorFlow Lite runtime installed
    (as per the [Python quickstart](
    https://www.tensorflow.org/lite/guide/python)).

2.  Clone this Git repo onto your computer:

    ```
    mkdir google-coral && cd google-coral

    git clone https://github.com/google-coral/examples-camera.git --depth 1
    ```

3.  Download the models:

    ```
    cd examples-camera

    sh download_models.sh
    ```

    These canned models will be downloaded and extracted to a new folder
    ```all_models```.

Further requirements may be needed by the different camera libraries, check the
README file for the respective subfolder.

## Contents

  * __Gstreamer__ Python examples using gstreamer to obtain camera images. These
    examples work on Linux using a webcam, Raspberry Pi with
    the Raspicam and on the Coral DevBoard using the Coral camera. For the
    former two you will also need a Coral USB Accelerator to run the models.
  * __Raspicam__ Python example using picamera. This is only intended for
    Raspberry Pi and will require a Coral USB Accelerator.
    Use ```install_requirements.sh``` to make sure all the dependencies are
    present.
  * __PyGame__ Python example using pygame to obtain camera frames.
    Use ```install_requirements.sh``` to make sure all the dependencies are
    present.
  * __OpenCV__ Python example using OpenCV to obtain camera frames.
    Use ```install_requirements.sh``` to make sure all the dependencies are
    present.
  * __NativeApp__ C++ example using gstreamer to obtain camera frames.
    See README in the nativeapp directory on how to compile for the
    Coral DevBoard.

## Canned models

For all the demos in this repository you can change the model and the labels
file by using the flags flags ```--model``` and
```--labels```. Be sure to use the models labeled _edgetpu, as those are
compiled for the accelerator -  otherwise the model will run on the CPU and
be much slower.

For classification you need to select one of the classification models
and its corresponding labels file:

```
inception_v1_224_quant_edgetpu.tflite, imagenet_labels.txt
inception_v2_224_quant_edgetpu.tflite, imagenet_labels.txt
inception_v3_299_quant_edgetpu.tflite, imagenet_labels.txt
inception_v4_299_quant_edgetpu.tflite, imagenet_labels.txt
mobilenet_v1_1.0_224_quant_edgetpu.tflite, imagenet_labels.txt
mobilenet_v2_1.0_224_quant_edgetpu.tflite, imagenet_labels.txt

mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite, inat_bird_labels.txt
mobilenet_v2_1.0_224_inat_insect_quant_edgetpu.tflite, inat_insect_labels.txt
mobilenet_v2_1.0_224_inat_plant_quant_edgetpu.tflite, inat_plant_labels.txt
```

For detection you need to select one of the SSD detection models
and its corresponding labels file:

```
mobilenet_ssd_v1_coco_quant_postprocess_edgetpu.tflite, coco_labels.txt
mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite, coco_labels.txt
mobilenet_ssd_v2_face_quant_postprocess_edgetpu.tflite, coco_labels.txt
```


text:
using System;

namespace Imageboard10.Core.ModelInterface.Posting
{
    /// <summary>
    /// Поле для постинга.
    /// </summary>
    public interface IPostingCapability
    {
        /// <summary>
        /// Роль поля.
        /// </summary>
        Guid Role { get; }
    }
}


text:
author: alba
layout: post
permalink: /2004/11/12/574/
categories:
  - asides
tags:
  - asides
  - del.icio.us
---
[Rush Limbaugh wants iCal to Sidekck solution][1]: for the first (and possibly only) time in my life, I agree with him.

 [1]: http://www.macdailynews.com/comments.php?id=P3838_0_1_0 "MacDailyNews - News - Welcome Home"


text:
package com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.implementation;

import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.AzureFileshareProtectedItem;
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.AzureIaaSVMProtectedItem;
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.AzureSqlProtectedItem;
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.AzureVmWorkloadProtectedItem;
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.AzureVmWorkloadSQLDatabaseProtectedItem;
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.BackupManagementType;
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.DPMProtectedItem;
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.DataSourceType;
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.GenericProtectedItem;
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.MabFileFolderProtectedItem;
import org.joda.time.DateTime;
import com.microsoft.azure.management.recoveryservices.backup.v2017_07_01.CreateMode;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonSubTypes;

/**
 * Base class for backup items.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType")
@JsonTypeName("ProtectedItem")
@JsonSubTypes({
    @JsonSubTypes.Type(name = "AzureFileShareProtectedItem", value = AzureFileshareProtectedItem.class),
    @JsonSubTypes.Type(name = "AzureIaaSVMProtectedItem", value = AzureIaaSVMProtectedItem.class),
    @JsonSubTypes.Type(name = "Microsoft.Sql/servers/databases", value = AzureSqlProtectedItem.class),
    @JsonSubTypes.Type(name = "AzureVmWorkloadProtectedItem", value = AzureVmWorkloadProtectedItem.class),
    @JsonSubTypes.Type(name = "AzureVmWorkloadSQLDatabase", value = AzureVmWorkloadSQLDatabaseProtectedItem.class),
    @JsonSubTypes.Type(name = "DPMProtectedItem", value = DPMProtectedItem.class),
    @JsonSubTypes.Type(name = "GenericProtectedItem", value = GenericProtectedItem.class),
    @JsonSubTypes.Type(name = "MabFileFolderProtectedItem", value = MabFileFolderProtectedItem.class)
})
public class ProtectedItemInner {
    /**
     * Type of backup managemenent for the backed up item. Possible values
     * include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer',
     * 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'.
     */
    @JsonProperty(value = "backupManagementType")
    private BackupManagementType backupManagementType;

    /**
     * Type of workload this item represents. Possible values include:
     * 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange',
     * 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource',
     * 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase'.
     */
    @JsonProperty(value = "workloadType")
    private DataSourceType workloadType;

    /**
     * Unique name of container.
     */
    @JsonProperty(value = "containerName")
    private String containerName;

    /**
     * ARM ID of the resource to be backed up.
     */
    @JsonProperty(value = "sourceResourceId")
    private String sourceResourceId;

    /**
     * ID of the backup policy with which this item is backed up.
     */
    @JsonProperty(value = "policyId")
    private String policyId;

    /**
     * Timestamp when the last (latest) backup copy was created for this backup
     * item.
     */
    @JsonProperty(value = "lastRecoveryPoint")
    private DateTime lastRecoveryPoint;

    /**
     * Name of the backup set the backup item belongs to.
     */
    @JsonProperty(value = "backupSetName")
    private String backupSetName;

    /**
     * Create mode to indicate recovery of existing soft deleted data source or
     * creation of new data source. Possible values include: 'Invalid',
     * 'Default', 'Recover'.
     */
    @JsonProperty(value = "createMode")
    private CreateMode createMode;

    /**
     * Get type of backup managemenent for the backed up item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'.
     *
     * @return the backupManagementType value
     */
    public BackupManagementType backupManagementType() {
        return this.backupManagementType;
    }

    /**
     * Set type of backup managemenent for the backed up item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'.
     *
     * @param backupManagementType the backupManagementType value to set
     * @return the ProtectedItemInner object itself.
     */
    public ProtectedItemInner withBackupManagementType(BackupManagementType backupManagementType) {
        this.backupManagementType = backupManagementType;
        return this;
    }

    /**
     * Get type of workload this item represents. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase'.
     *
     * @return the workloadType value
     */
    public DataSourceType workloadType() {
        return this.workloadType;
    }

    /**
     * Set type of workload this item represents. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase'.
     *
     * @param workloadType the workloadType value to set
     * @return the ProtectedItemInner object itself.
     */
    public ProtectedItemInner withWorkloadType(DataSourceType workloadType) {
        this.workloadType = workloadType;
        return this;
    }

    /**
     * Get unique name of container.
     *
     * @return the containerName value
     */
    public String containerName() {
        return this.containerName;
    }

    /**
     * Set unique name of container.
     *
     * @param containerName the containerName value to set
     * @return the ProtectedItemInner object itself.
     */
    public ProtectedItemInner withContainerName(String containerName) {
        this.containerName = containerName;
        return this;
    }

    /**
     * Get aRM ID of the resource to be backed up.
     *
     * @return the sourceResourceId value
     */
    public String sourceResourceId() {
        return this.sourceResourceId;
    }

    /**
     * Set aRM ID of the resource to be backed up.
     *
     * @param sourceResourceId the sourceResourceId value to set
     * @return the ProtectedItemInner object itself.
     */
    public ProtectedItemInner withSourceResourceId(String sourceResourceId) {
        this.sourceResourceId = sourceResourceId;
        return this;
    }

    /**
     * Get iD of the backup policy with which this item is backed up.
     *
     * @return the policyId value
     */
    public String policyId() {
        return this.policyId;
    }

    /**
     * Set iD of the backup policy with which this item is backed up.
     *
     * @param policyId the policyId value to set
     * @return the ProtectedItemInner object itself.
     */
    public ProtectedItemInner withPolicyId(String policyId) {
        this.policyId = policyId;
        return this;
    }

    /**
     * Get timestamp when the last (latest) backup copy was created for this backup item.
     *
     * @return the lastRecoveryPoint value
     */
    public DateTime lastRecoveryPoint() {
        return this.lastRecoveryPoint;
    }

    /**
     * Set timestamp when the last (latest) backup copy was created for this backup item.
     *
     * @param lastRecoveryPoint the lastRecoveryPoint value to set
     * @return the ProtectedItemInner object itself.
     */
    public ProtectedItemInner withLastRecoveryPoint(DateTime lastRecoveryPoint) {
        this.lastRecoveryPoint = lastRecoveryPoint;
        return this;
    }

    /**
     * Get name of the backup set the backup item belongs to.
     *
     * @return the backupSetName value
     */
    public String backupSetName() {
        return this.backupSetName;
    }

    /**
     * Set name of the backup set the backup item belongs to.
     *
     * @param backupSetName the backupSetName value to set
     * @return the ProtectedItemInner object itself.
     */
    public ProtectedItemInner withBackupSetName(String backupSetName) {
        this.backupSetName = backupSetName;
        return this;
    }

    /**
     * Get create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'Invalid', 'Default', 'Recover'.
     *
     * @return the createMode value
     */
    public CreateMode createMode() {
        return this.createMode;
    }

    /**
     * Set create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'Invalid', 'Default', 'Recover'.
     *
     * @param createMode the createMode value to set
     * @return the ProtectedItemInner object itself.
     */
    public ProtectedItemInner withCreateMode(CreateMode createMode) {
        this.createMode = createMode;
        return this;
    }

}


text:
package com.lush.lib.handler;

import android.content.Context;
import android.util.Log;

import com.lush.lib.image.CloudinaryImage;
import com.nostra13.universalimageloader.core.download.handlers.SchemeHandler;

import java.io.IOException;
import java.io.InputStream;

/**
 * Scheme handler for Cloundinary URLs. This allows for much better loading of images
 *
 * @author Matt Allen
 */
public class CloudinarySchemeHandler extends SchemeHandler
{
	private static final String TAG = CloudinarySchemeHandler.class.getSimpleName();
	@Override
	public InputStream getStreamForPath(Context context, String path, Object optionForDownloader, int connectTimeout, int readTimeout)
	{
		float densityDpi = context.getResources().getDisplayMetrics().density;
		CloudinaryImage image = new CloudinaryImage();
		image.fromUrl(path);
		int actualSize = (int) densityDpi * image.getSize();
		String[] parts = image.getImageUrl().split("upload/");
		try
		{
			String actualUrl = parts[0] + "upload/" + image.getOrientation() + "_" + String.valueOf(actualSize) + "/" + parts[1];
			return getStreamFromNetwork(actualUrl, connectTimeout, readTimeout, optionForDownloader);
		}
		catch (IOException e)
		{
			return null;
		}
		catch (ArrayIndexOutOfBoundsException e)
		{
			Log.w(TAG, "No ID for cloudinary image. Cannot download image.");
			return null;
		}
	}
}


text:
{-# LANGUAGE OverloadedStrings #-}

module Test.Hspec.Formatters.Markdown (
  markdownFormatter
  ) where

import Data.Maybe (fromMaybe)
import Text.Printf
import Test.Hspec.Formatters

h :: Int -> String -> String
h n text = replicate n '#' ++ " " ++ text ++ " " ++ replicate n '#'

item :: String -> String
item text = "* " ++ text

markdownFormatter :: Formatter
markdownFormatter = silent
  { headerFormatter = writeLine ""
  , exampleGroupStarted = \_ nesting name -> do
      writeLine $ h (length nesting+1) name
      newParagraph
  , exampleGroupDone = newParagraph
  , exampleSucceeded = \(_, requirement) -> writeLine (item requirement)
  , exampleFailed = \(_, requirement) _ -> do
      writeLine $ item (requirement ++ " (failed)")
  , examplePending = \(_, requirement) reason -> writeLine $ item (requirement ++ " (pending, " ++ fromMaybe "No reason given" reason ++ ")")
  , footerFormatter = markdownSummary
  }

markdownSummary :: FormatM ()
markdownSummary = do
  writeLine (h 1 "Test Summary")

  noTotal   <- getTotalCount
  noFail    <- getFailCount
  noPending <- getPendingCount
  writeLine (item (plural noTotal "test"))
  writeLine (item (plural noFail "failure"))
  writeLine (item (plural noPending "test" ++ " pending"))

  time <- getRealTime
  writeLine (item (printf "finished in %1.4f seconds" time))

plural :: Int -> String -> String
plural n text
  | n==0      = "no " ++ text ++ "s"
  | n==1      = show n ++ " " ++ text
  | otherwise = show n ++ " " ++ text ++ "s"


text:
package quickstart;

import java.io.Serializable;
import java.util.Properties;
import com.gemstone.gemfire.cache.Declarable;

/**
 * Represents a number of shares of a stock ("security") held in a {@link
 * Portfolio}.
 *

 * This class is Serializable because we want it to be distributed
 * to multiple members of a distributed system.  Because this class is
 * Declarable, we can describe instances of it in a GemFire
 * cache.xml file.
 *

 *
 * @author GemStone Systems, Inc.
 * @since 4.1.1
 */
public class Position implements Declarable, Serializable {

  private static final long serialVersionUID = -8229531542107983344L;

  private String secId;
  private double qty;
  private double mktValue;

  @Override
  public void init(Properties props) {
    this.secId = props.getProperty("secId");
    this.qty = Double.parseDouble(props.getProperty("qty"));
    this.mktValue = Double.parseDouble(props.getProperty("mktValue"));
  }

  public String getSecId(){
    return this.secId;
  }

  public double getQty(){
    return this.qty;
  }

  public double getMktValue() {
    return this.mktValue;
  }

  @Override
  public String toString(){
    return new StringBuffer()
        .append("Position [secId=").append(secId)
        .append(" qty=").append(this.qty)
        .append(" mktValue=").append(mktValue).append("]").toString();
  }
}


text:
module ApiExplorer
  module ApplicationHelper
  end
end


text:
package net.puklo.java.junit;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertTrue;

@RunWith(JUnitVWRunner.class)
public class SampleUsage {

    @Test
    public void should_fail_only_in_friendly_environment() {
        assertTrue(1 == 2);
    }

    @Test
    public void should_pass_regardless_of_environment() {
        assertTrue(2 == 2);
    }
}


text:
namespace clblast {
namespace database {

extern const DatabaseEntry PadHalf;
extern const DatabaseEntry PadSingle;
extern const DatabaseEntry PadComplexSingle;
extern const DatabaseEntry PadDouble;
extern const DatabaseEntry PadComplexDouble;

} // namespace database
} // namespace clblast


text:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

// Include the necessary evils.
global $CFG;
require_once($CFG->dirroot.'/cache/tests/fixtures/stores.php');
require_once($CFG->dirroot.'/cache/stores/memcached/lib.php');

/**
 * Memcached unit test class.
 *
 * @package    cachestore_memcached
 * @copyright  2013 Sam Hemelryk
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class cachestore_memcached_test extends cachestore_tests {
    /**
     * Returns the memcached class name
     * @return string
     */
    protected function get_class_name() {
        return 'cachestore_memcached';
    }

    /**
     * Tests the valid keys to ensure they work.
     */
    public function test_valid_keys() {
        if (!cachestore_memcached::are_requirements_met() || !defined('TEST_CACHESTORE_MEMCACHED_TESTSERVERS')) {
            $this->markTestSkipped('Could not test cachestore_memcached. Requirements are not met.');
        }

        $this->resetAfterTest(true);

        $definition = cache_definition::load_adhoc(cache_store::MODE_APPLICATION, 'cachestore_memcached', 'phpunit_test');
        $instance = new cachestore_memcached('Memcached Test', cachestore_memcached::unit_test_configuration());

        if (!$instance->is_ready()) {
            // Something prevented memcached store to be inited (extension, TEST_CACHESTORE_MEMCACHED_TESTSERVERS...).
            $this->markTestSkipped();
        }
        $instance->initialise($definition);

        $keys = array(
            // Alphanumeric.
            'abc', 'ABC', '123', 'aB1', '1aB',
            // Hyphens.
            'a-1', '1-a', '-a1', 'a1-',
            // Underscores.
            'a_1', '1_a', '_a1', 'a1_'
        );

        // Set some keys.
        foreach ($keys as $key) {
            $this->assertTrue($instance->set($key, $key), "Failed to set key `$key`");
        }

        // Get some keys.
        foreach ($keys as $key) {
            $this->assertEquals($key, $instance->get($key), "Failed to get key `$key`");
        }

        // Try get many.
        $values = $instance->get_many($keys);
        foreach ($values as $key => $value) {
            $this->assertEquals($key, $value);
        }

        // Reset a key.
        $this->assertTrue($instance->set($keys[0], 'New'), "Failed to reset key `$key`");
        $this->assertEquals('New', $instance->get($keys[0]), "Failed to get reset key `$key`");

        // Delete and check that we can't retrieve.
        foreach ($keys as $key) {
            $this->assertTrue($instance->delete($key), "Failed to delete key `$key`");
            $this->assertFalse($instance->get($key), "Retrieved deleted key `$key`");
        }

        // Try set many, and check that count is correct.
        $many = array();
        foreach ($keys as $key) {
            $many[] = array('key' => $key, 'value' => $key);
        }
        $returncount = $instance->set_many($many);
        $this->assertEquals(count($many), $returncount, 'Set many count didn\'t match');

        // Check keys retrieved with get_many.
        $values = $instance->get_many($keys);
        foreach ($keys as $key) {
            $this->assertTrue(isset($values[$key]), "Failed to get_many key `$key`");
            $this->assertEquals($key, $values[$key], "Failed to match get_many key `$key`");
        }

        // Delete many, make sure count matches.
        $returncount = $instance->delete_many($keys);
        $this->assertEquals(count($many), $returncount, 'Delete many count didn\'t match');

        // Check that each key was deleted.
        foreach ($keys as $key) {
            $this->assertFalse($instance->get($key), "Retrieved many deleted key `$key`");
        }

        // Set the keys again.
        $returncount = $instance->set_many($many);
        $this->assertEquals(count($many), $returncount, 'Set many count didn\'t match');

        // Purge.
        $this->assertTrue($instance->purge(), 'Failure to purge');

        // Delete and check that we can't retrieve.
        foreach ($keys as $key) {
            $this->assertFalse($instance->get($key), "Retrieved purged key `$key`");
        }
    }

    /**
     * Tests the clustering feature.
     */
    public function test_clustered() {
        if (!cachestore_memcached::are_requirements_met() || !defined('TEST_CACHESTORE_MEMCACHED_TESTSERVERS')) {
            $this->markTestSkipped('Could not test cachestore_memcached. Requirements are not met.');
        }

        $this->resetAfterTest(true);

        $testservers = explode("\n", trim(TEST_CACHESTORE_MEMCACHED_TESTSERVERS));

        if (count($testservers) < 2) {
            $this->markTestSkipped('Could not test clustered memcached, there are not enough test servers defined.');
        }

        // Use the first server as our primary.
        // We need to set a prefix for all, otherwise it uses the name, which will not match between connections.
        set_config('testprefix', 'pre', 'cachestore_memcached');
        // We need to set a name, otherwise we get a reused connection.
        set_config('testname', 'cluster', 'cachestore_memcached');
        set_config('testservers', $testservers[0], 'cachestore_memcached');
        set_config('testsetservers', TEST_CACHESTORE_MEMCACHED_TESTSERVERS, 'cachestore_memcached');
        set_config('testclustered', true, 'cachestore_memcached');

        // First and instance that we can use to test the second server.
        $definition = cache_definition::load_adhoc(cache_store::MODE_APPLICATION, 'cachestore_memcached', 'phpunit_test');
        $instance = cachestore_memcached::initialise_test_instance($definition);

        if (!$instance->is_ready()) {
            $this->markTestSkipped();
        }

        // Now we are going to setup a connection to each independent server.
        set_config('testclustered', false, 'cachestore_memcached');
        set_config('testsetservers', '', 'cachestore_memcached');
        $checkinstances = array();
        foreach ($testservers as $testserver) {
            // We need to set a name, otherwise we get a reused connection.
            set_config('testname', $testserver, 'cachestore_memcached');
            set_config('testservers', $testserver, 'cachestore_memcached');
            $checkinstance = cachestore_memcached::initialise_test_instance($definition);
            if (!$checkinstance->is_ready()) {
                $this->markTestSkipped();
            }
            $checkinstances[] = $checkinstance;
        }

        $keys = array(
            // Alphanumeric.
            'abc', 'ABC', '123', 'aB1', '1aB',
            // Hyphens.
            'a-1', '1-a', '-a1', 'a1-',
            // Underscores.
            'a_1', '1_a', '_a1', 'a1_'
        );

        // Set each key.
        foreach ($keys as $key) {
            $this->assertTrue($instance->set($key, $key), "Failed to set key `$key`");
        }

        // Check each key.
        foreach ($keys as $key) {
            $this->assertEquals($key, $instance->get($key), "Failed to get key `$key`");
            foreach ($checkinstances as $id => $checkinstance) {
                $this->assertEquals($key, $checkinstance->get($key), "Failed to get key `$key` from server $id");
            }
        }

        // Reset a key.
        $this->assertTrue($instance->set($keys[0], 'New'), "Failed to reset key `$key`");
        $this->assertEquals('New', $instance->get($keys[0]), "Failed to get reset key `$key`");
        foreach ($checkinstances as $id => $checkinstance) {
            $this->assertEquals('New', $checkinstance->get($keys[0]), "Failed to get reset key `$key` from server $id");
        }

        // Delete and check that we can't retrieve.
        foreach ($keys as $key) {
            $this->assertTrue($instance->delete($key), "Failed to delete key `$key`");
            $this->assertFalse($instance->get($key), "Retrieved deleted key `$key`");
            foreach ($checkinstances as $id => $checkinstance) {
                $this->assertFalse($checkinstance->get($key), "Retrieved deleted key `$key` from server $id");
            }
        }

        // Try set many, and check that count is correct.
        $many = array();
        foreach ($keys as $key) {
            $many[] = array('key' => $key, 'value' => $key);
        }
        $returncount = $instance->set_many($many);
        $this->assertEquals(count($many), $returncount, 'Set many count didn\'t match');

        // Check keys retrieved with get_many.
        $values = $instance->get_many($keys);
        foreach ($keys as $key) {
            $this->assertTrue(isset($values[$key]), "Failed to get_many key `$key`");
            $this->assertEquals($key, $values[$key], "Failed to match get_many key `$key`");
        }
        foreach ($checkinstances as $id => $checkinstance) {
            $values = $checkinstance->get_many($keys);
            foreach ($keys as $key) {
                $this->assertTrue(isset($values[$key]), "Failed to get_many key `$key` from server $id");
                $this->assertEquals($key, $values[$key], "Failed to get_many key `$key` from server $id");
            }
        }

        // Delete many, make sure count matches.
        $returncount = $instance->delete_many($keys);
        $this->assertEquals(count($many), $returncount, 'Delete many count didn\'t match');

        // Check that each key was deleted.
        foreach ($keys as $key) {
            $this->assertFalse($instance->get($key), "Retrieved many deleted key `$key`");
            foreach ($checkinstances as $id => $checkinstance) {
                $this->assertFalse($checkinstance->get($key), "Retrieved many deleted key `$key` from server $id");
            }
        }

        // Set the keys again.
        $returncount = $instance->set_many($many);
        $this->assertEquals(count($many), $returncount, 'Set many count didn\'t match');

        // Purge.
        $this->assertTrue($instance->purge(), 'Failure to purge');

        // Delete and check that we can't retrieve.
        foreach ($keys as $key) {
            $this->assertFalse($instance->get($key), "Retrieved purged key `$key`");
            foreach ($checkinstances as $id => $checkinstance) {
                $this->assertFalse($checkinstance->get($key), "Retrieved purged key `$key` from server 2");
            }
        }
    }

    /**
     * Tests that memcached cache store doesn't just flush everything and instead deletes only what belongs to it
     * when it is marked as a shared cache.
     */
    public function test_multi_use_compatibility() {
        if (!cachestore_memcached::are_requirements_met() || !defined('TEST_CACHESTORE_MEMCACHED_TESTSERVERS')) {
            $this->markTestSkipped('Could not test cachestore_memcached. Requirements are not met.');
        }

        $definition = cache_definition::load_adhoc(cache_store::MODE_APPLICATION, 'cachestore_memcached', 'phpunit_test');
        $cachestore = $this->create_test_cache_with_config($definition, array('isshared' => true));
        if (!$cachestore->is_connection_ready()) {
            $this->markTestSkipped('Could not test cachestore_memcached. Connection is not ready.');
        }

        $connection = new Memcached(crc32(__METHOD__));
        $connection->addServers($this->get_servers(TEST_CACHESTORE_MEMCACHED_TESTSERVERS));
        $connection->setOptions(array(
            Memcached::OPT_COMPRESSION => true,
            Memcached::OPT_SERIALIZER => Memcached::SERIALIZER_PHP,
            Memcached::OPT_PREFIX_KEY => 'phpunit_',
            Memcached::OPT_BUFFER_WRITES => false
        ));

        // We must flush first to make sure nothing is there.
        $connection->flush();

        // Test the cachestore.
        $this->assertFalse($cachestore->get('test'));
        $this->assertTrue($cachestore->set('test', 'cachestore'));
        $this->assertSame('cachestore', $cachestore->get('test'));

        // Test the connection.
        $this->assertFalse($connection->get('test'));
        $this->assertEquals(Memcached::RES_NOTFOUND, $connection->getResultCode());
        $this->assertTrue($connection->set('test', 'connection'));
        $this->assertSame('connection', $connection->get('test'));

        // Test both again and make sure the values are correct.
        $this->assertSame('cachestore', $cachestore->get('test'));
        $this->assertSame('connection', $connection->get('test'));

        // Purge the cachestore and check the connection was not purged.
        $this->assertTrue($cachestore->purge());
        $this->assertFalse($cachestore->get('test'));
        $this->assertSame('connection', $connection->get('test'));
    }

    /**
     * Tests that memcached cache store flushes entire cache when it is using a dedicated cache.
     */
    public function test_dedicated_cache() {
        if (!cachestore_memcached::are_requirements_met() || !defined('TEST_CACHESTORE_MEMCACHED_TESTSERVERS')) {
            $this->markTestSkipped('Could not test cachestore_memcached. Requirements are not met.');
        }

        $definition = cache_definition::load_adhoc(cache_store::MODE_APPLICATION, 'cachestore_memcached', 'phpunit_test');
        $cachestore = $this->create_test_cache_with_config($definition, array('isshared' => false));
        $connection = new Memcached(crc32(__METHOD__));
        $connection->addServers($this->get_servers(TEST_CACHESTORE_MEMCACHED_TESTSERVERS));
        $connection->setOptions(array(
            Memcached::OPT_COMPRESSION => true,
            Memcached::OPT_SERIALIZER => Memcached::SERIALIZER_PHP,
            Memcached::OPT_PREFIX_KEY => 'phpunit_',
            Memcached::OPT_BUFFER_WRITES => false
        ));

        // We must flush first to make sure nothing is there.
        $connection->flush();

        // Test the cachestore.
        $this->assertFalse($cachestore->get('test'));
        $this->assertTrue($cachestore->set('test', 'cachestore'));
        $this->assertSame('cachestore', $cachestore->get('test'));

        // Test the connection.
        $this->assertFalse($connection->get('test'));
        $this->assertEquals(Memcached::RES_NOTFOUND, $connection->getResultCode());
        $this->assertTrue($connection->set('test', 'connection'));
        $this->assertSame('connection', $connection->get('test'));

        // Test both again and make sure the values are correct.
        $this->assertSame('cachestore', $cachestore->get('test'));
        $this->assertSame('connection', $connection->get('test'));

        // Purge the cachestore and check the connection was also purged.
        $this->assertTrue($cachestore->purge());
        $this->assertFalse($cachestore->get('test'));
        $this->assertFalse($connection->get('test'));
    }

    /**
     * Given a server string this returns an array of servers.
     *
     * @param string $serverstring
     * @return array
     */
    public function get_servers($serverstring) {
        $servers = array();
        foreach (explode("\n", $serverstring) as $server) {
            if (!is_array($server)) {
                $server = explode(':', $server, 3);
            }
            if (!array_key_exists(1, $server)) {
                $server[1] = 11211;
                $server[2] = 100;
            } else if (!array_key_exists(2, $server)) {
                $server[2] = 100;
            }
            $servers[] = $server;
        }
        return $servers;
    }

    /**
     * Creates a test instance for unit tests.
     * @param cache_definition $definition
     * @param array $configuration
     * @return null|cachestore_memcached
     */
    private function create_test_cache_with_config(cache_definition $definition, $configuration = array()) {
        $class = $this->get_class_name();

        if (!$class::are_requirements_met()) {
            return null;
        }
        if (!defined('TEST_CACHESTORE_MEMCACHED_TESTSERVERS')) {
            return null;
        }

        $configuration['servers'] = explode("\n", TEST_CACHESTORE_MEMCACHED_TESTSERVERS);

        $store = new $class('Test memcached', $configuration);
        $store->initialise($definition);

        return $store;
    }
}


text:
package org.quartz.impl.jdbcjobstore;

import org.quartz.utils.Key;

/**
 * <p>
 * Conveys the state of a fired-trigger record.
 * </p>
 *
 * @author James House
 */
public class FiredTriggerRecord implements java.io.Serializable {

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     *
     * Data members.
     *
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    private String fireInstanceId;

    private long fireTimestamp;

    private String schedulerInstanceId;

    private Key triggerKey;

    private String fireInstanceState;

    private boolean triggerIsVolatile;

    private Key jobKey;

    private boolean jobIsStateful;

    private boolean jobRequestsRecovery;

    private int priority;

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     *
     * Interface.
     *
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    public String getFireInstanceId() {
        return fireInstanceId;
    }

    public long getFireTimestamp() {
        return fireTimestamp;
    }

    public boolean isJobIsStateful() {
        return jobIsStateful;
    }

    public Key getJobKey() {
        return jobKey;
    }

    public String getSchedulerInstanceId() {
        return schedulerInstanceId;
    }

    public Key getTriggerKey() {
        return triggerKey;
    }

    public String getFireInstanceState() {
        return fireInstanceState;
    }

    public void setFireInstanceId(String string) {
        fireInstanceId = string;
    }

    public void setFireTimestamp(long l) {
        fireTimestamp = l;
    }

    public void setJobIsStateful(boolean b) {
        jobIsStateful = b;
    }

    public void setJobKey(Key key) {
        jobKey = key;
    }

    public void setSchedulerInstanceId(String string) {
        schedulerInstanceId = string;
    }

    public void setTriggerKey(Key key) {
        triggerKey = key;
    }

    public void setFireInstanceState(String string) {
        fireInstanceState = string;
    }

    public boolean isJobRequestsRecovery() {
        return jobRequestsRecovery;
    }

    public boolean isTriggerIsVolatile() {
        return triggerIsVolatile;
    }

    public void setJobRequestsRecovery(boolean b) {
        jobRequestsRecovery = b;
    }

    public void setTriggerIsVolatile(boolean b) {
        triggerIsVolatile = b;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

}

// EOF


text:
#ifndef __gl_es20_h_
#define __gl_es20_h_

#include <Availability.h>

#ifdef __cplusplus
extern "C" {
#endif

#define GL_APIENTRY
#define GL_API extern

/*-------------------------------------------------------------------------
 * Data type definitions
 *-----------------------------------------------------------------------*/

typedef void            GLvoid;
typedef char            GLchar;
typedef unsigned int    GLenum;
typedef unsigned char   GLboolean;
typedef unsigned int    GLbitfield;
typedef signed char     GLbyte;
typedef short           GLshort;
typedef int             GLint;
typedef int             GLsizei;
typedef unsigned char   GLubyte;
typedef unsigned short  GLushort;
typedef unsigned int    GLuint;
typedef float           GLfloat;
typedef float           GLclampf;
typedef int             GLfixed;
typedef int             GLclampx;
typedef long            GLintptr;
typedef long            GLsizeiptr;

/*-------------------------------------------------------------------------
 * Token definitions
 *-----------------------------------------------------------------------*/

/* OpenGL ES core versions */
#define GL_ES_VERSION_2_0                                1

/* ClearBufferMask */
#define GL_DEPTH_BUFFER_BIT                              0x00000100
#define GL_STENCIL_BUFFER_BIT                            0x00000400
#define GL_COLOR_BUFFER_BIT                              0x00004000

/* Boolean */
#define GL_FALSE                                         0
#define GL_TRUE                                          1

/* BeginMode */
#define GL_POINTS                                        0x0000
#define GL_LINES                                         0x0001
#define GL_LINE_LOOP                                     0x0002
#define GL_LINE_STRIP                                    0x0003
#define GL_TRIANGLES                                     0x0004
#define GL_TRIANGLE_STRIP                                0x0005
#define GL_TRIANGLE_FAN                                  0x0006

/* BlendingFactorDest */
#define GL_ZERO                                          0
#define GL_ONE                                           1
#define GL_SRC_COLOR                                     0x0300
#define GL_ONE_MINUS_SRC_COLOR                           0x0301
#define GL_SRC_ALPHA                                     0x0302
#define GL_ONE_MINUS_SRC_ALPHA                           0x0303
#define GL_DST_ALPHA                                     0x0304
#define GL_ONE_MINUS_DST_ALPHA                           0x0305

/* BlendingFactorSrc */
/*      GL_ZERO */
/*      GL_ONE */
#define GL_DST_COLOR                                     0x0306
#define GL_ONE_MINUS_DST_COLOR                           0x0307
#define GL_SRC_ALPHA_SATURATE                            0x0308
/*      GL_SRC_ALPHA */
/*      GL_ONE_MINUS_SRC_ALPHA */
/*      GL_DST_ALPHA */
/*      GL_ONE_MINUS_DST_ALPHA */

/* BlendEquationSeparate */
#define GL_FUNC_ADD                                      0x8006
#define GL_BLEND_EQUATION                                0x8009
#define GL_BLEND_EQUATION_RGB                            0x8009    /* same as BLEND_EQUATION */
#define GL_BLEND_EQUATION_ALPHA                          0x883D

/* BlendSubtract */
#define GL_FUNC_SUBTRACT                                 0x800A
#define GL_FUNC_REVERSE_SUBTRACT                         0x800B

/* Separate Blend Functions */
#define GL_BLEND_DST_RGB                                 0x80C8
#define GL_BLEND_SRC_RGB                                 0x80C9
#define GL_BLEND_DST_ALPHA                               0x80CA
#define GL_BLEND_SRC_ALPHA                               0x80CB
#define GL_CONSTANT_COLOR                                0x8001
#define GL_ONE_MINUS_CONSTANT_COLOR                      0x8002
#define GL_CONSTANT_ALPHA                                0x8003
#define GL_ONE_MINUS_CONSTANT_ALPHA                      0x8004
#define GL_BLEND_COLOR                                   0x8005

/* Buffer Objects */
#define GL_ARRAY_BUFFER                                  0x8892
#define GL_ELEMENT_ARRAY_BUFFER                          0x8893
#define GL_ARRAY_BUFFER_BINDING                          0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING                  0x8895

#define GL_STREAM_DRAW                                   0x88E0
#define GL_STATIC_DRAW                                   0x88E4
#define GL_DYNAMIC_DRAW                                  0x88E8

#define GL_BUFFER_SIZE                                   0x8764
#define GL_BUFFER_USAGE                                  0x8765

#define GL_CURRENT_VERTEX_ATTRIB                         0x8626

/* CullFaceMode */
#define GL_FRONT                                         0x0404
#define GL_BACK                                          0x0405
#define GL_FRONT_AND_BACK                                0x0408

/* DepthFunction */
/*      GL_NEVER */
/*      GL_LESS */
/*      GL_EQUAL */
/*      GL_LEQUAL */
/*      GL_GREATER */
/*      GL_NOTEQUAL */
/*      GL_GEQUAL */
/*      GL_ALWAYS */

/* EnableCap */
#define GL_TEXTURE_2D                                    0x0DE1
#define GL_CULL_FACE                                     0x0B44
#define GL_BLEND                                         0x0BE2
#define GL_DITHER                                        0x0BD0
#define GL_STENCIL_TEST                                  0x0B90
#define GL_DEPTH_TEST                                    0x0B71
#define GL_SCISSOR_TEST                                  0x0C11
#define GL_POLYGON_OFFSET_FILL                           0x8037
#define GL_SAMPLE_ALPHA_TO_COVERAGE                      0x809E
#define GL_SAMPLE_COVERAGE                               0x80A0

/* ErrorCode */
#define GL_NO_ERROR                                      0
#define GL_INVALID_ENUM                                  0x0500
#define GL_INVALID_VALUE                                 0x0501
#define GL_INVALID_OPERATION                             0x0502
#define GL_OUT_OF_MEMORY                                 0x0505

/* FrontFaceDirection */
#define GL_CW                                            0x0900
#define GL_CCW                                           0x0901

/* GetPName */
#define GL_LINE_WIDTH                                    0x0B21
#define GL_ALIASED_POINT_SIZE_RANGE                      0x846D
#define GL_ALIASED_LINE_WIDTH_RANGE                      0x846E
#define GL_CULL_FACE_MODE                                0x0B45
#define GL_FRONT_FACE                                    0x0B46
#define GL_DEPTH_RANGE                                   0x0B70
#define GL_DEPTH_WRITEMASK                               0x0B72
#define GL_DEPTH_CLEAR_VALUE                             0x0B73
#define GL_DEPTH_FUNC                                    0x0B74
#define GL_STENCIL_CLEAR_VALUE                           0x0B91
#define GL_STENCIL_FUNC                                  0x0B92
#define GL_STENCIL_FAIL                                  0x0B94
#define GL_STENCIL_PASS_DEPTH_FAIL                       0x0B95
#define GL_STENCIL_PASS_DEPTH_PASS                       0x0B96
#define GL_STENCIL_REF                                   0x0B97
#define GL_STENCIL_VALUE_MASK                            0x0B93
#define GL_STENCIL_WRITEMASK                             0x0B98
#define GL_STENCIL_BACK_FUNC                             0x8800
#define GL_STENCIL_BACK_FAIL                             0x8801
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL                  0x8802
#define GL_STENCIL_BACK_PASS_DEPTH_PASS                  0x8803
#define GL_STENCIL_BACK_REF                              0x8CA3
#define GL_STENCIL_BACK_VALUE_MASK                       0x8CA4
#define GL_STENCIL_BACK_WRITEMASK                        0x8CA5
#define GL_VIEWPORT                                      0x0BA2
#define GL_SCISSOR_BOX                                   0x0C10
/*      GL_SCISSOR_TEST */
#define GL_COLOR_CLEAR_VALUE                             0x0C22
#define GL_COLOR_WRITEMASK                               0x0C23
#define GL_UNPACK_ALIGNMENT                              0x0CF5
#define GL_PACK_ALIGNMENT                                0x0D05
#define GL_MAX_TEXTURE_SIZE                              0x0D33
#define GL_MAX_VIEWPORT_DIMS                             0x0D3A
#define GL_SUBPIXEL_BITS                                 0x0D50
#define GL_RED_BITS                                      0x0D52
#define GL_GREEN_BITS                                    0x0D53
#define GL_BLUE_BITS                                     0x0D54
#define GL_ALPHA_BITS                                    0x0D55
#define GL_DEPTH_BITS                                    0x0D56
#define GL_STENCIL_BITS                                  0x0D57
#define GL_POLYGON_OFFSET_UNITS                          0x2A00
/*      GL_POLYGON_OFFSET_FILL */
#define GL_POLYGON_OFFSET_FACTOR                         0x8038
#define GL_TEXTURE_BINDING_2D                            0x8069
#define GL_SAMPLE_BUFFERS                                0x80A8
#define GL_SAMPLES                                       0x80A9
#define GL_SAMPLE_COVERAGE_VALUE                         0x80AA
#define GL_SAMPLE_COVERAGE_INVERT                        0x80AB

/* GetTextureParameter */
/*      GL_TEXTURE_MAG_FILTER */
/*      GL_TEXTURE_MIN_FILTER */
/*      GL_TEXTURE_WRAP_S */
/*      GL_TEXTURE_WRAP_T */

#define GL_NUM_COMPRESSED_TEXTURE_FORMATS                0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS                    0x86A3

/* HintMode */
#define GL_DONT_CARE                                     0x1100
#define GL_FASTEST                                       0x1101
#define GL_NICEST                                        0x1102

/* HintTarget */
#define GL_GENERATE_MIPMAP_HINT                          0x8192

/* DataType */
#define GL_BYTE                                          0x1400
#define GL_UNSIGNED_BYTE                                 0x1401
#define GL_SHORT                                         0x1402
#define GL_UNSIGNED_SHORT                                0x1403
#define GL_INT                                           0x1404
#define GL_UNSIGNED_INT                                  0x1405
#define GL_FLOAT                                         0x1406
#define GL_FIXED                                         0x140C

/* PixelFormat */
#define GL_DEPTH_COMPONENT                               0x1902
#define GL_ALPHA                                         0x1906
#define GL_RGB                                           0x1907
#define GL_RGBA                                          0x1908
#define GL_LUMINANCE                                     0x1909
#define GL_LUMINANCE_ALPHA                               0x190A

/* PixelType */
/*      GL_UNSIGNED_BYTE */
#define GL_UNSIGNED_SHORT_4_4_4_4                        0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1                        0x8034
#define GL_UNSIGNED_SHORT_5_6_5                          0x8363

/* Shaders */
#define GL_FRAGMENT_SHADER                               0x8B30
#define GL_VERTEX_SHADER                                 0x8B31
#define GL_MAX_VERTEX_ATTRIBS                            0x8869
#define GL_MAX_VERTEX_UNIFORM_VECTORS                    0x8DFB
#define GL_MAX_VARYING_VECTORS                           0x8DFC
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS              0x8B4D
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS                0x8B4C
#define GL_MAX_TEXTURE_IMAGE_UNITS                       0x8872
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS                  0x8DFD
#define GL_SHADER_TYPE                                   0x8B4F
#define GL_DELETE_STATUS                                 0x8B80
#define GL_LINK_STATUS                                   0x8B82
#define GL_VALIDATE_STATUS                               0x8B83
#define GL_ATTACHED_SHADERS                              0x8B85
#define GL_ACTIVE_UNIFORMS                               0x8B86
#define GL_ACTIVE_UNIFORM_MAX_LENGTH                     0x8B87
#define GL_ACTIVE_ATTRIBUTES                             0x8B89
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH                   0x8B8A
#define GL_SHADING_LANGUAGE_VERSION                      0x8B8C
#define GL_CURRENT_PROGRAM                               0x8B8D

/* StencilFunction */
#define GL_NEVER                                         0x0200
#define GL_LESS                                          0x0201
#define GL_EQUAL                                         0x0202
#define GL_LEQUAL                                        0x0203
#define GL_GREATER                                       0x0204
#define GL_NOTEQUAL                                      0x0205
#define GL_GEQUAL                                        0x0206
#define GL_ALWAYS                                        0x0207

/* StencilOp */
/*      GL_ZERO */
#define GL_KEEP                                          0x1E00
#define GL_REPLACE                                       0x1E01
#define GL_INCR                                          0x1E02
#define GL_DECR                                          0x1E03
#define GL_INVERT                                        0x150A
#define GL_INCR_WRAP                                     0x8507
#define GL_DECR_WRAP                                     0x8508

/* StringName */
#define GL_VENDOR                                        0x1F00
#define GL_RENDERER                                      0x1F01
#define GL_VERSION                                       0x1F02
#define GL_EXTENSIONS                                    0x1F03

/* TextureMagFilter */
#define GL_NEAREST                                       0x2600
#define GL_LINEAR                                        0x2601

/* TextureMinFilter */
/*      GL_NEAREST */
/*      GL_LINEAR */
#define GL_NEAREST_MIPMAP_NEAREST                        0x2700
#define GL_LINEAR_MIPMAP_NEAREST                         0x2701
#define GL_NEAREST_MIPMAP_LINEAR                         0x2702
#define GL_LINEAR_MIPMAP_LINEAR                          0x2703

/* TextureParameterName */
#define GL_TEXTURE_MAG_FILTER                            0x2800
#define GL_TEXTURE_MIN_FILTER                            0x2801
#define GL_TEXTURE_WRAP_S                                0x2802
#define GL_TEXTURE_WRAP_T                                0x2803

/* TextureTarget */
/*      GL_TEXTURE_2D */
#define GL_TEXTURE                                       0x1702

#define GL_TEXTURE_CUBE_MAP                              0x8513
#define GL_TEXTURE_BINDING_CUBE_MAP                      0x8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X                   0x8515
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X                   0x8516
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y                   0x8517
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y                   0x8518
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z                   0x8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z                   0x851A
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE                     0x851C

/* TextureUnit */
#define GL_TEXTURE0                                      0x84C0
#define GL_TEXTURE1                                      0x84C1
#define GL_TEXTURE2                                      0x84C2
#define GL_TEXTURE3                                      0x84C3
#define GL_TEXTURE4                                      0x84C4
#define GL_TEXTURE5                                      0x84C5
#define GL_TEXTURE6                                      0x84C6
#define GL_TEXTURE7                                      0x84C7
#define GL_TEXTURE8                                      0x84C8
#define GL_TEXTURE9                                      0x84C9
#define GL_TEXTURE10                                     0x84CA
#define GL_TEXTURE11                                     0x84CB
#define GL_TEXTURE12                                     0x84CC
#define GL_TEXTURE13                                     0x84CD
#define GL_TEXTURE14                                     0x84CE
#define GL_TEXTURE15                                     0x84CF
#define GL_TEXTURE16                                     0x84D0
#define GL_TEXTURE17                                     0x84D1
#define GL_TEXTURE18                                     0x84D2
#define GL_TEXTURE19                                     0x84D3
#define GL_TEXTURE20                                     0x84D4
#define GL_TEXTURE21                                     0x84D5
#define GL_TEXTURE22                                     0x84D6
#define GL_TEXTURE23                                     0x84D7
#define GL_TEXTURE24                                     0x84D8
#define GL_TEXTURE25                                     0x84D9
#define GL_TEXTURE26                                     0x84DA
#define GL_TEXTURE27                                     0x84DB
#define GL_TEXTURE28                                     0x84DC
#define GL_TEXTURE29                                     0x84DD
#define GL_TEXTURE30                                     0x84DE
#define GL_TEXTURE31                                     0x84DF
#define GL_ACTIVE_TEXTURE                                0x84E0

/* TextureWrapMode */
#define GL_REPEAT                                        0x2901
#define GL_CLAMP_TO_EDGE                                 0x812F
#define GL_MIRRORED_REPEAT                               0x8370

/* Uniform Types */
#define GL_FLOAT_VEC2                                    0x8B50
#define GL_FLOAT_VEC3                                    0x8B51
#define GL_FLOAT_VEC4                                    0x8B52
#define GL_INT_VEC2                                      0x8B53
#define GL_INT_VEC3                                      0x8B54
#define GL_INT_VEC4                                      0x8B55
#define GL_BOOL                                          0x8B56
#define GL_BOOL_VEC2                                     0x8B57
#define GL_BOOL_VEC3                                     0x8B58
#define GL_BOOL_VEC4                                     0x8B59
#define GL_FLOAT_MAT2                                    0x8B5A
#define GL_FLOAT_MAT3                                    0x8B5B
#define GL_FLOAT_MAT4                                    0x8B5C
#define GL_SAMPLER_2D                                    0x8B5E
#define GL_SAMPLER_CUBE                                  0x8B60

/* Vertex Arrays */
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED                   0x8622
#define GL_VERTEX_ATTRIB_ARRAY_SIZE                      0x8623
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE                    0x8624
#define GL_VERTEX_ATTRIB_ARRAY_TYPE                      0x8625
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED                0x886A
#define GL_VERTEX_ATTRIB_ARRAY_POINTER                   0x8645
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING            0x889F

/* Read Format */
#define GL_IMPLEMENTATION_COLOR_READ_TYPE                0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT              0x8B9B

/* Shader Source */
#define GL_COMPILE_STATUS                                0x8B81
#define GL_INFO_LOG_LENGTH                               0x8B84
#define GL_SHADER_SOURCE_LENGTH                          0x8B88
#define GL_SHADER_COMPILER                               0x8DFA

/* Shader Binary */
#define GL_SHADER_BINARY_FORMATS                         0x8DF8
#define GL_NUM_SHADER_BINARY_FORMATS                     0x8DF9

/* Shader Precision-Specified Types */
#define GL_LOW_FLOAT                                     0x8DF0
#define GL_MEDIUM_FLOAT                                  0x8DF1
#define GL_HIGH_FLOAT                                    0x8DF2
#define GL_LOW_INT                                       0x8DF3
#define GL_MEDIUM_INT                                    0x8DF4
#define GL_HIGH_INT                                      0x8DF5

/* Framebuffer Object. */
#define GL_FRAMEBUFFER                                   0x8D40
#define GL_RENDERBUFFER                                  0x8D41

#define GL_RGBA4                                         0x8056
#define GL_RGB5_A1                                       0x8057
#define GL_RGB565                                        0x8D62
#define GL_DEPTH_COMPONENT16                             0x81A5
#define GL_STENCIL_INDEX8                                0x8D48

#define GL_RENDERBUFFER_WIDTH                            0x8D42
#define GL_RENDERBUFFER_HEIGHT                           0x8D43
#define GL_RENDERBUFFER_INTERNAL_FORMAT                  0x8D44
#define GL_RENDERBUFFER_RED_SIZE                         0x8D50
#define GL_RENDERBUFFER_GREEN_SIZE                       0x8D51
#define GL_RENDERBUFFER_BLUE_SIZE                        0x8D52
#define GL_RENDERBUFFER_ALPHA_SIZE                       0x8D53
#define GL_RENDERBUFFER_DEPTH_SIZE                       0x8D54
#define GL_RENDERBUFFER_STENCIL_SIZE                     0x8D55

#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE            0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME            0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL          0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE  0x8CD3

#define GL_COLOR_ATTACHMENT0                             0x8CE0
#define GL_DEPTH_ATTACHMENT                              0x8D00
#define GL_STENCIL_ATTACHMENT                            0x8D20

#define GL_NONE                                          0

#define GL_FRAMEBUFFER_COMPLETE                          0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT             0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT     0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS             0x8CD9
#define GL_FRAMEBUFFER_UNSUPPORTED                       0x8CDD

#define GL_FRAMEBUFFER_BINDING                           0x8CA6
#define GL_RENDERBUFFER_BINDING                          0x8CA7
#define GL_MAX_RENDERBUFFER_SIZE                         0x84E8

#define GL_INVALID_FRAMEBUFFER_OPERATION                 0x0506

/*-------------------------------------------------------------------------
 * Entrypoint definitions
 *-----------------------------------------------------------------------*/

GL_API void           GL_APIENTRY glActiveTexture (GLenum texture);
GL_API void           GL_APIENTRY glAttachShader (GLuint program, GLuint shader)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
GL_API void           GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
GL_API void           GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glBlendEquation (GLenum mode)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
GL_API void           GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
GL_API void           GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
GL_API GLenum         GL_APIENTRY glCheckFramebufferStatus (GLenum target)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glClear (GLbitfield mask);
GL_API void           GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
GL_API void           GL_APIENTRY glClearDepthf (GLclampf depth);
GL_API void           GL_APIENTRY glClearStencil (GLint s);
GL_API void           GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
GL_API void           GL_APIENTRY glCompileShader (GLuint shader)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
GL_API void           GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
GL_API void           GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
GL_API void           GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_API GLuint         GL_APIENTRY glCreateProgram (void)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API GLuint         GL_APIENTRY glCreateShader (GLenum type)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glCullFace (GLenum mode);
GL_API void           GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
GL_API void           GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glDeleteProgram (GLuint program)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glDeleteShader (GLuint shader)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
GL_API void           GL_APIENTRY glDepthFunc (GLenum func);
GL_API void           GL_APIENTRY glDepthMask (GLboolean flag);
GL_API void           GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
GL_API void           GL_APIENTRY glDetachShader (GLuint program, GLuint shader)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glDisable (GLenum cap);
GL_API void           GL_APIENTRY glDisableVertexAttribArray (GLuint index)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
GL_API void           GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
GL_API void           GL_APIENTRY glEnable (GLenum cap);
GL_API void           GL_APIENTRY glEnableVertexAttribArray (GLuint index)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glFinish (void);
GL_API void           GL_APIENTRY glFlush (void);
GL_API void           GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glFrontFace (GLenum mode);
GL_API void           GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
GL_API void           GL_APIENTRY glGenerateMipmap (GLenum target)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
GL_API void           GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API int            GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
GL_API void           GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_API GLenum         GL_APIENTRY glGetError (void);
GL_API void           GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
GL_API void           GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
GL_API void           GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API const GLubyte* GL_APIENTRY glGetString (GLenum name);
GL_API void           GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
GL_API void           GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
GL_API void           GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API int            GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glHint (GLenum target, GLenum mode);
GL_API GLboolean      GL_APIENTRY glIsBuffer (GLuint buffer);
GL_API GLboolean      GL_APIENTRY glIsEnabled (GLenum cap);
GL_API GLboolean      GL_APIENTRY glIsFramebuffer (GLuint framebuffer)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API GLboolean      GL_APIENTRY glIsProgram (GLuint program);
GL_API GLboolean      GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API GLboolean      GL_APIENTRY glIsShader (GLuint shader)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API GLboolean      GL_APIENTRY glIsTexture (GLuint texture);
GL_API void           GL_APIENTRY glLineWidth (GLfloat width);
GL_API void           GL_APIENTRY glLinkProgram (GLuint program)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
GL_API void           GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
GL_API void           GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
GL_API void           GL_APIENTRY glReleaseShaderCompiler (void)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
GL_API void           GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_API void           GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const *string, const GLint* length)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_API void           GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glStencilMask (GLuint mask);
GL_API void           GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
GL_API void           GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
GL_API void           GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
GL_API void           GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
GL_API void           GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
GL_API void           GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
GL_API void           GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
GL_API void           GL_APIENTRY glUniform1f (GLint location, GLfloat x)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform1i (GLint location, GLint x)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glUseProgram (GLuint program)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glValidateProgram (GLuint program)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
GL_API void           GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);

#ifdef __cplusplus
}
#endif

#endif /* __gl_es20_h_ */


text:
using FFImageLoading.Work;

namespace FFImageLoading.Transformations
{
    public class CircleTransformation : TransformationBase
    {
        public CircleTransformation() : this(0d, null)
        {
        }

		public CircleTransformation(double borderSize, string borderHexColor)
		{
			BorderSize = borderSize;
			BorderHexColor = borderHexColor;
		}

		public double BorderSize { get; set; }
		public string BorderHexColor { get; set; }

		public override string Key
        {
            get { return string.Format("CircleTransformation,borderSize={0},borderHexColor={1}", BorderSize, BorderHexColor); }
        }

        protected override BitmapHolder Transform(BitmapHolder bitmapSource, string path, Work.ImageSource source, bool isPlaceholder, string key)
        {
            return RoundedTransformation.ToRounded(bitmapSource, 0, 1f, 1f, BorderSize, BorderHexColor);
        }
    }
}


text:
<?php

namespace Arrayzy\Interfaces;

use Arrayzy\AbstractArray;

/**
 * An interface with helpful array converting methods.
 *
 * @author Victor Bocharsky <bocharsky.bw@gmail.com>
 */
interface ConvertibleInterface
{
    /**
     * Converts array to a string with default separator.
     *
     * @return string The string representation of array
     */
    public function __toString();

    /**
     * Converts instance to a native PHP array.
     *
     * @return array The native PHP array
     */
    public function toArray();

    /**
     * Implodes array to a readable string with specified separator.
     *
     * @param string $separator The element's separator
     * @param string $conjunction The last element conjunction
     *
     * @return string The readable string representation of array
     */
    public function toReadableString($separator = AbstractArray::DEFAULT_SEPARATOR, $conjunction = ' and ');

    /**
     * Implodes array to a string with specified separator.
     *
     * @param string $separator The element's separator
     *
     * @return string The string representation of array
     */
    public function toString($separator = AbstractArray::DEFAULT_SEPARATOR);

    /**
     * Encodes array to a JSON string.
     *
     * @param int $options The bitmask
     * @param int $depth The maximum depth (must be greater than zero)
     *
     * @return string The JSON string representation of array
     */
    public function toJson($options = 0, $depth = 512);
}


text:
.class public final Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction$Builder;
.super Ljava/lang/Object;
.source "PlaybackStateCompat.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "Builder"
.end annotation

# instance fields
.field private final mAction:Ljava/lang/String;

.field private mExtras:Landroid/os/Bundle;

.field private final mIcon:I

.field private final mName:Ljava/lang/CharSequence;

# direct methods
.method public constructor <init>(Ljava/lang/String;Ljava/lang/CharSequence;I)V
    .locals 2
    .param p1, "action"    # Ljava/lang/String;
    .param p2, "name"    # Ljava/lang/CharSequence;
    .param p3, "icon"    # I

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

    .line 713
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 714
    new-instance v0, Ljava/lang/IllegalArgumentException;

    .line 715
    const-string/jumbo v1, "You must specify an action to build a CustomAction."

    .line 714
    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 717
    :cond_0
    invoke-static {p2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 718
    new-instance v0, Ljava/lang/IllegalArgumentException;

    .line 719
    const-string/jumbo v1, "You must specify a name to build a CustomAction."

    .line 718
    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 721
    :cond_1
    if-nez p3, :cond_2

    .line 722
    new-instance v0, Ljava/lang/IllegalArgumentException;

    .line 723
    const-string/jumbo v1, "You must specify an icon resource id to build a CustomAction."

    .line 722
    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 725
    :cond_2
    iput-object p1, p0, Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction$Builder;->mAction:Ljava/lang/String;

    .line 726
    iput-object p2, p0, Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction$Builder;->mName:Ljava/lang/CharSequence;

    .line 727
    iput p3, p0, Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction$Builder;->mIcon:I

    .line 712
    return-void
.end method

# virtual methods
.method public build()Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction;
    .locals 6

    .prologue
    .line 751
    new-instance v0, Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction;

    iget-object v1, p0, Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction$Builder;->mAction:Ljava/lang/String;

    iget-object v2, p0, Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction$Builder;->mName:Ljava/lang/CharSequence;

    iget v3, p0, Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction$Builder;->mIcon:I

    iget-object v4, p0, Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction$Builder;->mExtras:Landroid/os/Bundle;

    const/4 v5, 0x0

    invoke-direct/range {v0 .. v5}, Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction;-><init>(Ljava/lang/String;Ljava/lang/CharSequence;ILandroid/os/Bundle;Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction;)V

    return-object v0
.end method

.method public setExtras(Landroid/os/Bundle;)Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction$Builder;
    .locals 0
    .param p1, "extras"    # Landroid/os/Bundle;

    .prologue
    .line 740
    iput-object p1, p0, Landroid/support/v4/media/session/PlaybackStateCompat$CustomAction$Builder;->mExtras:Landroid/os/Bundle;

    .line 741
    return-object p0
.end method