text:
<?php

namespace Nette\Utils;

use Nette;

/**
 * Basic manipulation with images.
 *
 * <code>
 * $image = Image::fromFile('nette.jpg');
 * $image->resize(150, 100);
 * $image->sharpen();
 * $image->send();
 * </code>
 *
 * @author     David Grudl
 *
 * @method void alphaBlending(bool $on)
 * @method void antialias(bool $on)
 * @method void arc($x, $y, $w, $h, $s, $e, $color)
 * @method void char($font, $x, $y, $char, $color)
 * @method void charUp($font, $x, $y, $char, $color)
 * @method int colorAllocate($red, $green, $blue)
 * @method int colorAllocateAlpha($red, $green, $blue, $alpha)
 * @method int colorAt($x, $y)
 * @method int colorClosest($red, $green, $blue)
 * @method int colorClosestAlpha($red, $green, $blue, $alpha)
 * @method int colorClosestHWB($red, $green, $blue)
 * @method void colorDeallocate($color)
 * @method int colorExact($red, $green, $blue)
 * @method int colorExactAlpha($red, $green, $blue, $alpha)
 * @method void colorMatch(Image $image2)
 * @method int colorResolve($red, $green, $blue)
 * @method int colorResolveAlpha($red, $green, $blue, $alpha)
 * @method void colorSet($index, $red, $green, $blue)
 * @method array colorsForIndex($index)
 * @method int colorsTotal()
 * @method int colorTransparent([$color])
 * @method void convolution(array $matrix, float $div, float $offset)
 * @method void copy(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH)
 * @method void copyMerge(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $opacity)
 * @method void copyMergeGray(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $opacity)
 * @method void copyResampled(Image $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH)
 * @method void copyResized(Image $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH)
 * @method void dashedLine($x1, $y1, $x2, $y2, $color)
 * @method void ellipse($cx, $cy, $w, $h, $color)
 * @method void fill($x, $y, $color)
 * @method void filledArc($cx, $cy, $w, $h, $s, $e, $color, $style)
 * @method void filledEllipse($cx, $cy, $w, $h, $color)
 * @method void filledPolygon(array $points, $numPoints, $color)
 * @method void filledRectangle($x1, $y1, $x2, $y2, $color)
 * @method void fillToBorder($x, $y, $border, $color)
 * @method void filter($filtertype [, ...])
 * @method int fontHeight($font)
 * @method int fontWidth($font)
 * @method array ftBBox($size, $angle, string $fontFile, string $text [, array $extrainfo])
 * @method array ftText($size, $angle, $x, $y, $col, string $fontFile, string $text [, array $extrainfo])
 * @method void gammaCorrect(float $inputgamma, float $outputgamma)
 * @method int interlace([$interlace])
 * @method bool isTrueColor()
 * @method void layerEffect($effect)
 * @method void line($x1, $y1, $x2, $y2, $color)
 * @method int loadFont(string $file)
 * @method void paletteCopy(Image $source)
 * @method void polygon(array $points, $numPoints, $color)
 * @method array psBBox(string $text, $font, $size [, $space] [, $tightness] [, float $angle])
 * @method void psEncodeFont($fontIndex, string $encodingfile)
 * @method void psExtendFont($fontIndex, float $extend)
 * @method void psFreeFont($fontindex)
 * @method resource psLoadFont(string $filename)
 * @method void psSlantFont($fontIndex, float $slant)
 * @method array psText(string $text, $font, $size, $color, $backgroundColor, $x, $y [, $space] [, $tightness] [, float $angle] [, $antialiasSteps])
 * @method void rectangle($x1, $y1, $x2, $y2, $col)
 * @method Image rotate(float $angle, $backgroundColor)
 * @method void saveAlpha(bool $saveflag)
 * @method void setBrush(Image $brush)
 * @method void setPixel($x, $y, $color)
 * @method void setStyle(array $style)
 * @method void setThickness($thickness)
 * @method void setTile(Image $tile)
 * @method void string($font, $x, $y, string $s, $col)
 * @method void stringUp($font, $x, $y, string $s, $col)
 * @method void trueColorToPalette(bool $dither, $ncolors)
 * @method array ttfBBox($size, $angle, string $fontfile, string $text)
 * @method array ttfText($size, $angle, $x, $y, $color, string $fontfile, string $text)
 * @method int types()
 * @property-read int $width
 * @property-read int $height
 * @property-read resource $imageResource
 */
class Image extends Nette\Object
{
	/** {@link resize()} only shrinks images */
	const SHRINK_ONLY = 1;

	/** {@link resize()} will ignore aspect ratio */
	const STRETCH = 2;

	/** {@link resize()} fits in given area so its dimensions are less than or equal to the required dimensions */
	const FIT = 0;

	/** {@link resize()} fills given area so its dimensions are greater than or equal to the required dimensions */
	const FILL = 4;

	/** {@link resize()} fills given area exactly */
	const EXACT = 8;

	/** @int image types {@link send()} */
	const JPEG = IMAGETYPE_JPEG,
		PNG = IMAGETYPE_PNG,
		GIF = IMAGETYPE_GIF;

	const EMPTY_GIF = "GIF89a\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00!\xf9\x04\x01\x00\x00\x00\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02D\x01\x00;";

	/** @deprecated */
	const ENLARGE = 0;

	/** @var resource */
	private $image;

	/**
	 * Returns RGB color.
	 * @param  int  red 0..255
	 * @param  int  green 0..255
	 * @param  int  blue 0..255
	 * @param  int  transparency 0..127
	 * @return array
	 */
	public static function rgb($red, $green, $blue, $transparency = 0)
	{
		return array(
			'red' => max(0, min(255, (int) $red)),
			'green' => max(0, min(255, (int) $green)),
			'blue' => max(0, min(255, (int) $blue)),
			'alpha' => max(0, min(127, (int) $transparency)),
		);
	}

	/**
	 * Opens image from file.
	 * @param  string
	 * @param  mixed  detected image format
	 * @throws Nette\NotSupportedException if gd extension is not loaded
	 * @throws UnknownImageFileException if file not found or file type is not known
	 * @return Image
	 */
	public static function fromFile($file, & $format = NULL)
	{
		if (!extension_loaded('gd')) {
			throw new Nette\NotSupportedException('PHP extension GD is not loaded.');
		}

		$info = @getimagesize($file); // @ - files smaller than 12 bytes causes read error

		switch ($format = $info[2]) {
			case self::JPEG:
				return new static(imagecreatefromjpeg($file));

			case self::PNG:
				return new static(imagecreatefrompng($file));

			case self::GIF:
				return new static(imagecreatefromgif($file));

			default:
				throw new UnknownImageFileException("Unknown image type or file '$file' not found.");
		}
	}

