text:
using System;
using BoletoNet.Enums;
using System.Collections.Generic;
using BoletoNet.Excecoes;

namespace BoletoNet
{
    public enum EnumCodigoMovimento_Sicredi
    {
        EntradaConfirmada = 02,                                       //02 Entrada confirmada
        EntradaRejeitada = 03,                                        //03 Entrada rejeitada
        LiquidacaoNormal = 06,                                        //06 Liquidação normal
        BaixadoAutomaticamenteViaArquivo = 09,                        //09 Baixado automaticamente via arquivo
        BaixadoConformeInstrucoesDaCooperativaDeCredito = 10,         //10 Baixado conforme instruções da cooperativa de crédito
        AbatimentoConcedido = 12,                                     //12 Abatimento concedido
        AbatimentoCancelado = 13,                                     //13 Abatimento cancelado
        VencimentoAlterado = 14,                                      //14 Vencimento alterado
        LiquidacaoEmCartorio = 15,                                    //15 Liquidação em cartório
        LiquidacaoAposBaixa = 17,                                     //17 Liquidação após baixa
        ConfirmacaoDeRecebimentoDeInstrucaoDeProtesto = 19,           //19 Confirmação de recebimento de instrução de protesto
        ConfirmacaoDeRecebimentoDeInstrucaoDeSustacaoDeProtesto = 20, //20 Confirmação de recebimento de instrução de sustação de protesto
        EntradaDeTituloEmCartorio = 23,                               //23 Entrada de título em cartório
        EntradaRejeitadaPorCEPIrregular = 24,                         //24 Entrada rejeitada por CEP irregular
        BaixaRejeitada = 27,                                          //27 Baixa rejeitada
        Tarifa = 28,                                                  //28 Tarifa
        RejeicaoDoPagador = 29,                                       //29 Rejeição do pagador
        AlteracaoRejeitada = 30,                                      //30 Alteração rejeitada
        InstrucaoRejeitada = 32,                                      //32 Instrução rejeitada
        ConfirmacaoDePedidoDeAlteracaoDeOutrosDados = 33,             //33 Confirmação de pedido de alteração de outros dados
        RetiradoDeCartorioEManutencaoEmCarteira = 34,                 //34 Retirado de cartório e manutenção em carteira
        AceiteDoPagador = 35                                          //35 Aceite do pagador
    }

    public class CodigoMovimento_Sicredi : AbstractCodigoMovimento, ICodigoMovimento
    {
        #region Construtores
        internal CodigoMovimento_Sicredi()
        {
        }

        public CodigoMovimento_Sicredi(int codigo)
        {
            try
            {
                carregar(codigo);
            }
            catch (Exception ex)
            {
                throw new Exception("Erro ao carregar objeto", ex);
            }
        }
        #endregion

        private void carregar(int codigo)
        {
            try
            {
                this.Banco = new Banco_Sicredi();

                var movimento = (EnumCodigoMovimento_Sicredi)codigo;
                Codigo = codigo;
                Descricao = descricoes[movimento];
            }
            catch (Exception ex)
            {
                throw new BoletoNetException("Código de movimento é inválido", ex);
            }
        }

        public override TipoOcorrenciaRetorno ObterCorrespondenteFebraban()
        {
            return ObterCorrespondenteFebraban(correspondentesFebraban, (EnumCodigoMovimento_Sicredi)Codigo);
        }

        #region Dicionários
        private Dictionary<EnumCodigoMovimento_Sicredi, TipoOcorrenciaRetorno> correspondentesFebraban = new Dictionary<EnumCodigoMovimento_Sicredi, TipoOcorrenciaRetorno>()
        {
            { EnumCodigoMovimento_Sicredi.EntradaConfirmada                                      ,TipoOcorrenciaRetorno.EntradaConfirmada },
            { EnumCodigoMovimento_Sicredi.EntradaRejeitada                                       ,TipoOcorrenciaRetorno.EntradaRejeitada },
            { EnumCodigoMovimento_Sicredi.LiquidacaoNormal                                       ,TipoOcorrenciaRetorno.Liquidacao },
            { EnumCodigoMovimento_Sicredi.BaixadoAutomaticamenteViaArquivo                       ,TipoOcorrenciaRetorno.Baixa },
            { EnumCodigoMovimento_Sicredi.BaixadoConformeInstrucoesDaCooperativaDeCredito        ,TipoOcorrenciaRetorno.Baixa },
            { EnumCodigoMovimento_Sicredi.AbatimentoConcedido                                    ,TipoOcorrenciaRetorno.ConfirmacaoRecebimentoInstrucaoDeAbatimento },
            { EnumCodigoMovimento_Sicredi.AbatimentoCancelado                                    ,TipoOcorrenciaRetorno.ConfirmacaoRecebimentoInstrucaoDeCancelamentoAbatimento },
            { EnumCodigoMovimento_Sicredi.VencimentoAlterado                                     ,TipoOcorrenciaRetorno.ConfirmacaoRecebimentoInstrucaoAlteracaoDeVencimento },
            { EnumCodigoMovimento_Sicredi.LiquidacaoAposBaixa                                    ,TipoOcorrenciaRetorno.LiquidacaoAposBaixaOuLiquidacaoTituloNaoRegistrado },
            { EnumCodigoMovimento_Sicredi.ConfirmacaoDeRecebimentoDeInstrucaoDeProtesto          ,TipoOcorrenciaRetorno.ConfirmacaoRecebimentoInstrucaoDeProtesto },
            { EnumCodigoMovimento_Sicredi.ConfirmacaoDeRecebimentoDeInstrucaoDeSustacaoDeProtesto,TipoOcorrenciaRetorno.ConfirmacaoRecebimentoInstrucaoDeSustacaoCancelamentoDeProtesto },
            { EnumCodigoMovimento_Sicredi.EntradaDeTituloEmCartorio                              ,TipoOcorrenciaRetorno.RemessaACartorio },
            { EnumCodigoMovimento_Sicredi.Tarifa                                                 ,TipoOcorrenciaRetorno.DebitoDeTarifasCustas },
            { EnumCodigoMovimento_Sicredi.RejeicaoDoPagador                                      ,TipoOcorrenciaRetorno.OcorrenciasDoPagador },
            { EnumCodigoMovimento_Sicredi.AlteracaoRejeitada                                     ,TipoOcorrenciaRetorno.AlteracaoDeDadosRejeitada },
            { EnumCodigoMovimento_Sicredi.InstrucaoRejeitada                                     ,TipoOcorrenciaRetorno.InstrucaoRejeitada },
            { EnumCodigoMovimento_Sicredi.ConfirmacaoDePedidoDeAlteracaoDeOutrosDados            ,TipoOcorrenciaRetorno.ConfirmacaoDaAlteracaoDosDadosDoRateioDeCredito },
            { EnumCodigoMovimento_Sicredi.RetiradoDeCartorioEManutencaoEmCarteira                ,TipoOcorrenciaRetorno.ConfirmacaoDoCancelamentoDosDadosDoRateioDeCredito },
            { EnumCodigoMovimento_Sicredi.BaixaRejeitada                                         ,TipoOcorrenciaRetorno.BaixaRejeitada }
        };

        private Dictionary<EnumCodigoMovimento_Sicredi, string> descricoes = new Dictionary<EnumCodigoMovimento_Sicredi, string>()
        {
            { EnumCodigoMovimento_Sicredi.EntradaConfirmada                                       , "Entrada confirmada"                                             },
            { EnumCodigoMovimento_Sicredi.EntradaRejeitada                                        , "Entrada rejeitada"                                              },
            { EnumCodigoMovimento_Sicredi.LiquidacaoNormal                                        , "Liquidação normal"                                              },
            { EnumCodigoMovimento_Sicredi.BaixadoAutomaticamenteViaArquivo                        , "Baixado automaticamente via arquivo"                            },
            { EnumCodigoMovimento_Sicredi.BaixadoConformeInstrucoesDaCooperativaDeCredito         , "Baixado conforme instruções da cooperativa de crédito"          },
            { EnumCodigoMovimento_Sicredi.AbatimentoConcedido                                     , "Abatimento concedido"                                           },
            { EnumCodigoMovimento_Sicredi.AbatimentoCancelado                                     , "Abatimento cancelado"                                           },
            { EnumCodigoMovimento_Sicredi.VencimentoAlterado                                      , "Vencimento alterado"                                            },
            { EnumCodigoMovimento_Sicredi.LiquidacaoEmCartorio                                    , "Liquidação em cartório"                                         },
            { EnumCodigoMovimento_Sicredi.LiquidacaoAposBaixa                                     , "Liquidação após baixa"                                          },
            { EnumCodigoMovimento_Sicredi.ConfirmacaoDeRecebimentoDeInstrucaoDeProtesto           , "Confirmação de recebimento de instrução de protesto"            },
            { EnumCodigoMovimento_Sicredi.ConfirmacaoDeRecebimentoDeInstrucaoDeSustacaoDeProtesto , "Confirmação de recebimento de instrução de sustação de protesto"},
            { EnumCodigoMovimento_Sicredi.EntradaDeTituloEmCartorio                               , "Entrada de título em cartório"                                  },
            { EnumCodigoMovimento_Sicredi.EntradaRejeitadaPorCEPIrregular                         , "Entrada rejeitada por CEP irregular"                            },
            { EnumCodigoMovimento_Sicredi.BaixaRejeitada                                          , "Baixa rejeitada"                                                },
            { EnumCodigoMovimento_Sicredi.Tarifa                                                  , "Tarifa"                                                         },
            { EnumCodigoMovimento_Sicredi.RejeicaoDoPagador                                       , "Rejeição do pagador"                                            },
            { EnumCodigoMovimento_Sicredi.AlteracaoRejeitada                                      , "Alteração rejeitada"                                            },
            { EnumCodigoMovimento_Sicredi.InstrucaoRejeitada                                      , "Instrução rejeitada"                                            },
            { EnumCodigoMovimento_Sicredi.ConfirmacaoDePedidoDeAlteracaoDeOutrosDados             , "Confirmação de pedido de alteração de outros dados"             },
            { EnumCodigoMovimento_Sicredi.RetiradoDeCartorioEManutencaoEmCarteira                 , "Retirado de cartório e manutenção em carteira"                  },
            { EnumCodigoMovimento_Sicredi.AceiteDoPagador                                         , "Aceite do pagador" }
        };
        #endregion
    }
}


