text:
(function() {
  'use strict';

  var assert = require('assert'),
      _ = require('lodash'),
      sep = require('path').sep,

      Path = require('../../../lib/pimm/support/path');

  describe('Path', function() {
    var p;

    beforeEach(function() {
      p = new Path();
    });

    describe('#extension', function() {
      it('should return the extension of the file', function() {
        p.value = './test.js';
        assert.equal(p.extension(), '.js');
      });
    });

    describe('#withoutExtension', function() {
      it('should return the path of the file without the extension', function() {
        p.value = './test.js';
        assert.equal(p.withoutExtension(), './test');
      });
    });

    describe('#hasExtension', function() {
      it('should return true if the extension matches', function() {
        p.value = './test.js';
        assert(p.hasExtension('js'));
      });

      it('should return false if the extension does not match', function() {
        p.value = './test.js';
        assert(!p.hasExtension('html'));
      });
    });

    describe('#withoutPrefix', function() {
      it('should return the path without the prefix', function() {
        p.value = sep+'.'+sep+'1some'+sep+'path';
        assert.equal(p.withoutPrefix(), '1some'+sep+'path');
      });
    });
  });
}());


text:
jQuery( document ).ready( function () {

	jQuery( '#itsec_ssl_admin, #itsec_ssl_login' ).change( function () {

		if ( this.checked ) {

			var ssl_confirm = confirm( ssl_warning_text.text );

			if ( ssl_confirm == false ) {

				jQuery( '#itsec_ssl_login, #itsec_ssl_admin' ).attr( 'checked', false );

			}

		}

	} );

} );

redpajama_set_name: RedPajamaGithub


text:
import io
import tempfile
import json
from urlparse import urlparse
import copy
import tarfile
import shutil
import logging
import os.path
import yaml

from appr.discovery import ishosted, split_package_name

import kpm.registry as registry
import kpm.packager as packager
from kpm.utils import mkdir_p
from kpm.utils import convert_utf8
from kpm.manifest_jsonnet import ManifestJsonnet

logger = logging.getLogger(__name__)

class KubBase(object):
    media_type = "kpm-base"
    target = "platform"

    def __init__(self, name, version=None, variables=None, shards=None, namespace=None,
                 endpoint=None, resources=None):

        if shards.__class__ in [str, unicode]:
            shards = json.loads(shards)

        if variables is None:
            variables = {}

        if version is None:
            {"key": "version", "values": 'default'}

        self.endpoint = endpoint
        self._registry = registry.Registry(endpoint=self.endpoint)
        self._dependencies = None
        self._resources = None
        self._deploy_name = name
        self._deploy_version = version
        self._deploy_shards = shards
        self._deploy_resources = resources
        self._package = None
        self._manifest = None
        self.namespace = namespace
        if self.namespace:
            variables["namespace"] = self.namespace

        self._deploy_vars = variables
        self._variables = None

        self.tla_codes = {"variables": self._deploy_vars}
        if shards is not None:
            self.tla_codes["shards"] = shards

    @property
    def package(self):
        if self._package is None:
            result = self._fetch_package()
            self._package = packager.Package(result, b64_encoded=True)
        return self._package

    @property
    def manifest(self):
        if self._manifest is None:
            self._manifest = ManifestJsonnet(self.package, {"params": json.dumps(self.tla_codes)})
        return self._manifest

    def __unicode__(self):
        return ("(<{class_name}({name}=={version})>".format(class_name=self.__class__.__name__,
                                                            name=self.name, version=self.version))

    def __str__(self):
        return unicode(self).encode('utf-8')

    def __repr__(self):
        return unicode(self).encode('utf-8')

    @property
    def author(self):
        return self.manifest.package['author']

    @property
    def version(self):
        return self.manifest.package['version']

    @property
    def description(self):
        return self.manifest.package['description']

    @property
    def name(self):
        return self.manifest.package['name']

    @property
    def variables(self):
        if self._variables is None:
            self._variables = copy.deepcopy(self.manifest.variables)
            self._variables.update(self._deploy_vars)
        return self._variables

    def _fetch_package(self):
        parse = urlparse(self._deploy_name)
        if parse.scheme in ["http", "https"]:
            # @TODO
            pass
        elif parse.scheme == "file":
            parts = parse.path.split("/")
            _, ext = os.path.splitext(parts[-1])
            if ext == ".gz":
                filepath = parse.path
            else:
                filepath = tempfile.NamedTemporaryFile().name
                packager.pack_kub(filepath)
            with open(filepath, "rb") as f:
                return f.read()
        else:
            return self._registry.pull_json(self._deploy_name, self._deploy_version,
                                            self.media_type)['blob']

    @property
    def kubClass(self):
        raise NotImplementedError

    def _fetch_deps(self):
        self._dependencies = []
        for dep in self.manifest.deploy:
            if dep['name'] != '$self':
                # if the parent app has discovery but not child,
                # use the same domain to the child
                if ishosted(self._deploy_name) and not ishosted(dep['name']):
                    dep['name'] = "%s/%s" % (split_package_name(self._deploy_name)[0], dep['name'])
                variables = dep.get('variables', {})
                variables['kpmparent'] = {
                    'name': self.name,
                    'shards': self.shards,
                    'variables': self.variables
                }

                kub = self.kubClass(dep['name'], endpoint=self.endpoint, version={
                    "key": "version",
                    "value": dep.get('version', 'default')
                }, variables=variables, resources=dep.get('resources', None), shards=dep.get(
                    'shards', None), namespace=self.namespace)
                self._dependencies.append(kub)
            else:
                self._dependencies.append(self)
        if not self._dependencies:
            self._dependencies.append(self)

    @property
    def dependencies(self):
        if self._dependencies is None:
            self._fetch_deps()
        return self._dependencies

    def resources(self):
        if self._resources is None:
            self._resources = self.manifest.resources
        return self._resources

    @property
    def shards(self):
        shards = self.manifest.shards
        if self._deploy_shards is not None and len(self._deploy_shards):
            shards = self._deploy_shards
        return shards

    def make_tarfile(self, source_dir):
        output = io.BytesIO()
        with tarfile.open(fileobj=output, mode="w:gz") as tar:
            tar.add(source_dir, arcname=os.path.basename(source_dir))
        return output

    def build_tar(self, dest="/tmp"):
        package_json = self.build()

        tempdir = tempfile.mkdtemp()
        dest = os.path.join(tempdir, self.manifest.package_name())
        mkdir_p(dest)
        index = 0
        for kub in self.dependencies:
            index = kub.prepare_resources(dest, index)

        with open(os.path.join(dest, ".package.json"), mode="w") as f:
            f.write(json.dumps(package_json))

        tar = self.make_tarfile(dest)
        tar.flush()
        tar.seek(0)
        shutil.rmtree(tempdir)
        return tar.read()

    def prepare_resources(self, dest="/tmp", index=0):
        for resource in self.resources():
            index += 1
            path = os.path.join(dest, "%02d_%s_%s" % (index, self.version, resource['file']))
            f = open(path, 'w')
            f.write(yaml.safe_dump(convert_utf8(resource['value'])))
            resource['filepath'] = f.name
            f.close()
        return index

    def build(self):
        raise NotImplementedError

    def convert_to(self):
        raise NotImplementedError

    def deploy(self):
        raise NotImplementedError

    def delete(self):
        raise NotImplementedError

    def status(self):
        raise NotImplementedError