	/**
	 * Get format from the image stream in the string.
	 * @param  string
	 * @return mixed  detected image format
	 */
	public static function getFormatFromString($s)
	{
		$types = array('image/jpeg' => self::JPEG, 'image/gif' => self::GIF, 'image/png' => self::PNG);
		$type = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $s);
		return isset($types[$type]) ? $types[$type] : NULL;
	}

	/**
	 * Create a new image from the image stream in the string.
	 * @param  string
	 * @param  mixed  detected image format
	 * @return Image
	 */
	public static function fromString($s, & $format = NULL)
	{
		if (!extension_loaded('gd')) {
			throw new Nette\NotSupportedException('PHP extension GD is not loaded.');
		}

		$format = static::getFormatFromString($s);

		return new static(imagecreatefromstring($s));
	}

	/**
	 * Creates blank image.
	 * @param  int
	 * @param  int
	 * @param  array
	 * @return Image
	 */
	public static function fromBlank($width, $height, $color = NULL)
	{
		if (!extension_loaded('gd')) {
			throw new Nette\NotSupportedException('PHP extension GD is not loaded.');
		}

		$width = (int) $width;
		$height = (int) $height;
		if ($width < 1 || $height < 1) {
			throw new Nette\InvalidArgumentException('Image width and height must be greater than zero.');
		}

		$image = imagecreatetruecolor($width, $height);
		if (is_array($color)) {
			$color += array('alpha' => 0);
			$color = imagecolorallocatealpha($image, $color['red'], $color['green'], $color['blue'], $color['alpha']);
			imagealphablending($image, FALSE);
			imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $color);
			imagealphablending($image, TRUE);
		}
		return new static($image);
	}

	/**
	 * Wraps GD image.
	 * @param  resource
	 */
	public function __construct($image)
	{
		$this->setImageResource($image);
		imagesavealpha($image, TRUE);
	}

	/**
	 * Returns image width.
	 * @return int
	 */
	public function getWidth()
	{
		return imagesx($this->image);
	}

	/**
	 * Returns image height.
	 * @return int
	 */
	public function getHeight()
	{
		return imagesy($this->image);
	}

	/**
	 * Sets image resource.
	 * @param  resource
	 * @return self
	 */
	protected function setImageResource($image)
	{
		if (!is_resource($image) || get_resource_type($image) !== 'gd') {
			throw new Nette\InvalidArgumentException('Image is not valid.');
		}
		$this->image = $image;
		return $this;
	}

	/**
	 * Returns image GD resource.
	 * @return resource
	 */
	public function getImageResource()
	{
		return $this->image;
	}

	/**
	 * Resizes image.
	 * @param  mixed  width in pixels or percent
	 * @param  mixed  height in pixels or percent
	 * @param  int    flags
	 * @return self
	 */
	public function resize($width, $height, $flags = self::FIT)
	{
		if ($flags & self::EXACT) {
			return $this->resize($width, $height, self::FILL)->crop('50%', '50%', $width, $height);
		}

		list($newWidth, $newHeight) = static::calculateSize($this->getWidth(), $this->getHeight(), $width, $height, $flags);

		if ($newWidth !== $this->getWidth() || $newHeight !== $this->getHeight()) { // resize
			$newImage = static::fromBlank($newWidth, $newHeight, self::RGB(0, 0, 0, 127))->getImageResource();
			imagecopyresampled(
				$newImage, $this->image,
				0, 0, 0, 0,
				$newWidth, $newHeight, $this->getWidth(), $this->getHeight()
			);
			$this->image = $newImage;
		}

		if ($width < 0 || $height < 0) { // flip is processed in two steps for better quality
			$newImage = static::fromBlank($newWidth, $newHeight, self::RGB(0, 0, 0, 127))->getImageResource();
			imagecopyresampled(
				$newImage, $this->image,
				0, 0, $width < 0 ? $newWidth - 1 : 0, $height < 0 ? $newHeight - 1 : 0,
				$newWidth, $newHeight, $width < 0 ? -$newWidth : $newWidth, $height < 0 ? -$newHeight : $newHeight
			);
			$this->image = $newImage;
		}
		return $this;
	}

	/**
	 * Calculates dimensions of resized image.
	 * @param  mixed  source width
	 * @param  mixed  source height
	 * @param  mixed  width in pixels or percent
	 * @param  mixed  height in pixels or percent
	 * @param  int    flags
	 * @return array
	 */
	public static function calculateSize($srcWidth, $srcHeight, $newWidth, $newHeight, $flags = self::FIT)
	{
		if (substr($newWidth, -1) === '%') {
			$newWidth = round($srcWidth / 100 * abs($newWidth));
			$percents = TRUE;
		} else {
			$newWidth = (int) abs($newWidth);
		}

		if (substr($newHeight, -1) === '%') {
			$newHeight = round($srcHeight / 100 * abs($newHeight));
			$flags |= empty($percents) ? 0 : self::STRETCH;
		} else {
			$newHeight = (int) abs($newHeight);
		}

		if ($flags & self::STRETCH) { // non-proportional
			if (empty($newWidth) || empty($newHeight)) {
				throw new Nette\InvalidArgumentException('For stretching must be both width and height specified.');
			}

			if ($flags & self::SHRINK_ONLY) {
				$newWidth = round($srcWidth * min(1, $newWidth / $srcWidth));
				$newHeight = round($srcHeight * min(1, $newHeight / $srcHeight));
			}

		} else {  // proportional
			if (empty($newWidth) && empty($newHeight)) {
				throw new Nette\InvalidArgumentException('At least width or height must be specified.');
			}

			$scale = array();
			if ($newWidth > 0) { // fit width
				$scale[] = $newWidth / $srcWidth;
			}

			if ($newHeight > 0) { // fit height
				$scale[] = $newHeight / $srcHeight;
			}

			if ($flags & self::FILL) {
				$scale = array(max($scale));
			}

			if ($flags & self::SHRINK_ONLY) {
				$scale[] = 1;
			}

			$scale = min($scale);
			$newWidth = round($srcWidth * $scale);
			$newHeight = round($srcHeight * $scale);
		}

		return array(max((int) $newWidth, 1), max((int) $newHeight, 1));
	}

	/**
	 * Crops image.
	 * @param  mixed  x-offset in pixels or percent
	 * @param  mixed  y-offset in pixels or percent
	 * @param  mixed  width in pixels or percent
	 * @param  mixed  height in pixels or percent
	 * @return self
	 */
	public function crop($left, $top, $width, $height)
	{
		list($left, $top, $width, $height) = static::calculateCutout($this->getWidth(), $this->getHeight(), $left, $top, $width, $height);
		$newImage = static::fromBlank($width, $height, self::RGB(0, 0, 0, 127))->getImageResource();
		imagecopy($newImage, $this->image, 0, 0, $left, $top, $width, $height);
		$this->image = $newImage;
		return $this;
	}

	/**
	 * Calculates dimensions of cutout in image.
	 * @param  mixed  source width
	 * @param  mixed  source height
	 * @param  mixed  x-offset in pixels or percent
	 * @param  mixed  y-offset in pixels or percent
	 * @param  mixed  width in pixels or percent
	 * @param  mixed  height in pixels or percent
	 * @return array
	 */
	public static function calculateCutout($srcWidth, $srcHeight, $left, $top, $newWidth, $newHeight)
	{
		if (substr($newWidth, -1) === '%') {
			$newWidth = round($srcWidth / 100 * $newWidth);
		}
		if (substr($newHeight, -1) === '%') {
			$newHeight = round($srcHeight / 100 * $newHeight);
		}
		if (substr($left, -1) === '%') {
			$left = round(($srcWidth - $newWidth) / 100 * $left);
		}
		if (substr($top, -1) === '%') {
			$top = round(($srcHeight - $newHeight) / 100 * $top);
		}
		if ($left < 0) {
			$newWidth += $left; $left = 0;
		}
		if ($top < 0) {
			$newHeight += $top; $top = 0;
		}
		$newWidth = min((int) $newWidth, $srcWidth - $left);
		$newHeight = min((int) $newHeight, $srcHeight - $top);
		return array($left, $top, $newWidth, $newHeight);
	}

	/**
	 * Sharpen image.
	 * @return self
	 */
	public function sharpen()
	{
		imageconvolution($this->image, array( // my magic numbers ;)
			array( -1, -1, -1 ),
			array( -1, 24, -1 ),
			array( -1, -1, -1 ),
		), 16, 0);
		return $this;
	}

	/**
	 * Puts another image into this image.
	 * @param  Image
	 * @param  mixed  x-coordinate in pixels or percent
	 * @param  mixed  y-coordinate in pixels or percent
	 * @param  int  opacity 0..100
	 * @return self
	 */
	public function place(Image $image, $left = 0, $top = 0, $opacity = 100)
	{
		$opacity = max(0, min(100, (int) $opacity));

		if (substr($left, -1) === '%') {
			$left = round(($this->getWidth() - $image->getWidth()) / 100 * $left);
		}

		if (substr($top, -1) === '%') {
			$top = round(($this->getHeight() - $image->getHeight()) / 100 * $top);
		}

		if ($opacity === 100) {
			imagecopy(
				$this->image, $image->getImageResource(),
				$left, $top, 0, 0, $image->getWidth(), $image->getHeight()
			);

		} elseif ($opacity <> 0) {
			imagecopymerge(
				$this->image, $image->getImageResource(),
				$left, $top, 0, 0, $image->getWidth(), $image->getHeight(),
				$opacity
			);
		}
		return $this;
	}

	/**
	 * Saves image to the file.
	 * @param  string  filename
	 * @param  int  quality 0..100 (for JPEG and PNG)
	 * @param  int  optional image type
	 * @return bool TRUE on success or FALSE on failure.
	 */
	public function save($file = NULL, $quality = NULL, $type = NULL)
	{
		if ($type === NULL) {
			switch (strtolower(pathinfo($file, PATHINFO_EXTENSION))) {
				case 'jpg':
				case 'jpeg':
					$type = self::JPEG;
					break;
				case 'png':
					$type = self::PNG;
					break;
				case 'gif':
					$type = self::GIF;
			}
		}

		switch ($type) {
			case self::JPEG:
				$quality = $quality === NULL ? 85 : max(0, min(100, (int) $quality));
				return imagejpeg($this->image, $file, $quality);

			case self::PNG:
				$quality = $quality === NULL ? 9 : max(0, min(9, (int) $quality));
				return imagepng($this->image, $file, $quality);

			case self::GIF:
				return imagegif($this->image, $file);

			default:
				throw new Nette\InvalidArgumentException('Unsupported image type.');
		}
	}

	/**
	 * Outputs image to string.
	 * @param  int  image type
	 * @param  int  quality 0..100 (for JPEG and PNG)
	 * @return string
	 */
	public function toString($type = self::JPEG, $quality = NULL)
	{
		ob_start();
		$this->save(NULL, $quality, $type);
		return ob_get_clean();
	}

	/**
	 * Outputs image to string.
	 * @return string
	 */
	public function __toString()
	{
		try {
			return $this->toString();
		} catch (\Exception $e) {
			if (func_num_args()) {
				throw $e;
			}
			trigger_error("Exception in " . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR);
		}
	}

	/**
	 * Outputs image to browser.
	 * @param  int  image type
	 * @param  int  quality 0..100 (for JPEG and PNG)
	 * @return bool TRUE on success or FALSE on failure.
	 */
	public function send($type = self::JPEG, $quality = NULL)
	{
		if ($type !== self::GIF && $type !== self::PNG && $type !== self::JPEG) {
			throw new Nette\InvalidArgumentException('Unsupported image type.');
		}
		header('Content-Type: ' . image_type_to_mime_type($type));
		return $this->save(NULL, $quality, $type);
	}

	/**
	 * Call to undefined method.
	 *
	 * @param  string  method name
	 * @param  array   arguments
	 * @return mixed
	 * @throws MemberAccessException
	 */
	public function __call($name, $args)
	{
		$function = 'image' . $name;
		if (function_exists($function)) {
			foreach ($args as $key => $value) {
				if ($value instanceof self) {
					$args[$key] = $value->getImageResource();

				} elseif (is_array($value) && isset($value['red'])) { // rgb
					$args[$key] = imagecolorallocatealpha(
						$this->image,
						$value['red'], $value['green'], $value['blue'], $value['alpha']
					);
				}
			}
			array_unshift($args, $this->image);

			$res = call_user_func_array($function, $args);
			return is_resource($res) && get_resource_type($res) === 'gd' ? $this->setImageResource($res) : $res;
		}

		return parent::__call($name, $args);
	}

	public function __clone()
	{
		ob_start();
		imagegd2($this->image);
		$this->setImageResource(imagecreatefromstring(ob_get_clean()));
	}

}

/**
 * The exception that indicates invalid image file.
 */
class UnknownImageFileException extends \Exception
{
}


text:
<?php

class IdentityControllerCore extends FrontController
{
	public $auth = true;
	public $php_self = 'identity';
	public $authRedirection = 'identity';
	public $ssl = true;

	public function init()
	{
		parent::init();
		$this->customer = $this->context->customer;
	}

	/**
	 * Start forms process
	 * @see FrontController::postProcess()
	 */
	public function postProcess()
	{
		$origin_newsletter = (bool)$this->customer->newsletter;

		if (isset($_POST['years']) && isset($_POST['months']) && isset($_POST['days']))
			$this->customer->birthday = (int)($_POST['years']).'-'.(int)($_POST['months']).'-'.(int)($_POST['days']);

		if (Tools::isSubmit('submitIdentity'))
		{
			if (!@checkdate(Tools::getValue('months'), Tools::getValue('days'), Tools::getValue('years')) &&
				!(Tools::getValue('months') == '' && Tools::getValue('days') == '' && Tools::getValue('years') == ''))
				$this->errors[] = Tools::displayError('Invalid date of birth');
			else
			{
				$email = trim(Tools::getValue('email'));
				$this->customer->birthday = (empty($_POST['years']) ? '' : (int)$_POST['years'].'-'.(int)$_POST['months'].'-'.(int)$_POST['days']);
				$_POST['old_passwd'] = trim($_POST['old_passwd']);

				if (!Validate::isEmail($email))
					$this->errors[] = Tools::displayError('This e-mail address is not valid');
				elseif ($this->customer->email != $email && Customer::customerExists($email, true))
					$this->errors[] = Tools::displayError('An account is already registered with this e-mail.');
				elseif (empty($_POST['old_passwd']) || (Tools::encrypt($_POST['old_passwd']) != $this->context->cookie->passwd))
					$this->errors[] = Tools::displayError('Your password is incorrect.');
				elseif ($_POST['passwd'] != $_POST['confirmation'])
					$this->errors[] = Tools::displayError('Password and confirmation do not match');
				else
				{
					$prev_id_default_group = $this->customer->id_default_group;

					// Merge all errors of this file and of the Object Model
					$this->errors = array_merge($this->errors, $this->customer->validateController());
				}

				if (!count($this->errors))
				{
					$this->customer->id_default_group = (int)$prev_id_default_group;
					$this->customer->firstname = Tools::ucfirst(Tools::strtolower($this->customer->firstname));

					if (!isset($_POST['newsletter']))
						$this->customer->newsletter = 0;
					elseif (!$origin_newsletter && isset($_POST['newsletter']))
						if ($module_newsletter = Module::getInstanceByName('blocknewsletter'))
							if ($module_newsletter->active)
								$module_newsletter->confirmSubscription($this->customer->email);

					if (!isset($_POST['optin']))
						$this->customer->optin = 0;
					if (Tools::getValue('passwd'))
						$this->context->cookie->passwd = $this->customer->passwd;
					if ($this->customer->update())
					{
						$this->context->cookie->customer_lastname = $this->customer->lastname;
						$this->context->cookie->customer_firstname = $this->customer->firstname;
						$this->context->smarty->assign('confirmation', 1);
					}
					else
						$this->errors[] = Tools::displayError('Cannot update information');
				}
			}
		}
		else
			$_POST = array_map('stripslashes', $this->customer->getFields());

		return $this->customer;
	}
	/**
	 * Assign template vars related to page content
	 * @see FrontController::initContent()
	 */
	public function initContent()
	{
		parent::initContent();

		if ($this->customer->birthday)
			$birthday = explode('-', $this->customer->birthday);
		else
			$birthday = array('-', '-', '-');

		/* Generate years, months and days */
		$this->context->smarty->assign(array(
				'years' => Tools::dateYears(),
				'sl_year' => $birthday[0],
				'months' => Tools::dateMonths(),
				'sl_month' => $birthday[1],
				'days' => Tools::dateDays(),
				'sl_day' => $birthday[2],
				'errors' => $this->errors,
				'genders' => Gender::getGenders(),
			));

		$this->context->smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);

		$this->setTemplate(_PS_THEME_DIR_.'identity.tpl');
	}

	public function setMedia()
	{
		parent::setMedia();
		$this->addCSS(_THEME_CSS_DIR_.'identity.css');
	}

}

redpajama_set_name: RedPajamaGithub