text:
<?php

/**
 * Jyxo PHP Library
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file license.txt.
 * It is also available through the world-wide-web at this URL:
 * https://github.com/jyxo/php/blob/master/license.txt
 */

/**
 * Container for parsed SVN binary output.
 *
 * Experimental.
 *
 * @category Jyxo
 * @package Jyxo_Svn
 * @copyright Copyright (c) 2005-2011 Jyxo, s.r.o.
 * @license https://github.com/jyxo/php/blob/master/license.txt
 * @author Matěj Humpál
 */
class Jyxo_Svn_Result implements Countable, SeekableIterator
{

	/**
	 * OK status.
	 *
	 * @var string
	 */
	const OK = 'OK';

	/**
	 * KO status.
	 *
	 * @var string
	 */
	const KO = 'KO';

	/**
	 * Added file flag.
	 *
	 * @var string
	 */
	const ADD = 'A';

	/**
	 * Deleted file flag.
	 *
	 * @var string
	 */
	const DELETE = 'D';

	/**
	 * Updated file flag.
	 *
	 * @var string
	 */
	const UPDATE = 'U';

	/**
	 * Conflicted file flag.
	 *
	 * @var string
	 */
	const CONFLICT = 'C';

	/**
	 * Modified file flag.
	 *
	 * @var string
	 */
	const MODIFIED = 'M';

	/**
	 * Merged file flag.
	 *
	 * @var string
	 */
	const MERGE = 'G';

	/**
	 * SVN:externals file flag.
	 *
	 * @var string
	 */
	const EXTERNALS = 'X';

	/**
	 * Ignored file flag.
	 *
	 * @var string
	 */
	const IGNORED = 'I';

	/**
	 * Locked file flag.
	 *
	 * @var string
	 */
	const LOCKED = 'L';

	/**
	 * Non-versioned file flag.
	 *
	 * @var string
	 */
	const NOT_VERSIONED = '?';

	/**
	 * Missing file flag.
	 *
	 * @var string
	 */
	const MISSING = '!';

	/**
	 * Flag meaning that the versioned object (file, directory, ...)
	 * has been replaced with another kind of object.
	 *
	 * @var string
	 */
	const DIR_FILE_SWITCH = '~';

	/**
	 * History scheduled with commit flag.
	 *
	 * @var string
	 */
	const SCHEDULED = '+';

	/**
	 * Switched item flag.
	 *
	 * @var string
	 */
	const SWITCHED = 'S';

	/**
	 * Flag meaning that there is a newer version on the server.
	 *
	 * @var string
	 */
	const NEW_VERSION_EXISTS = '*';

	/**
	 * Status table.
	 *
	 * @var array
	 */
	protected $statusTable = array(
		self::ADD => 'A',
		self::DELETE => 'D',
		self::UPDATE => 'U',
		self::CONFLICT => 'C',
		self::MODIFIED => 'M',
		self::MERGE => 'G',
		self::EXTERNALS => 'X',
		self::IGNORED => 'I',
		self::LOCKED => 'L',
		self::NOT_VERSIONED => '?',
		self::MISSING => '!',
		self::DIR_FILE_SWITCH => '',
		self::SCHEDULED => '+',
		self::SWITCHED => 'S',
		self::NEW_VERSION_EXISTS => '*',
	);

	/**
	 * Action revision.
	 *
	 * @var integer
	 */
	protected $revision;

	/**
	 * Action error.
	 *
	 * @var string
	 */
	protected $error = '';

	/**
	 * Action status.
	 *
	 * @var string
	 */
	protected $status;

	/**
	 * Action items.
	 *
	 * @var array
	 */
	protected $items = array();

	/**
	 * Internal pointer.
	 *
	 * @var integer
	 */
	protected $pointer = 0;

	/**
	 * Constructor.
	 *
	 * @param string $action SVN action
	 * @param string $input Action input
	 * @param integer $returnCode SVN binary return code
	 */
	public function __construct($action, $input, $returnCode = 1)
	{
		$this->items = $this->parse($action, $input);
		$this->status = $returnCode === 0 ? self::OK : self::KO;
		$this->error = $returnCode === 0 ? '' : $input;
	}

	/**
	 * Parses SVN binary output according to the action.
	 *
	 * @param string $action SVN action
	 * @param string $input SVN binary output
	 * @return array
	 */
	protected function parse($action, $input)
	{
		switch ($action) {
			case 'add':
			case 'status':
				return $this->parseStatus($input);
			case 'commit':
				return $this->parseCommit($input);
			case 'update':
				return $this->parseUpdate($input);
			default:
				// Do nothing
				return array();
		}
	}

	/**
	 * Parses SVN statis.
	 *
	 * @param string $input SVN binary output
	 * @return array
	 */
	protected function parseStatus($input)
	{
		$array = explode("\n", (string) $input);
		foreach ($array as $key => &$line) {

			$line = trim($line);

			if (empty($line)) {
				unset($array[$key]);
				continue;
			}

			$tmp = $line;
			$line = array();

			if ($tmp{0} !== ' ') {
				$line['status'] = $tmp{0};
			}
			if ($tmp{1} !== ' ') {
				$line['properties'] = $tmp{1};
			}
			if ($tmp{2} !== ' ') {
				$line['lock'] = $tmp{2};
			}
			if ($tmp{3} !== ' ') {
				$line['history'] = $tmp{3};
			}
			if ($tmp{4} !== ' ') {
				$line['switch'] = $tmp{4};
			}
			$line['file'] = substr($tmp, 7);

		}
		return $array;
	}

	/**
	 * Parses commit output and sets revision number.
	 *
	 * @param string $input SVN binary output
	 * @return array
	 */
	protected function parseCommit($input)
	{
		$array = explode("\n", (string) $input);
		foreach ($array as $key => &$line) {

			$line = trim($line);

			if (empty($line)) {
				unset($array[$key]);
				continue;
			}

			if (preg_match('/Committed revision ([0-9]+)\./i', $line, $matches)) {
				$this->revision = (int) $matches[1];
				unset($array[$key]);
				continue;
			}

			if (!preg_match('/Sending.*/', $line)) {
				unset($array[$key]);
				continue;
			}

		}

		return $array;
	}

	/**
	 * Parses update output.
	 *
	 * @param mixed $input SVN binary output
	 * @return array
	 */
	protected function parseUpdate($input)
	{
		$array = explode("\n", (string) $input);
		foreach ($array as $key => &$line) {

			$line = trim($line);

			if (empty($line)) {
				unset($array[$key]);
				continue;
			}

			if (preg_match('/At revision ([0-9]+)\./i', $line, $matches)) {
				$this->revision = (int) $matches[1];
				unset($array[$key]);
				continue;
			}

		}

		return $array;
	}

	/**
	 * Magic __get method.
	 *
	 * @param string $prop Property name
	 * @return mixed
	 */
	public function __get($prop)
	{
		return isset($this->$prop) ? $this->$prop : null;
	}

	/**
	 * Moves the internal pointer to the given position.
	 *
	 * @param integer $position New pointer position
	 * @return Jyxo_Svn_Result
	 * @throws Jyxo_Svn_Exception On invalid position
	 */
	public function seek($position)
	{
		$position = (int) $position;
		if ($position < 0 || $position > count($this->items)) {
			throw new Jyxo_Svn_Exception(sprintf('Illegal index %d', $position));
		}
		$this->pointer = $position;

		return $this;
	}

	/**
	 * Returns an item on the actual pointer position.
	 *
	 * @return mixed
	 */
	public function current()
	{
		if ($this->valid()) {
			return $this->items[$this->pointer];
		}

		return null;
	}

	/**
	 * Advances internal pointer's position to the next item.
	 *
	 * @return boolean
	 */
	public function next()
	{
		return ++$this->pointer < count($this->items);
	}

	/**
	 * Moves the internal pointer to the beginning.
	 *
	 * @return Jyxo_Svn_Result
	 */
	public function rewind()
	{
		$this->pointer = 0;

		return $this;
	}

	/**
	 * Returns the current key value.
	 *
	 * @return null|string
	 */
	public function key()
	{
		return $this->items[$this->pointer];
	}

	/**
	 * Checks if the internal pointer is within correct boundaries.
	 *
	 * @return boolean
	 */
	public function valid()
	{
		return $this->pointer < count($this->items);
	}

	/**
	 * Returns item count.
	 *
	 * @return integer
	 */
	public function count()
	{
		return count($this->items);
	}
}

redpajama_set_name: RedPajamaGithub


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

<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct duration_traits_long</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../date_time/doxy.html#header.boost.date_time.date_duration_hpp" title="Header <boost/date_time/date_duration.hpp>">
<link rel="prev" href="date_duration.html" title="Class template date_duration">
<link rel="next" href="duration_traits_adapted.html" title="Struct duration_traits_adapted">

Home
Libraries
People
FAQ
More

Struct duration_traits_long

boost::date_time::duration_traits_long

Synopsis

// In header: <boost/date_time/date_duration.hpp>

struct duration_traits_long {
  // types
  typedef long int_type;
  typedef long impl_type;

  // public static functions
  static int_type as_number(impl_type);
};

Description

Struct for instantiating date_duration with NO special values functionality. Allows for transparent implementation of either date_duration<long> or date_duration<int_adapter<long> >

duration_traits_long public static functions

static int_type as_number(impl_type i);