text:
![Brewdex UI Pipeline](https://docs.google.com/drawings/d/e/2PACX-1vTfd8ZboIl1zJ5uGeJUukyFRi_0BgNVgbcqtwcxxevPgzss6fUNfc8PkENwt5CazvqbZDn3l4XEYoPw/pub?w=960&h=720)

Brewdex relies on a machine learning pipeline to support the application. This
pipeline has the following main stages:

1. Authorize w/ 3rd parties
2. Kick of learning pipeline

### Authorize w/ 3rd parties

[brewdex-ui](https://github.com/acbodine/brewdex-ui)

TODO

### Kick of learning pipeline

TODO


text:
<?php

namespace Kalley\LaravelOauthClient\Console;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;

class MigrationCommand extends Command {
  /**
   * The console command name.
   *
   * @var string
   */
  protected $name = 'oauth-client:migrations';

  /**
   * The console command description.
   *
   * @var string
   */
  protected $description = 'Create the migrations needed for OAuth Client';

  public $app;

  /**
   * Create a new command instance.
   *
   * @param \Illuminate\Foundation\Application $app Laravel application object
   *
   * @return void
   */
  public function __construct($app = null) {
    if (!is_array($app))
      parent::__construct();

    $this->app = $app ?: app();
  }

  /**
   * Get the console command options.
   *
   * @return array
   */
  protected function getOptions() {
    return array(
      array('table', null, InputOption::VALUE_OPTIONAL, 'Table name.', 'users'),
    );
  }

  /**
   * Execute the console command.
   *
   * @return void
   */
  public function fire() {
    // Prepare variables
    $table = lcfirst($this->option('table'));

    $viewVars = compact(
      'table'
    );

    // Prompt
    $this->line('');
    $this->info("Table name: $table");
    $this->comment(
      "A migration that creates social_sites and user_social_sites tables,".
      " referencing the $table table will".
      " be created in app/database/migrations directory"
    );
    $this->line('');

    if ($this->confirm("Proceed with the migration creation? [Yes|no]")) {
      $this->info("Creating migration...");
      // Generate
      $filename = 'database/migrations/' . date('Y_m_d_His') . "_create_oauth_client_setup_tables.php";
      $output = $this->app['view']->make('laravel-oauth-client::generators.migration', $viewVars)
        ->render();
      $filename = $this->app['path'] . '/' . trim($filename,'/');
      $directory = dirname($filename);
      if (!is_dir($directory)) {
        @mkdir($directory, 0755, true);
      }
      @file_put_contents($filename, $output, FILE_APPEND);

      $this->info("Migration successfully created!");
    }
    $this->call('dump-autoload');
  }
}


text:
RSA
===

Implementasi asymetric cryptograhy algorithma RSA menggunakan library MPIR (http://mpir.org)


text:
all: update

initial: clean
	@echo Initializing testing VM...
	vagrant up testing
	@echo Snapshotting initial state of testing VM...
	vagrant snapshot save testing initial

update:
	@echo Checking to see if testing VM exists...
	@vagrant snapshot list testing | grep -q initial || make initial
	@echo Restoring and updating initial snapshot of testing VM...
	vagrant snapshot restore --provision testing initial
	@echo Saving updates to initial snapshot of testing VM...
	vagrant snapshot save --force testing initial

restore:
	vagrant snapshot restore testing initial

clean:
	vagrant destroy testing


text:
<?php
/**
 * namespace para nosso modulo Core\Controller
 */

namespace Core\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;

use Zend\Paginator\Paginator;
use Zend\Paginator\Adapter\ArrayAdapter;

/**
 * class AbstractController
 * Responsável por gerencia os controller
 *
 * @author Winston Hanun Junior <ceo@sisdeve.com.br> skype ceo_sisdeve
 * @copyright (c) 2014, Winston Hanun Junior
 * @link http://www.sisdeve.com.br
 * @version V0.1
 */

abstract class AbstractController extends AbstractActionController
{
    /**
     * @var
     */
    protected $em; // EntityManager
    /**
     * @var
     */
    protected $entity; // Entidade
    /**
     * @var
     */
    protected $controller; // Controller
    /**
     * @var
     */
    protected $route; // Rota
    /**
     * @var
     */
    protected $service; // Serviço
    /**
     * @var
     */
    protected $form; // Formulário

    /**
     * @var
     */
    protected $dir; // Diretorio para guardas as imagens

    protected $itemPorPaigina = 2;

    /**
     *
     */
    abstract function __construct();

    /**
     * Lista Resultados
     *
     * @return array|ViewModel
     */
    public function indexAction()
    {
        $list = $this->getEm()->getRepository($this->entity)->findAll();

        $page = $this->params()->fromRoute('page');

        $paginator = new Paginator(new ArrayAdapter($list));
        $paginator->setCurrentPageNumber($page)
            ->setDefaultItemCountPerPage($this->itemPorPaigina);

        if ($this->flashMessenger()->hasSuccessMessages()){
            return new ViewModel(array(
                'data' => $paginator, 'page' => $page,
                'success' => $this->flashMessenger()->getSuccessMessages()));
        }

        if ($this->flashMessenger()->hasErrorMessages()){
            return new ViewModel(array(
                'data' => $paginator, 'page' => $page,
                'error' => $this->flashMessenger()->getErrorMessages()));
        }

        return new ViewModel(array('data' => $paginator, 'page' => $page));
    }

    /**
     * Inserir Registro
     */
    public function inserirAction()
    {
        if (is_string($this->form))
            $form = new $this->form;
        else
            $form = $this->form;

        $request = $this->getRequest();

        if ($request->isPost()){

            $postData = array_merge_recursive(
                $this->getRequest()->getPost()->toArray(),
                $this->getRequest()->getFiles()->toArray()
            );

            $form->setData($postData);

            //Nome do arquivo randômico

            if ($form->isValid()){
                $data = $form->getData();
                //var_dump($data['arquivo']['tmp_name']);die;

                $service = $this->getServiceLocator()->get($this->service);
                if($data['foto']['tmp_name']):
                    $postData['foto'] = $data['foto']['name'];

                    endif;

                //Pega os dados do POST
                $data = $form->getData();
                $arquivo = array_filter(explode(DIRECTORY_SEPARATOR,
                    $data['foto']['tmp_name']));
                $postData['foto'] = array_pop($arquivo);
                //var_dump($data['foto']);die;

                if ($service->save($postData)){
                    $this->flashMessenger()->addSuccessMessage('Cadastrado com sucesso!');
                }else{
                    $this->flashMessenger()->addErrorMessage('Não foi possivel cadastrar! Tente mais tarde.');
                }

                return $this->redirect()
                    ->toRoute($this->route, array('controller' => $this->controller, 'action' => 'inserir'));
            }
        }

        if ($this->flashMessenger()->hasSuccessMessages()){
            return new ViewModel(array(
                'form' => $form,
                'success' => $this->flashMessenger()->getSuccessMessages()));
        }

        if ($this->flashMessenger()->hasErrorMessages()){
            return new ViewModel(array(
                'form' => $form,
                'error' => $this->flashMessenger()->getErrorMessages()));
        }

        $this->flashMessenger()->clearMessages();

        return new ViewModel(array('form' => $form));
    }

    /**
     * Edita um registro
     */
    public function editarAction()
    {
        if (is_string($this->form))
            $form = new $this->form;
        else
            $form = $this->form;

        $request = $this->getRequest();

        $param = $this->params()->fromRoute('id', 0);

        $repository = $this->getEm()->getRepository($this->entity)->find($param);

        if ($repository){

            $array = array();
            foreach($repository->toArray() as $key => $value){
                if ($value instanceof \DateTime)
                    $array[$key] = $value->format('d/m/Y');
                else
                    $array[$key] = $value;
            }

            $form->setData($array);

            if ($request->isPost()){

                $form->setData($request->getPost());

                if ($form->isValid()){

                    $service = $this->getServiceLocator()->get($this->service);

                    $data = $request->getPost()->toArray();
                    if(!$data['senha']):
                        unset($data['senha']);
                        endif;
                    //var_dump($data['senha']);die;
                    $data['id'] = (int) $param;

                    if ($service->save($data)){
                        $this->flashMessenger()->addSuccessMessage('Atualizado com sucesso!');
                    }else{
                        $this->flashMessenger()->addErrorMessage('Não foi possivel atualizar! Tente mais tarde.');
                    }

                    return $this->redirect()
                        ->toRoute($this->route,
                            array('controller' => $this->controller,
                                'action' => 'editar', 'id' => $param));
                }

            }

        }else{
            $this->flashMessenger()->addInfoMessage('Registro não foi encontrado!');
            return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));
        }

        if ($this->flashMessenger()->hasSuccessMessages()){
            return new ViewModel(array(
                'form' => $form,
                'success' => $this->flashMessenger()->getSuccessMessages(),
                'id' => $param
            ));
        }

        if ($this->flashMessenger()->hasErrorMessages()){
            return new ViewModel(array(
                'form' => $form,
                'error' => $this->flashMessenger()->getErrorMessages(),
                'id' => $param
            ));
        }

        if ($this->flashMessenger()->hasInfoMessages()){
            return new ViewModel(array(
                'form' => $form,
                'warning' => $this->flashMessenger()->getInfoMessages(),
                'id' => $param
            ));
        }

        $this->flashMessenger()->clearMessages();

        return new ViewModel(array('form' => $form, 'id' => $param));
    }

    /**
     * Exclui um registro
     *
     * @return \Zend\Http\Response
     */
    public function excluirAction()
    {
        $service = $this->getServiceLocator()->get($this->service);
        $id = $this->params()->fromRoute('id', 0);

        if ($service->remove(array('id' => $id)))
            $this->flashMessenger()->addSuccessMessage('Resistro deletado com sucesso!');
        else
            $this->flashMessenger()->addErrorMessage('Não foi possivel deletar o registro!');

        return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));
    }

    /**
     * @return \Doctrine\ORM\EntityManager
     */
    public function getEm()
    {
        if ($this->em == null){
            $this->em = $this->getServiceLocator()->get('Doctrine\ORM\EntityManager');
        }

        return $this->em;
    }

}


text:
ACCEPTED

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

#### Published in
Syll. fung. (Abellini) 2: 604 (1883)

#### Original name
Phyllachora graminis fuscescens Speg., 1880

### Remarks
null


text:
h3 {
    color: navy;
    background-color: powderblue;
}


text:
#include <QtCore/QMetaType>

#include "utils/robotCommunication/robotCommunicator.h"

#include <plugins/robots/thirdparty/qextserialport/src/qextserialenumerator.h>
#include <plugins/robots/thirdparty/qextserialport/src/qextserialport.h>

using namespace utils::robotCommunication;

RobotCommunicator::RobotCommunicator(QObject *parent)
	: QObject(parent)
	, mRobotCommunicationThreadObject(nullptr)
{
}

RobotCommunicator::~RobotCommunicator()
{
	if (mRobotCommunicationThreadObject) {
		mRobotCommunicationThreadObject->allowLongJobs(false);
	}

	mRobotCommunicationThread.quit();
	mRobotCommunicationThread.wait();
	delete mRobotCommunicationThreadObject;
}

void RobotCommunicator::send(QObject *addressee, const QByteArray &buffer, const unsigned responseSize)
{
	mRobotCommunicationThreadObject->send(addressee, buffer, responseSize);
}

void RobotCommunicator::send(const QByteArray &buffer, const unsigned responseSize, QByteArray &outputBuffer)
{
	mRobotCommunicationThreadObject->send(buffer, responseSize, outputBuffer);
}

void RobotCommunicator::connect()
{
	mRobotCommunicationThreadObject->connect();
}

void RobotCommunicator::disconnect()
{
	mRobotCommunicationThreadObject->disconnect();
}

void RobotCommunicator::checkConsistency()
{
	if (mRobotCommunicationThreadObject) {
		mRobotCommunicationThreadObject->checkConsistency();
	}
}