text:
<?php
	namespace Wiki\Domain;

	/**
	 * @table log
	 * @author Dominik Jahn <dominik1991jahn@gmail.com>
	 * @version 0.1
	 * @since 0.1
	 */
	class Log extends Domain
	{
		  //
		 // CONSTRUCTOR
		//

		/**
		 * @author Dominik Jahn <dominik1991jahn@gmail.com>
		 * @version 0.1
		 * @since 0.1
		 */
		public function __construct() {

		}

		  //
		 // METHODS
		//

		public function jsonSerialize() {
			return [
				"user" => $this->user,
				"type" => $this->type,
				"timestamp" => $this->timestamp
			];
		}

		protected function CalculateChecksum() {
			return md5($this->Status.$this->objectTable.$this->{"object"}.$this->user->ID.$this->type.$this->timestamp->format("Y-m-d H:i:s"));
		}

		  //
		 // ATTRIBUTES
		//

		/**
		 * @field object_table
		 */
		protected $objectTable;

		/**
		 * @field object_id
		 */
		protected $object;

		/**
		 * @field user_id
		 */
		protected $user;

		/**
		 * @field type
		 */
		protected $type;

		/**
		 * @field timestamp
		 */
		protected $timestamp;

		  //
		 // GETTERS / SETTERS
		//

		# ObjectTable

		/**
		 * @author Dominik Jahn <dominik1991jahn@gmail.com>
		 * @version 0.1
		 * @since 0.1
		 */
		protected function GetObjectTable() {
			return $this->objectTable;
		}

		/**
		 * @author Dominik Jahn <dominik1991jahn@gmail.com>
		 * @version 0.1
		 * @since 0.1
		 */
		protected function SetObjectTable($value) {
			$this->objectTable = $value;
		}

		# Object

		/**
		 * @author Dominik Jahn <dominik1991jahn@gmail.com>
		 * @version 0.1
		 * @since 0.1
		 */
		protected function GetObject() {
			return $this->{"object"};
		}

		/**
		 * @author Dominik Jahn <dominik1991jahn@gmail.com>
		 * @version 0.1
		 * @since 0.1
		 */
		protected function SetObject($value) {
			$this->{"object"} = $value;
		}

		# User

		/**
		 * @author Dominik Jahn <dominik1991jahn@gmail.com>
		 * @version 0.1
		 * @since 0.1
		 */
		protected function GetUser() {
			return $this->user;
		}

		/**
		 * @author Dominik Jahn <dominik1991jahn@gmail.com>
		 * @version 0.1
		 * @since 0.1
		 */
		protected function SetUser(User $value) {
			$this->user = $value;
		}

		# Type

		/**
		 * @author Dominik Jahn <dominik1991jahn@gmail.com>
		 * @version 0.1
		 * @since 0.1
		 */
		protected function GetType() {
			return $this->type;
		}

		/**
		 * @author Dominik Jahn <dominik1991jahn@gmail.com>
		 * @version 0.1
		 * @since 0.1
		 */
		protected function SetType($value) {
			$this->type = $value;
		}

		# Timestamp

		/**
		 * @author Dominik Jahn <dominik1991jahn@gmail.com>
		 * @version 0.1
		 * @since 0.1
		 */
		protected function GetTimestamp() {
			return $this->timestamp;
		}

		/**
		 * @author Dominik Jahn <dominik1991jahn@gmail.com>
		 * @version 0.1
		 * @since 0.1
		 */
		protected function SetTimestamp(\DateTime $value) {
			$this->timestamp = $value;
		}

		  //
		 // CONSTANTS
		//

		const DB_TABLE = "log";

		const TYPE_CREATE = "CREATE";
		const TYPE_MODIFY = "MODIFY";
		const TYPE_DELETE = "DELETE";
	}
?>


text:
#include "mousearea.h"

void MouseArea::mouseAreaEnabled(bool enabled){
    item->setProperty("enabled",QVariant(enabled));
}

void MouseArea::onClicked(){
    if(canBeVoted){
        QString temp;
        if(!isClicked==1)
            temp="1";
        else
            temp="0";
        sendMessage("clicked",parent->name, temp);
    }
}

void MouseArea::connectSignal(){
    QObject::connect(this->item,SIGNAL(mouseAreaClicked()),this,SLOT(onClicked()));
    QObject::connect(this,SIGNAL(sendMessage(QString,QString,QString,QString,QString)),player,SLOT(receiveMessage(QString,QString,QString,QString,QString)));
    QObject::connect(player,SIGNAL(sendMessage(QString,QString,QString,QString,QString)),this,SLOT(receiveMessage(QString,QString,QString,QString,QString)));

}

void MouseArea::receiveMessage(QString str1, QString str2, QString str3, QString str4, QString str5){
    if(str1==parent->name){
        if(str2=="canBeVoted") canBeVoted=1;
        else if(str2=="cannotBeVoted") {
            canBeVoted=0;
            mouseAreaEnabled(0);
        }
        else if(str2=="finishClicked"){
            isClicked=!isClicked;
        }
        else if(canBeVoted){
            if(str2=="mouseAreaEnabled")
                mouseAreaEnabled(1);
            else if(str2=="mouseAreaDisabled"){
                mouseAreaEnabled(0);
                isClicked=0;
            }
        }
    }
    else if(str1=="clearClicked"){
        isClicked=0;
    }
}


text:
using Xunit;

namespace MySqlConnector.Tests;

public class MySqlParameterCollectionNameToIndexTests
{
	public MySqlParameterCollectionNameToIndexTests()
	{
		m_collection = new MySqlParameterCollection
		{
			new MySqlParameter { ParameterName = "A", Value = 1 },
			new MySqlParameter { ParameterName = "B", Value = 2 },
			new MySqlParameter { ParameterName = "C", Value = 3 },
		};
	}

	[Fact]
	public void IgnoreCase()
	{
		Assert.Equal(0, m_collection.NormalizedIndexOf("a"));
		Assert.Equal(1, m_collection.NormalizedIndexOf("b"));
		Assert.Equal(2, m_collection.NormalizedIndexOf("c"));
	}

	[Fact]
	public void RemoveFirst()
	{
		m_collection.Remove(m_collection[0]);
		Assert.Equal(-1, m_collection.NormalizedIndexOf("A"));
		Assert.Equal(0, m_collection.NormalizedIndexOf("B"));
		Assert.Equal(1, m_collection.NormalizedIndexOf("C"));
	}

	[Fact]
	public void RemoveSecond()
	{
		m_collection.Remove(m_collection[1]);
		Assert.Equal(0, m_collection.NormalizedIndexOf("A"));
		Assert.Equal(-1, m_collection.NormalizedIndexOf("B"));
		Assert.Equal(1, m_collection.NormalizedIndexOf("C"));
	}

	[Fact]
	public void RemoveLast()
	{
		m_collection.Remove(m_collection[2]);
		Assert.Equal(0, m_collection.NormalizedIndexOf("A"));
		Assert.Equal(1, m_collection.NormalizedIndexOf("B"));
		Assert.Equal(-1, m_collection.NormalizedIndexOf("C"));
	}

	[Fact]
	public void RemoveAtBeginning()
	{
		m_collection.RemoveAt(0);
		Assert.Equal(-1, m_collection.NormalizedIndexOf("A"));
		Assert.Equal(0, m_collection.NormalizedIndexOf("B"));
		Assert.Equal(1, m_collection.NormalizedIndexOf("C"));
	}

	[Fact]
	public void RemoveAtMiddle()
	{
		m_collection.RemoveAt(1);
		Assert.Equal(0, m_collection.NormalizedIndexOf("A"));
		Assert.Equal(-1, m_collection.NormalizedIndexOf("B"));
		Assert.Equal(1, m_collection.NormalizedIndexOf("C"));
	}

	[Fact]
	public void RemoveAtEnd()
	{
		m_collection.RemoveAt(2);
		Assert.Equal(0, m_collection.NormalizedIndexOf("A"));
		Assert.Equal(1, m_collection.NormalizedIndexOf("B"));
		Assert.Equal(-1, m_collection.NormalizedIndexOf("C"));
	}

	[Fact]
	public void InsertBeginning()
	{
		m_collection.Insert(0, new MySqlParameter { ParameterName = "D", Value = 4 });
		Assert.Equal(1, m_collection.NormalizedIndexOf("A"));
		Assert.Equal(2, m_collection.NormalizedIndexOf("B"));
		Assert.Equal(3, m_collection.NormalizedIndexOf("C"));
		Assert.Equal(0, m_collection.NormalizedIndexOf("D"));
	}

	[Fact]
	public void InsertMiddle()
	{
		m_collection.Insert(1, new MySqlParameter { ParameterName = "D", Value = 4 });
		Assert.Equal(0, m_collection.NormalizedIndexOf("A"));
		Assert.Equal(2, m_collection.NormalizedIndexOf("B"));
		Assert.Equal(3, m_collection.NormalizedIndexOf("C"));
		Assert.Equal(1, m_collection.NormalizedIndexOf("D"));
	}

	[Fact]
	public void InsertEnd()
	{
		m_collection.Insert(3, new MySqlParameter { ParameterName = "D", Value = 4 });
		Assert.Equal(0, m_collection.NormalizedIndexOf("A"));
		Assert.Equal(1, m_collection.NormalizedIndexOf("B"));
		Assert.Equal(2, m_collection.NormalizedIndexOf("C"));
		Assert.Equal(3, m_collection.NormalizedIndexOf("D"));
	}

	[Fact]
	public void AddEnd()
	{
		m_collection.Add(new MySqlParameter { ParameterName = "D", Value = 4 });
		Assert.Equal(0, m_collection.NormalizedIndexOf("A"));
		Assert.Equal(1, m_collection.NormalizedIndexOf("B"));
		Assert.Equal(2, m_collection.NormalizedIndexOf("C"));
		Assert.Equal(3, m_collection.NormalizedIndexOf("D"));
	}

	[Fact]
	public void ChangeParameter()
	{
		m_collection[1] = new MySqlParameter { ParameterName = "D", Value = 4 };
		Assert.Equal(0, m_collection.NormalizedIndexOf("A"));
		Assert.Equal(-1, m_collection.NormalizedIndexOf("B"));
		Assert.Equal(2, m_collection.NormalizedIndexOf("C"));
		Assert.Equal(1, m_collection.NormalizedIndexOf("D"));
	}

	MySqlParameterCollection m_collection;
}


text:
void PreProcessing::ImageFrameProcessingLogic()
{
	// convert input frame to RGB24 format
	ColorConversion::convertFrameToRGB24();

	// convert RGB frame to byte array
	ColorConversion::convertRGB24ToByteArray();

	// Call some OpenCL Kernel Call
	//cl_tmain();

	// Resize Image using openCV
	resizeImage();

	// get image features
	features = CNTKEvaluator::getFeatures(featureImageHeight, featureImageWidth);
}

void PreProcessing::resizeImage()
{
	cv::Mat Img = cv::Mat(inputImageHeight, inputImageWidth, CV_8UC3, originalImagedataArray);
	cv::Mat resImg = cv::Mat(featureImageHeight, featureImageWidth, CV_8UC3, cv::Scalar::all(0));
	cv::resize(Img, resImg, resImg.size(), 0, 0, CV_INTER_CUBIC);
	std::memcpy(resizedImagedataArray, resImg.data, 224 * 224 * 3 * sizeof(BYTE));
}


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

<title>InteractiveProcessEndpoint.RequestData (esoco-business 1.3.0 API)</title>
<meta name="date" content="2018-10-29">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

de.esoco.service

Class InteractiveProcessEndpoint.RequestData<T extends InteractiveProcessEndpoint.RequestData<T>>

java.lang.Object

org.obrel.core.RelatedObject

de.esoco.lib.json.JsonRelatedObject<T>

de.esoco.service.InteractiveProcessEndpoint.RequestData<T>

All Implemented Interfaces:

de.esoco.lib.json.JsonSerializable<T>, org.obrel.core.Relatable

Enclosing class:

InteractiveProcessEndpoint

public abstract static class InteractiveProcessEndpoint.RequestData<T extends InteractiveProcessEndpoint.RequestData<T>>
extends de.esoco.lib.json.JsonRelatedObject<T>

A container for the JSON serialization of process request data. The
 actual request data is contained in the relations of an instance.

Constructor Summary

Constructors

Constructor and Description

RequestData()

Method Summary

Methods inherited from class de.esoco.lib.json.JsonRelatedObject

appendTo, equals, fromJson, hashCode

Methods inherited from class org.obrel.core.RelatedObject

deleteRelation, get, getRelation, getRelations, notifyRelationListeners, readRelations, relationsEqual, relationsHashCode, relationsString, set, set, toString, transform, writeRelations

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Methods inherited from interface de.esoco.lib.json.JsonSerializable

toCompactJson, toJson

Methods inherited from interface org.obrel.core.Relatable

deleteRelation, deleteRelations, get, get, getAll, getRelationCount, getRelations, hasFlag, hasRelation, hasRelations, init, set, set, set, streamRelations