Copyright © 2001-2005 CrystalClear Software, Inc
Subject to the Boost Software License, Version 1.0. (See accompanying file
    LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
package gov.nih.nci.nbia.util;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;

public class TempFile {

	String filePath = "";

	public TempFile(String filePath)
	{
		this.filePath = filePath;
	}

	private void parseResult() throws Exception
	{
		BufferedReader br = null;
		PrintWriter pw = null;

		try{
			br = new BufferedReader(new FileReader(filePath + "BaselineOutput.txt"));
			String line = br.readLine();
			pw = new PrintWriter(new FileWriter(filePath+"BaselineCleanOutput.txt"));

			while(line != null){
				if (checkLine(line))
				{
					pw.println(line);
				}
				line = br.readLine();
			}
			System.out.println("Successful!");
		}catch(Exception e){
			e.printStackTrace();
			System.out.println("Failed!");
		}finally{
			br.close();
			pw.close();
		}
	}

	private boolean checkLine(String line)
	{
		if (line.indexOf("WARN") >= 0){
			return false;
		}

		return true;
	}

	public static void main(String[] args) {

		String currentResultFile = "C:\\CTP_data\\GroovyToCreateImage\\";

		TempFile tf = new TempFile(currentResultFile);
		try {
			tf.parseResult();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}


text:
<?php

declare(strict_types=1);

namespace Nyholm\Psr7;

/**
 * Trait implementing a locale-independent lowercasing logic.
 *
 * @author Nicolas Grekas <p@tchwork.com>
 *
 * @internal should not be used outside of Nyholm/Psr7 as it does not fall under our BC promise
 */
trait LowercaseTrait
{
    private static function lowercase(string $value): string
    {
        return \strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
    }
}


text:
INCLUDE(CMakeForceCompiler)

SET (CMAKE_CROSSCOMPILING   TRUE)
SET (CMAKE_SYSTEM_NAME      "Darwin")
SET (CMAKE_SYSTEM_PROCESSOR "armv6")

SET (SDKVER     "5.0")
SET (DEVROOT    "/Developer/Platforms/iPhoneOS.platform/Developer")
SET (SDKROOT    "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.sdk")
SET (CC         "${DEVROOT}/usr/bin/llvm-gcc")
SET (CXX        "${DEVROOT}/usr/bin/llvm-g++")

CMAKE_FORCE_C_COMPILER          (${CC} LLVM)
CMAKE_FORCE_CXX_COMPILER        (${CXX} LLVM)

SET (CMAKE_FIND_ROOT_PATH               "${SDKROOT}" "${DEVROOT}")
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM  NEVER)
SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY  ONLY)
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE  ONLY)


text:
"""
.. moduleauthor:: Krzysztof Wasiak (k.wasiak@gmail.com)
"""

from .transactionrecord import TransactionRecord
from .abstracttradelog import AbstractTradeLog
from .memorytradelog import MemoryTradeLog


text:
* http://www.zhihu.com/question/19831032
* http://learning.huawei.com/cn/
* http://support.huawei.com/learning/NavigationAction!createNavi#navi[id]=CERTIFICATE
* http://www.h3c.com.cn/Training/
*


text:
var message = require('./message');

module.exports.setup = function (app) {
	message(app);
}


text:
using namespace trading::data;

namespace trading {
namespace network {

	namespace {
		unsigned long read_value_track(const char* const buffer, size_t bytes, size_t* const bytes_read) {
			size_t offset = bytes_read ? *bytes_read : 0;
			unsigned long result = read_value(buffer + offset, bytes);
			if (bytes_read) {
				*bytes_read += bytes;
			}
			return result;
		}

		void write_value_track(char* const buffer, unsigned long value, size_t bytes, size_t* const bytes_written) {
			size_t offset = bytes_written ? *bytes_written : 0;
			write_value(buffer + offset, value, bytes);
			if (bytes_written) {
				*bytes_written += bytes;
			}
		}

	}

	unsigned long read_value(const char* const buffer, size_t bytes) {
		// assert(bytes <= sizeof(size_t));
		unsigned long result = 0;
		for (size_t i = 0 ; i < bytes ; ++i) {
			result |= static_cast<unsigned long>(buffer[i]) << i;
		}
		return result;
	}

	void write_value(char* const buffer, unsigned long value, size_t bytes) {
		// assert(bytes <= sizeof(size_t));
		for (size_t i = 0 ; i < bytes ; ++i) {
			buffer[i] = static_cast<char>(value & 0xFF);
			value >>= 8;
		}
	}

	void read_message_header(const char* const buffer, MessageHeader& header) {
		size_t bytes_read = 0;
		header.body_size = read_value_track(buffer, 4, &bytes_read);
		header.message_type = static_cast<MessageType>(read_value_track(buffer, 2, &bytes_read));
		header.header_version = read_value_track(buffer, 2, &bytes_read);
	}

	// caller is responsible for ensuring that buffer has sufficient space
	void write_message_header(char* const buffer, const MessageHeader& header) {
		size_t bytes_written = 0;
		write_value_track(buffer, header.body_size, 4, &bytes_written);
		write_value_track(buffer, header.message_type, 2, &bytes_written);
		write_value_track(buffer, header.header_version, 2, &bytes_written);
	}

}
}


text:
package com.ruigoncalo.marvin;

import android.content.Context;

import com.ruigoncalo.marvin.api.ApiManager;
import com.ruigoncalo.marvin.repository.CharactersStore;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by ruigoncalo on 23/04/16.
 */
@Module
public class ServicesModule {

    @Singleton
    @Provides
    ApiManager provideApiManager(Context context){
        return new ApiManager(context);
    }

    @Singleton
    @Provides
    public CharactersStore provideCharactersStore(ApiManager apiManager){
        return new CharactersStore(apiManager);
    }

}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Tennis Boooking</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="bower_components/html5-boilerplate/dist/css/normalize.css">
  <link rel="stylesheet" href="bower_components/html5-boilerplate/dist/css/main.css">
  <link rel="stylesheet" href="app.css">
  <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">


text:
This section describes how to delete a log group.

>![](/images/icon-note.gif) **NOTE:**
>Deleted log groups cannot be recovered. Therefore, exercise caution when performing this deletion operation.

## Prerequisites

-   You have obtained a username and password for logging in to the management console.
-   You have deleted the log transfer tasks associated with the target log group.

## Procedure

1.  Log in to the management console.
2.  In the upper left corner of the management console, select the target region and project.
3.  Click  **Service List**  and choose  **Management & Deployment**  \>  **Log Tank Service**.
4.  In the log group list, locate the target log group and click  **Delete**  in the  **Operation**  column.
5.  Click  **Yes**.

    **Figure  1**  Deleting a log group
    ![](figures/deleting-a-log-group.png "deleting-a-log-group")


text:
package com.haulmont.cuba.desktop.gui.components;

import com.haulmont.cuba.core.global.AppBeans;
import com.haulmont.cuba.desktop.App;
import com.haulmont.cuba.desktop.DesktopResources;
import com.haulmont.cuba.desktop.gui.icons.IconResolver;
import com.haulmont.cuba.desktop.sys.DesktopToolTipManager;
import com.haulmont.cuba.gui.ComponentsHelper;
import com.haulmont.cuba.gui.components.Action;
import com.haulmont.cuba.gui.components.Button;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.components.Frame;
import com.haulmont.cuba.gui.components.*;
import com.haulmont.cuba.gui.icons.Icons;
import org.apache.commons.lang3.StringUtils;

import javax.annotation.Nullable;
import javax.swing.*;
import javax.swing.BoxLayout;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;

import static java.awt.Component.CENTER_ALIGNMENT;

public class DesktopPopupButton extends DesktopAbstractActionsHolderComponent<JButton> implements PopupButton {

    public static final String DROP_DOWN_ICON = "/components/popupbutton/open-popup.png";

    protected JPopupMenu popup;

    protected String icon;

    protected DesktopResources resources = App.getInstance().getResources();

    protected List<Action> initializedActions = new ArrayList<>();
    protected final JLabel captionLabel;
    protected final JLabel rightIcon;

    protected boolean togglePopupVisibilityOnClick = true; // just stub
    protected PopupOpenDirection popupOpenDirection = PopupOpenDirection.BOTTOM_RIGHT; // just stub
    protected boolean closePopupOnOutsideClick = true; // just stub
    protected Component popupContent; // just stub

    protected List<PopupVisibilityListener> popupVisibilityListeners = new ArrayList<>();