void RobotCommunicator::setRobotCommunicationThreadObject(RobotCommunicationThreadInterface *robotCommunication)
{
	if (mRobotCommunicationThreadObject) {
		mRobotCommunicationThreadObject->allowLongJobs(false);
	}

	mRobotCommunicationThread.quit();
	mRobotCommunicationThread.wait();
	delete mRobotCommunicationThreadObject;
	mRobotCommunicationThreadObject = robotCommunication;
	mRobotCommunicationThreadObject->moveToThread(&mRobotCommunicationThread);
	mRobotCommunicationThreadObject->allowLongJobs();
	mRobotCommunicationThread.start();

	QObject::connect(mRobotCommunicationThreadObject, &RobotCommunicationThreadInterface::connected
			, this, &RobotCommunicator::connected);
	QObject::connect(mRobotCommunicationThreadObject, &RobotCommunicationThreadInterface::disconnected
			, this, &RobotCommunicator::disconnected);
	QObject::connect(mRobotCommunicationThreadObject, &RobotCommunicationThreadInterface::response
			, this, &RobotCommunicator::response);
	QObject::connect(mRobotCommunicationThreadObject, &RobotCommunicationThreadInterface::errorOccured
			, this, &RobotCommunicator::errorOccured);

	mRobotCommunicationThreadObject->checkConsistency();
}


text:
package com.apesconsole.repo.impl;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

import com.apesconsole.entity.SensorData;
import com.apesconsole.repo.SensorLog;

@Repository
public class SensorLogImpl implements SensorLog {

	private JdbcTemplate template;
	private RowMapper<SensorData> rowMapper = new LogRowMapper();
	private static final String INSERT = "insert into sensor_data(id, message, log_time) values(?, ?, sysdate)";
	private static final String SEARCH = "select * from sensor_data";
	private static final String COLUMN_ID = "id";
	private static final String COLUMN_MESSAGE = "message";
	private static final String COLUMN_TIME = "log_time";

	private Integer count = 0;

	@Autowired
	public SensorLogImpl(DataSource dataSource) {
		this.template = new JdbcTemplate(dataSource);
	}

	@Override
	public void logSensorData(SensorData data) {
		data.setId(++count);
		template.update(INSERT, new Object[]{
			data.getId(),
			data.getMessage()
		});

	}

	@Override
	public List<SensorData> loadSensorData() {
		return template.query(SEARCH, rowMapper);
	}

	private class LogRowMapper implements RowMapper<SensorData> {
		public SensorData mapRow(ResultSet rs, int i) throws SQLException {
			SensorData log = new SensorData();
			log.setId(rs.getInt(COLUMN_ID));
			log.setMessage(rs.getString(COLUMN_MESSAGE));
			log.setLog_time(rs.getString(COLUMN_TIME));
			return log;
		}
	}

}


text:
function validatePassorwEq(password, rpassword) {
    var pass1 = document.getElementById(password).value;
    var pass2 = document.getElementById(rpassword).value;
    if(pass1 != pass2) {
        document.getElementById(rpassword).setCustomValidity("Passwords Don't Match");
    } else {
        document.getElementById(rpassword).setCustomValidity('');
    }
}

function setInvalid(id) {
    document.getElementById(id).setCustomValidity("Invalid");
}
function setValid(id) {
    document.getElementById(id).setCustomValidity("");

}

function validateLogin(login) {
    $.ajax({
        type: 'GET',
        url: '/adduser',
        data: {
            'login' : login
        },
        success: function (response) {
            if (response == 'valid') {
                setValid('login');
            } else {
                setInvalid('login');
            }
        },
        error: function (resp) {
            $('#h2').empty().addClass('answer').append('Error!');
        }
    });
}

function validateAndSend() {
    var sendform = $('#sendform');
    if(!sendform[0].checkValidity()) {
        $('<input type="submit">').hide().appendTo(sendform).click().remove();
    } else {
        $.ajax({
            type: 'POST',
            url: '/adduser',
            data: jQuery("#sendform").serialize(),
            success: function (response) {
                if (response != -1) {
                    $('#h2').empty().addClass('answer').append('Successful, user id = ', response);
                    window.setTimeout(function(){
                        window.location.replace('/admin');
                    }, 2500);
                } else {
                    $('#h2').empty().addClass('answer').append('Error!');
                }
            },
            error: function (resp) {
                $('#h2').empty().addClass('answer').append('Error!');
            }
        });
    }
}


text:
package com.avira.ds.sparser.samples

import com.avira.ds.MacroUtils
import com.avira.ds.sparser._

import scala.util.{Failure, Success, Try}

/** Nested object sample returned as output by [[SampleNestedObjectParser]] */
case class NestedObject(
    a: String,
    b: String,
    c: Ratio)

/**
  * @see [[NestedObject]]
  */
case class Ratio(
    x: Int,
    y: Int)

/** Sample parser implemented to show how to test a
  * [[com.avira.ds.sparser.Parser]] implementation which outputs a nested
  * object.
  *
  * Check the tests to see how this kind of parsers can be tested.
  *
  */
class SampleNestedObjectParser extends Parser[String, NestedObject] {
  import SampleNestedObjectParser._

  override def parse(
      inputResult: ParseResult[String, String]): ParseResult[String, NestedObject] = {
    val columnsResult = inputResult.transform { line: String =>
      // Split the TSV line.
      val cols = line.split("\t")
      cols match {
        case Array(a, b, c) => TransformSuccess((a, b, c))
        case Array(a, b, c, _*) => TransformWarning((a, b, c),
          TooManyColumnsParseError(cols.length))
        case _ => TransformFailure(
          NotEnoughColumnsParseError(cols.length))
      }
    }

    // Split the components of the [[Ratio]] object and parse the numbers.
    columnsResult.transform { case (a, b, cRaw) =>
      val ratioSplits = cRaw.split(":")
      ratioSplits match {
        case Array(xRaw, yRaw) => Try(Ratio(xRaw.toInt, yRaw.toInt)) match {
          case Success(c) => TransformSuccess(NestedObject(a, b, c))
          case Failure(e: NumberFormatException) => TransformFailure(InvalidNumbersParseError(e))
          case Failure(e) => throw new RuntimeException(e)
        }
      }
    }
  }
}

/** Companion of [[SampleNestedObjectParser]] which defines
  * [[com.avira.ds.sparser.ParseError]]s that be reported by the parser.
  */
object SampleNestedObjectParser {

  sealed abstract class SampleNestedObjectParseError(
      override val message: Option[String],
      override val args: Seq[Any]) extends ParseError

  case class TooManyColumnsParseError(colsCount: Int)
      extends SampleNestedObjectParseError(Some("Too many columns"), Seq(colsCount))

  case class NotEnoughColumnsParseError(colsCount: Int)
      extends SampleNestedObjectParseError(Some("Insufficient columns"), Seq(colsCount))

  case class InvalidNumbersParseError(e: NumberFormatException)
      extends SampleNestedObjectParseError(
        Some("At least one of the numbers in Ratio is invalid"), Seq(e))

  /** Returns all [[ParseError]]s which could be reported by
    * [[SampleNestedObjectParser]].
    */
  def parseErrorClasses: Set[Class[_ <: ParseError]] =
    MacroUtils.getSealedClassChildren[SampleNestedObjectParseError]
        .asInstanceOf[Set[Class[_ <: ParseError]]]
}


text:
package org.broadinstitute.sting.gatk.refdata.tracks;

import net.sf.samtools.SAMSequenceDictionary;
import net.sf.samtools.SAMSequenceRecord;
import org.apache.log4j.Logger;
import org.broad.tribble.index.Index;
import org.broadinstitute.sting.gatk.arguments.ValidationExclusion;
import org.broadinstitute.sting.utils.SequenceDictionaryUtils;

import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

/**
 * Utilities for working with Sequence Dictionaries embedded in tribble indices
 *
 * @author Your Name
 * @since Date created
 */
public class IndexDictionaryUtils {
    private final static Logger logger = Logger.getLogger(IndexDictionaryUtils.class);

    // a constant we use for marking sequence dictionary entries in the Tribble index property list
    public static final String SequenceDictionaryPropertyPredicate = "DICT:";

    /**
     * get the sequence dictionary from the track, if available.  If not, make it from the contig list that is always in the index
     * @param index the index file to use
     * @return a SAMSequenceDictionary if available, null if unavailable
     */
    public static SAMSequenceDictionary getSequenceDictionaryFromProperties(Index index) {
        SAMSequenceDictionary dict = new SAMSequenceDictionary();
        for (Map.Entry<String,String> entry : index.getProperties().entrySet()) {
            if (entry.getKey().startsWith(SequenceDictionaryPropertyPredicate))
                dict.addSequence(new SAMSequenceRecord(entry.getKey().substring(SequenceDictionaryPropertyPredicate.length() , entry.getKey().length()),
                        Integer.valueOf(entry.getValue())));
        }
        return dict;
    }

    /**
     * create the sequence dictionary with the contig list; a backup approach
     * @param index the index file to use
     * @param dict the sequence dictionary to add contigs to
     * @return the filled-in sequence dictionary
     */
    static SAMSequenceDictionary createSequenceDictionaryFromContigList(Index index, SAMSequenceDictionary dict) {
        LinkedHashSet<String> seqNames = index.getSequenceNames();
        if (seqNames == null) {
            return dict;
        }
        for (String name : seqNames) {
            SAMSequenceRecord seq = new SAMSequenceRecord(name, 0);
            dict.addSequence(seq);
        }
        return dict;
    }

    public static void setIndexSequenceDictionary(Index index, SAMSequenceDictionary dict) {
        for ( SAMSequenceRecord seq : dict.getSequences() ) {
            final String contig = IndexDictionaryUtils.SequenceDictionaryPropertyPredicate + seq.getSequenceName();
            final String length = String.valueOf(seq.getSequenceLength());
            index.addProperty(contig,length);
        }
    }

    public static void validateTrackSequenceDictionary(final String trackName,
                                                       final SAMSequenceDictionary trackDict,
                                                       final SAMSequenceDictionary referenceDict,
                                                       final ValidationExclusion.TYPE validationExclusionType ) {
        // if the sequence dictionary is empty (as well as null which means it doesn't have a dictionary), skip validation
        if (trackDict == null || trackDict.size() == 0)
            logger.info("Track " + trackName + " doesn't have a sequence dictionary built in, skipping dictionary validation");
        else {
            Set<String> trackSequences = new TreeSet<String>();
            for (SAMSequenceRecord dictionaryEntry : trackDict.getSequences())
                trackSequences.add(dictionaryEntry.getSequenceName());
            SequenceDictionaryUtils.validateDictionaries(logger, validationExclusionType, trackName, trackDict, "reference", referenceDict);
        }
    }
}