Constructor Detail

RequestData

public RequestData()

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('../math/mat4.js').Mat4} Mat4 */

/**
 * A skin contains data about the bones in a hierarchy that drive a skinned mesh animation.
 * Specifically, the skin stores the bone name and inverse bind matrix and for each bone. Inverse
 * bind matrices are instrumental in the mathematics of vertex skinning.
 */
class Skin {
    /**
     * Create a new Skin instance.
     *
     * @param {GraphicsDevice} graphicsDevice - The graphics device used to manage this skin.
     * @param {Mat4[]} ibp - The array of inverse bind matrices.
     * @param {string[]} boneNames - The array of bone names for the bones referenced by this skin.
     */
    constructor(graphicsDevice, ibp, boneNames) {
        // Constant between clones
        this.device = graphicsDevice;
        this.inverseBindPose = ibp;
        this.boneNames = boneNames;
    }
}

export { Skin };


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentBottom="true"
    android:orientation="horizontal"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="1dp"
    android:paddingRight="1dp">

<TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_gravity="center_horizontal"
        android:layout_marginLeft="5dp"
        android:textSize="25sp" />

</RelativeLayout>


text:
How to Participate
==================

You can browse the code at `our github repo <https://github.com/stackforge/savanna>`_ and :doc:`here <\quickstart>` are the instructions on how to launch Savanna.

If you would like to ask some questions or make proposals,
feel free to reach us on #savanna irc channel at `freenode <http://freenode.net/>`_.
Typically somebody from our team will be online at irc from 6:00 to 20:00 UTC.
You can also contact Savanna community directly by mailto:savanna-all@lists.launchpad.net
(please, note that your email address should be registered in launchpad,
otherwise your mail will be ignored by mailing system).

We're going to hold public weekly meetings on Thursday at 18:00 UTC on #openstack-meeting-alt irc channel.

If you want to contribute either to docs or to code, simply send us change request via review.openstack.org (gerrit).
You can file `bugs <https://bugs.launchpad.net/savanna>`_ and register `blueprints <https://blueprints.launchpad.net/savanna>`_ at
`Savanna launchpad page <https://launchpad.net/savanna>`_.


text:
@interface ClickHoldButtonCell : ImageButtonCell {
 @private
  BOOL enableClickHold_;
  BOOL enableRightClick_;
  NSTimeInterval clickHoldTimeout_;
  id clickHoldTarget_;                  // Weak.
  SEL clickHoldAction_;
  id accessibilityShowMenuTarget_;                  // Weak.
  SEL accessibilityShowMenuAction_;
  BOOL trackOnlyInRect_;
  BOOL activateOnDrag_;
}

// Enable click-hold? Default: NO.
@property(assign, nonatomic) BOOL enableClickHold;

// Enable right click? Default: NO. Needs to be set for accessibility.
@property(assign, nonatomic) BOOL enableRightClick;

// Timeout is in seconds (at least 0.0, at most 5; 0.0 means that the button
// will always have its click-hold action activated immediately on press).
// Default: 0.25 (a guess at a Cocoa-ish value).
@property(assign, nonatomic) NSTimeInterval clickHoldTimeout;

// Track only in the frame rectangle? Default: NO.
@property(assign, nonatomic) BOOL trackOnlyInRect;

// Activate (click-hold) immediately on a sufficiently-large drag (if not,
// always wait for timeout)? Default: YES.
@property(assign, nonatomic) BOOL activateOnDrag;

// Defines what to do when click-held (as per usual action/target).
@property(assign, nonatomic) id clickHoldTarget;
@property(assign, nonatomic) SEL clickHoldAction;

// Defines what to do when the Show Menu accessibility action is performed.
// (clickHoldAction should be independent from accessibilityShowMenuAction
// since different operations, e.g. releasing vs. not releasing a mouse button,
// may need to be performed for each occasion.)
@property(assign, nonatomic) id accessibilityShowMenuTarget;
@property(assign, nonatomic) SEL accessibilityShowMenuAction;

@end  // @interface ClickHoldButtonCell

#endif  // CHROME_BROWSER_UI_COCOA_CLICKHOLD_BUTTON_CELL_H_


text:
using System;

namespace CoreIdentityDemo.Services.Data.Entities
{
    public class UserToken
    {
        public virtual Guid UserId { get; set; }
        public virtual string LoginProvider { get; set; }
        public virtual string Name { get; set; }
        public virtual string Value { get; set; }

        public virtual User User { get; set; }
    }
}


text:
package org.wallride.support;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.wallride.domain.Article;
import org.wallride.model.ArticleSearchRequest;
import org.wallride.service.ArticleService;

public class ArticleUtils {

	private ArticleService articleService;

	public ArticleUtils(ArticleService articleService) {
		this.articleService = articleService;
	}

	public Page<Article> search(ArticleSearchRequest request, int size) {
		return articleService.getArticles(request, new PageRequest(0, size));
	}
}


text:
package pool

import (
	"context"
	"regexp"
	"sort"
	"strings"
	"sync"

	mgo "github.com/globalsign/mgo"
	"github.com/globalsign/mgo/bson"
	"github.com/pkg/errors"
	"github.com/tsuru/tsuru/db"
)

var (
	ErrInvalidConstraintType = errors.Errorf("invalid constraint type. Valid types are: %s", validConstraintTypes)
	validConstraintTypes     = []poolConstraintType{ConstraintTypeTeam, ConstraintTypeService, ConstraintTypeRouter, ConstraintTypePlan, ConstraintTypeVolumePlan}
)

type poolConstraintType string

const (
	ConstraintTypeTeam       = poolConstraintType("team")
	ConstraintTypeRouter     = poolConstraintType("router")
	ConstraintTypeService    = poolConstraintType("service")
	ConstraintTypePlan       = poolConstraintType("plan")
	ConstraintTypeVolumePlan = poolConstraintType("volume-plan")
)

type regexpCache struct {
	m sync.Map
}

var rCache = regexpCache{}

func (c *regexpCache) Lookup(pattern string) (*regexp.Regexp, error) {
	cached, _ := c.m.Load(pattern)
	if cached == nil {
		var err error
		cached, err = regexp.Compile(pattern)
		if err != nil {
			return nil, err
		}
		c.m.Store(pattern, cached)
	}
	return cached.(*regexp.Regexp), nil
}

func (c *regexpCache) MatchString(pattern, value string) (bool, error) {
	r, err := c.Lookup(pattern)
	if err != nil {
		return false, err
	}
	return r.MatchString(value), nil
}

type PoolConstraint struct {
	PoolExpr  string
	Field     poolConstraintType
	Values    []string
	Blacklist bool
}

func (c *PoolConstraint) checkExact(v string) bool {
	if c == nil {
		return false
	}
	for _, r := range c.Values {
		if r == v {
			return !c.Blacklist
		}
	}
	return c.Blacklist
}

func (c *PoolConstraint) check(v string) bool {
	if c == nil {
		return false
	}
	for _, r := range c.Values {
		pattern := exprAsGlobPattern(r)
		if match, _ := rCache.MatchString(pattern, v); match {
			return !c.Blacklist
		}
	}
	return c.Blacklist
}

func (c *PoolConstraint) AllowsAll() bool {
	if c == nil || c.Blacklist {
		return false
	}
	return c.checkExact("*")
}

type constraintList []*PoolConstraint

func (l constraintList) Len() int      { return len(l) }
func (l constraintList) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
func (l constraintList) Less(i, j int) bool {
	lenI, lenJ := len(l[i].PoolExpr), len(l[j].PoolExpr)
	if lenI == lenJ {
		return strings.Count(l[i].PoolExpr, "*") < strings.Count(l[j].PoolExpr, "*")
	}
	return lenI > lenJ
}

func SetPoolConstraint(c *PoolConstraint) error {
	conn, err := db.Conn()
	if err != nil {
		return err
	}
	defer conn.Close()
	isValid := validateConstraintType(c.Field)
	if !isValid {
		return ErrInvalidConstraintType
	}
	if len(c.Values) == 0 || (len(c.Values) == 1 && c.Values[0] == "") {
		errRem := conn.PoolsConstraints().Remove(bson.M{"poolexpr": c.PoolExpr, "field": c.Field})
		if errRem != mgo.ErrNotFound {
			return errRem
		}
		return nil
	}
	_, err = conn.PoolsConstraints().Upsert(bson.M{"poolexpr": c.PoolExpr, "field": c.Field}, c)
	return err
}

func AppendPoolConstraint(c *PoolConstraint) error {
	isValid := validateConstraintType(c.Field)
	if !isValid {
		return ErrInvalidConstraintType
	}
	return appendPoolConstraint(c.PoolExpr, c.Field, c.Values...)
}

func validateConstraintType(c poolConstraintType) bool {
	for _, v := range validConstraintTypes {
		if c == v {
			return true
		}
	}
	return false
}

func appendPoolConstraint(poolExpr string, field poolConstraintType, values ...string) error {
	conn, err := db.Conn()
	if err != nil {
		return err
	}
	defer conn.Close()
	_, err = conn.PoolsConstraints().Upsert(
		bson.M{"poolexpr": poolExpr, "field": field},
		bson.M{"$addToSet": bson.M{"values": bson.M{"$each": values}}},
	)
	return err
}

func removePoolConstraint(poolExpr string, field poolConstraintType, values ...string) error {
	conn, err := db.Conn()
	if err != nil {
		return err
	}
	defer conn.Close()
	return conn.PoolsConstraints().Update(bson.M{"poolexpr": poolExpr, "field": field}, bson.M{"$pullAll": bson.M{"values": values}})
}

func getPoolsSatisfyConstraints(ctx context.Context, exactCheck bool, field poolConstraintType, values ...string) ([]Pool, error) {
	pools, err := listPools(ctx, nil)
	if err != nil {
		return nil, err
	}
	var satisfying []Pool
	for _, p := range pools {
		checked := false
		constraints, err := getConstraintsForPool(p.Name, field)
		if err != nil {
			return nil, err
		}
		c, ok := constraints[field]
		if !ok || c.PoolExpr != p.Name {
			continue
		}
		for _, v := range values {
			if exactCheck && !c.checkExact(v) {
				continue
			}
			if !exactCheck && !c.check(v) {
				continue
			}
			checked = true
		}
		if checked || len(values) == 0 {
			satisfying = append(satisfying, p)
		}
	}
	return satisfying, nil
}

func getConstraintsForPool(pool string, fields ...poolConstraintType) (map[poolConstraintType]*PoolConstraint, error) {
	var query bson.M
	if len(fields) > 0 {
		query = bson.M{"field": bson.M{"$in": fields}}
	}
	constraints, err := ListPoolsConstraints(query)
	if err != nil {
		return nil, err
	}
	var matches []*PoolConstraint
	for _, c := range constraints {
		pattern := exprAsGlobPattern(c.PoolExpr)
		match, err := rCache.MatchString(pattern, pool)
		if err != nil {
			return nil, err
		}
		if match {
			matches = append(matches, c)
		}
	}
	sort.Sort(constraintList(matches))
	merged := make(map[poolConstraintType]*PoolConstraint)
	for i := range matches {
		if _, ok := merged[matches[i].Field]; !ok {
			merged[matches[i].Field] = matches[i]
		}
	}
	return merged, nil
}

func getExactConstraintForPool(pool string, field poolConstraintType) (*PoolConstraint, error) {
	constraints, err := ListPoolsConstraints(bson.M{"poolexpr": pool, "field": field})
	if err != nil {
		return nil, err
	}
	if len(constraints) == 0 {
		return nil, nil
	}
	return constraints[0], nil
}

func ListPoolsConstraints(query bson.M) ([]*PoolConstraint, error) {
	conn, err := db.Conn()
	if err != nil {
		return nil, err
	}
	defer conn.Close()
	constraints := []*PoolConstraint{}
	err = conn.PoolsConstraints().Find(query).All(&constraints)
	if err != nil {
		return nil, err
	}
	return constraints, nil
}

func ToConstraintType(value string) (poolConstraintType, error) {
	if !validateConstraintType(poolConstraintType(value)) {
		return "", ErrInvalidConstraintType
	}
	return poolConstraintType(value), nil
}