    public DesktopPopupButton() {
        popup = new JPopupMenu();

        impl = new JButton();
        impl.setLayout(new BoxLayout(impl, BoxLayout.X_AXIS));

        captionLabel = new JLabel();
        impl.add(Box.createHorizontalGlue());
        impl.add(captionLabel);
        captionLabel.setAlignmentX(CENTER_ALIGNMENT);

        rightIcon = new JLabel();
        rightIcon.setIcon(resources.getIcon(DROP_DOWN_ICON));
        rightIcon.setAlignmentX(CENTER_ALIGNMENT);
        impl.add(rightIcon);
        impl.add(Box.createHorizontalGlue());

        impl.addActionListener(
                new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        if (popup.isVisible())
                            popup.setVisible(false);
                        else
                            showPopup();
                    }
                }
        );
        DesktopComponentsHelper.adjustSize(impl);
    }

    protected void showPopup() {
        firePopupVisibilityEvent();
        popup.removeAll();

        for (final Action action : actionList) {
            if (action.isVisible()) {
                final JMenuItem menuItem = new JMenuItem(action.getCaption());
                menuItem.addActionListener(
                        new ActionListener() {
                            @Override
                            public void actionPerformed(ActionEvent e) {
                                action.actionPerform((Component) action.getOwner());
                            }
                        }
                );
                menuItem.setEnabled(action.isEnabled());
                menuItem.setName(action.getId());

                initAction(action, menuItem);

                popup.add(menuItem);
            }
        }

        int popupHeight = popup.getComponentCount() * 25;

        Point pt = new Point();
        SwingUtilities.convertPointToScreen(pt, impl);

        int y;
        if (pt.getY() + impl.getHeight() + popupHeight < Toolkit.getDefaultToolkit().getScreenSize().getHeight()) {
            y = impl.getHeight();
        } else {
            y = -popupHeight;
        }

        // do not show ugly empty popup
        if (popup.getComponentCount() > 0) {
            popup.show(impl, 0, y);
        }
    }

    @Override
    protected void updateEnabled() {
        boolean resolvedEnabled = isEnabledWithParent();

        getComposition().setEnabled(resolvedEnabled);
        captionLabel.setEnabled(resolvedEnabled);
        rightIcon.setEnabled(resolvedEnabled);

        requestContainerUpdate();

        if (parent instanceof DesktopFieldGroup) {
            ((DesktopFieldGroup) parent).updateChildEnabled(this);
        }
    }

    protected void initAction(final Action action, final JMenuItem menuItem) {
        if (initializedActions.contains(action))
            return;

        action.addPropertyChangeListener(
                new PropertyChangeListener() {
                    @Override
                    public void propertyChange(PropertyChangeEvent evt) {
                        if (Action.PROP_CAPTION.equals(evt.getPropertyName())) {
                            menuItem.setText(action.getCaption());
                        } else if (Action.PROP_ENABLED.equals(evt.getPropertyName())) {
                            menuItem.setEnabled(action.isEnabled());
                        } else if (Action.PROP_VISIBLE.equals(evt.getPropertyName())) {
                            menuItem.setVisible(action.isVisible());
                        }
                    }
                }
        );

        initializedActions.add(action);
    }

    @Override
    public boolean isPopupVisible() {
        return popup.isVisible();
    }

    @Override
    public void setPopupVisible(boolean popupVisible) {
        if (popupVisible && !popup.isVisible()) {
            showPopup();
        } else if (popup.isVisible()) {
            popup.setVisible(false);
        }
    }

    @Override
    public void setMenuWidth(String width) {
        // unsupported
    }

    @Override
    public float getMenuWidth() {
        return 0; // unsupported
    }

    @Override
    public int getMenuWidthUnits() {
        return ComponentsHelper.convertFromSizeUnit(getMenuWidthSizeUnit());
    }

    @Override
    public SizeUnit getMenuWidthSizeUnit() {
        return SizeUnit.PIXELS; // unsupported
    }

    @Override
    public boolean isAutoClose() {
        return true;
    }

    @Override
    public void setAutoClose(boolean autoClose) {
    }

    @Override
    public void setShowActionIcons(boolean showActionIcons) {
        // do nothing
    }

    @Override
    public boolean isShowActionIcons() {
        return false;
    }

    @Override
    public boolean isTogglePopupVisibilityOnClick() {
        return togglePopupVisibilityOnClick;
    }

    @Override
    public void setTogglePopupVisibilityOnClick(boolean togglePopupVisibilityOnClick) {
        this.togglePopupVisibilityOnClick = togglePopupVisibilityOnClick;
    }

    @Override
    public PopupOpenDirection getPopupOpenDirection() {
        return popupOpenDirection;
    }

    @Override
    public void setPopupOpenDirection(PopupOpenDirection popupOpenDirection) {
        this.popupOpenDirection = popupOpenDirection;
    }

    @Override
    public boolean isClosePopupOnOutsideClick() {
        return closePopupOnOutsideClick;
    }

    @Override
    public void setClosePopupOnOutsideClick(boolean closePopupOnOutsideClick) {
        this.closePopupOnOutsideClick = closePopupOnOutsideClick;
    }

    @Override
    public void setPopupContent(Component popupContent) {
        this.popupContent = popupContent;
    }

    @Override
    public Component getPopupContent() {
        return popupContent;
    }

    @Override
    public void addPopupVisibilityListener(PopupVisibilityListener listener) {
        if (!popupVisibilityListeners.contains(listener)) {
            popupVisibilityListeners.add(listener);
        }
    }

    @Override
    public void removePopupVisibilityListener(PopupVisibilityListener listener) {
        popupVisibilityListeners.remove(listener);
    }

    protected void firePopupVisibilityEvent() {
        PopupVisibilityEvent event = new PopupVisibilityEvent(this);
        for (PopupVisibilityListener listener : popupVisibilityListeners) {
            listener.popupVisibilityChange(event);
        }
    }

    @Override
    public String getCaption() {
        return impl.getText();
    }

    @Override
    public void setCaption(String caption) {
        captionLabel.setText(caption);

        if (StringUtils.isNotEmpty(caption) || icon != null) {
            rightIcon.setBorder(new EmptyBorder(0, 5, 0, 0));
        } else {
            rightIcon.setBorder(null);
        }
    }

    @Override
    public String getDescription() {
        return getImpl().getToolTipText();
    }

    @Override
    public void setDescription(String description) {
        getImpl().setToolTipText(description);
        DesktopToolTipManager.getInstance().registerTooltip(impl);
    }

    @Override
    public String getIcon() {
        return icon;
    }

    @Override
    public void setIcon(String icon) {
        this.icon = icon;

        IconResolver iconResolver = AppBeans.get(IconResolver.class);
        if (icon != null) {
            captionLabel.setIcon(iconResolver.getIconResource(icon));
        } else {
            captionLabel.setIcon(iconResolver.getIconResource(DROP_DOWN_ICON));
        }

        if (StringUtils.isNotEmpty(getCaption()) || icon != null) {
            rightIcon.setBorder(new EmptyBorder(0, 5, 0, 0));
        } else {
            rightIcon.setBorder(null);
        }
    }

    @Override
    public void setIconFromSet(Icons.Icon icon) {
        String iconPath = AppBeans.get(Icons.class)
                .get(icon);
        setIcon(iconPath);
    }

    @Override
    public boolean isFocusable() {
        return impl.isFocusable();
    }

    @Override
    public void setFocusable(boolean focusable) {
        impl.setFocusable(focusable);
    }

    @Override
    public void addAction(Action action, int index) {
        super.addAction(action, index);
        action.addOwner(new ButtonStub(action));
    }

    /**
     * This class is only needed to serve as a pseudo-owner for actions.
     */
    protected class ButtonStub implements Button {

        protected Action action;
        protected boolean responsive = false;

        public ButtonStub(Action action) {
            this.action = action;
        }

        @Override
        public Action getAction() {
            return action;
        }

        @Override
        public void setAction(Action action) {
        }

        @Override
        public Frame getFrame() {
            return DesktopPopupButton.this.getFrame();
        }

        @Override
        public void setFrame(Frame frame) {
        }

        @Override
        public String getId() {
            return "__" + action.getId() + "_button";
        }

        @Override
        public void setId(String id) {
        }

        @Override
        public boolean isResponsive() {
            return responsive;
        }

        @Override
        public void setResponsive(boolean responsive) {
            this.responsive = responsive;
        }

        @Override
        public Component getParent() {
            return null;
        }

        @Override
        public void setParent(Component parent) {
        }

        @Override
        public String getDebugId() {
            return getId();
        }

        @Override
        public void setDebugId(String id) {
        }

        @Override
        public boolean isEnabled() {
            return action.isEnabled();
        }

        @Override
        public void setEnabled(boolean enabled) {
        }

        @Override
        public boolean isVisible() {
            return DesktopPopupButton.this.isVisible();
        }

        @Override
        public void setVisible(boolean visible) {
        }

        @Override
        public boolean isVisibleRecursive() {
            return DesktopPopupButton.this.isVisibleRecursive();
        }

        @Override
        public boolean isEnabledRecursive() {
            return DesktopPopupButton.this.isEnabledRecursive();
        }

        @Override
        public void focus() {
        }

        @Override
        public float getHeight() {
            return 0;
        }

        @Override
        public int getHeightUnits() {
            return 0;
        }

        @Override
        public SizeUnit getHeightSizeUnit() {
            return SizeUnit.PIXELS;
        }

        @Override
        public void setHeight(String height) {
        }

        @Override
        public float getWidth() {
            return 0;
        }

        @Override
        public int getWidthUnits() {
            return 0;
        }

        @Override
        public SizeUnit getWidthSizeUnit() {
            return SizeUnit.PIXELS;
        }

        @Override
        public void setWidth(String width) {
        }

        @Override
        public Alignment getAlignment() {
            return DesktopPopupButton.this.getAlignment();
        }

        @Override
        public void setAlignment(Alignment alignment) {
        }

        @Override
        public String getStyleName() {
            return DesktopPopupButton.this.getStyleName();
        }

        @Override
        public void setStyleName(String styleName) {
            DesktopPopupButton.this.setStyleName(styleName);
        }

        @Override
        public void addStyleName(String styleName) {
            DesktopPopupButton.this.addStyleName(styleName);
        }

        @Override
        public void removeStyleName(String styleName) {
            DesktopPopupButton.this.removeStyleName(styleName);
        }

        @Override
        public <X> X unwrap(Class<X> internalComponentClass) {
            return null;
        }

        @Nullable
        @Override
        public <X> X unwrapOrNull(Class<X> internalComponentClass) {
            return null;
        }

        @Override
        public <X> void withUnwrapped(Class<X> internalComponentClass, Consumer<X> action) {
        }

        @Override
        public <X> X unwrapComposition(Class<X> internalCompositionClass) {
            return null;
        }

        @Nullable
        @Override
        public <X> X unwrapCompositionOrNull(Class<X> internalCompositionClass) {
            return null;
        }

        @Override
        public <X> void withUnwrappedComposition(Class<X> internalCompositionClass, Consumer<X> action) {
        }

        @Override
        public String getCaption() {
            return action.getCaption();
        }

        @Override
        public void setCaption(String caption) {
        }

        @Override
        public String getDescription() {
            return DesktopPopupButton.this.getDescription();
        }

        @Override
        public void setDescription(String description) {
        }

        @Override
        public String getIcon() {
            return action.getIcon();
        }

        @Override
        public void setIcon(String icon) {
        }

        // just stub
        @Override
        public void setIconFromSet(Icons.Icon icon) {
        }

        @Override
        public boolean isFocusable() {
            return DesktopPopupButton.this.isFocusable();
        }

        @Override
        public void setFocusable(boolean focusable) {
        }

        @Override
        public int getTabIndex() {
            return 0;
        }

        @Override
        public void setTabIndex(int tabIndex) {
        }

        @Override
        public void setDisableOnClick(boolean value) {
        }

        @Override
        public boolean isDisableOnClick() {
            return false;
        }

        @Override
        public boolean isUseResponsePending() {
            return false;
        }

        @Override
        public void setUseResponsePending(boolean useResponsePending) {
        }

        @Override
        public void setCaptionAsHtml(boolean captionAsHtml) {
        }

        @Override
        public boolean isCaptionAsHtml() {
            return false;
        }
    }
}


text:
#include "gb-include.h"

#include "Revdb.h"
#include "Threads.h"

Revdb g_revdb;
Revdb g_revdb2;

// reset rdb
void Revdb::reset() { m_rdb.reset(); }

// init our rdb
bool Revdb::init ( ) {

	long long maxTreeMem = 200000000;
	// . what's max # of tree nodes?
	// . assume avg RevRec size (compressed html doc) is about 1k we get:
	// . NOTE: overhead is about 32 bytes per node
	long maxTreeNodes  = maxTreeMem  / (1*1024);

	// each entry in the cache is usually just a single record, no lists
	long maxCacheNodes = 0;//g_conf.m_revdbMaxCacheMem / (10*1024);

	// initialize our own internal rdb
	if ( ! m_rdb.init ( g_hostdb.m_dir              ,
			    "revdb"                   ,
			    true                        , // dedup same keys?
			    -1                          , // fixed record size
			    // this should not really be changed...
			    2                         , // min files to merge
			    maxTreeMem,//g_conf.m_revdbMaxTreeMem  ,
			    maxTreeNodes                ,
			    // now we balance so Sync.cpp can ordered huge list
			    true                        , // balance tree?
			    0                           , // cache mem
			    maxCacheNodes               ,
			    false                       ,// half keys?
			    false                       ,// g_conf.m_revdbSav
			    NULL                        , // page cache ptr
			    false                       ) )// is titledb?
		return false;
	return true;
}