text:
title: "Cómo lograr que el usuario dé su consentimiento para que se comparta su ubicación"
description: "TODO"
updated_on: 2014-10-21
translation_priority: 1
key-takeaways:
  geo:
    - Suponga que los usuarios no le proporcionarán su ubicación.
    - Explique claramente por qué necesita acceder a la ubicación del usuario.
    - No solicite acceso de inmediato en la carga de la página.
comments:
  # NOTA: If the section titles or URL changes the following shortlinks must be updated
  - g.co/mobilesiteprinciple25
---

  Como desarrollador web, el hecho de tener acceso a la ubicación del usuario abre una gran cantidad de posibilidades, como filtrado avanzado, identificación del usuario en un mapa y ofrecimiento de sugerencias proactivas sobre lo que el usuario puede hacer teniendo en cuenta su posición actual.

Como usuario, su ubicación física es una pieza de información que desea
conservar y compartirla solo con las personas en las que confía.  Es por ello que en el navegador se muestra
una petición cuando en un sitio le solicitan su ubicación.

{% include shared/toc.liquid %}

Estudios recientes realizados entre los usuarios han demostrado que los
usuarios no confían en los sitios que simplemente le solicitan al usuario que proporcione su
posición durante la carga de la página. Entonces, ¿cuáles son las mejores prácticas?

{% include shared/takeaway.liquid list=page.key-takeaways.geo %}

## Suponga que los usuarios no le proporcionarán su ubicación

Tal vez no quiera escuchar esto, pero muchos de sus usuarios no querrán proporcionarle su
ubicación, por lo que deberá adoptar un estilo de desarrollo defensivo.

1.  Elimine todos los errores de la API de geolocalización, de modo que pueda adaptar su
 sitio a esta condición.
2.  Sea claro y explícito acerca de la necesidad de conocer la ubicación.
3.  Utilice una solución de reserva, si es necesario.

## Utilice una reserva si es necesario conocer la geolocalización

Le recomendamos que en su sitio o aplicación no solicite
acceso a la ubicación actual del usuario, pero si su aplicación o sitio
la necesitan realmente, existen soluciones de terceros que le permiten saber
mejor dónde se encuentra la persona en ese momento.

Por lo general, estas soluciones resultan eficientes si se analiza la dirección IP del usuario y esta se asigna
a las direcciones físicas registradas en la base de datos del RIPE (Centro de Coordinación de Redes IP Europeas).  A menudo, estas ubicaciones
 no son muy precisas, ya que normalmente le proporcionan una posición del concentrador
de telecomunicaciones más cercano al usuario o de la torre de telefonía celular más cercana.  En muchos
casos, pueden incluso no ser tan precisas, especialmente si el usuario utiliza una VPN (red privada virtual)
o algún otro servicio proxy.

## Siempre obtenga acceso a la ubicación mediante un gesto del usuario

Asegúrese de que los usuarios comprendan por qué les solicita su ubicación y cuál será
el beneficio para ellos.  El hecho de solicitar la ubicación de inmediato en la página de inicio
mientras se carga el sitio hace que la experiencia del usuario sea poco agradable.

El hecho de solicitar la ubicación de inmediato en la página de inicio mientras se carga el sitio hace que la experiencia del usuario sea poco agradable.

 Siempre obtenga acceso a la ubicación mediante un gesto del usuario.

Por el contrario, debe proporcionarle al usuario un llamado a la acción claro u ofrecerle una indicación de que
en una operación se necesitará tener acceso a su ubicación.  De este modo, el usuario podrá
asociar más fácilmente la petición de acceso del sistema con la acción
que se acaba de iniciar.

## Indique claramente al usuario que en una acción le solicitarán la ubicación

En un estudio realizado por el equipo de Google Ads, cuando se les pidió a los usuarios que reservaran una habitación en un hotel de Boston mediante un sitio particular de hoteles para una conferencia futura, se les solicitó que compartieran su ubicación del GPS (Sistema de posicionamiento global) inmediatamente luego de presionar el llamado a la acción 'Find and Book' en la página de inicio.

En algunos casos, el usuario se siente frustrado porque se esfuerza por entender por qué
le muestran hoteles en San Francisco si desea reservar una habitación en
Boston.

Para mejorar la experiencia, se debe asegurar de que el usuario comprenda por qué se le solicita
su ubicación. Agregue un significante muy conocido que sea común en todos los
dispositivos, tal como el buscador de rangos.

O bien, considere incluir un llamado a la acción muy explícito, como "Buscar cerca de mi ubicación".

## Invite sutilmente a los usuarios a otorgarle permiso para acceder a su ubicación

Usted no posee acceso a lo que los usuarios están haciendo.  Sabe exactamente
cuándo los usuarios deshabilitan el acceso a su ubicación, pero no sabe
cuándo le otorgan acceso. Solo sabe que obtiene acceso cuando aparecen los resultados.

Se considera buen práctica "tentar" al usuario a realizar una acción si necesita que el usuario lo haga.

Le recomendamos lo siguiente:

1.  Configurar un temporizador que se activará luego de un breve período: 5 segundos es un buen valor.
2.  Si obtiene un mensaje de error, muéstrele un mensaje al usuario.
3.  Si obtiene una respuesta positiva, deshabilite el temporizador y procese los resultados.
4.  Si, cuando se acaba el tiempo, no obtiene una respuesta positiva, muéstrele una notificación al usuario.
5.  Si la respuesta llega más tarde y la notificación aún está presente, retírela de la pantalla.

