text:
<?php

/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
	/**
	 * @ignore
	 */
	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}

/**
 * PHPExcel_Reader_Gnumeric
 *
 * @category	PHPExcel
 * @package		PHPExcel_Reader
 * @copyright	Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
 */
class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
{
	/**
	 * Formats
	 *
	 * @var array
	 */
	private $_styles = array();

	/**
	 * Shared Expressions
	 *
	 * @var array
	 */
	private $_expressions = array();

	private $_referenceHelper = null;

	/**
	 * Create a new PHPExcel_Reader_Gnumeric
	 */
	public function __construct() {
		$this->_readFilter 	= new PHPExcel_Reader_DefaultReadFilter();
		$this->_referenceHelper = PHPExcel_ReferenceHelper::getInstance();
	}

	/**
	 * Can the current PHPExcel_Reader_IReader read the file?
	 *
	 * @param 	string 		$pFilename
	 * @return 	boolean
	 * @throws PHPExcel_Reader_Exception
	 */
	public function canRead($pFilename)
	{
		// Check if file exists
		if (!file_exists($pFilename)) {
			throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
		}

		// Check if gzlib functions are available
		if (!function_exists('gzread')) {
			throw new PHPExcel_Reader_Exception("gzlib library is not enabled");
		}

		// Read signature data (first 3 bytes)
		$fh = fopen($pFilename, 'r');
		$data = fread($fh, 2);
		fclose($fh);

		if ($data != chr(0x1F).chr(0x8B)) {
			return false;
		}

		return true;
	}

	/**
	 * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
	 *
	 * @param 	string 		$pFilename
	 * @throws 	PHPExcel_Reader_Exception
	 */
	public function listWorksheetNames($pFilename)
	{
		// Check if file exists
		if (!file_exists($pFilename)) {
			throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
		}

		$xml = new XMLReader();
		$xml->open(
			'compress.zlib://'.realpath($pFilename), null, PHPExcel_Settings::getLibXmlLoaderOptions()
		);
		$xml->setParserProperty(2,true);

		$worksheetNames = array();
		while ($xml->read()) {
			if ($xml->name == 'gnm:SheetName' && $xml->nodeType == XMLReader::ELEMENT) {
			    $xml->read();	//	Move onto the value node
				$worksheetNames[] = (string) $xml->value;
			} elseif ($xml->name == 'gnm:Sheets') {
				//	break out of the loop once we've got our sheet names rather than parse the entire file
				break;
			}
		}

		return $worksheetNames;
	}

	/**
	 * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
	 *
	 * @param   string     $pFilename
	 * @throws   PHPExcel_Reader_Exception
	 */
	public function listWorksheetInfo($pFilename)
	{
		// Check if file exists
		if (!file_exists($pFilename)) {
			throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
		}

		$xml = new XMLReader();
		$xml->open(
			'compress.zlib://'.realpath($pFilename), null, PHPExcel_Settings::getLibXmlLoaderOptions()
		);
		$xml->setParserProperty(2,true);

		$worksheetInfo = array();
		while ($xml->read()) {
			if ($xml->name == 'gnm:Sheet' && $xml->nodeType == XMLReader::ELEMENT) {
				$tmpInfo = array(
					'worksheetName' => '',
					'lastColumnLetter' => 'A',
					'lastColumnIndex' => 0,
					'totalRows' => 0,
					'totalColumns' => 0,
				);

				while ($xml->read()) {
					if ($xml->name == 'gnm:Name' && $xml->nodeType == XMLReader::ELEMENT) {
					    $xml->read();	//	Move onto the value node
						$tmpInfo['worksheetName'] = (string) $xml->value;
					} elseif ($xml->name == 'gnm:MaxCol' && $xml->nodeType == XMLReader::ELEMENT) {
					    $xml->read();	//	Move onto the value node
						$tmpInfo['lastColumnIndex'] = (int) $xml->value;
						$tmpInfo['totalColumns'] = (int) $xml->value + 1;
					} elseif ($xml->name == 'gnm:MaxRow' && $xml->nodeType == XMLReader::ELEMENT) {
					    $xml->read();	//	Move onto the value node
						$tmpInfo['totalRows'] = (int) $xml->value + 1;
						break;
					}
				}
				$tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
				$worksheetInfo[] = $tmpInfo;
			}
		}

		return $worksheetInfo;
	}

	private function _gzfileGetContents($filename) {
		$file = @gzopen($filename, 'rb');
		if ($file !== false) {
			$data = '';
			while (!gzeof($file)) {
				$data .= gzread($file, 1024);
			}
			gzclose($file);
		}
		return $data;
	}

	/**
	 * Loads PHPExcel from file
	 *
	 * @param 	string 		$pFilename
	 * @return 	PHPExcel
	 * @throws 	PHPExcel_Reader_Exception
	 */
	public function load($pFilename)
	{
		// Create new PHPExcel
		$objPHPExcel = new PHPExcel();

		// Load into this instance
		return $this->loadIntoExisting($pFilename, $objPHPExcel);
	}