text:
layout: page
title: "Estación meteorológica digital usb con arduino"
image:
  thumb: 12/2012-04-14-08.29.49-1024x768.jpg
---

Utilizando un arduino nano, un módulo basado en el sensor SHT15 (temperatura y humedad), un módulo basado en el sensor MM1616 (iluminancia), y un módulo basado basado en el sensor MS5561C (presión y temperatura) se ha construido un sistema que permite registrar las siguientes variables del entorno:

- Temperatura
- Presión atmosférica
- Humedad
- iluminancia

El programa desarrollado para arduino proporciona un interface a través del puerto serie (9600 baudios). Al recibir el caracter ASCII 'g' el sistema obtiene medidas de cada uno de los sensores escribiendo sus valores en el puerto serie con el formato que se muestra en la siguiente figura:

El orden de las mediciones el es siguiente:

Temperatura (ºC, SHT15)

Humedad (%)

Iluminancia (lux)

Presión atmosférica (mb)

Temperatura (MS5561C)

Código fuente: Sketch Arduino para estación meteorológica


text:
<?php

declare(strict_types=1);

namespace Psi\Component\Grid;

use Psi\Component\ObjectAgent\AgentInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

interface ActionInterface
{
    /**
     * Perform this action on the given collection using the given agent with
     * the given options.
     */
    public function perform(AgentInterface $agent, string $classFqn, array $identifiers, array $options): ActionResponseInterface;

    /**
     * Configure the option resolver for this action.
     */
    public function configureOptions(OptionsResolver $options);
}


text:
package agui.support.v4.database;

import thahn.java.agui.utils.TextUtils;

/**
 * Helper for accessing features in {@link android.database.DatabaseUtils}
 * introduced after API level 4 in a backwards compatible fashion.
 */
public class DatabaseUtilsCompat {

    private DatabaseUtilsCompat() {
        /* Hide constructor */
    }

    /**
     * Concatenates two SQL WHERE clauses, handling empty or null values.
     */
    public static String concatenateWhere(String a, String b) {
        if (TextUtils.isEmpty(a)) {
            return b;
        }
        if (TextUtils.isEmpty(b)) {
            return a;
        }

        return "(" + a + ") AND (" + b + ")";
    }

    /**
     * Appends one set of selection args to another. This is useful when adding a selection
     * argument to a user provided set.
     */
    public static String[] appendSelectionArgs(String[] originalValues, String[] newValues) {
        if (originalValues == null || originalValues.length == 0) {
            return newValues;
        }
        String[] result = new String[originalValues.length + newValues.length ];
        System.arraycopy(originalValues, 0, result, 0, originalValues.length);
        System.arraycopy(newValues, 0, result, originalValues.length, newValues.length);
        return result;
    }
}


text:
package java.lang.management;

/**
 *

 * The management interface for the compilation system.
 *

 *

 * ObjectName: java.lang:type=Compilation
 *

 *
 * @since 1.5
 */
public interface CompilationMXBean {
    /**
     *

     * The name of the compilation system.
     *

     *
     * @return The compiler's name.
     */
    String getName();

    /**
     *

     * The approximate, cumulative time (in milliseconds) spent performing
     * compilation.
     *

     *
     * @return The total time spent compiling.
     * @throws UnsupportedOperationException if this is not supported.
     */
    long getTotalCompilationTime();

    /**
     *

     * Indicates whether or not the JVM supports compilation time monitoring.
     *

     *
     * @return true if supported, otherwise false.
     */
    boolean isCompilationTimeMonitoringSupported();
}


text:
'use strict';

var chai = chai || require('chai');
var bitcore = bitcore || require('../bitcore');

var should = chai.should();

var SINModule = bitcore.SIN;
var SIN;

describe('SIN', function() {
  it('should initialze the main object', function() {
    should.exist(SINModule);
  });
  it('should be able to create class', function() {
    SIN = SINModule;
    should.exist(SIN);
  });
  it('should be able to create instance', function() {
    var s = new SIN();
    should.exist(s);
  });
});


text:
package org.apache.cassandra.triggers;

import java.util.Collection;
import java.util.Collections;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import org.apache.cassandra.SchemaLoader;
import org.apache.cassandra.schema.Schema;
import org.apache.cassandra.cql3.QueryProcessor;
import org.apache.cassandra.cql3.UntypedResultSet;
import org.apache.cassandra.db.*;
import org.apache.cassandra.db.ConsistencyLevel;
import org.apache.cassandra.db.Mutation;
import org.apache.cassandra.db.partitions.Partition;
import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.exceptions.RequestExecutionException;
import org.apache.cassandra.service.StorageService;
import org.apache.cassandra.utils.FBUtilities;

import static org.apache.cassandra.utils.ByteBufferUtil.toInt;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class TriggersTest
{
    private static boolean triggerCreated = false;

    private static String ksName = "triggers_test_ks";
    private static String cfName = "test_table";
    private static String otherCf = "other_table";

    @BeforeClass
    public static void beforeTest() throws ConfigurationException
    {
        SchemaLoader.loadSchema();
    }

    @Before
    public void setup() throws Exception
    {
        StorageService.instance.initServer(0);

        String cql = String.format("CREATE KEYSPACE IF NOT EXISTS %s " +
                                   "WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1}",
                                   ksName);
        QueryProcessor.process(cql, ConsistencyLevel.ONE);

        cql = String.format("CREATE TABLE IF NOT EXISTS %s.%s (k int, v1 int, v2 int, PRIMARY KEY (k))", ksName, cfName);
        QueryProcessor.process(cql, ConsistencyLevel.ONE);

        cql = String.format("CREATE TABLE IF NOT EXISTS %s.%s (k int, v1 int, v2 int, PRIMARY KEY (k))", ksName, otherCf);
        QueryProcessor.process(cql, ConsistencyLevel.ONE);

        // no conditional execution of create trigger stmt yet
        if (! triggerCreated)
        {
            cql = String.format("CREATE TRIGGER trigger_1 ON %s.%s USING '%s'",
                                ksName, cfName, TestTrigger.class.getName());
            QueryProcessor.process(cql, ConsistencyLevel.ONE);
            triggerCreated = true;
        }
    }

    @Test
    public void executeTriggerOnCqlInsert() throws Exception
    {
        String cql = String.format("INSERT INTO %s.%s (k, v1) VALUES (0, 0)", ksName, cfName);
        QueryProcessor.process(cql, ConsistencyLevel.ONE);
        assertUpdateIsAugmented(0);
    }

    @Test
    public void executeTriggerOnCqlBatchInsert() throws Exception
    {
        String cql = String.format("BEGIN BATCH " +
                                   "    INSERT INTO %s.%s (k, v1) VALUES (1, 1); " +
                                   "APPLY BATCH",
                                   ksName, cfName);
        QueryProcessor.process(cql, ConsistencyLevel.ONE);
        assertUpdateIsAugmented(1);
    }

    @Test
    public void executeTriggerOnCqlInsertWithConditions() throws Exception
    {
        String cql = String.format("INSERT INTO %s.%s (k, v1) VALUES (4, 4) IF NOT EXISTS", ksName, cfName);
        QueryProcessor.process(cql, ConsistencyLevel.ONE);
        assertUpdateIsAugmented(4);
    }

    @Test
    public void executeTriggerOnCqlBatchWithConditions() throws Exception
    {
        String cql = String.format("BEGIN BATCH " +
                                   "  INSERT INTO %1$s.%2$s (k, v1) VALUES (5, 5) IF NOT EXISTS; " +
                                   "  INSERT INTO %1$s.%2$s (k, v1) VALUES (5, 5); " +
                                   "APPLY BATCH",
                                    ksName, cfName);
        QueryProcessor.process(cql, ConsistencyLevel.ONE);
        assertUpdateIsAugmented(5);
    }

    @Test(expected=org.apache.cassandra.exceptions.InvalidRequestException.class)
    public void onCqlUpdateWithConditionsRejectGeneratedUpdatesForDifferentPartition() throws Exception
    {
        String cf = "cf" + System.nanoTime();
        try
        {
            setupTableWithTrigger(cf, CrossPartitionTrigger.class);
            String cql = String.format("INSERT INTO %s.%s (k, v1) VALUES (7, 7) IF NOT EXISTS", ksName, cf);
            QueryProcessor.process(cql, ConsistencyLevel.ONE);
        }
        finally
        {
            assertUpdateNotExecuted(cf, 7);
        }
    }

    @Test(expected=org.apache.cassandra.exceptions.InvalidRequestException.class)
    public void onCqlUpdateWithConditionsRejectGeneratedUpdatesForDifferentTable() throws Exception
    {
        String cf = "cf" + System.nanoTime();
        try
        {
            setupTableWithTrigger(cf, CrossTableTrigger.class);
            String cql = String.format("INSERT INTO %s.%s (k, v1) VALUES (8, 8) IF NOT EXISTS", ksName, cf);
            QueryProcessor.process(cql, ConsistencyLevel.ONE);
        }
        finally
        {
            assertUpdateNotExecuted(cf, 7);
        }
    }

    @Test(expected=org.apache.cassandra.exceptions.InvalidRequestException.class)
    public void ifTriggerThrowsErrorNoMutationsAreApplied() throws Exception
    {
        String cf = "cf" + System.nanoTime();
        try
        {
            setupTableWithTrigger(cf, ErrorTrigger.class);
            String cql = String.format("INSERT INTO %s.%s (k, v1) VALUES (11, 11)", ksName, cf);
            QueryProcessor.process(cql, ConsistencyLevel.ONE);
        }
        catch (Exception e)
        {
            assertTrue(e.getMessage().equals(ErrorTrigger.MESSAGE));
            throw e;
        }
        finally
        {
            assertUpdateNotExecuted(cf, 11);
        }
    }

    private void setupTableWithTrigger(String cf, Class<? extends ITrigger> triggerImpl)
    throws RequestExecutionException
    {
        String cql = String.format("CREATE TABLE IF NOT EXISTS %s.%s (k int, v1 int, v2 int, PRIMARY KEY (k))", ksName, cf);
        QueryProcessor.process(cql, ConsistencyLevel.ONE);

        // no conditional execution of create trigger stmt yet
        cql = String.format("CREATE TRIGGER trigger_1 ON %s.%s USING '%s'",
                            ksName, cf, triggerImpl.getName());
        QueryProcessor.process(cql, ConsistencyLevel.ONE);
    }

    private void assertUpdateIsAugmented(int key)
    {
        UntypedResultSet rs = QueryProcessor.executeInternal(
                String.format("SELECT * FROM %s.%s WHERE k=%s", ksName, cfName, key));
        assertTrue(String.format("Expected value (%s) for augmented cell v2 was not found", key), rs.one().has("v2"));
        assertEquals(999, rs.one().getInt("v2"));
    }

    private void assertUpdateNotExecuted(String cf, int key)
    {
        UntypedResultSet rs = QueryProcessor.executeInternal(
                String.format("SELECT * FROM %s.%s WHERE k=%s", ksName, cf, key));
        assertTrue(rs.isEmpty());
    }

    public static class TestTrigger implements ITrigger
    {
        public Collection<Mutation> augment(Partition partition)
        {
            RowUpdateBuilder update = new RowUpdateBuilder(partition.metadata(), FBUtilities.timestampMicros(), partition.partitionKey().getKey());
            update.add("v2", 999);

            return Collections.singletonList(update.build());
        }
    }

    public static class CrossPartitionTrigger implements ITrigger
    {
        public Collection<Mutation> augment(Partition partition)
        {
            RowUpdateBuilder update = new RowUpdateBuilder(partition.metadata(), FBUtilities.timestampMicros(), toInt(partition.partitionKey().getKey()) + 1000);
            update.add("v2", 999);

            return Collections.singletonList(update.build());
        }
    }

    public static class CrossTableTrigger implements ITrigger
    {
        public Collection<Mutation> augment(Partition partition)
        {

            RowUpdateBuilder update = new RowUpdateBuilder(Schema.instance.getTableMetadata(ksName, otherCf), FBUtilities.timestampMicros(), partition.partitionKey().getKey());
            update.add("v2", 999);

            return Collections.singletonList(update.build());
        }
    }

    public static class ErrorTrigger implements ITrigger
    {
        public static final String MESSAGE = "Thrown by ErrorTrigger";
        public Collection<Mutation> augment(Partition partition)
        {
            throw new org.apache.cassandra.exceptions.InvalidRequestException(MESSAGE);
        }
    }
}