{% highlight javascript %}
button.onclick = function() {
  var startPos;
  var element = document.getElementById("nudge");

  var showNudgeBanner = function() {
    nudge.style.display = "block";
  };

  var hideNudgeBanner = function() {
    nudge.style.display = "none";
  };

  var nudgeTimeoutId = setTimeout(showNudgeBanner, 5000);

  var geoSuccess = function(position) {
    hideNudgeBanner();
    // We have the location, don't display banner
    clearTimeout(nudgeTimeoutId);

    // Do magic with location
    startPos = position;
    document.getElementById('startLat').innerHTML = startPos.coords.latitude;
    document.getElementById('startLon').innerHTML = startPos.coords.longitude;
  };
  var geoError = function(error) {
    switch(error.code) {
      case error.TIMEOUT:
        // The user didn't accept the callout
        showNudgeBanner();
        break;
  };

  navigator.geolocation.getCurrentPosition(geoSuccess, geoError);
};
{% endhighlight %}


text:
'use strict';

/**
 * @ngdoc directive
 * @name greensopinionfinanceApp.directive:toast
 * @description
 * # toast
 */
angular.module('greensopinionfinanceApp')
  .directive('toast', ['toastService', function (toastService) {
    return {
      templateUrl: 'views/directives/toast.html',
      restrict: 'E',
      link: function postLink(scope) {
        scope.toastMessage = function() {
          return toastService.message();
        };
      }
    };
  }]);


text:
<?php

namespace App\SecurityModule\Model;
use \App\SecurityModule\Model\Resource;

/**
 * Entity serves for representing presenter within tree of authorization resources PresenterResource
 *
 * @author Michal Fučík <michal.fuca.fucik(at)gmail.com>
 */
class PresenterResource extends Resource {

    public function getPrivileges() {
	// vratit select akci
	$subs = $this->getSubResources();
	$arrSel = [];
	foreach ($subs as $key=>$sub) {
	    $arrSel[$key] = $sub->getLabel();
	}
	return $arrSel;
    }
}


text:
<!DOCTYPE HTML>

<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff">
<title>MetadataDecoder (ExoPlayer library)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

All Classes

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Package com.google.android.exoplayer2.metadata

Interface MetadataDecoder

All Known Implementing Classes:

AppInfoTableDecoder, EventMessageDecoder, IcyDecoder, Id3Decoder, SimpleMetadataDecoder, SpliceInfoDecoder

public interface MetadataDecoder

Decodes metadata from binary data.

Method Summary

All Methods Instance Methods Abstract Methods

Modifier and Type
Method
Description

Metadata
decode(MetadataInputBuffer inputBuffer)

Decodes a Metadata element from the provided input buffer.

Method Detail

decode

@Nullable
Metadata decode(MetadataInputBuffer inputBuffer)

Decodes a Metadata element from the provided input buffer.

Respects Buffer.limit() of inputBuffer.data, but assumes Buffer.position() and ByteBuffer.arrayOffset() are both zero and ByteBuffer.hasArray() is true.

Parameters:

inputBuffer - The input buffer to decode.

Returns:

The decoded metadata object, or null if the metadata could not be decoded or if
     Buffer.isDecodeOnly() was set on the input buffer.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

All Classes

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
var expect = require("chai").expect;

it("should mount components", function () {
  expect(window.helloComponent != null).to.equal(true);
});


text:
package org.apache.flink.table.data;

import org.apache.flink.api.common.typeutils.base.StringSerializer;
import org.apache.flink.core.memory.MemorySegment;
import org.apache.flink.core.memory.MemorySegmentFactory;
import org.apache.flink.table.api.DataTypes;
import org.apache.flink.table.data.binary.BinaryArrayData;
import org.apache.flink.table.data.binary.BinaryMapData;
import org.apache.flink.table.data.binary.BinaryRowData;
import org.apache.flink.table.data.binary.BinarySegmentUtils;
import org.apache.flink.table.data.writer.BinaryArrayWriter;
import org.apache.flink.table.data.writer.BinaryRowWriter;
import org.apache.flink.table.runtime.typeutils.ArrayDataSerializer;
import org.apache.flink.table.runtime.typeutils.MapDataSerializer;
import org.apache.flink.table.runtime.typeutils.RawValueDataSerializer;
import org.apache.flink.table.runtime.typeutils.RowDataSerializer;
import org.apache.flink.table.types.logical.IntType;
import org.apache.flink.table.types.logical.RowType;
import org.apache.flink.table.types.logical.VarCharType;

import org.junit.Assert;
import org.junit.Test;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.time.LocalDateTime;

import static org.apache.flink.table.data.StringData.fromString;
import static org.apache.flink.table.utils.RawValueDataAsserter.equivalent;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

/**
 * Test of {@link BinaryArrayData} and {@link BinaryArrayWriter}.
 */
public class BinaryArrayDataTest {

	@Test
	public void testArray() {
		// 1.array test
		BinaryArrayData array = new BinaryArrayData();
		BinaryArrayWriter writer = new BinaryArrayWriter(array, 3, 4);

		writer.writeInt(0, 6);
		writer.setNullInt(1);
		writer.writeInt(2, 666);
		writer.complete();

		assertEquals(array.getInt(0), 6);
		assertTrue(array.isNullAt(1));
		assertEquals(array.getInt(2), 666);

		//2.test write to binary row.
		{
			BinaryRowData row2 = new BinaryRowData(1);
			BinaryRowWriter writer2 = new BinaryRowWriter(row2);
			writer2.writeArray(0, array, new ArrayDataSerializer(DataTypes.INT().getLogicalType(), null));
			writer2.complete();

			BinaryArrayData array2 = (BinaryArrayData) row2.getArray(0);
			assertEquals(array2, array);
			assertEquals(array2.getInt(0), 6);
			assertTrue(array2.isNullAt(1));
			assertEquals(array2.getInt(2), 666);
		}

		//3.test write var seg array to binary row.
		{
			BinaryArrayData array3 = splitArray(array);

			BinaryRowData row2 = new BinaryRowData(1);
			BinaryRowWriter writer2 = new BinaryRowWriter(row2);
			writer2.writeArray(0, array3, new ArrayDataSerializer(DataTypes.INT().getLogicalType(), null));
			writer2.complete();

			BinaryArrayData array2 = (BinaryArrayData) row2.getArray(0);
			assertEquals(array2, array);
			assertEquals(array2.getInt(0), 6);
			assertTrue(array2.isNullAt(1));
			assertEquals(array2.getInt(2), 666);
		}
	}

	@Test
	public void testArrayTypes() {
		{
			// test bool
			BinaryArrayData array = new BinaryArrayData();
			BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 1);
			writer.setNullBoolean(0);
			writer.writeBoolean(1, true);
			writer.complete();

			assertTrue(array.isNullAt(0));
			assertTrue(array.getBoolean(1));
			array.setBoolean(0, true);
			assertTrue(array.getBoolean(0));
			array.setNullBoolean(0);
			assertTrue(array.isNullAt(0));

			BinaryArrayData newArray = splitArray(array);
			assertTrue(newArray.isNullAt(0));
			assertTrue(newArray.getBoolean(1));
			newArray.setBoolean(0, true);
			assertTrue(newArray.getBoolean(0));
			newArray.setNullBoolean(0);
			assertTrue(newArray.isNullAt(0));

			newArray.setBoolean(0, true);
			assertEquals(newArray, BinaryArrayData.fromPrimitiveArray(newArray.toBooleanArray()));
		}

		{
			// test byte
			BinaryArrayData array = new BinaryArrayData();
			BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 1);
			writer.setNullByte(0);
			writer.writeByte(1, (byte) 25);
			writer.complete();

			assertTrue(array.isNullAt(0));
			assertEquals(25, array.getByte(1));
			array.setByte(0, (byte) 5);
			assertEquals(5, array.getByte(0));
			array.setNullByte(0);
			assertTrue(array.isNullAt(0));

			BinaryArrayData newArray = splitArray(array);
			assertTrue(newArray.isNullAt(0));
			assertEquals(25, newArray.getByte(1));
			newArray.setByte(0, (byte) 5);
			assertEquals(5, newArray.getByte(0));
			newArray.setNullByte(0);
			assertTrue(newArray.isNullAt(0));

			newArray.setByte(0, (byte) 3);
			assertEquals(newArray, BinaryArrayData.fromPrimitiveArray(newArray.toByteArray()));
		}

		{
			// test short
			BinaryArrayData array = new BinaryArrayData();
			BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 2);
			writer.setNullShort(0);
			writer.writeShort(1, (short) 25);
			writer.complete();

			assertTrue(array.isNullAt(0));
			assertEquals(25, array.getShort(1));
			array.setShort(0, (short) 5);
			assertEquals(5, array.getShort(0));
			array.setNullShort(0);
			assertTrue(array.isNullAt(0));

			BinaryArrayData newArray = splitArray(array);
			assertTrue(newArray.isNullAt(0));
			assertEquals(25, newArray.getShort(1));
			newArray.setShort(0, (short) 5);
			assertEquals(5, newArray.getShort(0));
			newArray.setNullShort(0);
			assertTrue(newArray.isNullAt(0));

			newArray.setShort(0, (short) 3);
			assertEquals(newArray, BinaryArrayData.fromPrimitiveArray(newArray.toShortArray()));
		}

		{
			// test int
			BinaryArrayData array = new BinaryArrayData();
			BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 4);
			writer.setNullInt(0);
			writer.writeInt(1, 25);
			writer.complete();

			assertTrue(array.isNullAt(0));
			assertEquals(25, array.getInt(1));
			array.setInt(0, 5);
			assertEquals(5, array.getInt(0));
			array.setNullInt(0);
			assertTrue(array.isNullAt(0));

			BinaryArrayData newArray = splitArray(array);
			assertTrue(newArray.isNullAt(0));
			assertEquals(25, newArray.getInt(1));
			newArray.setInt(0, 5);
			assertEquals(5, newArray.getInt(0));
			newArray.setNullInt(0);
			assertTrue(newArray.isNullAt(0));

			newArray.setInt(0, 3);
			assertEquals(newArray, BinaryArrayData.fromPrimitiveArray(newArray.toIntArray()));
		}

		{
			// test long
			BinaryArrayData array = new BinaryArrayData();
			BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 8);
			writer.setNullLong(0);
			writer.writeLong(1, 25);
			writer.complete();

			assertTrue(array.isNullAt(0));
			assertEquals(25, array.getLong(1));
			array.setLong(0, 5);
			assertEquals(5, array.getLong(0));
			array.setNullLong(0);
			assertTrue(array.isNullAt(0));

			BinaryArrayData newArray = splitArray(array);
			assertTrue(newArray.isNullAt(0));
			assertEquals(25, newArray.getLong(1));
			newArray.setLong(0, 5);
			assertEquals(5, newArray.getLong(0));
			newArray.setNullLong(0);
			assertTrue(newArray.isNullAt(0));

			newArray.setLong(0, 3);
			assertEquals(newArray, BinaryArrayData.fromPrimitiveArray(newArray.toLongArray()));
		}

		{
			// test float
			BinaryArrayData array = new BinaryArrayData();
			BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 4);
			writer.setNullFloat(0);
			writer.writeFloat(1, 25);
			writer.complete();

			assertTrue(array.isNullAt(0));
			assertTrue(25 == array.getFloat(1));
			array.setFloat(0, 5);
			assertTrue(5 == array.getFloat(0));
			array.setNullFloat(0);
			assertTrue(array.isNullAt(0));

			BinaryArrayData newArray = splitArray(array);
			assertTrue(newArray.isNullAt(0));
			assertTrue(25 == newArray.getFloat(1));
			newArray.setFloat(0, 5);
			assertTrue(5 == newArray.getFloat(0));
			newArray.setNullFloat(0);
			assertTrue(newArray.isNullAt(0));

			newArray.setFloat(0, 3);
			assertEquals(newArray, BinaryArrayData.fromPrimitiveArray(newArray.toFloatArray()));
		}

		{
			// test double
			BinaryArrayData array = new BinaryArrayData();
			BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 8);
			writer.setNullDouble(0);
			writer.writeDouble(1, 25);
			writer.complete();

			assertTrue(array.isNullAt(0));
			assertTrue(25 == array.getDouble(1));
			array.setDouble(0, 5);
			assertTrue(5 == array.getDouble(0));
			array.setNullDouble(0);
			assertTrue(array.isNullAt(0));

			BinaryArrayData newArray = splitArray(array);
			assertTrue(newArray.isNullAt(0));
			assertTrue(25 == newArray.getDouble(1));
			newArray.setDouble(0, 5);
			assertTrue(5 == newArray.getDouble(0));
			newArray.setNullDouble(0);
			assertTrue(newArray.isNullAt(0));

			newArray.setDouble(0, 3);
			assertEquals(newArray, BinaryArrayData.fromPrimitiveArray(newArray.toDoubleArray()));
		}

		{
			// test string
			BinaryArrayData array = new BinaryArrayData();
			BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 8);
			writer.setNullAt(0);
			writer.writeString(1, fromString("jaja"));
			writer.complete();

			assertTrue(array.isNullAt(0));
			assertEquals(fromString("jaja"), array.getString(1));

			BinaryArrayData newArray = splitArray(array);
			assertTrue(newArray.isNullAt(0));
			assertEquals(fromString("jaja"), newArray.getString(1));
		}

		BinaryArrayData subArray = new BinaryArrayData();
		BinaryArrayWriter subWriter = new BinaryArrayWriter(subArray, 2, 8);
		subWriter.setNullAt(0);
		subWriter.writeString(1, fromString("hehehe"));
		subWriter.complete();

		{
			// test array
			BinaryArrayData array = new BinaryArrayData();
			BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 8);
			writer.setNullAt(0);
			writer.writeArray(1, subArray, new ArrayDataSerializer(DataTypes.INT().getLogicalType(), null));
			writer.complete();

			assertTrue(array.isNullAt(0));
			assertEquals(subArray, array.getArray(1));

			BinaryArrayData newArray = splitArray(array);
			assertTrue(newArray.isNullAt(0));
			assertEquals(subArray, newArray.getArray(1));
		}

		{
			// test map
			BinaryArrayData array = new BinaryArrayData();
			BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 8);
			writer.setNullAt(0);
			writer.writeMap(1, BinaryMapData.valueOf(subArray, subArray),
					new MapDataSerializer(DataTypes.INT().getLogicalType(), DataTypes.INT().getLogicalType(), null));
			writer.complete();

			assertTrue(array.isNullAt(0));
			assertEquals(BinaryMapData.valueOf(subArray, subArray), array.getMap(1));

			BinaryArrayData newArray = splitArray(array);
			assertTrue(newArray.isNullAt(0));
			assertEquals(BinaryMapData.valueOf(subArray, subArray), newArray.getMap(1));
		}
	}

	@Test
	public void testMap() {
		BinaryArrayData array1 = new BinaryArrayData();
		BinaryArrayWriter writer1 = new BinaryArrayWriter(array1, 3, 4);
		writer1.writeInt(0, 6);
		writer1.writeInt(1, 5);
		writer1.writeInt(2, 666);
		writer1.complete();

		BinaryArrayData array2 = new BinaryArrayData();
		BinaryArrayWriter writer2 = new BinaryArrayWriter(array2, 3, 8);
		writer2.writeString(0, fromString("6"));
		writer2.writeString(1, fromString("5"));
		writer2.writeString(2, fromString("666"));
		writer2.complete();

		BinaryMapData binaryMap = BinaryMapData.valueOf(array1, array2);

		BinaryRowData row = new BinaryRowData(1);
		BinaryRowWriter rowWriter = new BinaryRowWriter(row);
		rowWriter.writeMap(0, binaryMap,
				new MapDataSerializer(DataTypes.INT().getLogicalType(), DataTypes.INT().getLogicalType(), null));
		rowWriter.complete();

		BinaryMapData map = (BinaryMapData) row.getMap(0);
		BinaryArrayData key = map.keyArray();
		BinaryArrayData value = map.valueArray();

		assertEquals(binaryMap, map);
		assertEquals(array1, key);
		assertEquals(array2, value);

		assertEquals(key.getInt(1), 5);
		assertEquals(value.getString(1), fromString("5"));
	}

	private static BinaryArrayData splitArray(BinaryArrayData array) {
		BinaryArrayData ret = new BinaryArrayData();
		MemorySegment[] segments = splitBytes(BinarySegmentUtils.copyToBytes(
			array.getSegments(), 0, array.getSizeInBytes()), 0);
		ret.pointTo(segments, 0, array.getSizeInBytes());
		return ret;
	}

	private static MemorySegment[] splitBytes(byte[] bytes, int baseOffset) {
		int newSize = (bytes.length + 1) / 2 + baseOffset;
		MemorySegment[] ret = new MemorySegment[2];
		ret[0] = MemorySegmentFactory.wrap(new byte[newSize]);
		ret[1] = MemorySegmentFactory.wrap(new byte[newSize]);

		ret[0].put(baseOffset, bytes, 0, newSize - baseOffset);
		ret[1].put(0, bytes, newSize - baseOffset, bytes.length - (newSize - baseOffset));
		return ret;
	}

	@Test
	public void testToArray() {
		BinaryArrayData array = new BinaryArrayData();
		BinaryArrayWriter writer = new BinaryArrayWriter(array, 3, 2);
		writer.writeShort(0, (short) 5);
		writer.writeShort(1, (short) 10);
		writer.writeShort(2, (short) 15);
		writer.complete();

		short[] shorts = array.toShortArray();
		assertEquals(5, shorts[0]);
		assertEquals(10, shorts[1]);
		assertEquals(15, shorts[2]);

		MemorySegment[] segments = splitBytes(writer.getSegments().getArray(), 3);
		array.pointTo(segments, 3, array.getSizeInBytes());
		assertEquals(5, array.getShort(0));
		assertEquals(10, array.getShort(1));
		assertEquals(15, array.getShort(2));
		short[] shorts2 = array.toShortArray();
		assertEquals(5, shorts2[0]);
		assertEquals(10, shorts2[1]);
		assertEquals(15, shorts2[2]);
	}

	@Test
	public void testDecimal() {

		BinaryArrayData array = new BinaryArrayData();
		BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 8);

		// 1.compact
		{
			int precision = 4;
			int scale = 2;
			writer.reset();
			writer.writeDecimal(0, DecimalData.fromUnscaledLong(5, precision, scale), precision);
			writer.setNullAt(1);
			writer.complete();

			assertEquals("0.05", array.getDecimal(0, precision, scale).toString());
			assertTrue(array.isNullAt(1));
			array.setDecimal(0, DecimalData.fromUnscaledLong(6, precision, scale), precision);
			assertEquals("0.06", array.getDecimal(0, precision, scale).toString());
		}

		// 2.not compact
		{
			int precision = 25;
			int scale = 5;
			DecimalData decimal1 = DecimalData.fromBigDecimal(BigDecimal.valueOf(5.55), precision, scale);
			DecimalData decimal2 = DecimalData.fromBigDecimal(BigDecimal.valueOf(6.55), precision, scale);

			writer.reset();
			writer.writeDecimal(0, decimal1, precision);
			writer.writeDecimal(1, null, precision);
			writer.complete();

			assertEquals("5.55000", array.getDecimal(0, precision, scale).toString());
			assertTrue(array.isNullAt(1));
			array.setDecimal(0, decimal2, precision);
			assertEquals("6.55000", array.getDecimal(0, precision, scale).toString());
		}
	}

	@Test
	public void testGeneric() {
		BinaryArrayData array = new BinaryArrayData();
		BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 8);
		RawValueData<String> generic = RawValueData.fromObject("hahah");
		RawValueDataSerializer<String> serializer = new RawValueDataSerializer<>(StringSerializer.INSTANCE);
		writer.writeRawValue(0, generic, serializer);
		writer.setNullAt(1);
		writer.complete();

		RawValueData<String> newGeneric = array.getRawValue(0);
		assertThat(newGeneric, equivalent(generic, serializer));
		assertTrue(array.isNullAt(1));
	}

	@Test
	public void testNested() {
		BinaryArrayData array = new BinaryArrayData();
		BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 8);
		writer.writeRow(0, GenericRowData.of(fromString("1"), 1),
				new RowDataSerializer(null, RowType.of(new VarCharType(VarCharType.MAX_LENGTH), new IntType())));
		writer.setNullAt(1);
		writer.complete();

		RowData nestedRow = array.getRow(0, 2);
		assertEquals("1", nestedRow.getString(0).toString());
		assertEquals(1, nestedRow.getInt(1));
		assertTrue(array.isNullAt(1));
	}

	@Test
	public void testBinary() {
		BinaryArrayData array = new BinaryArrayData();
		BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 8);
		byte[] bytes1 = new byte[] {1, -1, 5};
		byte[] bytes2 = new byte[] {1, -1, 5, 5, 1, 5, 1, 5};
		writer.writeBinary(0, bytes1);
		writer.writeBinary(1, bytes2);
		writer.complete();

		Assert.assertArrayEquals(bytes1, array.getBinary(0));
		Assert.assertArrayEquals(bytes2, array.getBinary(1));
	}

	@Test
	public void testTimestampData() {
		BinaryArrayData array = new BinaryArrayData();
		BinaryArrayWriter writer = new BinaryArrayWriter(array, 2, 8);

		// 1. compact
		{
			final int precision = 3;
			writer.reset();
			writer.writeTimestamp(0, TimestampData.fromEpochMillis(123L), precision);
			writer.setNullAt(1);
			writer.complete();

			assertEquals("1970-01-01T00:00:00.123", array.getTimestamp(0, 3).toString());
			assertTrue(array.isNullAt(1));
			array.setTimestamp(0, TimestampData.fromEpochMillis(-123L), precision);
			assertEquals("1969-12-31T23:59:59.877", array.getTimestamp(0, 3).toString());
		}

		// 2. not compact
		{
			final int precision = 9;
			TimestampData timestamp1 = TimestampData.fromLocalDateTime(LocalDateTime.of(1970, 1, 1, 0, 0, 0, 123456789));
			TimestampData timestamp2 = TimestampData.fromTimestamp(Timestamp.valueOf("1969-01-01 00:00:00.123456789"));

			writer.reset();
			writer.writeTimestamp(0, timestamp1, precision);
			writer.writeTimestamp(1, null, precision);
			writer.complete();

			assertEquals("1970-01-01T00:00:00.123456789", array.getTimestamp(0, precision).toString());
			assertTrue(array.isNullAt(1));
			array.setTimestamp(0, timestamp2, precision);
			assertEquals("1969-01-01T00:00:00.123456789", array.getTimestamp(0, precision).toString());
		}
	}
}