// init the rebuild/secondary rdb, used by PageRepair.cpp
bool Revdb::init2 ( long treeMem ) {
	// . what's max # of tree nodes?
	// . assume avg RevRec size (compressed html doc) is about 1k we get:
	// . NOTE: overhead is about 32 bytes per node
	long maxTreeNodes  = treeMem / (1*1024);
	// initialize our own internal rdb
	if ( ! m_rdb.init ( g_hostdb.m_dir              ,
			    "revdbRebuild"            ,
			    true                        , // dedup same keys?
			    -1                          , // fixed record size
			    240                         , // MinFilesToMerge
			    treeMem                     ,
			    maxTreeNodes                ,
			    // now we balance so Sync.cpp can ordered huge list
			    true                        , // balance tree?
			    0                           , // MaxCacheMem ,
			    0                           , // maxCacheNodes
			    false                       , // half keys?
			    false                       , // revdbSaveCache
			    NULL                        , // page cache ptr
			    false                        ) )// is titledb?
		return false;
	return true;
}
/*
bool Revdb::addColl ( char *coll, bool doVerify ) {
	if ( ! m_rdb.addColl ( coll ) ) return false;
	if ( ! doVerify ) return true;
	// verify
	if ( verify(coll) ) return true;
	// if not allowing scale, return false
	if ( ! g_conf.m_allowScale ) return false;
	// otherwise let it go
	log ( "db: Verify failed, but scaling is allowed, passing." );
	return true;
}
*/
bool Revdb::verify ( char *coll ) {
	log ( LOG_INFO, "db: Verifying Revdb for coll %s...", coll );
	g_threads.disableThreads();

	Msg5 msg5;
	Msg5 msg5b;
	RdbList list;
	key_t startKey;
	key_t endKey;
	startKey.setMin();
	endKey.setMax();
	//long minRecSizes = 64000;
	CollectionRec *cr = g_collectiondb.getRec(coll);

	if ( ! msg5.getList ( RDB_REVDB   ,
			      cr->m_collnum       ,
			      &list         ,
			      startKey      ,
			      endKey        ,
			      1024*1024     , // minRecSizes   ,
			      true          , // includeTree   ,
			      false         , // add to cache?
			      0             , // max cache age
			      0             , // startFileNum  ,
			      -1            , // numFiles      ,
			      NULL          , // state
			      NULL          , // callback
			      0             , // niceness
			      false         , // err correction?
			      NULL          , // cache key ptr
			      0             , // retry num
			      -1            , // maxRetries
			      true          , // compensate for merge
			      -1LL          , // sync point
			      &msg5b        ,
			      false         )) {
		g_threads.enableThreads();
		return log("db: HEY! it did not block");
	}

	long count = 0;
	long got   = 0;
	for ( list.resetListPtr() ; ! list.isExhausted() ;
	      list.skipCurrentRecord() ) {
		key_t k = list.getCurrentKey();
		count++;
		//unsigned long groupId = getGroupId ( RDB_REVDB , &k );
		//if ( groupId == g_hostdb.m_groupId ) got++;
		unsigned long shardNum = getShardNum( RDB_REVDB , &k );
		if ( shardNum == getMyShardNum() ) got++;
	}
	if ( got != count ) {
		log ("db: Out of first %li records in revdb, "
		     "only %li belong to our group.",count,got);
		// exit if NONE, we probably got the wrong data
		if ( count > 10 && got == 0 )
			log("db: Are you sure you have the right "
				   "data in the right directory? "
				   "Exiting.");
		log ( "db: Exiting due to Revdb inconsistency." );
		g_threads.enableThreads();
		return g_conf.m_bypassValidation;
	}

	log ( LOG_INFO, "db: Revdb passed verification successfully for %li"
			" recs.", count );
	// DONE
	g_threads.enableThreads();
	return true;
}

// . make the key of a RevRec from a docId
// . remember to set the low bit so it's not a delete
// . hi bits are set in the key
key_t Revdb::makeKey ( long long docId, bool isDel ){
	key_t key ;
	key.n1 = 0;
	// shift up for delbit
	key.n0 = ((unsigned long long)docId) << 1;
	// final del bit
	if ( ! isDel ) key.n0 |= 0x01;
	return key;
};

long long Revdb::getDocId ( key_t *k ) {
	return (k->n0 >> 1);
}


text:
<?php
namespace eMapper\SQL\Aggregate;

/**
 * The SQLMax class represents the MAX SQL aggregate function.
 * @author emaphp
 */
class SQLMax extends SQLFunction {
	public function getName() {
		return 'MAX';
	}

	public function getDefaultType() {
		return 'float';
	}
}


text:
package com.ztiany.view.draw.path;

import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PointF;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;

import com.ztiany.view.utils.UnitConverter;

public class BezierCircleTranslate extends View implements View.OnClickListener {

    private static final float C = 0.551915024494f;

    private PointF[] mControlPoints = new PointF[8];
    private PointF[] mExtremityPoints = new PointF[4];

    private Paint mPaint;
    private Path mPath;

    private AnimatorSet mAnimatorSet;

    private float mCenterX, mCenterY;
    private float mCircleRadius;
    private float mBezierDistance;

    private float mHeadAdd;
    private float mEndAdd;

    public BezierCircleTranslate(Context context) {
        this(context, null);
    }

    public BezierCircleTranslate(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public BezierCircleTranslate(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    private void init() {

        mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mPath = new Path();

        int length = mControlPoints.length;
        for (int i = 0; i < length; i++) {
            mControlPoints[i] = new PointF();
        }
        length = mExtremityPoints.length;
        for (int i = 0; i < length; i++) {
            mExtremityPoints[i] = new PointF();
        }
        setOnClickListener(this);
    }

    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        float min = Math.min(w, h) / 6F;
        mCircleRadius = min / 2;
        mCenterX = mCircleRadius;
        mCenterY = h / 2;
        mBezierDistance = mCircleRadius * C;
        setValues();
    }

    private void setValues() {

        mExtremityPoints[0].set(mCenterX + mEndAdd- mCircleRadius, mCenterY);
        mExtremityPoints[1].set(mCenterX, mCenterY - mCircleRadius );
        mExtremityPoints[2].set(mCenterX+ mHeadAdd + mCircleRadius, mCenterY);
        mExtremityPoints[3].set(mCenterX, mCenterY + mCircleRadius );

        mControlPoints[0].set(mCenterX - mCircleRadius+ mEndAdd, mCenterY - mBezierDistance);
        mControlPoints[1].set(mCenterX - mBezierDistance, mCenterY - mCircleRadius );
        mControlPoints[2].set(mCenterX + mBezierDistance, mCenterY - mCircleRadius );
        mControlPoints[3].set(mCenterX + mCircleRadius+ mHeadAdd, mCenterY - mBezierDistance );
        mControlPoints[4].set(mCenterX + mCircleRadius+ mHeadAdd, mCenterY + mBezierDistance );
        mControlPoints[5].set(mCenterX + mBezierDistance, mCenterY + mCircleRadius);
        mControlPoints[6].set(mCenterX - mBezierDistance, mCenterY + mCircleRadius);
        mControlPoints[7].set(mCenterX - mCircleRadius+ mEndAdd, mCenterY + mBezierDistance);
    }

    private void drawCircle() {
        mPath.reset();
        mPath.moveTo(mExtremityPoints[0].x, mExtremityPoints[0].y);
        int length = mExtremityPoints.length;
        int temp;
        for (int i = 0; i < length; i++) {
            temp = i + 1;
            if (temp == length) {
                temp = 0;
            }
            mPath.cubicTo(
                    mControlPoints[i * 2].x,
                    mControlPoints[i * 2].y,
                    mControlPoints[i * 2 + 1].x,
                    mControlPoints[i * 2 + 1].y,
                    mExtremityPoints[temp].x,
                    mExtremityPoints[temp].y);
        }
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        drawCircle();
        mPaint.setStyle(Paint.Style.FILL);
        mPaint.setStrokeWidth(UnitConverter.dpToPx(1));
        mPaint.setColor(Color.RED);
        canvas.drawPath(mPath, mPaint);

        mPaint.setStrokeWidth(UnitConverter.dpToPx(5));
        mPaint.setColor(Color.BLUE);
        for (PointF controlPoint : mControlPoints) {
            canvas.drawPoint(controlPoint.x, controlPoint.y, mPaint);
        }
        mPaint.setColor(Color.GREEN);
        for (PointF extremityPoint : mExtremityPoints) {
            canvas.drawPoint(extremityPoint.x, extremityPoint.y, mPaint);
        }
    }

    @Override
    public void onClick(View v) {
        mCenterX = mCircleRadius;
        if (mAnimatorSet == null) {
            ValueAnimator valueAnimator = ValueAnimator.ofFloat(mCenterX, getMeasuredWidth() - mCircleRadius).setDuration(2000);
            valueAnimator.setStartDelay(1000);
            valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
            valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public void onAnimationUpdate(ValueAnimator animation) {
                    mCenterX = (Float) animation.getAnimatedValue();
                }
            });

            ValueAnimator valueAnimator1 = ValueAnimator.ofFloat(0, mCircleRadius * 2, 0).setDuration(3000);
            valueAnimator1.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public void onAnimationUpdate(ValueAnimator animation) {
                    mHeadAdd = (Float) animation.getAnimatedValue();
                    setValues();
                    invalidate();
                }
            });
            ValueAnimator valueAnimator2 = ValueAnimator.ofFloat(0, -mCircleRadius * 2, 0).setDuration(1500);
            valueAnimator2.setStartDelay(1500);
            valueAnimator2.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public void onAnimationUpdate(ValueAnimator animation) {
                    mEndAdd = (Float) animation.getAnimatedValue();
                }
            });
            mAnimatorSet = new AnimatorSet();
            mAnimatorSet.play(valueAnimator1).with(valueAnimator).with(valueAnimator2);

        } else {
            mAnimatorSet.cancel();
        }
        mAnimatorSet.start();
    }

}