text:
{% extends "base.html" %}

{% block title %}Subscription to {{ cl.long_name }}{% endblock %}

{% block content %}

Subscription to {{ cl.long_name }}

You email address {{ email }} has been successfully subscribed to {{ cl.long_name }}

Return to the list view

{% endblock %}


text:
// Last time updated: 2019-06-21 4:09:42 AM UTC

// ________________________
// MultiStreamsMixer v1.2.2

// Open-Sourced: https://github.com/muaz-khan/MultiStreamsMixer

// --------------------------------------------------
// Muaz Khan     - www.MuazKhan.com
// MIT License   - www.WebRTC-Experiment.com/licence
// --------------------------------------------------

function MultiStreamsMixer(arrayOfMediaStreams, elementClass) {

    var browserFakeUserAgent = 'Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45';

    (function(that) {
        if (typeof RecordRTC !== 'undefined') {
            return;
        }

        if (!that) {
            return;
        }

        if (typeof window !== 'undefined') {
            return;
        }

        if (typeof global === 'undefined') {
            return;
        }

        global.navigator = {
            userAgent: browserFakeUserAgent,
            getUserMedia: function() {}
        };

        if (!global.console) {
            global.console = {};
        }

        if (typeof global.console.log === 'undefined' || typeof global.console.error === 'undefined') {
            global.console.error = global.console.log = global.console.log || function() {
                console.log(arguments);
            };
        }

        if (typeof document === 'undefined') {
            /*global document:true */
            that.document = {
                documentElement: {
                    appendChild: function() {
                        return '';
                    }
                }
            };

            document.createElement = document.captureStream = document.mozCaptureStream = function() {
                var obj = {
                    getContext: function() {
                        return obj;
                    },
                    play: function() {},
                    pause: function() {},
                    drawImage: function() {},
                    toDataURL: function() {
                        return '';
                    },
                    style: {}
                };
                return obj;
            };

            that.HTMLVideoElement = function() {};
        }

        if (typeof location === 'undefined') {
            /*global location:true */
            that.location = {
                protocol: 'file:',
                href: '',
                hash: ''
            };
        }

        if (typeof screen === 'undefined') {
            /*global screen:true */
            that.screen = {
                width: 0,
                height: 0
            };
        }

        if (typeof URL === 'undefined') {
            /*global screen:true */
            that.URL = {
                createObjectURL: function() {
                    return '';
                },
                revokeObjectURL: function() {
                    return '';
                }
            };
        }

        /*global window:true */
        that.window = global;
    })(typeof global !== 'undefined' ? global : null);

    // requires: chrome://flags/#enable-experimental-web-platform-features

    elementClass = elementClass || 'multi-streams-mixer';

    var videos = [];
    var isStopDrawingFrames = false;

    var canvas = document.createElement('canvas');
    var context = canvas.getContext('2d');
    canvas.style.opacity = 0;
    canvas.style.position = 'absolute';
    canvas.style.zIndex = -1;
    canvas.style.top = '-1000em';
    canvas.style.left = '-1000em';
    canvas.className = elementClass;
    (document.body || document.documentElement).appendChild(canvas);

    this.disableLogs = false;
    this.frameInterval = 10;

    this.width = 360;
    this.height = 240;

    // use gain node to prevent echo
    this.useGainNode = true;

    var self = this;

    // _____________________________
    // Cross-Browser-Declarations.js

    // WebAudio API representer
    var AudioContext = window.AudioContext;

    if (typeof AudioContext === 'undefined') {
        if (typeof webkitAudioContext !== 'undefined') {
            /*global AudioContext:true */
            AudioContext = webkitAudioContext;
        }

        if (typeof mozAudioContext !== 'undefined') {
            /*global AudioContext:true */
            AudioContext = mozAudioContext;
        }
    }

    /*jshint -W079 */
    var URL = window.URL;

    if (typeof URL === 'undefined' && typeof webkitURL !== 'undefined') {
        /*global URL:true */
        URL = webkitURL;
    }

    if (typeof navigator !== 'undefined' && typeof navigator.getUserMedia === 'undefined') { // maybe window.navigator?
        if (typeof navigator.webkitGetUserMedia !== 'undefined') {
            navigator.getUserMedia = navigator.webkitGetUserMedia;
        }

        if (typeof navigator.mozGetUserMedia !== 'undefined') {
            navigator.getUserMedia = navigator.mozGetUserMedia;
        }
    }

    var MediaStream = window.MediaStream;

    if (typeof MediaStream === 'undefined' && typeof webkitMediaStream !== 'undefined') {
        MediaStream = webkitMediaStream;
    }

    /*global MediaStream:true */
    if (typeof MediaStream !== 'undefined') {
        // override "stop" method for all browsers
        if (typeof MediaStream.prototype.stop === 'undefined') {
            MediaStream.prototype.stop = function() {
                this.getTracks().forEach(function(track) {
                    track.stop();
                });
            };
        }
    }

    var Storage = {};

    if (typeof AudioContext !== 'undefined') {
        Storage.AudioContext = AudioContext;
    } else if (typeof webkitAudioContext !== 'undefined') {
        Storage.AudioContext = webkitAudioContext;
    }

    function setSrcObject(stream, element) {
        if ('srcObject' in element) {
            element.srcObject = stream;
        } else if ('mozSrcObject' in element) {
            element.mozSrcObject = stream;
        } else {
            element.srcObject = stream;
        }
    }

    this.startDrawingFrames = function() {
        drawVideosToCanvas();
    };

    function drawVideosToCanvas() {
        if (isStopDrawingFrames) {
            return;
        }

        var videosLength = videos.length;

        var fullcanvas = false;
        var remaining = [];
        videos.forEach(function(video) {
            if (!video.stream) {
                video.stream = {};
            }

            if (video.stream.fullcanvas) {
                fullcanvas = video;
            } else {
                // todo: video.stream.active or video.stream.live to fix blank frames issues?
                remaining.push(video);
            }
        });

        if (fullcanvas) {
            canvas.width = fullcanvas.stream.width;
            canvas.height = fullcanvas.stream.height;
        } else if (remaining.length) {
            canvas.width = videosLength > 1 ? remaining[0].width * 2 : remaining[0].width;

            var height = 1;
            if (videosLength === 3 || videosLength === 4) {
                height = 2;
            }
            if (videosLength === 5 || videosLength === 6) {
                height = 3;
            }
            if (videosLength === 7 || videosLength === 8) {
                height = 4;
            }
            if (videosLength === 9 || videosLength === 10) {
                height = 5;
            }
            canvas.height = remaining[0].height * height;
        } else {
            canvas.width = self.width || 360;
            canvas.height = self.height || 240;
        }

        if (fullcanvas && fullcanvas instanceof HTMLVideoElement) {
            drawImage(fullcanvas);
        }

        remaining.forEach(function(video, idx) {
            drawImage(video, idx);
        });

        setTimeout(drawVideosToCanvas, self.frameInterval);
    }

    function drawImage(video, idx) {
        if (isStopDrawingFrames) {
            return;
        }

        var x = 0;
        var y = 0;
        var width = video.width;
        var height = video.height;

        if (idx === 1) {
            x = video.width;
        }

        if (idx === 2) {
            y = video.height;
        }

        if (idx === 3) {
            x = video.width;
            y = video.height;
        }

        if (idx === 4) {
            y = video.height * 2;
        }

        if (idx === 5) {
            x = video.width;
            y = video.height * 2;
        }

        if (idx === 6) {
            y = video.height * 3;
        }

        if (idx === 7) {
            x = video.width;
            y = video.height * 3;
        }

        if (typeof video.stream.left !== 'undefined') {
            x = video.stream.left;
        }

        if (typeof video.stream.top !== 'undefined') {
            y = video.stream.top;
        }

        if (typeof video.stream.width !== 'undefined') {
            width = video.stream.width;
        }

        if (typeof video.stream.height !== 'undefined') {
            height = video.stream.height;
        }

        context.drawImage(video, x, y, width, height);

        if (typeof video.stream.onRender === 'function') {
            video.stream.onRender(context, x, y, width, height, idx);
        }
    }

    function getMixedStream() {
        isStopDrawingFrames = false;
        var mixedVideoStream = getMixedVideoStream();

        var mixedAudioStream = getMixedAudioStream();
        if (mixedAudioStream) {
            mixedAudioStream.getTracks().filter(function(t) {
                return t.kind === 'audio';
            }).forEach(function(track) {
                mixedVideoStream.addTrack(track);
            });
        }

        var fullcanvas;
        arrayOfMediaStreams.forEach(function(stream) {
            if (stream.fullcanvas) {
                fullcanvas = true;
            }
        });

        // mixedVideoStream.prototype.appendStreams = appendStreams;
        // mixedVideoStream.prototype.resetVideoStreams = resetVideoStreams;
        // mixedVideoStream.prototype.clearRecordedData = clearRecordedData;

        return mixedVideoStream;
    }

    function getMixedVideoStream() {
        resetVideoStreams();

        var capturedStream;

        if ('captureStream' in canvas) {
            capturedStream = canvas.captureStream();
        } else if ('mozCaptureStream' in canvas) {
            capturedStream = canvas.mozCaptureStream();
        } else if (!self.disableLogs) {
            console.error('Upgrade to latest Chrome or otherwise enable this flag: chrome://flags/#enable-experimental-web-platform-features');
        }

        var videoStream = new MediaStream();

        capturedStream.getTracks().filter(function(t) {
            return t.kind === 'video';
        }).forEach(function(track) {
            videoStream.addTrack(track);
        });

        canvas.stream = videoStream;

        return videoStream;
    }

    function getMixedAudioStream() {
        // via: @pehrsons
        if (!Storage.AudioContextConstructor) {
            Storage.AudioContextConstructor = new Storage.AudioContext();
        }

        self.audioContext = Storage.AudioContextConstructor;

        self.audioSources = [];

        if (self.useGainNode === true) {
            self.gainNode = self.audioContext.createGain();
            self.gainNode.connect(self.audioContext.destination);
            self.gainNode.gain.value = 0; // don't hear self
        }

        var audioTracksLength = 0;
        arrayOfMediaStreams.forEach(function(stream) {
            if (!stream.getTracks().filter(function(t) {
                    return t.kind === 'audio';
                }).length) {
                return;
            }

            audioTracksLength++;

            var audioSource = self.audioContext.createMediaStreamSource(stream);

            if (self.useGainNode === true) {
                audioSource.connect(self.gainNode);
            }

            self.audioSources.push(audioSource);
        });

        if (!audioTracksLength) {
            // because "self.audioContext" is not initialized
            // that's why we've to ignore rest of the code
            return;
        }

        self.audioDestination = self.audioContext.createMediaStreamDestination();
        self.audioSources.forEach(function(audioSource) {
            audioSource.connect(self.audioDestination);
        });
        return self.audioDestination.stream;
    }

    function getVideo(stream) {
        var video = document.createElement('video');

        setSrcObject(stream, video);

        video.className = elementClass;

        video.muted = true;
        video.volume = 0;

        video.width = stream.width || self.width || 360;
        video.height = stream.height || self.height || 240;

        video.play();

        return video;
    }

    this.appendStreams = function(streams) {
        if (!streams) {
            throw 'First parameter is required.';
        }

        if (!(streams instanceof Array)) {
            streams = [streams];
        }

        streams.forEach(function(stream) {
            var newStream = new MediaStream();

            if (stream.getTracks().filter(function(t) {
                    return t.kind === 'video';
                }).length) {
                var video = getVideo(stream);
                video.stream = stream;
                videos.push(video);

                newStream.addTrack(stream.getTracks().filter(function(t) {
                    return t.kind === 'video';
                })[0]);
            }

            if (stream.getTracks().filter(function(t) {
                    return t.kind === 'audio';
                }).length) {
                var audioSource = self.audioContext.createMediaStreamSource(stream);
                self.audioDestination = self.audioContext.createMediaStreamDestination();
                audioSource.connect(self.audioDestination);

                newStream.addTrack(self.audioDestination.stream.getTracks().filter(function(t) {
                    return t.kind === 'audio';
                })[0]);
            }

            arrayOfMediaStreams.push(newStream);
        });
    };

    this.releaseStreams = function() {
        videos = [];
        isStopDrawingFrames = true;

        if (self.gainNode) {
            self.gainNode.disconnect();
            self.gainNode = null;
        }

        if (self.audioSources.length) {
            self.audioSources.forEach(function(source) {
                source.disconnect();
            });
            self.audioSources = [];
        }

        if (self.audioDestination) {
            self.audioDestination.disconnect();
            self.audioDestination = null;
        }

        if (self.audioContext) {
            self.audioContext.close();
        }

        self.audioContext = null;

        context.clearRect(0, 0, canvas.width, canvas.height);

        if (canvas.stream) {
            canvas.stream.stop();
            canvas.stream = null;
        }
    };

    this.resetVideoStreams = function(streams) {
        if (streams && !(streams instanceof Array)) {
            streams = [streams];
        }

        resetVideoStreams(streams);
    };

    function resetVideoStreams(streams) {
        videos = [];
        streams = streams || arrayOfMediaStreams;

        // via: @adrian-ber
        streams.forEach(function(stream) {
            if (!stream.getTracks().filter(function(t) {
                    return t.kind === 'video';
                }).length) {
                return;
            }

            var video = getVideo(stream);
            video.stream = stream;
            videos.push(video);
        });
    }

    // for debugging
    this.name = 'MultiStreamsMixer';
    this.toString = function() {
        return this.name;
    };

    this.getMixedStream = getMixedStream;

}