text:
__license__     = 'MIT'
__author__      = 'Alberto Pettarin (alberto@albertopettarin.it)'
__copyright__   = '2014-2015 Alberto Pettarin (alberto@albertopettarin.it)'
__version__     = 'v0.0.3'
__date__        = '2015-01-31'
__description__ = 'ink2fxl is an Inkscape plugin to export XHTML+CSS suitable for EPUB FXL ebooks'

### BEGIN changelog ###
#
# 0.0.1 2014-07-10 Initial release, inspired by SAWS (https://code.google.com/p/saws/) but completely rewritten from scratch
#
### END changelog ###

import inkex
import commands, os, re, sys
from options import Options
from svgexporter import SVGExporter

class Ink2FXL(inkex.Effect):

    # global variables
    output_dom = None
    output_css = ""
    log = None
    current_fragment_id = None

    # init plugin
    def __init__(self):
        # call super
        inkex.Effect.__init__(self)

        # initialize options
        commandLineOptions = Options.getOptions()
        for opt in commandLineOptions:
            if (opt["short"] != None):
                self.OptionParser.add_option(
                        opt["short"],
                        opt["long"],
                        dest=opt["dest"],
                        action="store",
                        type=opt["type"],
                        default=opt["default"],
                        help=opt["help"]
                        )
            else:
                self.OptionParser.add_option(
                        opt["long"],
                        dest=opt["dest"],
                        action="store",
                        type=opt["type"],
                        default=opt["default"],
                        help=opt["help"]
                        )

    # debug
    def show(self, string):
        inkex.debug(str(string))
    def output(self):
        pass

    # the magic happens here
    def effect(self):
        svg_file_path = self.args[-1]
        options = Options.convertToDict(self.options)
        isOK, message = Options.verifyOptions(options)
        if (isOK):
            converter = SVGExporter(svg_file_path, options)
            converter.parse()
            converter.output()
            converter.log()