	/**
	 * Loads PHPExcel from file into PHPExcel instance
	 *
	 * @param 	string 		$pFilename
	 * @param	PHPExcel	$objPHPExcel
	 * @return 	PHPExcel
	 * @throws 	PHPExcel_Reader_Exception
	 */
	public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
	{
		// Check if file exists
		if (!file_exists($pFilename)) {
			throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
		}

		$timezoneObj = new DateTimeZone('Europe/London');
		$GMT = new DateTimeZone('UTC');

		$gFileData = $this->_gzfileGetContents($pFilename);

//		echo '
';
//		echo htmlentities($gFileData,ENT_QUOTES,'UTF-8');
//		echo '

';
//
		$xml = simplexml_load_string($gFileData, 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
		$namespacesMeta = $xml->getNamespaces(true);

//		var_dump($namespacesMeta);
//
		$gnmXML = $xml->children($namespacesMeta['gnm']);

		$docProps = $objPHPExcel->getProperties();
		//	Document Properties are held differently, depending on the version of Gnumeric
		if (isset($namespacesMeta['office'])) {
			$officeXML = $xml->children($namespacesMeta['office']);
		    $officeDocXML = $officeXML->{'document-meta'};
			$officeDocMetaXML = $officeDocXML->meta;

			foreach($officeDocMetaXML as $officePropertyData) {

				$officePropertyDC = array();
				if (isset($namespacesMeta['dc'])) {
					$officePropertyDC = $officePropertyData->children($namespacesMeta['dc']);
				}
				foreach($officePropertyDC as $propertyName => $propertyValue) {
					$propertyValue = (string) $propertyValue;
					switch ($propertyName) {
						case 'title' :
								$docProps->setTitle(trim($propertyValue));
								break;
						case 'subject' :
								$docProps->setSubject(trim($propertyValue));
								break;
						case 'creator' :
								$docProps->setCreator(trim($propertyValue));
								$docProps->setLastModifiedBy(trim($propertyValue));
								break;
						case 'date' :
								$creationDate = strtotime(trim($propertyValue));
								$docProps->setCreated($creationDate);
								$docProps->setModified($creationDate);
								break;
						case 'description' :
								$docProps->setDescription(trim($propertyValue));
								break;
					}
				}
				$officePropertyMeta = array();
				if (isset($namespacesMeta['meta'])) {
					$officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']);
				}
				foreach($officePropertyMeta as $propertyName => $propertyValue) {
					$attributes = $propertyValue->attributes($namespacesMeta['meta']);
					$propertyValue = (string) $propertyValue;
					switch ($propertyName) {
						case 'keyword' :
								$docProps->setKeywords(trim($propertyValue));
								break;
						case 'initial-creator' :
								$docProps->setCreator(trim($propertyValue));
								$docProps->setLastModifiedBy(trim($propertyValue));
								break;
						case 'creation-date' :
								$creationDate = strtotime(trim($propertyValue));
								$docProps->setCreated($creationDate);
								$docProps->setModified($creationDate);
								break;
						case 'user-defined' :
								list(,$attrName) = explode(':',$attributes['name']);
								switch ($attrName) {
									case 'publisher' :
											$docProps->setCompany(trim($propertyValue));
											break;
									case 'category' :
											$docProps->setCategory(trim($propertyValue));
											break;
									case 'manager' :
											$docProps->setManager(trim($propertyValue));
											break;
								}
								break;
					}
				}
			}
		} elseif (isset($gnmXML->Summary)) {
			foreach($gnmXML->Summary->Item as $summaryItem) {
				$propertyName = $summaryItem->name;
				$propertyValue = $summaryItem->{'val-string'};
				switch ($propertyName) {
					case 'title' :
						$docProps->setTitle(trim($propertyValue));
						break;
					case 'comments' :
						$docProps->setDescription(trim($propertyValue));
						break;
					case 'keywords' :
						$docProps->setKeywords(trim($propertyValue));
						break;
					case 'category' :
						$docProps->setCategory(trim($propertyValue));
						break;
					case 'manager' :
						$docProps->setManager(trim($propertyValue));
						break;
					case 'author' :
						$docProps->setCreator(trim($propertyValue));
						$docProps->setLastModifiedBy(trim($propertyValue));
						break;
					case 'company' :
						$docProps->setCompany(trim($propertyValue));
						break;
				}
			}
		}

		$worksheetID = 0;
		foreach($gnmXML->Sheets->Sheet as $sheet) {
			$worksheetName = (string) $sheet->Name;
//			echo 'Worksheet: ',$worksheetName,'
';
			if ((isset($this->_loadSheetsOnly)) && (!in_array($worksheetName, $this->_loadSheetsOnly))) {
				continue;
			}

			$maxRow = $maxCol = 0;

			// Create new Worksheet
			$objPHPExcel->createSheet();
			$objPHPExcel->setActiveSheetIndex($worksheetID);
			//	Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in formula
			//		cells... during the load, all formulae should be correct, and we're simply bringing the worksheet
			//		name in line with the formula, not the reverse
			$objPHPExcel->getActiveSheet()->setTitle($worksheetName,false);

			if ((!$this->_readDataOnly) && (isset($sheet->PrintInformation))) {
				if (isset($sheet->PrintInformation->Margins)) {
					foreach($sheet->PrintInformation->Margins->children('gnm',TRUE) as $key => $margin) {
						$marginAttributes = $margin->attributes();
						$marginSize = 72 / 100;	//	Default
						switch($marginAttributes['PrefUnit']) {
							case 'mm' :
								$marginSize = intval($marginAttributes['Points']) / 100;
								break;
						}
						switch($key) {
							case 'top' :
								$objPHPExcel->getActiveSheet()->getPageMargins()->setTop($marginSize);
								break;
							case 'bottom' :
								$objPHPExcel->getActiveSheet()->getPageMargins()->setBottom($marginSize);
								break;
							case 'left' :
								$objPHPExcel->getActiveSheet()->getPageMargins()->setLeft($marginSize);
								break;
							case 'right' :
								$objPHPExcel->getActiveSheet()->getPageMargins()->setRight($marginSize);
								break;
							case 'header' :
								$objPHPExcel->getActiveSheet()->getPageMargins()->setHeader($marginSize);
								break;
							case 'footer' :
								$objPHPExcel->getActiveSheet()->getPageMargins()->setFooter($marginSize);
								break;
						}
					}
				}
			}

			foreach($sheet->Cells->Cell as $cell) {
				$cellAttributes = $cell->attributes();
				$row = (int) $cellAttributes->Row + 1;
				$column = (int) $cellAttributes->Col;

				if ($row > $maxRow) $maxRow = $row;
				if ($column > $maxCol) $maxCol = $column;

				$column = PHPExcel_Cell::stringFromColumnIndex($column);

				// Read cell?
				if ($this->getReadFilter() !== NULL) {
					if (!$this->getReadFilter()->readCell($column, $row, $worksheetName)) {
						continue;
					}
				}

				$ValueType = $cellAttributes->ValueType;
				$ExprID = (string) $cellAttributes->ExprID;
//				echo 'Cell ',$column,$row,'
';
//				echo 'Type is ',$ValueType,'
';
//				echo 'Value is ',$cell,'
';
				$type = PHPExcel_Cell_DataType::TYPE_FORMULA;
				if ($ExprID > '') {
					if (((string) $cell) > '') {

						$this->_expressions[$ExprID] = array( 'column'	=> $cellAttributes->Col,
															  'row'		=> $cellAttributes->Row,
															  'formula'	=> (string) $cell
															);
//						echo 'NEW EXPRESSION ',$ExprID,'
';
					} else {
						$expression = $this->_expressions[$ExprID];

						$cell = $this->_referenceHelper->updateFormulaReferences( $expression['formula'],
																				  'A1',
																				  $cellAttributes->Col - $expression['column'],
																				  $cellAttributes->Row - $expression['row'],
																				  $worksheetName
																				);
//						echo 'SHARED EXPRESSION ',$ExprID,'
';
//						echo 'New Value is ',$cell,'
';
					}
					$type = PHPExcel_Cell_DataType::TYPE_FORMULA;
				} else {
					switch($ValueType) {
						case '10' :		//	NULL
							$type = PHPExcel_Cell_DataType::TYPE_NULL;
							break;
						case '20' :		//	Boolean
							$type = PHPExcel_Cell_DataType::TYPE_BOOL;
							$cell = ($cell == 'TRUE') ? True : False;
							break;
						case '30' :		//	Integer
							$cell = intval($cell);
						case '40' :		//	Float
							$type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
							break;
						case '50' :		//	Error
							$type = PHPExcel_Cell_DataType::TYPE_ERROR;
							break;
						case '60' :		//	String
							$type = PHPExcel_Cell_DataType::TYPE_STRING;
							break;
						case '70' :		//	Cell Range
						case '80' :		//	Array
					}
				}
				$objPHPExcel->getActiveSheet()->getCell($column.$row)->setValueExplicit($cell,$type);
			}

			if ((!$this->_readDataOnly) && (isset($sheet->Objects))) {
				foreach($sheet->Objects->children('gnm',TRUE) as $key => $comment) {
					$commentAttributes = $comment->attributes();
					//	Only comment objects are handled at the moment
					if ($commentAttributes->Text) {
						$objPHPExcel->getActiveSheet()->getComment( (string)$commentAttributes->ObjectBound )
															->setAuthor( (string)$commentAttributes->Author )
															->setText($this->_parseRichText((string)$commentAttributes->Text) );
					}
				}
			}
//			echo '$maxCol=',$maxCol,'; $maxRow=',$maxRow,'
';
//
			foreach($sheet->Styles->StyleRegion as $styleRegion) {
				$styleAttributes = $styleRegion->attributes();
				if (($styleAttributes['startRow'] <= $maxRow) &&
					($styleAttributes['startCol'] <= $maxCol)) {

					$startColumn = PHPExcel_Cell::stringFromColumnIndex((int) $styleAttributes['startCol']);
					$startRow = $styleAttributes['startRow'] + 1;

					$endColumn = ($styleAttributes['endCol'] > $maxCol) ? $maxCol : (int) $styleAttributes['endCol'];
					$endColumn = PHPExcel_Cell::stringFromColumnIndex($endColumn);
					$endRow = ($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow'];
					$endRow += 1;
					$cellRange = $startColumn.$startRow.':'.$endColumn.$endRow;
//					echo $cellRange,'
';

					$styleAttributes = $styleRegion->Style->attributes();
//					var_dump($styleAttributes);
//					echo '
';

					//	We still set the number format mask for date/time values, even if _readDataOnly is true
					if ((!$this->_readDataOnly) ||
						(PHPExcel_Shared_Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) {
						$styleArray = array();
						$styleArray['numberformat']['code'] = (string) $styleAttributes['Format'];
						//	If _readDataOnly is false, we set all formatting information
						if (!$this->_readDataOnly) {
							switch($styleAttributes['HAlign']) {
								case '1' :
									$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
									break;
								case '2' :
									$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_LEFT;
									break;
								case '4' :
									$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_RIGHT;
									break;
								case '8' :
									$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER;
									break;
								case '16' :
								case '64' :
									$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS;
									break;
								case '32' :
									$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY;
									break;
							}

							switch($styleAttributes['VAlign']) {
								case '1' :
									$styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_TOP;
									break;
								case '2' :
									$styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_BOTTOM;
									break;
								case '4' :
									$styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_CENTER;
									break;
								case '8' :
									$styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_JUSTIFY;
									break;
							}

							$styleArray['alignment']['wrap'] = ($styleAttributes['WrapText'] == '1') ? True : False;
							$styleArray['alignment']['shrinkToFit'] = ($styleAttributes['ShrinkToFit'] == '1') ? True : False;
							$styleArray['alignment']['indent'] = (intval($styleAttributes["Indent"]) > 0) ? $styleAttributes["indent"] : 0;

							$RGB = self::_parseGnumericColour($styleAttributes["Fore"]);
							$styleArray['font']['color']['rgb'] = $RGB;
							$RGB = self::_parseGnumericColour($styleAttributes["Back"]);
							$shade = $styleAttributes["Shade"];
							if (($RGB != '000000') || ($shade != '0')) {
								$styleArray['fill']['color']['rgb'] = $styleArray['fill']['startcolor']['rgb'] = $RGB;
								$RGB2 = self::_parseGnumericColour($styleAttributes["PatternColor"]);
								$styleArray['fill']['endcolor']['rgb'] = $RGB2;
								switch($shade) {
									case '1' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_SOLID;
										break;
									case '2' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR;
										break;
									case '3' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_GRADIENT_PATH;
										break;
									case '4' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN;
										break;
									case '5' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY;
										break;
									case '6' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID;
										break;
									case '7' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL;
										break;
									case '8' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS;
										break;
									case '9' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKUP;
										break;
									case '10' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL;
										break;
									case '11' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625;
										break;
									case '12' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_GRAY125;
										break;
									case '13' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN;
										break;
									case '14' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY;
										break;
									case '15' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID;
										break;
									case '16' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL;
										break;
									case '17' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS;
										break;
									case '18' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP;
										break;
									case '19' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL;
										break;
									case '20' :
										$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY;
										break;
								}
							}

							$fontAttributes = $styleRegion->Style->Font->attributes();
//							var_dump($fontAttributes);
//							echo '
';
							$styleArray['font']['name'] = (string) $styleRegion->Style->Font;
							$styleArray['font']['size'] = intval($fontAttributes['Unit']);
							$styleArray['font']['bold'] = ($fontAttributes['Bold'] == '1') ? True : False;
							$styleArray['font']['italic'] = ($fontAttributes['Italic'] == '1') ? True : False;
							$styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? True : False;
							switch($fontAttributes['Underline']) {
								case '1' :
									$styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLE;
									break;
								case '2' :
									$styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_DOUBLE;
									break;
								case '3' :
									$styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING;
									break;
								case '4' :
									$styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING;
									break;
								default :
									$styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_NONE;
									break;
							}
							switch($fontAttributes['Script']) {
								case '1' :
									$styleArray['font']['superScript'] = True;
									break;
								case '-1' :
									$styleArray['font']['subScript'] = True;
									break;
							}

							if (isset($styleRegion->Style->StyleBorder)) {
								if (isset($styleRegion->Style->StyleBorder->Top)) {
									$styleArray['borders']['top'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Top->attributes());
								}
								if (isset($styleRegion->Style->StyleBorder->Bottom)) {
									$styleArray['borders']['bottom'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Bottom->attributes());
								}
								if (isset($styleRegion->Style->StyleBorder->Left)) {
									$styleArray['borders']['left'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Left->attributes());
								}
								if (isset($styleRegion->Style->StyleBorder->Right)) {
									$styleArray['borders']['right'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Right->attributes());
								}
								if ((isset($styleRegion->Style->StyleBorder->Diagonal)) && (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}))) {
									$styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
									$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_BOTH;
								} elseif (isset($styleRegion->Style->StyleBorder->Diagonal)) {
									$styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
									$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_UP;
								} elseif (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'})) {
									$styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}->attributes());
									$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_DOWN;
								}
							}
							if (isset($styleRegion->Style->HyperLink)) {
								//	TO DO
								$hyperlink = $styleRegion->Style->HyperLink->attributes();
							}
						}
//						var_dump($styleArray);
//						echo '
';
						$objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray);
					}
				}
			}