if (typeof RecordRTC === 'undefined') {
    if (typeof module !== 'undefined' /* && !!module.exports*/ ) {
        module.exports = MultiStreamsMixer;
    }

    if (typeof define === 'function' && define.amd) {
        define('MultiStreamsMixer', [], function() {
            return MultiStreamsMixer;
        });
    }
}


text:
function sayHello(){
  console.log("Hello!");
}

sayHello();

function output(text){
  console.log(text);
}

output("Hello!");
output("Hello!", "How's it going?");

// in the above case the second argument is ignored

function sum(num1, num2){
  return num1 + num2;
}

var result = sum(1,2);
output(result);

// or
console.log(sum(1,2));


text:
package fm.flatfile.excel

import java.io.InputStream
import java.lang.Double
import org.apache.poi.ss.usermodel.{BuiltinFormats, DataFormatter}
import org.apache.poi.xssf.model.StylesTable
import org.apache.poi.xssf.usermodel.{XSSFCellStyle, XSSFRichTextString}
import org.apache.poi.xssf.eventusermodel.ReadOnlySharedStringsTable
import scala.util.Try
import fm.flatfile.{FlatFileParsedRow, FlatFileReaderOptions}
import fm.common.Logging

private[excel] final class XLSXStreamProcessor(options: FlatFileReaderOptions, stylesTable: StylesTable, stringsTable: ReadOnlySharedStringsTable) extends Logging {
  private implicit def toRichXMLStreamReader2(sr: org.codehaus.stax2.XMLStreamReader2): RichXMLStreamReader2 = new RichXMLStreamReader2(sr)

  private[this] val formatter: DataFormatter = new DataFormatter()

  // Created a cached copy of the plain shared strings from the shared strings table
  private[this] val plainSharedStrings: Array[String] = new Array(stringsTable.getUniqueCount)
  (0 until stringsTable.getUniqueCount).foreach { i: Int =>
    plainSharedStrings(i) = richStringToPlain(stringsTable.getEntryAt(i))
  }

  private def richStringToPlain(s: String): String = new XSSFRichTextString(s).toString

  def processSheet[U](sheetInputStream: InputStream, f: Try[FlatFileParsedRow] => U): Unit = {
    import com.ctc.wstx.stax.WstxInputFactory
    import org.codehaus.stax2.XMLStreamReader2
    import javax.xml.stream.XMLInputFactory

    val inputFactory: WstxInputFactory = new WstxInputFactory()
    inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false)
    inputFactory.configureForSpeed()

    val sr: XMLStreamReader2 = inputFactory.createXMLStreamReader(sheetInputStream).asInstanceOf[XMLStreamReader2]

    // Not using Resource.using to avoid Proguard complaining about XMLStreamReader2
    try {
      sr.seekToRootElement("worksheet")

      // foreach row in the sheetData
      sr.foreach("sheetData/row") {
        val row: Try[FlatFileParsedRow] = Try {
          val rowNumber: Long = sr.getAttributeValue("r").toLong // This is the row number

          val values = Vector.newBuilder[String]
          var lastColIdx: Int = -1

          // foreach cell in the row
          sr.foreach("c") {
            val ref: String = sr.getAttributeValue("r")
            val colIdx: Int = referenceToColumn(ref)
            val cellType: String = sr.getAttributeValue("t")
            val cellStyle: String = sr.getAttributeValue("s")

            // Fill is missing columns
            if (lastColIdx + 1 != colIdx) {
              var i: Int = lastColIdx + 1
              while (i < colIdx) {
                values += ""
                i += 1
              }
            }

            lastColIdx = colIdx

            var value: String = ""

            if (cellType == "inlineStr") sr.foreach("is/t"){ value = richStringToPlain(sr.readElementText()) }
            else value = sr.tryReadChildElementText("v").map{ value: String => formatCell(cellType, cellStyle, value) }.getOrElse("")

            values += value
          }

          FlatFileParsedRow(values = values.result, rawRow = "", lineNumber = rowNumber)
        }

        f(row)
      }
    } finally {
      sr.closeCompletely()
    }
  }

  /**
   * cellType and cellStyle might be null
   */
  private def formatCell(cellType: String, cellStyle: String, value: String): String = cellType match {
    case "b"         => if (value.charAt(0) == '0') "FALSE" else "TRUE" // Boolean
    case "e"         => value // Error -- TODO: should this just return an empty string instead of the #DIV/0! stuff?
    case "inlineStr" => throw new AssertionError("This should not happen!")
    case "s"         => sharedStringTableValue(value) // Shared Strings Table Index
    case "str"       => value // A Formula Calculated String
    case _ => {
      // It's a number, but almost certainly one with a special style or format
      if (null != cellStyle) {
        val styleIndex: Int = cellStyle.toInt
        val style: XSSFCellStyle = stylesTable.getStyleAt(styleIndex)
        val formatIndex: Short = style.getDataFormat()
        var formatString: String = style.getDataFormatString()
        if (formatString == null) formatString = BuiltinFormats.getBuiltinFormat(formatIndex)
        formatter.formatRawCellContents(Double.parseDouble(value), formatIndex, formatString)
      } else value
    }
  }

  def sharedStringTableValue(idx: String): String = try {
    plainSharedStrings(idx.toInt)
  } catch {
    case ex: NumberFormatException => logger.warn(s"Failed to parse SST index '$idx': ${ex.toString()}"); ""
    case ex: ArrayIndexOutOfBoundsException => logger.warn(s"ArrayIndexOutOfBoundsException for SST index '$idx': ${ex.toString()}"); ""
  }

  /**
   * Converts an Excel reference name like "C123" to the column zero-based index
   */
  final def referenceToColumn(name: String): Int = {
    var i = 0
    while (i < name.length && name.charAt(i).isLetter) {
      i += 1
    }
    nameToColumn(name.substring(0, i))
  }

  /**
   * Converts an Excel column name like "C" to a zero-based index.
   */
  final def nameToColumn(name: String): Int = {
    var column: Int = -1
    var i = 0

    while (i < name.length) {
      val c: Int = name.charAt(i)
      column = (column + 1) * 26 + c - 'A'
      i += 1
    }

    column
  }
}


text:
package dwriter.ui;

import java.awt.Component;
import java.awt.Graphics;
import javax.swing.Icon;

/**
 * An Blank Icon.
 *
 * @author João Andrade (joaodeaps@gmail.com)
 */
public class BlankIcon implements Icon {

    /**
     * Width of the blank icon.
     */
    private int width;

    /**
     * Height of the blank icon.
     */
    private int height;

    /**
     * Class Constructor.
     *
     * @param width
     * @param height
     */
    public BlankIcon(int width, int height) {
        this.width = width;
        this.height = height;
    }

    @Override
    public void paintIcon(Component c, Graphics g, int x, int y) {
    }

    @Override
    public int getIconWidth() {
        return width;
    }

    @Override
    public int getIconHeight() {
        return height;
    }

}


text:
package com.amazonaws.services.cloudfront.model.transform;

import org.w3c.dom.Node;
import javax.annotation.Generated;

import com.amazonaws.AmazonServiceException;

import com.amazonaws.transform.StandardErrorUnmarshaller;

import com.amazonaws.services.cloudfront.model.IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorException;

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorExceptionUnmarshaller extends StandardErrorUnmarshaller {

    public IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorExceptionUnmarshaller() {
        super(IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorException.class);
    }

    @Override
    public AmazonServiceException unmarshall(Node node) throws Exception {
        // Bail out if this isn't the right error code that this
        // marshaller understands
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior"))
            return null;

        IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorException e = (IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorException) super
                .unmarshall(node);

        return e;
    }
}


text:
require 'concurrent/utility/engine'
require 'concurrent/executor/thread_pool_executor'