text:
package org.fest.swing.hierarchy;

import static org.fest.assertions.Assertions.assertThat;
import static org.fest.swing.test.builder.JButtons.button;

import java.awt.Component;

import org.junit.Test;

/**
 * Tests for {@link WindowFilter#implicitlyIgnore(Component)}.
 *
 * @author Alex Ruiz
 */
public class WindowFilter_implicitlyIgnore_Test extends WindowFilter_TestCase {
  @Test
  public void should_implicit_ignore() {
    Component c = button().createNew();
    filter.implicitlyIgnore(c);
    assertThat(allImplicityIgnored()).containsOnly(c);
  }
}


text:
<?php
namespace Icicle\Http\Message;

use Icicle\Http\Exception\{InvalidMethodException, InvalidValueException};
use Icicle\Http\Message\Cookie\{BasicCookie, Cookie};
use Icicle\Stream\ReadableStream;

class BasicRequest extends AbstractMessage implements Request
{
    /**
     * @var string
     */
    private $method;

    /**
     * @var \Icicle\Http\Message\Uri
     */
    private $uri;

    /**
     * @var bool
     */
    private $hostFromUri = false;

    /**
     * @var string
     */
    private $target;

    /**
     * @var \Icicle\Http\Message\Cookie\Cookie[]
     */
    private $cookies = [];

    /**
     * @param string $method
     * @param string|\Icicle\Http\Message\Uri $uri
     * @param \Icicle\Stream\ReadableStream|null $stream
     * @param string[][] $headers
     * @param string|\Icicle\Http\Message\Uri $target
     * @param string $protocol
     *
     * @throws \Icicle\Http\Exception\MessageException If one of the arguments is invalid.
     */
    public function __construct(
        string $method,
        $uri = '',
        array $headers = [],
        ReadableStream $stream = null,
        $target = null,
        string $protocol = '1.1'
    ) {
        parent::__construct($headers, $stream, $protocol);

        $this->method = $this->filterMethod($method);
        $this->uri = $uri instanceof Uri ? $uri : new BasicUri($uri);

        $this->target = $target instanceof Uri ? $target : $this->filterTarget($target);

        if (!$this->hasHeader('Host')) {
            $this->setHostFromUri();
        }

        if ($this->hasHeader('Cookie')) {
            $this->setCookiesFromHeaders();
        }
    }

    /**
     * {@inheritdoc}
     */
    public function getRequestTarget(): Uri
    {
        if (null !== $this->target) {
            return $this->target;
        }

        return $this->uri;
    }

    /**
     * {@inheritdoc}
     */
    public function getUri(): Uri
    {
        return $this->uri;
    }

    /**
     * {@inheritdoc}
     */
    public function getMethod(): string
    {
        return $this->method;
    }

    /**
     * {@inheritdoc}
     */
    public function withRequestTarget(string $target = null): Request
    {
        $new = clone $this;
        $new->target = $target instanceof Uri ? $target : $new->filterTarget($target);
        return $new;
    }

    /**
     * {@inheritdoc}
     */
    public function withMethod(string $method): Request
    {
        $new = clone $this;
        $new->method = $new->filterMethod($method);
        return $new;
    }

    /**
     * {@inheritdoc}
     */
    public function withHeader(string $name, $value): Message
    {
        $new = parent::withHeader($name, $value);

        $normalized = strtolower($name);

        if ('host' === $normalized) {
            $new->hostFromUri = false;
        } elseif ('cookie' === $normalized) {
            $new->setCookiesFromHeaders();
        }

        return $new;
    }
    /**
     * {@inheritdoc}
     */
    public function withAddedHeader(string $name, $value): Message
    {
        $normalized = strtolower($name);

        if ('host' === $normalized && $this->hostFromUri) {
            $new = parent::withoutHeader('Host');
            $new->setHeader($name, $value);
            $new->hostFromUri = false;
        } else {
            $new = parent::withAddedHeader($name, $value);

            if ('cookie' === $normalized) {
                $new->setCookiesFromHeaders();
            }
        }

        return $new;
    }
    /**
     * {@inheritdoc}
     */
    public function withoutHeader(string $name): Message
    {
        $new = parent::withoutHeader($name);

        $normalized = strtolower($name);

        if ('host' === $normalized) {
            $new->setHostFromUri();
        } elseif ('cookie' === $normalized) {
            $new->cookies = [];
        }

        return $new;
    }
    /**
     * {@inheritdoc}
     */
    public function withUri($uri): Request
    {
        if (!$uri instanceof Uri) {
            $uri = new BasicUri($uri);
        }

        $new = clone $this;
        $new->uri = $uri;

        if ($new->hostFromUri) {
            $new->setHostFromUri();
        }

        return $new;
    }

    /**
     * {@inheritdoc}
     */
    public function getCookies(): array
    {
        return $this->cookies;
    }

    /**
     * {@inheritdoc}
     */
    public function getCookie(string $name)
    {
        $name = (string) $name;
        return isset($this->cookies[$name]) ? $this->cookies[$name] : null;
    }

    /**
     * {@inheritdoc}
     */
    public function hasCookie(string $name): bool
    {
        return isset($this->cookies[(string) $name]);
    }

    /**
     * {@inheritdoc}
     */
    public function withCookie(string $name, $value): Request
    {
        $new = clone $this;
        $new->cookies[(string) $name] = new BasicCookie($name, $value);
        $new->setHeadersFromCookies();
        return $new;
    }

    /**
     * {@inheritdoc}
     */
    public function withoutCookie(string $name): Request
    {
        $new = clone $this;
        unset($new->cookies[(string) $name]);
        $new->setHeadersFromCookies();
        return $new;
    }

    /**
     * @param string $method
     *
     * @return string
     *
     * @throws \Icicle\Http\Exception\InvalidMethodException If the method is not valid.
     */
    protected function filterMethod(string $method): string
    {
        if (!is_string($method)) {
            throw new InvalidMethodException('Request method must be a string.');
        }

        return strtoupper($method);
    }

    /**
     * @param string|null $target
     *
     * @return \Icicle\Http\Message\Uri
     *
     * @throws \Icicle\Http\Exception\InvalidValueException If the target contains whitespace.
     */
    protected function filterTarget(string $target = null)
    {
        if (null === $target || '' === $target) {
            return null;
        }

        if ('/' === $target[0]) {
            return new BasicUri($target);
        }

        if (preg_match('/^https?:\/\//i', $target)) { // absolute-form
            return new BasicUri($target);
        }

        if (strrpos($target, ':', -1)) {
            return new BasicUri($target);
        }

        return new BasicUri('//' . $target);
    }

    /**
     * Sets the host based on the current URI.
     */
    private function setHostFromUri()
    {
        $this->hostFromUri = true;

        $host = $this->uri->getHost();

        if (!empty($host)) { // Do not set Host header if URI has no host.
            $port = $this->uri->getPort();
            if (null !== $port) {
                $host = sprintf('%s:%d', $host, $port);
            }

            parent::setHeader('Host', $host);
        }
    }

    /**
     * Sets cookies based on headers.
     *
     * @throws \Icicle\Http\Exception\InvalidValueException
     */
    private function setCookiesFromHeaders()
    {
        $this->cookies = [];

        $headers = $this->getHeaderAsArray('Cookie');

        foreach ($headers as $line) {
            foreach (explode(';', $line) as $pair) {
                $cookie = BasicCookie::fromHeader($pair);
                $this->cookies[$cookie->getName()] = $cookie;
            }
        }
    }

    /**
     * Sets headers based on cookie values.
     */
    private function setHeadersFromCookies()
    {
        $values = [];

        foreach ($this->cookies as $cookie) {
            $values[] = $cookie->toHeader();
        }

        if (!empty($values)) {
            $this->setHeader('Cookie', implode('; ', $values));
        }
    }
}


text:
package com.leansoft.luxun.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * If mx4j-tools is in the classpath call maybeLoad to load the HTTP interface of mx4j.
 *
 * The default port is 8082. To override that provide e.g. -Dmx4jport=8083 The default listen
 * address is 0.0.0.0. To override that provide -Dmx4jaddress=127.0.0.1 This feature must be
 * enabled with -Dmx4jenable=true
 *
 * <p>
 * see https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/utils/
 * Mx4jTool.java
 * </p>
 *
 */
public class Mx4jLoader {

    private static final Logger logger = LoggerFactory.getLogger(Mx4jLoader.class);

    private static Object httpAdaptor;

    private static Class<?> httpAdaptorClass;

    /**
     * Starts a JMX over http interface if and mx4j-tools.jar is in the classpath.
     *
     * @return true if successfully loaded.
     */
    public synchronized static boolean maybeLoad() {
        try {
            if (!Utils.getBoolean(System.getProperties(), "luxun_mx4jenable", false)) {
                return false;
            }
            if (httpAdaptor != null) {
                logger.warn("mx4j has started");
                return true;
            }
            logger.debug("Will try to load mx4j now, if it's in the classpath");
            //MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
            //ObjectName processorName = new ObjectName("Server:name=XSLTProcessor");

            httpAdaptorClass = Class.forName("mx4j.tools.adaptor.http.HttpAdaptor");
            httpAdaptor = httpAdaptorClass.newInstance();
            httpAdaptorClass.getMethod("setHost", String.class).invoke(httpAdaptor, getAddress());
            httpAdaptorClass.getMethod("setPort", Integer.TYPE).invoke(httpAdaptor, getPort());

            //ObjectName httpName = new ObjectName("system:name=http");
            //mbs.registerMBean(httpAdaptor, httpName);
            Utils.registerMBean(httpAdaptor, "system:name=http");

            Class<?> xsltProcessorClass = Class.forName("mx4j.tools.adaptor.http.XSLTProcessor");
            Object xsltProcessor = xsltProcessorClass.newInstance();
            httpAdaptorClass.getMethod("setProcessor", Class.forName("mx4j.tools.adaptor.http.ProcessorMBean")).invoke(
                    httpAdaptor, xsltProcessor);
            //mbs.registerMBean(xsltProcessor, processorName);
            Utils.registerMBean(xsltProcessor, "Server:name=XSLTProcessor");
            httpAdaptorClass.getMethod("start").invoke(httpAdaptor);
            logger.info("mx4j successfuly loaded");
            return true;
        } catch (ClassNotFoundException e) {
            logger.info("Will not load MX4J, mx4j-tools.jar is not in the classpath");
        } catch (Exception e) {
            logger.warn("Could not start register mbean in JMX", e);
        }
        return false;
    }