			if ((!$this->_readDataOnly) && (isset($sheet->Cols))) {
				//	Column Widths
				$columnAttributes = $sheet->Cols->attributes();
				$defaultWidth = $columnAttributes['DefaultSizePts']  / 5.4;
				$c = 0;
				foreach($sheet->Cols->ColInfo as $columnOverride) {
					$columnAttributes = $columnOverride->attributes();
					$column = $columnAttributes['No'];
					$columnWidth = $columnAttributes['Unit']  / 5.4;
					$hidden = ((isset($columnAttributes['Hidden'])) && ($columnAttributes['Hidden'] == '1')) ? true : false;
					$columnCount = (isset($columnAttributes['Count'])) ? $columnAttributes['Count'] : 1;
					while ($c < $column) {
						$objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($defaultWidth);
						++$c;
					}
					while (($c < ($column+$columnCount)) && ($c <= $maxCol)) {
						$objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($columnWidth);
						if ($hidden) {
							$objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setVisible(false);
						}
						++$c;
					}
				}
				while ($c <= $maxCol) {
					$objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($defaultWidth);
					++$c;
				}
			}

			if ((!$this->_readDataOnly) && (isset($sheet->Rows))) {
				//	Row Heights
				$rowAttributes = $sheet->Rows->attributes();
				$defaultHeight = $rowAttributes['DefaultSizePts'];
				$r = 0;

				foreach($sheet->Rows->RowInfo as $rowOverride) {
					$rowAttributes = $rowOverride->attributes();
					$row = $rowAttributes['No'];
					$rowHeight = $rowAttributes['Unit'];
					$hidden = ((isset($rowAttributes['Hidden'])) && ($rowAttributes['Hidden'] == '1')) ? true : false;
					$rowCount = (isset($rowAttributes['Count'])) ? $rowAttributes['Count'] : 1;
					while ($r < $row) {
						++$r;
						$objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight);
					}
					while (($r < ($row+$rowCount)) && ($r < $maxRow)) {
						++$r;
						$objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($rowHeight);
						if ($hidden) {
							$objPHPExcel->getActiveSheet()->getRowDimension($r)->setVisible(false);
						}
					}
				}
				while ($r < $maxRow) {
					++$r;
					$objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight);
				}
			}

			//	Handle Merged Cells in this worksheet
			if (isset($sheet->MergedRegions)) {
				foreach($sheet->MergedRegions->Merge as $mergeCells) {
					if (strpos($mergeCells,':') !== FALSE) {
						$objPHPExcel->getActiveSheet()->mergeCells($mergeCells);
					}
				}
			}

			$worksheetID++;
		}

		//	Loop through definedNames (global named ranges)
		if (isset($gnmXML->Names)) {
			foreach($gnmXML->Names->Name as $namedRange) {
				$name = (string) $namedRange->name;
				$range = (string) $namedRange->value;
				if (stripos($range, '#REF!') !== false) {
					continue;
				}

				$range = explode('!',$range);
				$range[0] = trim($range[0],"'");;
				if ($worksheet = $objPHPExcel->getSheetByName($range[0])) {
					$extractedRange = str_replace('$', '', $range[1]);
					$objPHPExcel->addNamedRange( new PHPExcel_NamedRange($name, $worksheet, $extractedRange) );
				}
			}
		}

		// Return
		return $objPHPExcel;
	}

	private static function _parseBorderAttributes($borderAttributes)
	{
		$styleArray = array();

		if (isset($borderAttributes["Color"])) {
			$RGB = self::_parseGnumericColour($borderAttributes["Color"]);
			$styleArray['color']['rgb'] = $RGB;
		}

		switch ($borderAttributes["Style"]) {
			case '0' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_NONE;
				break;
			case '1' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_THIN;
				break;
			case '2' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUM;
				break;
			case '4' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHED;
				break;
			case '5' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_THICK;
				break;
			case '6' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_DOUBLE;
				break;
			case '7' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_DOTTED;
				break;
			case '9' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHDOT;
				break;
			case '10' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT;
				break;
			case '11' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHDOTDOT;
				break;
			case '12' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT;
				break;
			case '13' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT;
				break;
			case '3' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_SLANTDASHDOT;
				break;
			case '8' :
				$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHED;
				break;
		}
		return $styleArray;
	}

	private function _parseRichText($is = '') {
		$value = new PHPExcel_RichText();

		$value->createText($is);

		return $value;
	}

	private static function _parseGnumericColour($gnmColour) {
		list($gnmR,$gnmG,$gnmB) = explode(':',$gnmColour);
		$gnmR = substr(str_pad($gnmR,4,'0',STR_PAD_RIGHT),0,2);
		$gnmG = substr(str_pad($gnmG,4,'0',STR_PAD_RIGHT),0,2);
		$gnmB = substr(str_pad($gnmB,4,'0',STR_PAD_RIGHT),0,2);
		$RGB = $gnmR.$gnmG.$gnmB;
//		echo 'Excel Colour: ',$RGB,'
';
		return $RGB;
	}

}


text:
/**
 * This class is generated by jOOQ
 */
package classes.tables.records;

import classes.tables.Positions;

import javax.annotation.Generated;

import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record3;
import org.jooq.Row3;
import org.jooq.impl.UpdatableRecordImpl;

/**
 * This class is generated by jOOQ.
 */