module Concurrent

  # @!macro thread_pool_executor_constant_default_max_pool_size
  #   Default maximum number of threads that will be created in the pool.

  # @!macro thread_pool_executor_constant_default_min_pool_size
  #   Default minimum number of threads that will be retained in the pool.

  # @!macro thread_pool_executor_constant_default_max_queue_size
  #   Default maximum number of tasks that may be added to the task queue.

  # @!macro thread_pool_executor_constant_default_thread_timeout
  #   Default maximum number of seconds a thread in the pool may remain idle
  #   before being reclaimed.

  # @!macro thread_pool_executor_constant_default_synchronous
  #   Default value of the :synchronous option.

  # @!macro thread_pool_executor_attr_reader_max_length
  #   The maximum number of threads that may be created in the pool.
  #   @return [Integer] The maximum number of threads that may be created in the pool.

  # @!macro thread_pool_executor_attr_reader_min_length
  #   The minimum number of threads that may be retained in the pool.
  #   @return [Integer] The minimum number of threads that may be retained in the pool.

  # @!macro thread_pool_executor_attr_reader_largest_length
  #   The largest number of threads that have been created in the pool since construction.
  #   @return [Integer] The largest number of threads that have been created in the pool since construction.

  # @!macro thread_pool_executor_attr_reader_scheduled_task_count
  #   The number of tasks that have been scheduled for execution on the pool since construction.
  #   @return [Integer] The number of tasks that have been scheduled for execution on the pool since construction.

  # @!macro thread_pool_executor_attr_reader_completed_task_count
  #   The number of tasks that have been completed by the pool since construction.
  #   @return [Integer] The number of tasks that have been completed by the pool since construction.

  # @!macro thread_pool_executor_attr_reader_idletime
  #   The number of seconds that a thread may be idle before being reclaimed.
  #   @return [Integer] The number of seconds that a thread may be idle before being reclaimed.

  # @!macro thread_pool_executor_attr_reader_synchronous
  #   Whether or not a value of 0 for :max_queue option means the queue must perform direct hand-off or rather unbounded queue.
  #   @return [true, false]

  # @!macro thread_pool_executor_attr_reader_max_queue
  #   The maximum number of tasks that may be waiting in the work queue at any one time.
  #   When the queue size reaches `max_queue` subsequent tasks will be rejected in
  #   accordance with the configured `fallback_policy`.
  #
  #   @return [Integer] The maximum number of tasks that may be waiting in the work queue at any one time.
  #     When the queue size reaches `max_queue` subsequent tasks will be rejected in
  #     accordance with the configured `fallback_policy`.

  # @!macro thread_pool_executor_attr_reader_length
  #   The number of threads currently in the pool.
  #   @return [Integer] The number of threads currently in the pool.

  # @!macro thread_pool_executor_attr_reader_queue_length
  #   The number of tasks in the queue awaiting execution.
  #   @return [Integer] The number of tasks in the queue awaiting execution.

  # @!macro thread_pool_executor_attr_reader_remaining_capacity
  #   Number of tasks that may be enqueued before reaching `max_queue` and rejecting
  #   new tasks. A value of -1 indicates that the queue may grow without bound.
  #
  #   @return [Integer] Number of tasks that may be enqueued before reaching `max_queue` and rejecting
  #     new tasks. A value of -1 indicates that the queue may grow without bound.

  # @!macro thread_pool_executor_public_api
  #
  #   @!macro abstract_executor_service_public_api
  #
  #   @!attribute [r] max_length
  #     @!macro thread_pool_executor_attr_reader_max_length
  #
  #   @!attribute [r] min_length
  #     @!macro thread_pool_executor_attr_reader_min_length
  #
  #   @!attribute [r] largest_length
  #     @!macro thread_pool_executor_attr_reader_largest_length
  #
  #   @!attribute [r] scheduled_task_count
  #     @!macro thread_pool_executor_attr_reader_scheduled_task_count
  #
  #   @!attribute [r] completed_task_count
  #     @!macro thread_pool_executor_attr_reader_completed_task_count
  #
  #   @!attribute [r] idletime
  #     @!macro thread_pool_executor_attr_reader_idletime
  #
  #   @!attribute [r] max_queue
  #     @!macro thread_pool_executor_attr_reader_max_queue
  #
  #   @!attribute [r] length
  #     @!macro thread_pool_executor_attr_reader_length
  #
  #   @!attribute [r] queue_length
  #     @!macro thread_pool_executor_attr_reader_queue_length
  #
  #   @!attribute [r] remaining_capacity
  #     @!macro thread_pool_executor_attr_reader_remaining_capacity
  #
  #   @!method can_overflow?
  #     @!macro executor_service_method_can_overflow_question

  # @!macro thread_pool_options
  #
  #   **Thread Pool Options**
  #
  #   Thread pools support several configuration options:
  #
  #   * `idletime`: The number of seconds that a thread may be idle before being reclaimed.
  #   * `name`: The name of the executor (optional). Printed in the executor's `#to_s` output and
  #     a `<name>-worker-<id>` name is given to its threads if supported by used Ruby
  #     implementation. `<id>` is uniq for each thread.
  #   * `max_queue`: The maximum number of tasks that may be waiting in the work queue at
  #     any one time. When the queue size reaches `max_queue` and no new threads can be created,
  #     subsequent tasks will be rejected in accordance with the configured `fallback_policy`.
  #   * `auto_terminate`: When true (default), the threads started will be marked as daemon.
  #   * `fallback_policy`: The policy defining how rejected tasks are handled.
  #
  #   Three fallback policies are supported:
  #
  #   * `:abort`: Raise a `RejectedExecutionError` exception and discard the task.
  #   * `:discard`: Discard the task and return false.
  #   * `:caller_runs`: Execute the task on the calling thread.
  #
  #   **Shutting Down Thread Pools**
  #
  #   Killing a thread pool while tasks are still being processed, either by calling
  #   the `#kill` method or at application exit, will have unpredictable results. There
  #   is no way for the thread pool to know what resources are being used by the
  #   in-progress tasks. When those tasks are killed the impact on those resources
  #   cannot be predicted. The *best* practice is to explicitly shutdown all thread
  #   pools using the provided methods:
  #
  #   * Call `#shutdown` to initiate an orderly termination of all in-progress tasks
  #   * Call `#wait_for_termination` with an appropriate timeout interval an allow
  #     the orderly shutdown to complete
  #   * Call `#kill` *only when* the thread pool fails to shutdown in the allotted time
  #
  #   On some runtime platforms (most notably the JVM) the application will not
  #   exit until all thread pools have been shutdown. To prevent applications from
  #   "hanging" on exit, all threads can be marked as daemon according to the
  #   `:auto_terminate` option.
  #
  #   ```ruby
  #   pool1 = Concurrent::FixedThreadPool.new(5) # threads will be marked as daemon
  #   pool2 = Concurrent::FixedThreadPool.new(5, auto_terminate: false) # mark threads as non-daemon
  #   ```
  #
  #   @note Failure to properly shutdown a thread pool can lead to unpredictable results.
  #     Please read *Shutting Down Thread Pools* for more information.
  #
  #   @see http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html Java Tutorials: Thread Pools
  #   @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html Java Executors class
  #   @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html Java ExecutorService interface
  #   @see https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean-

  # @!macro fixed_thread_pool
  #
  #   A thread pool that reuses a fixed number of threads operating off an unbounded queue.
  #   At any point, at most `num_threads` will be active processing tasks. When all threads are busy new
  #   tasks `#post` to the thread pool are enqueued until a thread becomes available.
  #   Should a thread crash for any reason the thread will immediately be removed
  #   from the pool and replaced.
  #
  #   The API and behavior of this class are based on Java's `FixedThreadPool`
  #
  # @!macro thread_pool_options
  class FixedThreadPool < ThreadPoolExecutor

    # @!macro fixed_thread_pool_method_initialize
    #
    #   Create a new thread pool.
    #
    #   @param [Integer] num_threads the number of threads to allocate
    #   @param [Hash] opts the options defining pool behavior.
    #   @option opts [Symbol] :fallback_policy (`:abort`) the fallback policy
    #
    #   @raise [ArgumentError] if `num_threads` is less than or equal to zero
    #   @raise [ArgumentError] if `fallback_policy` is not a known policy
    #
    #   @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool-int-
    def initialize(num_threads, opts = {})
      raise ArgumentError.new('number of threads must be greater than zero') if num_threads.to_i < 1
      defaults  = { max_queue:   DEFAULT_MAX_QUEUE_SIZE,
                    idletime:    DEFAULT_THREAD_IDLETIMEOUT }
      overrides = { min_threads: num_threads,
                    max_threads: num_threads }
      super(defaults.merge(opts).merge(overrides))
    end
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Proc. Fla Acad. Sci. 7(2/3): 123 (1945)

#### Original name
Inocybe umbrinescens Murrill

### Remarks
null


text:
<?php
namespace xral\Tests\Mock {
    use kfiltr;

    class XMLBookFilter {
        use kfiltr\Factory\Mapper;

        function __construct() {
            $this->setFactory(new GenericFactory());
            $this->setMapping([
                'book' => 'xral\Tests\Mock\Book'
            ],function($input) {
                if($input instanceof \SimpleXMLElement) {
                    return $input->getName();
                } else {
                    return (string)$input;
                }
            });
        }
    }
}


text:
"""Policy evaluation."""
import typing
import tensorflow.compat.v2 as tf

def evaluate(
    env,
    policy,
    num_episodes = 10,
    ctx_length = None,
    embed_training_window = None,
    state_mask_fn = None,  # pylint: disable=g-bare-generic
):
  """Evaluates the policy.

  Args:
    env: Environment to evaluate the policy on.
    policy: Policy to evaluate.
    num_episodes: A number of episodes to average the policy on.
    ctx_length: number of previous steps to compute context from.
    embed_training_window: window size used during embed training.
    state_mask_fn: state masking function for partially obs envs.

  Returns:
    Averaged reward and a total number of steps.
  """
  total_timesteps = 0
  total_returns = 0.0

  def apply_mask(observation):
    if state_mask_fn:
      return tf.convert_to_tensor(state_mask_fn(observation.numpy()))
    return observation

  for _ in range(num_episodes):
    timestep = env.reset()
    if ctx_length:
      states = [apply_mask(timestep.observation) for _ in range(ctx_length)]
      actions = [
          tf.zeros(policy.action_spec.shape)[None, :] for _ in range(ctx_length)
      ]
      rewards = [[0.] for _ in range(ctx_length)]

    latent_action = None
    i = 0
    while not timestep.is_last():
      if embed_training_window and (i % embed_training_window == 0 or
                                    embed_training_window <= 2):
        latent_action = None
      if ctx_length:
        states.append(apply_mask(timestep.observation))
        if len(states) > ctx_length:
          states.pop(0)
          actions.pop(0)
          rewards.pop(0)
        action = policy.act(
            tf.stack(states, axis=1),
            actions=tf.stack(actions, axis=1),
            rewards=tf.stack(rewards, axis=1))
        actions.append(action)
      else:
        if embed_training_window:
          action, latent_action = policy.act(
              apply_mask(timestep.observation), latent_action=latent_action)
        else:
          action = policy.act(apply_mask(timestep.observation))

      timestep = env.step(action)
      if ctx_length:
        rewards.append(timestep.reward)

      total_returns += timestep.reward[0]
      total_timesteps += 1
      i += 1

  return total_returns / num_episodes, total_timesteps / num_episodes


text:
package org.test;

/**
 * Quicksort in place
 * @author az
 *
 */
public class QuickSort {

	public static void quickSort(int[] array) {
		quickSort(array,0,array.length-1);
	}

	private static void quickSort(int[] array, int begin, int end) {
		if (end <= begin)
			return;
		int pivot = begin + (end - begin)/2;
		int l = partition(array, begin, end, pivot);
		quickSort(array, begin, l - 1);
		quickSort(array, l+1, end);
	}

	private static int partition(int[] array, int begin, int end, int pivot) {
		swap(array,pivot,end);
		int index = begin;
		for (int i=begin; i<end; i++) {
			if (array[i] < array[end]) {
				swap(array, i, index);
				index++;
			}
		}
		swap(array,index,end);
		return index;
	}

	private static void swap(int[] array, int pos1, int pos2) {
		int val = array[pos1];
		array[pos1] = array[pos2];
		array[pos2] = val;
	}

}


text:
import { FowerPlugin, ResponsiveBoolean, ResponsiveValue } from '@fower/core'
import * as CSS from 'csstype'

declare const _default: () => FowerPlugin
export default _default

declare module '@fower/atomic-props' {
  export interface AtomicProps {
    /**
     * Set textDecoration to underline
     * ```css
     * { text-decoration: underline; }
     * ```
     *
     * @example
     * ```tsx
     * <Box underline></Box>
     * ```
     * @see https://fower.vercel.app/docs/text-decoration
     * https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration
     */
    underline?: ResponsiveBoolean

    /**
     * Set textDecoration to lineThrough
     *
     * ```css
     * { text-decoration: line-through; }
     * ```
     *
     * @example
     * ```tsx
     * <Box lineThrough></Box>
     * ```
     * @see https://fower.vercel.app/docs/text-decoration
     * https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration
     */
    lineThrough?: ResponsiveBoolean

    /**
     * Set textDecoration to none
     *
     * ```css
     * { text-decoration: none; }
     * ```
     *
     * @example
     * ```tsx
     * <Box noUnderline></Box>
     * ```
     * @see https://fower.vercel.app/docs/text-decoration
     * https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration
     */
    noUnderline?: ResponsiveBoolean

    /**
     * Set textDecoration to some value
     *
     * ```css
     * { text-decoration: $value; }
     * ```
     *
     * @example
     * ```tsx
     * <Box textDecoration="overline"></Box>
     * ```
     * @see https://fower.vercel.app/docs/text-decoration
     * https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration
     */
    textDecoration?: ResponsiveValue<CSS.Property.TextDecoration>
  }
}


text:
var _curry2 = require('./internal/_curry2');
var keys = require('./keys');

/**
 * Iterate over an input `object`, calling a provided function `fn` for each
 * key and value in the object.
 *
 * `fn` receives three argument: *(value, key, obj)*.
 *
 * @func
 * @memberOf R
 * @since v0.23.0
 * @category Object
 * @sig ((a, String, StrMap a) -> Any) -> StrMap a -> StrMap a
 * @param {Function} fn The function to invoke. Receives three argument, `value`, `key`, `obj`.
 * @param {Object} obj The object to iterate over.
 * @return {Object} The original object.
 * @example
 *
 *      var printKeyConcatValue = (value, key) => console.log(key + ':' + value);
 *      R.forEachObjIndexed(printKeyConcatValue, {x: 1, y: 2}); //=> {x: 1, y: 2}
 *      // logs x:1
 *      // logs y:2
 * @symb R.forEachObjIndexed(f, {x: a, y: b}) = {x: a, y: b}
 */
module.exports = _curry2(function forEachObjIndexed(fn, obj) {
  var keyList = keys(obj);
  var idx = 0;
  while (idx < keyList.length) {
    var key = keyList[idx];
    fn(obj[key], key, obj);
    idx += 1;
  }
  return obj;
});