# let's go!
effect = Ink2FXL()
effect.affect()


text:
<?php
if (!defined('EVENT_ESPRESSO_VERSION'))
	exit('No direct script access allowed');

/**
 * EE_Credit_Card_Year_Input
 * Exactly like EE_Year_Input, except has the EE_All_Sensitive_Data_Removal strategy
 * @package			Event Espresso
 * @subpackage
 * @author				Mike Nelson
 */
class EE_Credit_Card_Year_Input extends EE_Year_Input{

	/**
	 * @param array $input_settings
	 * @param bool  $four_digit_year
	 * @param int   $years_behind
	 * @param int   $years_ahead
	 */
	function __construct( $input_settings = array(), $four_digit_year = true, $years_behind = 0, $years_ahead = 15 ){
		$this->set_sensitive_data_removal_strategy( new EE_All_Sensitive_Data_Removal() );
		parent::__construct( $input_settings, $four_digit_year, $years_behind, $years_ahead );
	}
}


text:
import React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import configureStore from './store/configureStore'

import AppContainer from './containers/App'
import './app.global.css'

const store = configureStore()

render(
  <Provider store={store}>
    <AppContainer />
  </Provider>,
  document.getElementById('root')
)


text:
<meta charset="UTF-8">
    <title>Dashboard</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <!-- Bootstrap 3.3.2 -->
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Font Awesome Icons -->
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Ionicons -->
    <link href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <link href="dist/css/skins/skin-blue.min2.css" rel="stylesheet" type="text/css" />
    <link href="dist/css/pnotify.custom.min.css" media="all" rel="stylesheet" type="text/css"/>
    <link rel="icon"
      type="image/png"
      href="favicon.ico">


text:
.class Landroid/support/v7/app/MediaRouteExpandCollapseButton;
.super Landroid/widget/ImageButton;
.source "MediaRouteExpandCollapseButton.java"

# instance fields
.field final mCollapseAnimationDrawable:Landroid/graphics/drawable/AnimationDrawable;

.field final mCollapseGroupDescription:Ljava/lang/String;

.field final mExpandAnimationDrawable:Landroid/graphics/drawable/AnimationDrawable;

.field final mExpandGroupDescription:Ljava/lang/String;

.field mIsGroupExpanded:Z

.field mListener:Landroid/view/View$OnClickListener;

# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Landroid/support/v7/app/MediaRouteExpandCollapseButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Landroid/support/v7/app/MediaRouteExpandCollapseButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 3

    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ImageButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    sget v1, Landroid/support/v7/mediarouter/R$drawable;->mr_group_expand:I

    invoke-static {p1, v1}, Landroid/support/v4/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    check-cast v1, Landroid/graphics/drawable/AnimationDrawable;

    iput-object v1, p0, Landroid/support/v7/app/MediaRouteExpandCollapseButton;->mExpandAnimationDrawable:Landroid/graphics/drawable/AnimationDrawable;

    sget v1, Landroid/support/v7/mediarouter/R$drawable;->mr_group_collapse:I

    invoke-static {p1, v1}, Landroid/support/v4/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    check-cast v1, Landroid/graphics/drawable/AnimationDrawable;

    iput-object v1, p0, Landroid/support/v7/app/MediaRouteExpandCollapseButton;->mCollapseAnimationDrawable:Landroid/graphics/drawable/AnimationDrawable;

    new-instance v0, Landroid/graphics/PorterDuffColorFilter;

    invoke-static {p1, p3}, Landroid/support/v7/app/MediaRouterThemeHelper;->getControllerColor(Landroid/content/Context;I)I

    move-result v1

    sget-object v2, Landroid/graphics/PorterDuff$Mode;->SRC_IN:Landroid/graphics/PorterDuff$Mode;

    invoke-direct {v0, v1, v2}, Landroid/graphics/PorterDuffColorFilter;-><init>(ILandroid/graphics/PorterDuff$Mode;)V

    iget-object v1, p0, Landroid/support/v7/app/MediaRouteExpandCollapseButton;->mExpandAnimationDrawable:Landroid/graphics/drawable/AnimationDrawable;

    invoke-virtual {v1, v0}, Landroid/graphics/drawable/AnimationDrawable;->setColorFilter(Landroid/graphics/ColorFilter;)V

    iget-object v1, p0, Landroid/support/v7/app/MediaRouteExpandCollapseButton;->mCollapseAnimationDrawable:Landroid/graphics/drawable/AnimationDrawable;

    invoke-virtual {v1, v0}, Landroid/graphics/drawable/AnimationDrawable;->setColorFilter(Landroid/graphics/ColorFilter;)V

    sget v1, Landroid/support/v7/mediarouter/R$string;->mr_controller_expand_group:I

    invoke-virtual {p1, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Landroid/support/v7/app/MediaRouteExpandCollapseButton;->mExpandGroupDescription:Ljava/lang/String;

    sget v1, Landroid/support/v7/mediarouter/R$string;->mr_controller_collapse_group:I

    invoke-virtual {p1, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Landroid/support/v7/app/MediaRouteExpandCollapseButton;->mCollapseGroupDescription:Ljava/lang/String;

    iget-object v1, p0, Landroid/support/v7/app/MediaRouteExpandCollapseButton;->mExpandAnimationDrawable:Landroid/graphics/drawable/AnimationDrawable;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Landroid/graphics/drawable/AnimationDrawable;->getFrame(I)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    invoke-virtual {p0, v1}, Landroid/support/v7/app/MediaRouteExpandCollapseButton;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    iget-object v1, p0, Landroid/support/v7/app/MediaRouteExpandCollapseButton;->mExpandGroupDescription:Ljava/lang/String;

    invoke-virtual {p0, v1}, Landroid/support/v7/app/MediaRouteExpandCollapseButton;->setContentDescription(Ljava/lang/CharSequence;)V

    new-instance v1, Landroid/support/v7/app/MediaRouteExpandCollapseButton$1;

    invoke-direct {v1, p0}, Landroid/support/v7/app/MediaRouteExpandCollapseButton$1;-><init>(Landroid/support/v7/app/MediaRouteExpandCollapseButton;)V

    invoke-super {p0, v1}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    return-void
.end method

# virtual methods
.method public setOnClickListener(Landroid/view/View$OnClickListener;)V
    .locals 0

    iput-object p1, p0, Landroid/support/v7/app/MediaRouteExpandCollapseButton;->mListener:Landroid/view/View$OnClickListener;

    return-void
.end method


text:
using System.Collections.Generic;

namespace Smellyriver.TankInspector.Pro.Data.Entities
{
    public sealed class Chassis : Module, IArmoredObject, IInternalArmoredObject, IModelObject
    {
        public double TraverseSpeed { get { return this.QueryDouble("rotationSpeed"); } }
        public double MaximumLoad { get { return this.QueryDouble("maxLoad"); } }

        private readonly Dictionary<string, ArmorGroup> _armorGroups;
        Dictionary<string, ArmorGroup> IInternalArmoredObject.ArmorGroups { get { return _armorGroups; } }

        public Chassis(IXQueryable chassisData)
            : base(chassisData)
        {
            _armorGroups = new Dictionary<string, ArmorGroup>();
        }

        public ArmorGroup GetArmorGroup(string key)
        {
            return IArmoredObjectImpl.GetArmorGroup(this, key);
        }

        public double GetThickestArmor(bool spaced)
        {
            return IArmoredObjectImpl.GetThickestArmor(this, spaced);
        }

        public double GetThinnestArmor(bool spaced)
        {
            return IArmoredObjectImpl.GetThinnestArmor(this, spaced);
        }

        public double[] GetArmorValues(bool spaced)
        {
            return IArmoredObjectImpl.GetArmorValues(this, spaced);
        }

        public string GetModelPath(ModelType type)
        {
            return IModelObjectImpl.GetModelPath(this, type);
        }
    }
}


text:
package com.ack.adventureandconquer.game.dice;

/**
 * Created by saskyrar on 16/01/15.
 */
public class D12 extends AbstractDice {
    @Override
    protected int getDiceNumber() {
        return 12;
    }
}


text:
require './lib/misc'

class RubyGemsOrgDB
  def initialize
    @download_prefix = 'https://s3-us-west-2.amazonaws.com/rubygems-dumps/'

    @http_option = {}
    # TODO: LicenseAuto::Base.config({http_proxy})
    http_proxy = Misc.get_http_proxy
    if http_proxy
      @http_option[:http_proxyaddr] = http_proxy[:addr]
      @http_option[:http_proxyport] = http_proxy[:port]
    end
  end

  def find_archive_download_url()
    api_url = 'https://s3-us-west-2.amazonaws.com/rubygems-dumps/?prefix=production/public_postgresql'
    download_url = nil

    response = HTTParty.get(api_url, options=@http_option)
    if response.code == 200
      # DOC: http://www.nokogiri.org/tutorials/searching_a_xml_html_document.html#but_i_m_lazy_and_don_t_want_to_deal_with_namespaces_
      doc = Nokogiri::XML(response.licenses).remove_namespaces!

      xpath = "//Contents[last()]/Key/text()"
      xpath = "//Contents[last()]/Key/text()"
      text_node = doc.xpath(xpath)
      relative_url = text_node.text

      download_url = "#{@download_prefix}#{relative_url}"
    else
      raise Exception("http_status: #{response.status}")
    end
    download_url
  end

  # TODO: download function move into misc.rb or others, like launchpad.rb has the same function
  def download(url)
    file_pathname = nil
    return file_pathname
  end

end

if __FILE__ == $0
  p RubygemsOrgDB.new.find_archive_download_url
end


text:
module Azure::Compute::Mgmt::V2017_12_01
  module Models
    #
    # The List Compute Operation operation response.
    #
    class ComputeOperationListResult

      include MsRestAzure

      # @return [Array<ComputeOperationValue>] The list of compute operations
      attr_accessor :value

      #
      # Mapper for ComputeOperationListResult class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ComputeOperationListResult',
          type: {
            name: 'Composite',
            class_name: 'ComputeOperationListResult',
            model_properties: {
              value: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'value',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ComputeOperationValueElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ComputeOperationValue'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
package connect.ui.adapter;

import android.support.v7.widget.RecyclerView;

import connect.ui.activity.chat.view.holder.MsgBaseHolder;

/**
 * Created by pujin on 2017/1/19.
 */
public abstract class BaseChatAdapter extends RecyclerView.Adapter<MsgBaseHolder> {

}


text:
'use strict';

var locate = require('../locate/escape');

module.exports = escape;
escape.locator = locate;

function escape(eat, value, silent) {
  var self = this;
  var character;
  var node;

  if (value.charAt(0) === '\\') {
    character = value.charAt(1);

    if (self.escape.indexOf(character) !== -1) {
      /* istanbul ignore if - never used (yet) */
      if (silent) {
        return true;
      }

      if (character === '\n') {
        node = {type: 'break'};
      } else {
        node = {
          type: 'text',
          value: character
        };
      }

      return eat('\\' + character)(node);
    }
  }
}


text:
<?php
namespace rakelley\jhframe\test\traits;

/**
 * @coversDefaultClass \rakelley\jhframe\traits\Reproducible
 */
class ReproducibleTest extends
    \rakelley\jhframe\test\helpers\cases\Base
{
    protected $locatorMock;

    protected function setUp()
    {
        $locatorInterface =
            '\rakelley\jhframe\interfaces\services\IServiceLocator';
        $testedTrait = '\rakelley\jhframe\traits\Reproducible';

        $this->locatorMock = $this->getMock($locatorInterface);

        $this->testObj = $this->getMockForTrait($testedTrait);
        $this->testObj->method('getLocator')
                      ->willReturn($this->locatorMock);
    }

    /**
     * @covers ::getNewInstance
     */
    public function testGetNewInstance()
    {
        $this->locatorMock->expects($this->once())
                          ->method('getNew')
                          ->with($this->identicalTo($this->testObj))
                          ->will($this->returnArgument(0));

        $this->assertEquals($this->testObj, $this->testObj->getNewInstance());
    }
}


text:
<!--
Description: feed author homepage
Expect:      not bozo and feed['author_detail']['url'] == u'http://example.com/'
-->
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
  <author>
    <name>Example author</name>
    <email>me@example.com</email>
    <homepage>http://example.com/</homepage>
  </author>
</feed>


text:
require "autotest/growl"

Autotest.add_discovery { "rails" }
Autotest.add_discovery { "rspec2" }

Autotest.add_hook :initialize do |at|
  at.add_mapping(/^spec\/acceptance\/.*_spec.rb$/) { |f| f }
end


text:
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

/**
 * Plugin compatibility for easy-digital-downloads
 * @since 0.7 (builder version)
 * @link https://easydigitaldownloads.com
 */
class ET_Builder_Plugin_Compat_Easy_Digital_Downloads extends ET_Builder_Plugin_Compat_Base {
	/**
	 * Constructor
	 */
	function __construct() {
		$this->plugin_id = "easy-digital-downloads/easy-digital-downloads.php";
		$this->init_hooks();
	}

	/**
	 * Hook methods to WordPress
	 * Note: once this issue is fixed in future version, run version_compare() to limit the scope of the hooked fix
	 * Latest plugin version: 2.6.17
	 * @return void
	 */
	function init_hooks() {
		// Bail if there's no version found
		if ( ! $this->get_plugin_version() ) {
			return;
		}

		// Up to: latest theme version
		if ( ! is_admin() ) {
			add_filter( 'edd_purchase_link_defaults',   array( $this, 'purchase_link_defaults' ) );
			add_filter( 'shortcode_atts_purchase_link', array( $this, 'purchase_link_defaults' ) );
			add_action( 'wp_enqueue_scripts', array( $this, 'add_compatibility_scripts' ), 15 );
		} else {
			add_filter( 'edd_checkout_button_purchase', array( $this, 'modify_edd_checkout_button_purchase' ) );
		}
	}

	/**
	 * Appended et_pb_button for various EDD button so it matches Divi styled button
	 * @param  array initial link configuration
	 * @return array moodified link configuration
	 */
	function purchase_link_defaults ( $args ) {
		if ( isset( $args['class'] ) ) {
			$args['class'] = $args['class'] . ' et_pb_button';
		}

		return $args;
	}

	/**
	 * Addded et_pb_button class for checkout button which has no attribute filter
	 * @param string of HTML of the button
	 * @return string of modified HTML of the button
	 */
	function modify_edd_checkout_button_purchase( $button ) {
		$button = str_replace( 'edd-submit', 'edd-submit et_pb_button', $button );

		return $button;
	}

	/**
	 * Added additional styling & scripts for EDD on Divi
	 * @return void
	 */
	function add_compatibility_scripts() {
		// Normalize UI for Divi Builder
		if ( et_is_builder_plugin_active() ) {
			wp_add_inline_style( 'et-builder-modules-style', "
				.et_divi_builder #et_builder_outer_content .edd_download_inner {
					padding: 0 8px 8px;
					margin: 0 0 10px;
				}

				.et_divi_builder #et_builder_outer_content .edd_download_excerpt p {
					margin-bottom: 25px;
				}

				.et_divi_builder #et_builder_outer_content .edd_purchase_submit_wrapper {
					margin-top: 15px;
					margin-bottom: 35px;
				}

				.et_divi_builder #et_builder_outer_content ul.edd-cart {
					border: 1px solid #eee;
					margin-top: 0.8em;
				}

				.et_divi_builder #et_builder_outer_content ul.edd-cart li {
					padding: 0.8em 1.387em;
					border-bottom: 1px solid #eee;
				}

				.et_divi_builder #et_builder_outer_content ul.edd-cart li:last-child {
					border-bottom: none;
				}

				.et_divi_builder #et_builder_outer_content ul.edd-cart .edd-cart-item span {
					padding: 0 3px;
				}

				.et_divi_builder #et_builder_outer_content ul.edd-cart .edd-cart-item a {
					text-decoration: underline !important;
				}

				.et_divi_builder #et_builder_outer_content .edd_cart_item_image {
					margin-right: 10px;
					display: inline-block;
					vertical-align: middle;
				}

				.et_divi_builder #et_builder_outer_content .edd-cart-meta.edd_subtotal,
				.et_divi_builder #et_builder_outer_content .edd-cart-meta.edd_total {
					background: #f9f9f9;
				}

				.et_divi_builder #et_builder_outer_content .cart_item.edd_checkout {
					padding: 1.387em;
				}

				.et_divi_builder #et_builder_outer_content .et_pb_module a.edd_cart_remove_item_btn {
					text-decoration: underline !important;
				}

				.et_divi_builder #et_builder_outer_content #edd_profile_editor_form .edd-select,
				.et_divi_builder #et_builder_outer_content #edd_profile_editor_form .edd-input {
					margin-bottom: 5px;
				}

				.et_divi_builder #et_builder_outer_content #edd_final_total_wrap {
					margin-bottom: 20px;
				}

				.et_divi_builder #et_builder_outer_content .et_pb_module .et_pb_button {
					border-bottom-style: solid;
					border-bottom-width: 2px;
				}

				.et_divi_builder #et_builder_outer_content .et_pb_module input.et_pb_button:hover {
					padding-right: 1em;
				}
			" );
		}

		// Re-styled button with Divi's button UI using javascript due to lack of filter
		wp_add_inline_script( 'et-builder-modules-script', "
			(function($){
				$(document).ready( function(){
					$('.cart_item.edd_checkout a, input[name=\"edd_register_submit\"], .edd_submit').addClass( 'et_pb_button' ).attr('style', 'padding-right: 1em;');
				});
			})(jQuery)
		");
	}
}
new ET_Builder_Plugin_Compat_Easy_Digital_Downloads;


text:
<?php

namespace Revinate\Sequence;

class TraverseSequence extends RecursiveSequence {
    protected $path;
    protected $pathSeparator = '.';

    /**
     * @param $iterator
     * @param null|string $path
     * @param string $pathSeparator
     * @return TraverseSequence
     */
    public static function make($iterator, $path = null, $pathSeparator = '.') {
        /** @var TraverseSequence $traverseSequence */
        $traverseSequence = parent::make($iterator);
        $traverseSequence->pathSeparator = $pathSeparator;
        $traverseSequence->path = is_null($path) ? '' : $path . $pathSeparator;
        return $traverseSequence;
    }

    /**
     * @return TraverseSequence|MappedSequence
     */
    public function getChildren() {
        $x = $this->current();
        if ($this->canGoDeeper()) {
            return self::make($x, $this->key(), $this->pathSeparator)->setMaxDepth($this->depth - 1);
        } else {
            return IterationTraits::map(
                Sequence::make($x),
                FnGen::fnIdentity(),
                FnString::fnAddPrefix($this->key() . $this->pathSeparator)
            );
        }
    }

    /**
     * @return string
     */
    public function key() {
        $key = parent::key();
        return $this->path . $key;
    }
}