    public static synchronized void close() {
        if (httpAdaptor == null) {
            return;
        }
        try {
            httpAdaptorClass.getMethod("stop").invoke(httpAdaptor);
        } catch (Exception e) {
            logger.warn("close mx4j failed. " + e.getMessage());
        }
    }

    private static String getAddress() {
        return System.getProperty("mx4jaddress", "0.0.0.0");
    }

    private static int getPort() {
        return Utils.getInt(System.getProperties(), "mx4jport", 8082);
    }
}


text:
use strict;
use warnings;
use JSON::XS;
use Data::Dumper;
use LWP::UserAgent;

#use Net::SSL;
use URI::Escape;

use diagnostics;

####
#### Tk module use block
use Tk;
use Tk::LabFrame;
use Tk::NoteBook;
use Tk::BrowseEntry;
####

our $main = MainWindow->new;
$main->geometry("800x600");

$main->configure( -menu => my $menubar = $main->Menu );
my $file = $menubar->cascade( -label => '~File' );
my $edit = $menubar->cascade( -label => '~Edit' );
my $help = $menubar->cascade( -label => '~Help' );
$file->command(
                -label       => "Authorize",
                -underline   => 1,
                -command     => \&Auth,
);
$file->separator;
$file->command(
                -label       => "Quit",
                -accelerator => 'Ctrl-q',
                -underline   => 0,
                -command     => \&exit,
);

$edit->command( -label => 'Preferences ...' );

$help->command( -label => 'Version', -command => sub { print "Version\n" } );
$help->separator;
$help->command( -label => 'About', -command => sub { print "About\n" } );
our $URLmutable= "https://esi.tech.is/latest/";
our $URL = $main->Label()->grid(-row=>1, -column=>1, -columnspan=>10);
$URL->configure(-text=>"${URLmutable}");
my $endpoint = 'Search';

my $frame = $main->Frame;
my $endpointchoice = $frame->BrowseEntry(
                                          -label    => "Endpoint:",
                                          -variable => \$endpoint,
                                          ,
                                          -browsecmd => \&EndpointSelected
);
$endpointchoice->pack;
&BuildEndpoint;
my $buttonframe = $frame->Frame;
$buttonframe->Button(
    -text    => "Print value",
    -command => sub {
        print "The endpoint is $endpoint\n";
    },
    -relief => "raised"
)->pack;

$buttonframe->pack;
$frame->grid(-row=>2, -column=>1);
my $operation;
our $operationchoice;
my $frame2 = $main->Frame;
$operationchoice = $frame2->BrowseEntry(
    -label     => "Search Type:",
    -variable  => \$operation,
    -browsecmd => \&OperationPop

);

=begin comment
    -listcmd  => sub {
        if ( $endpoint eq 'Search' ) {
            $operationchoice->configure(
                                     -choices => [
                                                   'agent',     'alliance',
                                                   'character', 'constellation',
                                                   'corporation',   'faction',
                                                   'inventorytype', 'region',
                                                   'solarsystem',   'station',
                                                   'wormhole'
                                     ]
            );
        }
        else { 1 }
    }
=end comment
=cut

$operationchoice->pack;

my $buttonframe2 = $frame2->Frame;
$buttonframe2->Button(
    -text    => "Print value",
    -command => sub {
        print "The operation type is $operation\n";
    },
    -relief => "raised"
)->pack;

$buttonframe2->pack;
$frame2->grid(-row=>2, -column=>2);

MainLoop;
sub BuildEndpoint {
 $endpointchoice->configure(
                                     -choices => [
                                                   'alliances',
                                                   'characters', 'corporations',
                                                   'dogma',   'search',
                                                   'industry', 'insurance',
                                                   'markets',   'universe',
                                     ]
            );
			}

sub EndpointSelected {

    #access subroutine arguments via $_[index] to grab selection choice
    my $arg = $_[1];
    print "\n\n";
    print $arg;
	if ($arg eq 'alliances'){
		my $temp = $URL->cget(-text);

    }elsif ( $arg eq 'search' ) {
        my $temp = $URL->cget( -text );
        print "\n\nCurrent URL is $temp\n";

        #$temp=
        $URL->configure( -text => "${temp}${arg}/?categories=" );
        print "\n\nNew built URL is " . $URL->cget( -text );
        $operationchoice->configure(
                                     -choices => [
                                               'agent',         'alliance',
                                               'character',     'constellation',
                                               'corporation',   'faction',
                                               'inventorytype', 'region',
                                               'solarsystem',   'station',
                                               'wormhole'
                                     ]
        );
    }
    else { 1 }
}
#the following sub contains the lwp useragent building stuff, use when necessary
sub useragentstuff {

    # Create a user agent object
    our $hostname = "https://esi.tech.ccp.is/latest/";
    print "current iteration is _latest \n";
    print "please select an endpoint (test with search): \t";
    our $endpoint = <stdin>;
    chomp($endpoint);
    print "\nplease select a category if applicable (test with region): \t";
    our $categories = <stdin>;
    chomp($categories);
    print "\nplease select a region to search for:\t";
    our $search = <stdin>;
    chomp($search);
    print "\nsanitizing unsafe characters\n";
    our $urlsanity = uri_escape($search);

    our $URL =
"${hostname}${endpoint}/?categories=${categories}&datasource=tranquility&language=en-us&search=${urlsanity}&strict=false";
    print "\n\n$URL\n\n";

    #our $sanitizedURL = uri_escape($URL);
    #print "\n\n$sanitizedURL\n\n";
    our $json;

    my $ua = LWP::UserAgent->new;
    $ua->agent("MyApp/0.1 ");

    # Create a request
    my $req = HTTP::Request->new( GET => $URL );
    $req->content_type('application/json');

    # Pass request to the user agent and get a response back
    my $res = $ua->request($req);

    # Check the outcome of the response
    if ( $res->is_success ) {
        print $res->content;
        print "\nparsing response\n";
        $json = $res->decoded_content;
        print Dumper($json);
    }
    else {
        print $res->status_line, "\n";
    }

    our %test        = %{ decode_json($json) };
    our @anothertest = @{ $test{'region'} };

    print @anothertest;
    print $anothertest[0];

}

#  10000002 the forge

# 34 tritanium

sub Auth {

 #use Tk::DialogBox;

    $main::box = $main::main->DialogBox(-title => "Authorization", -buttons => ["OK", "Cancel"]);
    my $widget = $main::box->add('Label', -text=> "Click OK when Authorization is complete")->pack;

$main::coderef = undef;

{
 package MyWebServer;

 use HTTP::Server::Simple::CGI;
 use base qw(HTTP::Server::Simple::CGI);
  use Data::Dumper;
 my %dispatch = (
     '/hello' => \&resp_hello,
	 '/callback' => \&resp_code,
     # ...
 );

 sub handle_request {
     my $self = shift;
     my $cgi  = shift;

     our $path = $cgi->path_info();

     my $handler = $dispatch{$path};

     if (ref($handler) eq "CODE") {
         print "HTTP/1.0 200 OK\r\n";
         $handler->($cgi);
       #  print $cgi->param('code');
     } else {
         print "HTTP/1.0 404 Not found\r\n";
         print $cgi->header,
		 print $cgi->path_info();
               $cgi->start_html('Not found'),
               $cgi->h1('Not found'),
               $cgi->end_html;
     }
 }

 sub resp_hello {
     my $cgi  = shift;   # CGI.pm object
     return if !ref $cgi;

     my $who = $cgi->param('name');
     my $what = $cgi->param('code');
     print $cgi->header,
           $cgi->start_html("Hello"),
           $cgi->h1("Hello $who!"),
		   $cgi->h2("\nYour code is $what");
           $cgi->end_html;
 }

  sub resp_code {
     my $cgi  = shift;   # CGI.pm object
     return if !ref $cgi;

     my $what = $cgi->param('code');

     print $cgi->header,
           $cgi->start_html("Hello"),
           $cgi->h1("Code is $what"),
           $cgi->end_html;
$main::coderef = $what;
 $main::authcode = $main::main->Label()->grid(-row=>5, -column=>1, -columnspan=>10);
$main::authcode->configure(-textvariable=>\$main::coderef);
 }

 }

my $pid = MyWebServer->new(8080)->background();
print "User 'kill $pid' to stop server.\n";
use WWW::Shorten::TinyURL;

my $shorturl= makeashorterlink('https://login.eveonline.com/oauth/authorize?response_type=code&redirect_uri=http://localhost:8080/callback&client_id=a530913af26a4316a94c24a9a15d3bbc&state=12345');
my @command = ('start', $shorturl);
system(@command);

 my $button = $main::box->Show;

 }


text:
module xlib.reflection.enums {

  class Reflection implements IReflection {}

}


text:
console.log("Flint Sharing app run!!!");

String.prototype.replaceAll = function (AFindText,ARepText){
    raRegExp = new RegExp(AFindText,"g");
    return this.replace(raRegExp,ARepText);
}
String.prototype.trim = function(){
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

function hasClass(e, cls) {
    return e.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
};
function addClass(e, cls) {
    if(!hasClass(e, cls)){
        e.className = e.className.trim();
        e.className += " "+cls;
    }
    return this;
};
function removeClass(e, cls) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    e.className = e.className.replace(reg,' ');
    return this;
};

const appInfo = {
    appUrl: 'https://openflint.github.io/flint-sharing/receiver/screen_receiver.html',
    useIpc: true,
    maxInactive: -1
};

var devices = {},
    sharing = false,

    shareBtn = null,
    stopBtn = null,

    domNodevice = null,
    domDevices = null,
    domDeviceSelectors = null,
    domTempDevice = null,
    domState = null,
    domStateText = null,

    currDevice = null,
    wStream = null,
    senderManager = null;

var port = chrome.runtime.connect();

function bindSelectorEvent(){
    var dlist = document.querySelectorAll("#selector li");

    if(dlist.length==1){
        addClass(dlist[0], "active");
        currDevice = {
            "id": dlist[0].getAttribute("device_id"),
            "name": dlist[0].getAttribute("device_name")};
    }
    for(var i=0; i<dlist.length; i++){
        dlist[i].onclick = function(){
            var did = this.getAttribute("device_id");
            if(!hasClass(this, "active")){
                addClass(this, "active");
                currDevice = {
                    "id": this.getAttribute("device_id"),
                    "name": this.getAttribute("device_name")};
                for (var i = dlist.length - 1; i >= 0; i--) {
                    if(dlist[i]==this){
                        continue;
                    }else{
                        removeClass(dlist[i], "active");
                    }
                };
            }
        };
    }
}