@Generated(
    value = {
        "http://www.jooq.org",
        "jOOQ version:3.8.6"
    },
    comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PositionsRecord extends UpdatableRecordImpl<PositionsRecord> implements Record3<Integer, String, String> {

    private static final long serialVersionUID = 787904585;

    /**
     * Setter for public.positions.position_id.
     */
    public void setPositionId(Integer value) {
        set(0, value);
    }

    /**
     * Getter for public.positions.position_id.
     */
    public Integer getPositionId() {
        return (Integer) get(0);
    }

    /**
     * Setter for public.positions.name.
     */
    public void setName(String value) {
        set(1, value);
    }

    /**
     * Getter for public.positions.name.
     */
    public String getName() {
        return (String) get(1);
    }

    /**
     * Setter for public.positions.description.
     */
    public void setDescription(String value) {
        set(2, value);
    }

    /**
     * Getter for public.positions.description.
     */
    public String getDescription() {
        return (String) get(2);
    }

    // -------------------------------------------------------------------------
    // Primary key information
    // -------------------------------------------------------------------------

    /**
     * {@inheritDoc}
     */
    @Override
    public Record1<Integer> key() {
        return (Record1) super.key();
    }

    // -------------------------------------------------------------------------
    // Record3 type implementation
    // -------------------------------------------------------------------------

    /**
     * {@inheritDoc}
     */
    @Override
    public Row3<Integer, String, String> fieldsRow() {
        return (Row3) super.fieldsRow();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Row3<Integer, String, String> valuesRow() {
        return (Row3) super.valuesRow();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Field<Integer> field1() {
        return Positions.POSITIONS.POSITION_ID;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Field<String> field2() {
        return Positions.POSITIONS.NAME;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Field<String> field3() {
        return Positions.POSITIONS.DESCRIPTION;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Integer value1() {
        return getPositionId();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String value2() {
        return getName();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String value3() {
        return getDescription();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public PositionsRecord value1(Integer value) {
        setPositionId(value);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public PositionsRecord value2(String value) {
        setName(value);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public PositionsRecord value3(String value) {
        setDescription(value);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public PositionsRecord values(Integer value1, String value2, String value3) {
        value1(value1);
        value2(value2);
        value3(value3);
        return this;
    }

    // -------------------------------------------------------------------------
    // Constructors
    // -------------------------------------------------------------------------

    /**
     * Create a detached PositionsRecord
     */
    public PositionsRecord() {
        super(Positions.POSITIONS);
    }

    /**
     * Create a detached, initialised PositionsRecord
     */
    public PositionsRecord(Integer positionId, String name, String description) {
        super(Positions.POSITIONS);

        set(0, positionId);
        set(1, name);
        set(2, description);
    }
}

redpajama_set_name: RedPajamaGithub


text:
============
Installation
============

At the command line::

    $ easy_install dj-elasticsearch-flex

Or, if you have virtualenvwrapper installed::

    $ mkvirtualenv dj-elasticsearch-flex
    $ pip install dj-elasticsearch-flex


text:
<!DOCTYPE html>

    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title><%= htmlWebpackPlugin.options.title %></title>


text:
(function() {
    var method;
    var noop = function () {};
    var methods = [
        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
        'timeStamp', 'trace', 'warn'
    ];
    var length = methods.length;
    var console = (window.console = window.console || {});

    while (length--) {
        method = methods[length];

        // Only stub undefined methods.
        if (!console[method]) {
            console[method] = noop;
        }
    }
}());

// Place any jQuery/helper plugins in here.

// placeholder hack
// ref: http://diveintohtml5.org/detect.html
function supports_input_placeholder()
{
var i = document.createElement('input');
return 'placeholder' in i;
}
if(!supports_input_placeholder()) {
    var fields = document.getElementsByTagName('INPUT');
    for(var i=0; i < fields.length; i++) {
      if(fields[i].hasAttribute('placeholder')) {
        fields[i].defaultValue = fields[i].getAttribute('placeholder');
        fields[i].onfocus = function() { if(this.value == this.defaultValue) this.value = ''; }
        fields[i].onblur = function() { if(this.value == '') this.value = this.defaultValue; }
      }
    }
}


text:
"""A webclient backend that uses libsoup."""

import httplib

from twisted.internet import defer

from ubuntu_sso.logger import setup_logging
from ubuntu_sso.utils.webclient.common import (
    BaseWebClient,
    HeaderDict,
    Response,
    ProxyUnauthorizedError,
    UnauthorizedError,
    WebClientError,
)

URI_ANONYMOUS_TEMPLATE = "http://{host}:{port}/"
URI_USERNAME_TEMPLATE = "http://{username}:{password}@{host}:{port}/"

logger = setup_logging("ubuntu_sso.utils.webclient.libsoup")

class WebClient(BaseWebClient):
    """A webclient with a libsoup backend."""

    def __init__(self, *args, **kwargs):
        """Initialize this instance."""
        super(WebClient, self).__init__(*args, **kwargs)
        # pylint: disable=E0611,F0401
        from gi.repository import Soup, SoupGNOME
        self.soup = Soup
        self.session = Soup.SessionAsync()
        self.session.add_feature(SoupGNOME.ProxyResolverGNOME())
        self.session.connect("authenticate", self._on_authenticate)

    def _on_message(self, session, message, d):
        """Handle the result of an http message."""
        logger.debug('_on_message status code is %s', message.status_code)
        if message.status_code == httplib.OK:
            headers = HeaderDict()
            response_headers = message.get_property("response-headers")
            add_header = lambda key, value, _: headers[key].append(value)
            response_headers.foreach(add_header, None)
            content = message.response_body.flatten().get_data()
            response = Response(content, headers)
            d.callback(response)
        elif message.status_code == httplib.UNAUTHORIZED:
            e = UnauthorizedError(message.reason_phrase)
            d.errback(e)
        elif message.status_code == httplib.PROXY_AUTHENTICATION_REQUIRED:
            e = ProxyUnauthorizedError(message.reason_phrase)
            d.errback(e)
        else:
            e = WebClientError(message.reason_phrase)
            d.errback(e)

    @defer.inlineCallbacks
    def _on_authenticate(self, session, message, auth, retrying, data=None):
        """Handle the "authenticate" signal."""
        self.session.pause_message(message)
        try:
            logger.debug('_on_authenticate: message status code is %s',
                         message.status_code)
            if not retrying and self.username and self.password:
                auth.authenticate(self.username, self.password)
            if auth.is_for_proxy():
                logger.debug('_on_authenticate auth is for proxy.')
                got_creds = yield self.request_proxy_auth_credentials(
                    self.session.props.proxy_uri.host,
                    retrying)
                if got_creds:
                    logger.debug('Got proxy credentials from user.')
                    auth.authenticate(self.proxy_username, self.proxy_password)
        finally:
            self.session.unpause_message(message)

    @defer.inlineCallbacks
    def _on_proxy_authenticate(self, failure, iri, method="GET",
                extra_headers=None, oauth_credentials=None, post_content=None):
        """Deal with wrong settings."""
        failure.trap(ProxyUnauthorizedError)
        logger.debug('Proxy settings are wrong.')
        got_creds = yield self.request_proxy_auth_credentials(
            self.session.props.proxy_uri.host,
            True)
        if got_creds:
            settings = dict(host=self.session.props.proxy_uri.host,
                            port=self.session.props.proxy_uri.port,
                            username=self.proxy_username,
                            password=self.proxy_password)
            self.force_use_proxy(settings)
            response = yield self.request(iri, method, extra_headers,
                                         oauth_credentials, post_content)
            defer.returnValue(response)

    @defer.inlineCallbacks
    def request(self, iri, method="GET", extra_headers=None,
                oauth_credentials=None, post_content=None):
        """Return a deferred that will be fired with a Response object."""
        uri = self.iri_to_uri(iri)
        headers = yield self.build_request_headers(uri, method, extra_headers,
                                                   oauth_credentials)
        d = defer.Deferred()
        message = self.soup.Message.new(method, uri)

        for key, value in headers.items():
            message.request_headers.append(key, value)

        if post_content:
            message.request_body.append(post_content)

        self.session.queue_message(message, self._on_message, d)
        d.addErrback(self._on_proxy_authenticate, iri, method, extra_headers,
                     oauth_credentials, post_content)
        response = yield d
        defer.returnValue(response)

    def force_use_proxy(self, settings):
        """Setup this webclient to use the given proxy settings."""
        # pylint: disable=W0511
        proxy_uri = self.get_proxy_uri(settings)
        self.session.set_property("proxy-uri", proxy_uri)

    def get_proxy_uri(self, settings):
        """Get a Soup.URI for the proxy, or None if disabled."""
        if "host" in settings and "port" in settings:
            template = URI_ANONYMOUS_TEMPLATE
            if "username" in settings and "password" in settings:
                template = URI_USERNAME_TEMPLATE
            uri = template.format(**settings)
            return self.soup.URI.new(uri)
        else:
            # If the proxy host is not set, use no proxy
            return None

    def shutdown(self):
        """End the soup session for this webclient."""
        self.session.abort()


text:
package com.thaiopensource.validate;

import com.thaiopensource.util.PropertyMap;

/**
 * A schema that can be used to validate an XML document. A single Schema object
 * is safe for concurrent access by multiple threads.
 *
 * @see SchemaReader
 * @see Validator
 *
 * @author James Clark
 */
public interface Schema {
  /**
   * Creates a new Validator that can be used to validate XML documents with
   * respect to this schema.  The PropertyMap should contain a
   * ValidateProperty.ERROR_HANDLER property, which will be
   * used to report errors.  If it does not, then an ErrorHandler
   * will be used that ignores warnings and throws its argument on errors and fatal errors.
   * Common properties are defined in ValidateProperty.  Implementations
   * may support additional properties.
   *
   * @param properties a PropertyMap specifying the properties of the
   * Validator to be created
   * @return a new Validator that can be used to validate an XML document
   * with respect to this schema; never null
   *
   * @see ValidateProperty#ERROR_HANDLER
   */
  Validator createValidator(PropertyMap properties);
  PropertyMap getProperties();
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Sitzungber. der Akad. der Wissensch. zu Berlin 855 (1882)

#### Original name
Achlya colorata Pringsh., 1882

### Remarks
null


text:
/**
 * SessionAwareType.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package com.codeborne.security.digidoc_v2;

public abstract class SessionAwareType  implements java.io.Serializable {
    /* Session identifier */
    private java.lang.String sesscode;

    public SessionAwareType() {
    }

    public SessionAwareType(
           java.lang.String sesscode) {
           this.sesscode = sesscode;
    }

    /**
     * Gets the sesscode value for this SessionAwareType.
     *
     * @return sesscode   * Session identifier
     */
    public java.lang.String getSesscode() {
        return sesscode;
    }

    /**
     * Sets the sesscode value for this SessionAwareType.
     *
     * @param sesscode   * Session identifier
     */
    public void setSesscode(java.lang.String sesscode) {
        this.sesscode = sesscode;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof SessionAwareType)) return false;
        SessionAwareType other = (SessionAwareType) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.sesscode==null && other.getSesscode()==null) ||
             (this.sesscode!=null &&
              this.sesscode.equals(other.getSesscode())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getSesscode() != null) {
            _hashCode += getSesscode().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(SessionAwareType.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "SessionAwareType"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("sesscode");
        elemField.setXmlName(new javax.xml.namespace.QName("", "Sesscode"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
import mcheck as c
import unittest

def is_positive(x):
    return x > 0

def is_even(x):
    return not x & 1

check_positive = c.lift(is_positive, 'Number has to be positive.')
check_even = c.lift(is_even, 'Number has to be even.')
check_evenpositive = c.compose(check_even, check_positive)

class TestCheck(unittest.TestCase):
    def test_return(self):
        x = c.return_(42)
        self.assertTrue(c.is_pass(x))
        self.assertEqual(x.value, 42)

    def test_lift(self):
        x = check_positive(-5)
        y = check_positive(5)
        self.assertTrue(c.is_fail(x))
        self.assertEqual(x.message, 'Number has to be positive.')
        self.assertTrue(c.is_pass(y))
        self.assertEqual(y.value, 5)

    def test_compose(self):
        x = check_evenpositive(1)
        y = check_evenpositive(2)
        z = check_evenpositive(-1)
        w = check_evenpositive(-2)

        self.assertTrue(c.is_fail(x))
        self.assertEqual(x.message, 'Number has to be even.')
        self.assertTrue(c.is_pass(y))
        self.assertEqual(y.value, 2)
        self.assertTrue(c.is_fail(z))
        self.assertEqual(z.message, 'Number has to be even.')
        self.assertTrue(c.is_fail(w))
        self.assertEqual(w.message, 'Number has to be positive.')


text:
<?php namespace Fungku\NetSuite\Classes;

class ItemOptionsList {
	public $itemOptions;
	static $paramtypesmap = array(
		"itemOptions" => "RecordRef[]",
	);
}


text:
#pragma warning (disable: 4530)
#include "CShortcutMenu.h"
#include "ListShell.h"
#include "../ListRegistry.h"
#include <shlwapi.h>
#pragma comment(lib,"shlwapi.lib")
#include "GUID.h"

/*
#include <stdio.h>
#include <stdlib.h>

#define SHOWMESSAGE(msg,title) \
    { \
        MessageBox (NULL, msg, title, MB_OK); \
    }

#define SHOWREFCOUNT(fname) \
    { \
        char Text[1024]; \
        sprintf (Text, "RefCount: %d, GlobalRefCount: %d", RefCount, GlobalRefCount); \
        SHOWMESSAGE (Text, fname); \
    }
*/

#define SHOWMESSAGE(msg,title)
#define SHOWREFCOUNT(fname)

CShortcutMenu::CShortcutMenu ()
{
    RefCount = 1;
    GlobalRefCount++;
    DataObject = NULL;
    FileName[0] = '\0';
    AddMenuItem = false;
    SHOWREFCOUNT("CShortCutMenu()");
    return;
}

CShortcutMenu::~CShortcutMenu ()
{
    GlobalRefCount--;

    if (DataObject != NULL)
        DataObject->Release ();

    SHOWREFCOUNT("~CShortCutMenu()");
    return;
}

// IUnknown implementation
STDMETHODIMP CShortcutMenu::QueryInterface (REFIID riid, LPVOID *ppReturn)
{
    *ppReturn = NULL;

    if (IsEqualCLSID (riid, IID_IUnknown))
        *ppReturn = this;

    if (IsEqualCLSID (riid, IID_IShellExtInit))
        *ppReturn = (IShellExtInit *) this;

    if (IsEqualCLSID (riid, IID_IContextMenu))
        *ppReturn = (IContextMenu *) this;

    if (*ppReturn != NULL)
    {
        (*(LPUNKNOWN *)ppReturn)->AddRef ();
        return (S_OK);
    }

    return (E_NOINTERFACE);
}

STDMETHODIMP_(DWORD) CShortcutMenu::AddRef ()
{
    RefCount++;
    SHOWREFCOUNT("AddRef()");
    return (RefCount);
}

STDMETHODIMP_(DWORD) CShortcutMenu::Release ()
{
    RefCount--;

    SHOWREFCOUNT("Release()");

    if (RefCount == 0)
    {
        SHOWMESSAGE("deleting","word");
        delete this;
        return (0);
    }

    return (RefCount);
}

// IShellExtInit implementation
STDMETHODIMP CShortcutMenu::Initialize (LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hKeyProgID)
{
    //Store the PIDL.
    if (pidlFolder != NULL)
        PIDLFolder = pidlFolder;

    // If Initialize has already been called, release the old IDataObject pointer.
    if (DataObject != NULL)
	{
        DataObject->Release();
        DataObject = NULL;
    }

    // If a data object pointer was passed in, save it and extract the file name.
    if (pdtobj != NULL)
    {
        STGMEDIUM   StgMedium;
        FORMATETC   fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1,
		                   TYMED_HGLOBAL };
        UINT        Count;
        char        Name[MAX_PATH];

        DataObject = pdtobj;
        DataObject->AddRef();

        if (SUCCEEDED (DataObject->GetData (&fe, &StgMedium)))
        {
            // Get the file name from the CF_HDROP.
            Count = DragQueryFile ((HDROP)StgMedium.hGlobal, (UINT)-1, NULL, 0);

            if (Count != 0)
            {
                DragQueryFile((HDROP)StgMedium.hGlobal, 0, Name, sizeof(FileName));
                lstrcpy (FileName, "\"");
                lstrcat (FileName, Name);
                lstrcat (FileName, "\"");
            }

            ReleaseStgMedium (&StgMedium);

            if (Count == 1)
                AddMenuItem = true;
            else
                AddMenuItem = false;
        }

        DataObject->Release ();
        DataObject = NULL;
    }

    return (S_OK);
}

// IContextMenu implementation
STDMETHODIMP CShortcutMenu::GetCommandString (UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax)
{
    HRESULT ReturnVal;

    ReturnVal = E_INVALIDARG;

    switch (idCmd)
    {
        case IDM_LIST:
            switch (uFlags)
            {
                case GCS_HELPTEXT:
                    lstrcpy (pszName, "This will load the file with ListXP");
                    ReturnVal = NOERROR;
                    break;

                case GCS_VERB:
                    lstrcpy (pszName, "List");
                    ReturnVal = NOERROR;
                    break;

                case GCS_VALIDATE:
                    ReturnVal = NOERROR;
                    break;
            }

            break;
    }

    return (ReturnVal);
}

STDMETHODIMP CShortcutMenu::InvokeCommand (LPCMINVOKECOMMANDINFO pico)
{
    switch (LOWORD (pico->lpVerb))
    {   // Called when the user clicks our verb.
        case IDM_LIST:
            {
                HKEY Key;
                LONG Result;
                char EXEString[2048];
                int Length;
                DWORD Type;
                int SER;

                // We do not use ListXP's VarList[Ext] class because that would add a lot to our DLL size!
                Result = RegCreateKeyEx (LISTREGROOTKEY, LISTREGSUBKEY, 0, NULL, REG_OPTION_NON_VOLATILE,
                    KEY_ALL_ACCESS, NULL, &Key, NULL);

                if (Result == ERROR_SUCCESS)
                {
                    Type = REG_SZ;

                    if (ERROR_SUCCESS != RegQueryValueEx (Key, "LastEXEPath", NULL, &Type, NULL, (unsigned long *)&Length))
                    {   // The entry doesn't exist so we'll use our own current directory + listxp.exe ... maybe it'll work!
                        char EXEName[1024];
                        char *p;

                        GetModuleFileName (GlobalInstance, EXEName, sizeof (EXEName));

                        p = EXEName + lstrlen (EXEName) - 1;

                        while (*p != '\\'  &&  p != EXEName)
                            p--;

                        if (p == EXEName)
                            p = NULL;

                        if (p != NULL)
                            *p = '\0';

                        lstrcpy (EXEString, EXEName);
                        lstrcat (EXEString, "\\listxp.exe");
                    }
                    else
                    {
                        RegQueryValueEx (Key, "LastEXEPath", NULL, &Type, (unsigned char *)EXEString, (unsigned long *)&Length);
                    }

                    RegCloseKey (Key);

                    SER = (int) ShellExecute (pico->hwnd, "open", EXEString, FileName, ".", SW_SHOWNORMAL);

                    // Was there an error running list? Well maybe they deleted listxp.exe ... ask if
                    // they want to remove ListXP's presence from the registry
                    if (SER < 32)
                    {
                        // However, some error codes do not result from listxp.exe being deleted ...
                        if (SER == ERROR_FILE_NOT_FOUND  ||
                            SER == ERROR_PATH_NOT_FOUND  ||
                            SER == SE_ERR_FNF            ||
                            SER == SE_ERR_PNF)
                        {
                            int MBResult;

                            MBResult = MessageBox (pico->hwnd,
                                "It appears that the ListXP executable has been deleted.\n"
                                "Would you like to remove all ListXP registry entries?",
                                "ListXP Uninstall",
                                MB_YESNO | MB_ICONQUESTION);

                            if (MBResult == IDYES)
                            {   // Delete the following registry keys:
                                // HKEY_CURRENT_USER\SOFTWARE\ListXP
                                // HKEY_CLASSES_ROOT\CLSID\{Our GUID}
                                // HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\ListXP
                                SHDeleteKey (LISTREGROOTKEY, LISTREGSUBKEY);
                                SHDeleteKey (HKEY_CLASSES_ROOT, "CLSID\\" CLSID_LISTXPSHORTCUTMENU_GUIDSTRING);
                                SHDeleteKey (HKEY_CLASSES_ROOT, "*\\shellex\\ContextMenuHandlers\\ListXP");

                                MessageBox (pico->hwnd,
                                    "ListXP's registry settings and shell integration have been removed.",
                                    "Done",
                                    MB_OK);
                            }
                        }
                    }
                }
            }

            break;

        default:
            return (E_INVALIDARG);
    }

    return (NOERROR);
}

STDMETHODIMP CShortcutMenu::QueryContextMenu (HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
{
    // Do not modify the default verb actions!
    if (!(uFlags & CMF_DEFAULTONLY)  &&  AddMenuItem)
    {
        InsertMenu (hMenu, indexMenu, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_LIST, "&List");
        return (MAKE_HRESULT (SEVERITY_SUCCESS, 0, USHORT(IDM_LIST + 1)));
    }

    return (MAKE_HRESULT (SEVERITY_SUCCESS, 0, USHORT(0)));
}


text:
<?php

namespace r0mdau;

class r0mdauDb
{
    private $directory;

    public function __construct($directory)
    {
        $this->directory = $directory;
    }

    public function collection($name)
    {
        return new r0mdauCollection($this->directory, $name);
    }
}


text:
package io.udash.web.guide.views.ext.demo.bootstrap

import io.udash.css.CssView
import io.udash.web.guide.demos.AutoDemo
import io.udash.web.guide.styles.partials.GuideStyles
import scalatags.JsDom.all._

object ListGroupDemo extends AutoDemo with CssView {

  private val (rendered, source) = {
    import io.udash._
    import io.udash.bootstrap.list.UdashListGroup
    import io.udash.bootstrap.utils.BootstrapStyles.{active => activeStyle, disabled => disabledStyle, _}
    import io.udash.css.CssStyleName
    import org.scalajs.dom.window
    import scalatags.JsDom.all._

    val news = SeqProperty("Title 1", "Title 2", "Title 3")

    def newsStyle(newsProperty: Property[String]): ReadableProperty[CssStyleName] = {
      newsProperty.transform(_.last match {
        case '1' => activeStyle
        case '2' => disabledStyle
        case '3' => List.color(Color.Success)
        case '4' => List.color(Color.Danger)
        case '5' => List.color(Color.Info)
        case '6' => List.color(Color.Warning)
      })
    }

    var i = 1
    val appendHandler = window.setInterval(() => {
      news.append(s"Dynamic $i")
      i += 1
    }, 2000)
    window.setTimeout(() => window.clearInterval(appendHandler), 12000)

    div(
      UdashListGroup(news)((news, nested) =>
        li(nested(cls.bind(newsStyle(news).transform(_.className))))(nested(bind(news))).render
      )
    ).render
  }.withSourceCode

  override protected def demoWithSource(): (Modifier, Iterator[String]) = {
    (rendered.setup(_.applyTags(GuideStyles.frame)), source.linesIterator)
  }
}


text:
@interface UYLCaptureViewController () <AVCaptureMetadataOutputObjectsDelegate>

@property (nonatomic, strong) AVCaptureVideoPreviewLayer *previewLayer;
@property (nonatomic, strong) CALayer *targetLayer;
@property (nonatomic, strong) AVCaptureSession *captureSession;
@property (nonatomic, strong) NSMutableArray *codeObjects;

@end

@implementation UYLCaptureViewController

static NSString *UYLSegueToTableView = @"UYLSegueToTableView";

#pragma mark -
#pragma mark === Accessors ===
#pragma mark -

- (NSMutableArray *)codeObjects
{
    if (!_codeObjects)
    {
        _codeObjects = [NSMutableArray new];
    }
    return _codeObjects;
}

- (AVCaptureSession *)captureSession
{
    if (!_captureSession)
    {
        _captureSession = [[AVCaptureSession alloc] init];

        NSError *error = nil;
        AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
        if (device.isAutoFocusRangeRestrictionSupported)
        {
            if ([device lockForConfiguration:&error])
            {
                [device setAutoFocusRangeRestriction:AVCaptureAutoFocusRangeRestrictionNear];
                [device unlockForConfiguration];
            }
        }

        AVCaptureDeviceInput *deviceInput = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];
        if (deviceInput)
        {
            if ([_captureSession canAddInput:deviceInput])
            {
                [_captureSession addInput:deviceInput];
            }
        }
        else
        {
            NSLog(@"Input Device error: %@",[error localizedDescription]);
        }

        AVCaptureMetadataOutput *metadataOutput = [[AVCaptureMetadataOutput alloc] init];
        if ([_captureSession canAddOutput:metadataOutput])
        {
            [_captureSession addOutput:metadataOutput];
            [metadataOutput setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()];
            [metadataOutput setMetadataObjectTypes:@[AVMetadataObjectTypeQRCode]];
        }

        self.previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:_captureSession];
        self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
        self.previewLayer.frame = self.view.bounds;
        [self.view.layer addSublayer:self.previewLayer];

        self.targetLayer = [CALayer layer];
        self.targetLayer.frame = self.view.bounds;
        [self.view.layer addSublayer:self.targetLayer];

    }
    return _captureSession;
}

#pragma mark -
#pragma mark === View Lifecycle ===
#pragma mark -

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(applicationDidEnterBackground:)
                                                 name:UIApplicationDidEnterBackgroundNotification
                                               object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(applicationWillEnterForeground:)
                                                 name:UIApplicationWillEnterForegroundNotification
                                               object:nil];
    [self startRunning];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [self stopRunning];
}

- (void)applicationDidEnterBackground:(NSNotification *)notification
{
    [self stopRunning];
}

- (void)applicationWillEnterForeground:(NSNotification *)notification
{
    [self startRunning];
}

- (void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

#pragma mark -
#pragma mark === Segue ===
#pragma mark -

- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender
{
    if ([identifier isEqualToString:UYLSegueToTableView])
    {
        return [self.codeObjects count];
    }

    return NO;
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:UYLSegueToTableView])
    {
        UYLTableViewController *viewController = segue.destinationViewController;
        viewController.codeObjects = self.codeObjects;
    }
}

#pragma mark -
#pragma mark === AVCaptureMetadataOutputObjectsDelegate ===
#pragma mark -

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection
{
    self.codeObjects = nil;

    for (AVMetadataObject *metadataObject in metadataObjects)
    {
        AVMetadataObject *transformedObject = [self.previewLayer transformedMetadataObjectForMetadataObject:metadataObject];
        [self.codeObjects addObject:transformedObject];
    }

    [self clearTargetLayer];
    [self showDetectedObjects];
}

#pragma mark -
#pragma mark === Utility methods ===
#pragma mark -

- (void)startRunning
{
    self.codeObjects = nil;
    [self.captureSession startRunning];
}

- (void)stopRunning
{
    [self.captureSession stopRunning];
    self.captureSession = nil;
}

- (void)clearTargetLayer
{
    NSArray *sublayers = [[self.targetLayer sublayers] copy];
    for (CALayer *sublayer in sublayers)
    {
        [sublayer removeFromSuperlayer];
    }
}

- (void)showDetectedObjects
{
    for (AVMetadataObject *object in self.codeObjects)
    {
        if ([object isKindOfClass:[AVMetadataMachineReadableCodeObject class]])
        {
            CAShapeLayer *shapeLayer = [CAShapeLayer layer];
            shapeLayer.strokeColor = [UIColor redColor].CGColor;
            shapeLayer.fillColor = [UIColor clearColor].CGColor;
            shapeLayer.lineWidth = 2.0;
            shapeLayer.lineJoin = kCALineJoinRound;
            CGPathRef path = createPathForPoints([(AVMetadataMachineReadableCodeObject *)object corners]);
            shapeLayer.path = path;
            CFRelease(path);
            [self.targetLayer addSublayer:shapeLayer];
        }
    }
}

CGMutablePathRef createPathForPoints(NSArray* points)
{
	CGMutablePathRef path = CGPathCreateMutable();
	CGPoint point;

	if ([points count] > 0)
    {
		CGPointMakeWithDictionaryRepresentation((CFDictionaryRef)[points objectAtIndex:0], &point);
		CGPathMoveToPoint(path, nil, point.x, point.y);

		int i = 1;
		while (i < [points count])
        {
			CGPointMakeWithDictionaryRepresentation((CFDictionaryRef)[points objectAtIndex:i], &point);
			CGPathAddLineToPoint(path, nil, point.x, point.y);
			i++;
		}

		CGPathCloseSubpath(path);
	}

	return path;
}

@end


text:
package org.apache.beam.runners.dataflow.worker;

import static org.apache.beam.runners.dataflow.util.Structs.getInt;
import static org.apache.beam.runners.dataflow.util.Structs.getStrings;

import com.google.auto.service.AutoService;
import com.google.common.collect.ImmutableMap;
import java.util.Collections;
import java.util.Map;
import javax.annotation.Nullable;
import org.apache.beam.runners.dataflow.util.CloudObject;
import org.apache.beam.runners.dataflow.worker.util.WorkerPropertyNames;
import org.apache.beam.runners.dataflow.worker.util.common.worker.NativeReader;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.options.PipelineOptions;

/** Creates an InMemoryReader from a CloudObject spec. */
public class InMemoryReaderFactory implements ReaderFactory {

  /** A {@link ReaderFactory.Registrar} for in memory sources. */
  @AutoService(ReaderFactory.Registrar.class)
  public static class Registrar implements ReaderFactory.Registrar {

    @Override
    public Map<String, ReaderFactory> factories() {
      return ImmutableMap.of("InMemorySource", new InMemoryReaderFactory());
    }
  }

  @Override
  public NativeReader<?> create(
      CloudObject spec,
      @Nullable Coder<?> coder,
      @Nullable PipelineOptions options,
      @Nullable DataflowExecutionContext executionContext,
      DataflowOperationContext operationContext)
      throws Exception {
    return create(spec, coder);
  }

  <T> InMemoryReader<T> create(CloudObject spec, Coder<T> coder) throws Exception {
    return new InMemoryReader<>(
        getStrings(spec, WorkerPropertyNames.ELEMENTS, Collections.<String>emptyList()),
        getInt(spec, WorkerPropertyNames.START_INDEX, null),
        getInt(spec, WorkerPropertyNames.END_INDEX, null),
        coder);
  }
}


text:
set -euxo pipefail

apt-get install -y unzip
curl https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip > /tmp/terraform.zip
unzip /tmp/terraform.zip && mv ./terraform /usr/local/bin/ && terraform --version


text:
typedef unsigned char data_t;
extern unsigned char Taltab[],Tal1tab[];
#define NN 255
#define NROOTS 32


text:
//  ------------------------------------------------------------------------------------
//  Copyright (c) Microsoft Corporation
//  All rights reserved.
//
//  Licensed under the Apache License, Version 2.0 (the ""License""); you may not use this
//  file except in compliance with the License. You may obtain a copy of the License at
//  http://www.apache.org/licenses/LICENSE-2.0
//
//  THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
//  EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR
//  CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR
//  NON-INFRINGEMENT.
//
//  See the Apache Version 2.0 License for specific language governing permissions and
//  limitations under the License.
//  ------------------------------------------------------------------------------------

namespace Amqp.Listener
{
    /// <summary>
    /// The state of a concext.
    /// </summary>
    public enum ContextState
    {
        /// <summary>
        /// The context is active.
        /// </summary>
        Active = 0,

        /// <summary>
        /// The context is completed.
        /// </summary>
        Completed = 1,

        /// <summary>
        /// The context is aborted due to transport errors.
        /// </summary>
        Aborted = 2
    }
}


text:
package gov.nih.nci.cagrid.testing.system.deployment.steps;

import gov.nih.nci.cagrid.common.Utils;
import gov.nih.nci.cagrid.testing.system.haste.Step;

import java.io.File;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * DeployServiceStep Deploys a caGrid service to the container
 *
 * @author David W. Ervin *
 * @created Nov 8, 2006
 * @version $Id: DeleteServiceStep.java,v 1.1 2008-05-19 16:39:23 langella Exp $
 */
public class DeleteServiceStep extends Step {
	private static final Log LOG = LogFactory.getLog(DeleteServiceStep.class);

	private File serviceDir;

	public DeleteServiceStep(File serviceDir) {
		this.serviceDir = serviceDir;
	}

	public void runStep() throws Throwable {
		LOG.debug("Running step: " + getClass().getName());
		Utils.deleteDir(serviceDir);
	}
}


text:
  Bewaren

$var['atmailstyle']

Adresboekprofiel van $var['UserEmail'] tonen. U kunt de gebruikersgegevens aanpassen door onderstaande velden te bewerken. Nadat u op 'Doorsturen' heeft geklikt, worden de wijzigingen opgeslagen in uw adresboek.

<form method="post" name="abook_new" ENCTYPE="multipart/form-data">

<input type="hidden" name="WriteSelectedGroups">
<input type="hidden" name="WriteSelectedUsers">
<input type="hidden" name="ReadSelectedGroups">
<input type="hidden" name="ReadSelectedUsers">
<input type="hidden" name="PreviousEmail" value="$var['UserEmail']">

<input type="hidden" name="UserEmail2" value="$var['UserEmail2']">
<input type="hidden" name="UserEmail3" value="$var['UserEmail3']">
<input type="hidden" name="UserEmail4" value="$var['UserEmail4']">
<input type="hidden" name="UserEmail5" value="$var['UserEmail5']">
<input type="hidden" name="UserTitle" value="$var['UserTitle']">
<input type="hidden" name="UserGender" value="$var['UserGender']">
<input type="hidden" name="UserDOB" value="$var['UserDOB']">
<input type="hidden" name="UserWorkTitle" value="$var['UserWorkTitle']">
<input type="hidden" name="UserWorkDept" value="$var['UserWorkDept']">
<input type="hidden" name="UserWorkOffice" value="$var['UserWorkOffice']">
<input type="hidden" name="UserPgpKey" value="$var['UserPgpKey']">

<input type=hidden name="func" value="open">
<input type=hidden name="update" value="1">
<input type=hidden name="type" value="$var['abookview']">
<input type=hidden name="id" value="$var['id']">

 Gebruiker aan adresboek toevoegen.

		SecondaryColor">

SecondaryColor" width="150">E-mail adres
SecondaryColor">
<input type="text" class="inputfield" name="UserEmail" size="40" maxlength="64" value="$var['UserEmail']">

SecondaryColor">Voornaam
SecondaryColor">
<input type="text" class="inputfield" name="UserFirstName" size="40" maxlength="64" value="$var['UserFirstName']">

SecondaryColor">Tweede voornaam
SecondaryColor">
<input type="text" class="inputfield" name="UserMiddleName" size="40" maxlength="64" value="$var['UserMiddleName']">

SecondaryColor">Familienaam
SecondaryColor">
<input type="text" class="inputfield" name="UserLastName" size="40" maxlength="64" value="$var['UserLastName']">

SecondaryColor">Adres
SecondaryColor">
<input type="text" class="inputfield" name="UserHomeAddress" size="30" maxlength="64" value="$var['UserHomeAddress']">

SecondaryColor">Stad
SecondaryColor">
<input type="text" class="inputfield" name="UserHomeCity" size="30" maxlength="64" value="$var['UserHomeCity']">

SecondaryColor">Provincie
SecondaryColor">
<input type="text" class="inputfield" name="UserHomeState" size="20" maxlength="64" value="$var['UserHomeState']">

SecondaryColor">Postcode
SecondaryColor">
<input type="text" class="inputfield" name="UserHomeZip" size="20" maxlength="64" value="$var['UserHomeZip']">

SecondaryColor">Land
SecondaryColor">
<input type="text" class="inputfield" name="UserHomeCountry" size="35" maxlength="64" value="$var['UserHomeCountry']">

SecondaryColor">URL
SecondaryColor">
<input type="text" class="inputfield" name="UserURL" size="40" maxlength="128" value="$var['UserURL']">

SecondaryColor">GSM nummer
SecondaryColor">
<input type="text" class="inputfield" name="UserHomeMobile" size="20" maxlength="64" value="$var['UserHomeMobile']">

SecondaryColor">Telefoonnummer privé
SecondaryColor">
<input type="text" class="inputfield" name="UserHomePhone" size="20" maxlength="64" value="$var['UserHomePhone']">

SecondaryColor">Faxnummer privé
SecondaryColor">
<input type="text" class="inputfield" name="UserHomeFax" size="20" maxlength="64" value="$var['UserHomeFax']">

SecondaryColor">Extra informatie
SecondaryColor">
<textarea name="UserInfo" cols="40" rows="5" class="inputfieldtextarea">$var['UserInfo']</textarea>

 Zaken

		SecondaryColor">

SecondaryColor" width="150">Bedrijfsnaam
SecondaryColor">
<input type="text" class="inputfield" name="UserWorkCompany" size="40" maxlength="64" value="$var['UserWorkCompany']">

SecondaryColor">Adres
SecondaryColor">
<input type="text" class="inputfield" name="UserWorkAddress" size="30" maxlength="64" value="$var['UserWorkAddress']">

SecondaryColor">Stad
SecondaryColor">
<input type="text" class="inputfield" name="UserWorkCity" size="30" maxlength="64" value="$var['UserWorkCity']">

SecondaryColor">Provincie
SecondaryColor">
<input type="text" class="inputfield" name="UserWorkState" size="20" maxlength="64" value="$var['UserWorkState']">

SecondaryColor">Postcode
SecondaryColor">
<input type="text" class="inputfield" name="UserWorkZip" size="20" maxlength="64" value="$var['UserWorkZip']">

SecondaryColor">Land
SecondaryColor">
<input type="text" class="inputfield" name="UserWorkCountry" size="35" maxlength="64" value="$var['UserWorkCountry']">

SecondaryColor">GSM werk
SecondaryColor">
<input type="text" class="inputfield" name="UserWorkMobile" size="20" maxlength="64" value="$var['UserWorkMobile']">

SecondaryColor">Telefoonnummer werk
SecondaryColor">
<input type="text" class="inputfield" name="UserWorkPhone" size="20" maxlength="64" value="$var['UserWorkPhone']">

SecondaryColor">Faxnummer werk
SecondaryColor">
<input type="text" class="inputfield" name="UserWorkFax" size="20" maxlength="64" value="$var['UserWorkFax']">

</form>

<input type=submit name="submitform" value="Toepassen" class="stdbtnlong" style="display: none">


text:
package com.bmpak.anagramsolver.ui;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBar;
import android.text.InputFilter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import com.bmpak.anagramsolver.R;
import com.bmpak.anagramsolver.dictionary.Dictionary;
import com.bmpak.anagramsolver.utils.AnagramTextWatcher;
import com.bmpak.anagramsolver.utils.AppPrefs;
import com.bmpak.anagramsolver.utils.ViewUtils;
import butterknife.ButterKnife;
import butterknife.InjectView;
import io.realm.Realm;

/**
 * A simple {@link Fragment} subclass.
 */
public class AnagramFragment extends Fragment implements AnagramTextWatcher.OnWordsFound {

    private Realm realm;

    public AnagramFragment() {
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        realm = Realm.getInstance(activity);
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        ActionBar actionbar = ((MainActivity) getActivity()).getSupportActionBar();
        actionbar.show();
        actionbar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
        actionbar.setCustomView(R.layout.actionbar_view);
    }

    @InjectView(R.id.swipeContainer)
    SwipeRefreshLayout mSwipeRefreshLayout;

    @InjectView(R.id.languages)
    LinearLayout languages;

    @InjectView(R.id.inputWord)
    EditText inputWordET;

    @InjectView(R.id.anagramsListView)
    ListView anagramsLV;

    @InjectView(R.id.reportStatus)
    TextView reportStatus;

    /**
     * {@link com.bmpak.anagramsolver.utils.AnagramTextWatcher} instance.
     */
    private AnagramTextWatcher anagramTextWatcher;

    /* helper View for languages initialization */
    private View currentDict;

    /* ListView's adapter */
    private ArrayAdapter<String> wordListAdapter;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View rootView = inflater.inflate(R.layout.fragment_anagram, container, false);
        ButterKnife.inject(this, rootView);

        SharedPreferences prefs = getActivity()
                .getSharedPreferences(AppPrefs.MAIN_PREF_NAME, Context.MODE_PRIVATE);

        //sets doesn't have an order
        Set<String> installedDictsSet = prefs.getStringSet(
                AppPrefs.DICTIONARIES_INSTALLED, new HashSet<String>());

        //convert to array to have a specific order in layout
        String[] installedDictsArray = installedDictsSet.toArray(new String[installedDictsSet.size()]);
        Arrays.sort(installedDictsArray);

        //initialize language section
        initLanguages(installedDictsArray);

        wordListAdapter = new ArrayAdapter<String>(
                getActivity(),
                R.layout.listview_item, R.id.list_content);
        anagramsLV.setAdapter(wordListAdapter);

        anagramTextWatcher = new AnagramTextWatcher(this, realm, wordListAdapter);
        anagramTextWatcher.setSwipeRefreshLayout(mSwipeRefreshLayout);

        //set the first dictionary
        anagramTextWatcher.setDictionary(installedDictsArray[0]);
        inputWordET.addTextChangedListener(anagramTextWatcher);
        inputWordET.setTypeface(
                Typeface.createFromAsset(getResources().getAssets(),
                        "font/RobotoSlab-Regular.ttf"), Typeface.BOLD
        );
        inputWordET.setFilters(new InputFilter[]{new InputFilter.AllCaps()});

        //http://nlopez.io/swiperefreshlayout-with-listview-done-right/
        anagramsLV.setOnScrollListener(new AbsListView.OnScrollListener() {
            @Override
            public void onScrollStateChanged(AbsListView absListView, int i) {
                //nothing to do
            }

            @Override
            public void onScroll(AbsListView absListView, int i, int i2, int i3) {
                int topRowVerticalPosition =
                        (anagramsLV == null || anagramsLV.getChildCount() == 0) ?
                                0 : anagramsLV.getChildAt(0).getTop();
                mSwipeRefreshLayout.setEnabled(topRowVerticalPosition >= 0);
            }
        });

        mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {
                anagramTextWatcher.scrabble();
                Toast.makeText(getActivity(), R.string.scrabbling, Toast.LENGTH_SHORT).show();
            }
        });

        mSwipeRefreshLayout.setColorSchemeColors(
                R.color.grey_flag,
                R.color.dark_blue_flag,
                R.color.blue_flag,
                R.color.red_flag
        );

        return rootView;
    }

    /**
     * Gets the installed dictionaries and adds ImageButtons dynamically in LinearLayout.
     * <p/>
     * It also initialize them with onClick events.
     */
    private void initLanguages(String[] installedDicts) {
        for (String lang : installedDicts) {
            ImageButton languageImageButton = new ImageButton(getActivity());
            languageImageButton.setBackgroundColor(Color.TRANSPARENT);

            languageImageButton.setImageDrawable(getActivity().getResources().getDrawable(Dictionary.getDrawableId(lang)));

            //set layout parameters
            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                    LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
            //weight set to 1 to have same distance between languages..
            params.weight = 1;

            languageImageButton.setLayoutParams(params);

            //set language to Tag
            languageImageButton.setTag(lang);

            languageImageButton.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {

                    if(view != currentDict) {
                        //send singal to change the parser
                        String dictionarySelected = (String) view.getTag();
                        anagramTextWatcher.dictionaryChange(dictionarySelected);

                        //make previous selected language semi transparent
                        ViewUtils.setAlpha(currentDict, ViewUtils.DEFAULT_SEMI_ALPHA, 0);

                        //set clicked language as current dictionary and set to full alpha
                        currentDict = view;
                        ViewUtils.setAlpha(view, ViewUtils.DEFAULT_FULL_ALPHA, 0);
                    }
                }
            });

            if (currentDict == null) {
                currentDict = languageImageButton;
                ViewUtils.setAlpha(languageImageButton, ViewUtils.DEFAULT_FULL_ALPHA, 0);
            } else {
                ViewUtils.setAlpha(languageImageButton, ViewUtils.DEFAULT_SEMI_ALPHA, 0);
            }

            //add to languages section
            languages.addView(languageImageButton);
        }
    }

    @Override
    public void onWordsFound(int wordsCount) {

        //flag to remain the right and left lines
        if (wordsCount == -1) {
            reportStatus.setText("");
            reportStatus.setVisibility(View.INVISIBLE);
        } else {
            reportStatus.setVisibility(View.VISIBLE);
            if (wordsCount == 0) {
                reportStatus.setText(getResources().getString(R.string.not_found));
            } else {
                reportStatus.setText(
                        String.format(getResources().getString(R.string.found), wordsCount)
                );
            }
        }
    }

}


text:
<?php

return [
    'title'=> 'Recupero password',
    'header'=> 'Recupero password',
    'text'=> 'Dopo aver effettuato la richiesta riceverai una mail dove sarà descritta la procedura per il recupero della password del tuo account.',
    'question'=> 'Password dimenticata?',
    'suggestion'=> 'Effettua la procedura di recupero!',
    'button'=> 'Effettua il recupero',
    'success'=> 'La richiesta di recupero è stata effettuata con successo!',
];


text:
.class public interface abstract Lcom/google/android/gms/internal/ac;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/os/IInterface;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/google/android/gms/internal/ac$a;
    }
.end annotation

# virtual methods
.method public abstract H()V
.end method

.method public abstract a(Lcom/google/android/gms/internal/ab;)V
.end method

.method public abstract a(Lcom/google/android/gms/internal/ae;)V
.end method

.method public abstract a(Lcom/google/android/gms/internal/x;)V
.end method

.method public abstract a(Lcom/google/android/gms/internal/v;)Z
.end method

.method public abstract destroy()V
.end method

.method public abstract isReady()Z
.end method

.method public abstract pause()V
.end method

.method public abstract resume()V
.end method

.method public abstract showInterstitial()V
.end method

.method public abstract stopLoading()V
.end method

.method public abstract x()Lcom/google/android/gms/dynamic/b;
.end method

.method public abstract y()Lcom/google/android/gms/internal/x;
.end method


text:
Tiltingatwindmills
==================

A small Go app to show user's tweets and find shared followers

Requirements
------------

[Go](http://golang.org)

[Twitter API credentials](https://apps.twitter.com/) (TODO: This might not be the right link ...)

Installation
------------

Install the packages that this application relies on:

``` shell

export GOPATH=<wherever you wish Go libs to reside>

go get gopkg.in/gin-gonic/gin.v1
go get github.com/ChimeraCoder/anaconda

```

Set the required environment variables with the credentials as
supplied when you create a Twitter app account:

``` shell

export TW_ACCESS_TOKEN_SECRET=<twitter secret access token>
export TW_ACCESS_TOKEN=<twitter access token>
export TW_CONSUMER_SECRET=<twitter secret consumer key>
export TW_CONSUMER_KEY=<twitter consumer key>

```

Invocation
----------

Use `go run` to start the app:

``` shell

go run tiltingatwindmils.go

```

The server runs on localhost port 8000, documentation is at:

http://localhost:8000/doc/dist


text:
require File.expand_path('../../../../../spec_helper', __FILE__)
require 'net/http'
require File.expand_path('../fixtures/http_server', __FILE__)

describe "Net::HTTP#options" do
  before :each do
    NetHTTPSpecs.start_server
    @http = Net::HTTP.start("localhost", NetHTTPSpecs.port)
  end

  after :each do
    @http.finish if @http.started?
    NetHTTPSpecs.stop_server
  end

  it "sends an options request to the passed path and returns the response" do
    response = @http.options("/request")

    response.body.should == "Request type: OPTIONS"
  end

  it "returns a Net::HTTPResponse" do
    @http.options("/request").should be_kind_of(Net::HTTPResponse)
  end
end


text:
package io.aos.aop.aspectj.auth;

import static org.aspectj.lang.Aspects.aspectOf;
import io.aos.aop.aspectj.auth.aspect.ProfileVerificationAspect;
import io.aos.aop.aspectj.auth.auth.UserProfileChecker;
import io.aos.aop.aspectj.auth.auth.UserProfileCheckerImpl;
import io.aos.aop.aspectj.auth.contact.ContactManager;
import io.aos.aop.aspectj.auth.contact.ContactManagerImpl;

import com.google.inject.AbstractModule;

public class AspectJAuthModule extends AbstractModule {

    @Override
    protected void configure() {
        bind(ContactManager.class).to(ContactManagerImpl.class).asEagerSingleton();
        bind(UserProfileChecker.class).to(UserProfileCheckerImpl.class).asEagerSingleton();
        requestInjection(aspectOf(ProfileVerificationAspect.class));
    }

}


text:
package org.teavm.backend.javascript.decompile;

import java.util.ArrayList;
import java.util.List;
import org.teavm.model.ClassHolder;

public class PreparedClass {
    private ClassHolder classHolder;
    private List<PreparedMethod> methods = new ArrayList<>();

    public PreparedClass(ClassHolder classHolder) {
        this.classHolder = classHolder;
    }

    public String getName() {
        return classHolder.getName();
    }

    public String getParentName() {
        return classHolder.getParent();
    }

    public List<PreparedMethod> getMethods() {
        return methods;
    }

    public ClassHolder getClassHolder() {
        return classHolder;
    }
}