port.onMessage.addListener(function (msg) {
    console.log('port: ', msg);
    if (msg.type == 'devicefound') {
        var device = msg.device;
        var uniqueId = device.uniqueId,
            temp = domTempDevice.innerHTML;

        console.log('find new device: ', device);
        addClass(domNodevice, "hide");
        removeClass(domDevices, "hide");

        domDeviceSelectors.innerHTML+= temp.replaceAll("##device_id##", device.uniqueId).
            replaceAll("##device_name##", device.deviceName).
            replaceAll("##device_ip##", device.host);

        bindSelectorEvent();
        devices[uniqueId] = device;

    } else if (msg.type == 'devicegone') {
        var device = msg.device;
        console.log('lost device: ', device.deviceName);
    } else if (msg.type == 'ready') {
        ready();
    }
});

function ready() {
    domDeviceSelectors = document.querySelector("#selector");
    domTempDevice = document.querySelector("#temp-device");
    domNodevice = document.querySelector("#nodevice");
    domDevices = document.querySelector("#devices");

    domState = document.querySelector("#state");
    domStateText = document.querySelector("#state-text");

    shareBtn = document.querySelector("#share");
    stopBtn = document.querySelector("#stop");

    shareBtn.onclick = function () {
        if(hasClass(this, "active")){
            return;
        }
        addClass(this, "active");
        if (sharing) {
            // todo
            console.info('@@@@@@@@@@@@alert: Already sharing!!!');
            removeClass(this, "active");
            return;
        }
        sharing = true;

        if (!currDevice) {
            console.info("@@@@@@@@@@@@alert: Please select a device");
            removeClass(this, "active");

        } else {
            console.log('select device: ', currDevice["id"], ', text = ', currDevice["name"]);

            domStateText.innerHTML = "屏幕投射中";
            removeClass(domState, "hide");

            getStream(function (error, stream) {
                wStream = stream;
                if (error != null) {
                    console.error('app get stream error: ', error);
                }
                port.postMessage({
                    type: 'stream',
                    stream: wStream
                });

                port.postMessage({
                    type: 'device',
                    device: devices[currDevice["id"]]
                });

                var options = {
                    appId: '~a3ad1b9e-6883-11e4-b116-123b93f75cba',
                    urlBase: devices[currDevice["id"]].urlBase,
                    host: devices[currDevice["id"]].host,
                    useHeartbeat: true
                };
                senderManager = new FlintSenderManager(options);

                senderManager.launch(appInfo, function (result, token) {
                    if (result) {
                        console.log('Application is launched ! OK!!! -> ' + token);

                        senderManager.callReceiverMediaPeer(wStream);
                        senderManager.on('appstate', function (_, state, additionaldata) {
                            if (state == 'stopped') {
                                sharing = false;
                                wStream.stop();
                                wStream = null;

                                removeClass(shareBtn, "hide");
                                addClass(stopBtn, "hide");
                                console.log('Receiver application is stopped!!!');
                            }
                        });

                        addClass(shareBtn, "hide");
                        removeClass(stopBtn, "hide");

                        wStream.onended = function() {
                            console.warn('media ended!!!');
                            sharing = false;
                            if (wStream != null) {
                                wStream.stop();
                                wStream = null;
                            }
                            if (senderManager != null) {
                                senderManager.stop(appInfo);
                                senderManager = null;
                            }
                            removeClass(shareBtn, "hide");
                            addClass(stopBtn, "hide");
                            addClass(domState, "hide");
                        };
                    } else {
                        console.log('Application is launched ! failed!!!');
                    }
                    removeClass(shareBtn, "active");

                    addClass(domState, "hide");
                });
                chrome.app.window.current().onClosed.addListener(function () {
                    sharing = false;
                    if (wStream != null) {
                        wStream.stop();
                        wStream = null;
                    }
                    if (senderManager != null) {
                        senderManager.stop(appInfo);
                        senderManager = null;
                    }
                });
            });
        }
    };

    stopBtn.onclick = function () {
        if (!sharing) {
            console.info('@@@@@@@@@@@@alert: Not sharing!!!');
            return;
        }
        sharing = false;
        if (wStream != null) {
            wStream.stop();
            wStream = null;
        }
        senderManager.stop(appInfo);
        senderManager = null;
        removeClass(shareBtn, "hide");
        addClass(stopBtn, "hide");
        addClass(domState, "hide");
    };
}


text:
import {Component, OnInit, Injectable} from 'angular2/core';
import {CORE_DIRECTIVES, FORM_DIRECTIVES, NgClass, NgStyle} from 'angular2/common';
import {FILE_UPLOAD_DIRECTIVES, FileUploader} from '../../../node_modules/ng2-file-upload/ng2-file-upload';

import {WorkService} from '../../services/work.service';
import {GroupService} from '../../services/group.service';
import {ManageErrorService} from '../../services/manage-error.service';
import {Work} from '../../models/work';
import {Group} from '../../models/group';

// const URL = '/api/';
const URL = '/api/works/test';

/**
 * Overri
 */
class FileUploaderImproved extends FileUploader {

	constructor(
		private _manageErrorService: ManageErrorService, private pictures: String[], public options: any) {
		super(options);
		this.queueLimit = 100;
	}

	onCompleteItem(item: any, response: any, status: any, headers: any) {
		let resJson = JSON.parse(response);
		if (resJson.error) {
			this._manageErrorService.addMessage(<any>resJson.error);
		}
		else {
			if(resJson.file){
				resJson.file.forEach(e => this.pictures.push(e.filename));
			}
		}
	}
}

@Component({
    templateUrl: '/app/admin/addwork/addwork.html',
    styleUrls: ['app/admin/addwork/addwork.css'],
	directives: [FILE_UPLOAD_DIRECTIVES, NgClass, NgStyle, CORE_DIRECTIVES, FORM_DIRECTIVES]
})
export class AddWorkComponent implements OnInit{

    constructor(
		private _workService: WorkService,
		private _groupService: GroupService,
		private _manageErrorService: ManageErrorService) { }

    work : Work;
	errorMessage : string;

	title: string;
	description: string;
	types: [string];
	pictures: String[];
	minpic : string;

	groups: Group[];

	private uploader: FileUploaderImproved;
	private hasBaseDropZoneOver: boolean = false;
	private hasAnotherDropZoneOver: boolean = false;

	test(){
		console.log(this.uploader);
		this.pictures.forEach(e => console.log(e));
	}
	ngOnInit() {
		this.pictures = [];
		this.uploader = new FileUploaderImproved(this._manageErrorService, this.pictures, { url: URL, queueLimit: 999 });
		this._groupService.getGroups().subscribe(
			groups => this.groups = groups,
			error => this._manageErrorService.addMessage(<any>error));
	}

	private fileOverBase(e: any) {
		this.hasBaseDropZoneOver = e;
	}

	private fileOverAnother(e: any) {
		this.hasAnotherDropZoneOver = e;
	}
	addWork (title: string, description: string, types: [string], groups: [string], pictures: [string], minpic: string) {
	  if (!title) {return;}
	  this._workService.addWork(title, description, types, groups, pictures, minpic)
	                   .subscribe(
	                     work  => this.work = work,
	                     error =>  this.errorMessage = <any>error);
	}
}


text:
require 'github_scrumboard'
describe GithubScrumboard::UserStory do
  let (:body) {
'''
As somebody
I want...

= Acceptance Criteria:
* at least something should be possible
'''
}

  context ".new(issue)" do
    context "extracts details, that are marked by a sign" do
      before(:each) do
        GithubScrumboard::UserStory.any_instance.stub(:extract).and_return(1)
        GithubScrumboard::Settings.issues.prefix.stub(:details).and_return('=')
      end

      context "from the comment section of an issue" do
          let (:issue) {{'title' => "A Neat Title", 'body' => "As a user\nI want...", 'number' => 1}}
          subject {GithubScrumboard::UserStory.new(issue)}

          it "but only the text that is marked up" do
            skip do
              subject.details.should =~ /Details:.* this is a hint/
            end
          end

          it "multiple detail descriptions are tied together" do
            skip do
              subject.details.should =~ /Details:.* this is a hint.*this is an implementation detail/
            end
          end

      end

      context "from the body of an issue" do
        let (:issue) {{ 'title' => 'A Neat Title', 'body' => body, 'number' => 2}}
        subject {GithubScrumboard::UserStory.new(issue)}

        it "e.g. acceptance criteria" do
          subject.text.should =~ /As somebody/
          subject.details.should =~ /Acceptance Criteria:.*at least something should be possible/m
        end

        it "that won't go into the main text of a user story" do
          subject.text.should =~ /As somebody/
          subject.text.should_not =~ /Acceptance Criteria:.*at least something should be possible/m
        end

        it 'and won\'t crash, if there is no details section at all' do
          issue['body']= "Something, that is not a details section\n\nDefinitely not"
          story = GithubScrumboard::UserStory.new(issue)
          story.details.should be_empty
          story.text.should eq issue['body']
        end

        context "the ending is" do
          it "an empty line" do
            issue['body'] << "\n \nfoobar"
            story = GithubScrumboard::UserStory.new(issue)
            story.details.should include("Acceptance Criteria:")
            story.details.should include("something")
            story.details.should_not include("foobar")
            story.text.should include("foobar")
          end

          it "the end of the text" do
            issue['body'] << "foobar"
            story = GithubScrumboard::UserStory.new(issue)
            story.details.should include("foobar")
            story.text.should_not include("foobar")
          end
        end
        context "if the state of the issue is closed" do
          it "then the state of the corresponding user story is done" do
            issue['state'] = "closed"
            story = GithubScrumboard::UserStory.new(issue)
            expect(story.state).to be :done
          end
        end

      end

    end

  end
end


text:
module Azure::DataFactory::Mgmt::V2018_06_01
  module Models
    #
    # Defines values for TriggerRuntimeState
    #
    module TriggerRuntimeState
      Started = "Started"
      Stopped = "Stopped"
      Disabled = "Disabled"
    end
  end
end