text:
package dk.deck.maven.util;

import java.io.BufferedReader;
import java.io.FilterReader;
import java.io.IOException;
import java.util.Map;

/**
 * A filter reader that replaces variables from a Map with variable names from a map.
 *
 * The the values in the map cannot contain variable indicators,
 * thus those must be resolved in the map before applying to the file
 *
 *
 * @author Jesper Terkelsen
 */
public class VariableFilterReader extends FilterReader {

    private Map<String, String> variables;

    public VariableFilterReader(BufferedReader in, Map<String, String> variables) {
        super(in);
        // TODO replace variables with variables, before using them
        this.variables = VariableUtil.replaceVariables(variables);
    }
    // This variable holds the current line.
    // If null and emitNewline is false, a newline must be fetched.
    private String curLine;
    // This is the index of the first unread character in curLine.
    // If at any time curLineIx == curLine.length, curLine is set to null.
    private int curLineIx;

    // This overridden method fills cbuf with characters read from in.
    @Override
    public int read(char cbuf[], int off, int len) throws IOException {
        // System.out.println("read() off:" + off + " len:" + len);
        // Fetch new line if necessary
        if (curLine == null) {
            getNextLine();
        }

        // Return characters from current line
        if (curLine != null) {

            int num = Math.min(len, Math.min(cbuf.length - off,
                    curLine.length() - curLineIx));
            // Copy characters from curLine to cbuf
            for (int i = 0; i < num; i++) {
                cbuf[off++] = curLine.charAt(curLineIx++);
            }

            // No more characters in curLine
            if (curLineIx == curLine.length()) {
                curLine = null;

                // Is there room for the newline?
                if (num < len && off < cbuf.length) {
                    cbuf[off++] = '\n';
                    num++;
                }
            }

            // Return number of character read
            // System.out.println("read " + num);
            return num;
        } else if (len > 0) {
            // No more characters left in input reader
            return -1;
        } else {
            // Client did not ask for any characters
            return 0;
        }
    }

    // Get next line
    private void getNextLine() throws IOException {
        curLine = ((BufferedReader) in).readLine();
        if (curLine != null) {
            curLineIx = 0;
            // System.out.println("Reading line: " + curLine);
            // Replace variables

            curLine = VariableUtil.replaceVariables(curLine, variables);

            return;
        }
        return;
    }

    @Override
    public boolean ready() throws IOException {
        return curLine != null || in.ready();
    }

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


text:
import THREE from 'three';

export default class Player {
  constructor( playerTicks, id ) {
    this.geometry = new THREE.Geometry();

    const { ticks, start } = playerTicks;

    for ( let i = start, il = ticks.length - start; i < il; i++ ) {
      const tick = ticks[i];
      if ( !tick ) {
        continue;
      }

      for ( let j = 0, jl = tick.length; j < jl; j++ ) {
        const player = tick[j];
        if ( player.id === id ) {
          this.geometry.vertices.push( new THREE.Vector3().copy( player ) );
        }
      }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
<talend-tooltip
        class="datagrid-tooltip"
        position="datagridCtrl.state.playground.grid.tooltip.position"
        requested-state="datagridCtrl.state.playground.grid.showTooltip">

</talend-tooltip>


text:
using System.Windows;
using DataExplorer.Application.Core.Commands;
using DataExplorer.Application.Core.Messages;
using DataExplorer.Application.Views.ScatterPlots;
using DataExplorer.Application.Views.ScatterPlots.Commands;
using DataExplorer.Application.Views.ScatterPlots.Queries;
using DataExplorer.Presentation.Views.ScatterPlots.Commands;
using DataExplorer.Presentation.Views.ScatterPlots.Scalers;
using Moq;
using NUnit.Framework;

namespace DataExplorer.Presentation.Tests.Views.ScatterPlots.Commands
{
    [TestFixture]
    public class ZoomInScatterPlotCommandTests
    {
        private ZoomInScatterPlotCommand _command;
        private Mock<IMessageBus> _mockService;
        private Mock<IPointScaler> _mockScaler;
        private Rect _viewExtent;
        private Size _controlSize;
        private Point _targetPoint;
        private Point _sourcePoint;

        [SetUp]
        public void SetUp()
        {
            _viewExtent = new Rect();
            _controlSize = new Size();
            _sourcePoint = new Point();
            _targetPoint = new Point();

            _mockService = new Mock<IMessageBus>();
            _mockService.Setup(p => p.Execute(It.IsAny<GetViewExtentQuery>()))
                .Returns(_viewExtent);

            _mockScaler = new Mock<IPointScaler>();
            _mockScaler.Setup(p => p.ScalePoint(_sourcePoint, _controlSize, _viewExtent))
                .Returns(_targetPoint);

            _command = new ZoomInScatterPlotCommand(
                _mockService.Object,
                _mockScaler.Object);
        }

        [Test]
        public void TestExecuteShouldZoomIn()
        {
            _command.Execute(_sourcePoint, _controlSize);
            _mockService.Verify(p => p.Execute(It.Is<ZoomInCommand>(q => q.Center == _sourcePoint)),
                Times.Once());
        }
    }
}


text:
// #define DEV
using UnityEngine;
using System.Collections;

public class BioBricksCollapse : MonoBehaviour {

    [SerializeField]
    private Transform[] _bricksTransform;
    private float _distanceBetweenMiddleBricks;
    private float _distanceBetweenSideBricksL;
    private float _distanceBetweenSideBricksR;
    [SerializeField]
    private Texture _referenceTexture;
    private CraftDeviceSlot _craftDeviceSlot;
    private const int _bricksCount = 4;
    private Vector3[] _goTo = new Vector3[_bricksCount];
    private Vector3[] _origin = new Vector3[_bricksCount];

    public delegate void Callback();
    public Callback onBricksStoppedMoving;

    private bool _initialized = false;
    private void lazyInitialize()
    {
        if(!_initialized)
        {

            _distanceBetweenMiddleBricks = Vector3.Distance(_bricksTransform[1].localPosition, _bricksTransform[2].localPosition) - _referenceTexture.width;
            _distanceBetweenSideBricksL = Vector3.Distance(_bricksTransform[0].localPosition, _bricksTransform[1].localPosition) + (_distanceBetweenMiddleBricks / 2) - _referenceTexture.width;
            _distanceBetweenSideBricksR = Vector3.Distance(_bricksTransform[2].localPosition, _bricksTransform[3].localPosition) + (_distanceBetweenMiddleBricks / 2) - _referenceTexture.width;

            _craftDeviceSlot = this.gameObject.GetComponent<CraftDeviceSlot>();

            for (int i = 0; i < _bricksCount; i++)
            {
                _origin[i] = _bricksTransform[i].localPosition;
            }

            _goTo[1] = new Vector3(_bricksTransform[1].localPosition.x + (_distanceBetweenMiddleBricks / 2), _bricksTransform[1].localPosition.y, _bricksTransform[1].localPosition.z);
            _goTo[2] = new Vector3(_bricksTransform[2].localPosition.x - (_distanceBetweenMiddleBricks / 2), _bricksTransform[2].localPosition.y, _bricksTransform[2].localPosition.z);

            _goTo[0] = new Vector3(_bricksTransform[0].localPosition.x + (_distanceBetweenSideBricksL), _bricksTransform[0].localPosition.y, _bricksTransform[0].localPosition.z);
            _goTo[3] = new Vector3(_bricksTransform[3].localPosition.x - (_distanceBetweenSideBricksL), _bricksTransform[3].localPosition.y, _bricksTransform[3].localPosition.z);

            _initialized = true;
        }
    }

    public void setPosition(bool expanded)
    {
        lazyInitialize();

        Vector3[] targetPosition = expanded?_origin:_goTo;

        for(int index = 0; index < _bricksCount; index++)
        {
            if(null != _bricksTransform[index])
            {
                _bricksTransform[index].localPosition = targetPosition[index];
            }
        }

        moveBricks();
    }

    // Use this for initialization
    void Start () {
        lazyInitialize();
    }

    public void startCollapseBricks()
    {
        // Debug.Log(this.GetType() + " startCollapseBricks");

        StopAllCoroutines();

        lazyInitialize();

        moveBricks();

        if(gameObject.activeInHierarchy)
        {
            StartCoroutine(collapseBricks(50f));
        }
        else
        {
            // Debug.Log(this.GetType() + " startCollapseBricks !gameObject.activeInHierarchy");
            setPosition(false);
        }
        onBricksStoppedMoving();
    }

#if DEV
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Keypad0))
        {
            StartCoroutine(expandBricks(50f));
        }
    }
#endif

    IEnumerator collapseBricks(float speed)
    {
        float multiplicator = 1f;
        while (Vector3.Distance(_bricksTransform[0].localPosition , _goTo[0]) >= 0.002f)
        {
            multiplicator += 1f;
            for (int i = 0; i < _bricksCount; i++)
            {
                // Debug.Log(this.GetType() + " executing");
                _bricksTransform[i].localPosition = Vector3.MoveTowards(_bricksTransform[i].localPosition, _goTo[i], speed * Time.unscaledDeltaTime * multiplicator);
            }
            moveBricks();
            yield return null;
        }
        yield return null;
    }

    IEnumerator expandBricks(float speed)
    {
        float multiplicator = 1f;
        while(Mathf.Abs(_bricksTransform[0].localPosition.x - _origin[0].x) >= 0.002f)
        {
            multiplicator += 1f;
            for (int i = 0; i < _bricksCount; i++)
            {
                if (_bricksTransform[i] != null)
                {
                    // Debug.Log(this.GetType() + " executing");
                    _bricksTransform[i].localPosition = Vector3.MoveTowards(_bricksTransform[i].localPosition, _origin[i], speed * Time.unscaledDeltaTime * multiplicator);
                }
            }
            moveBricks();
            yield return null;
        }
        yield return null;
    }

    private void moveBricks()
    {
        // Debug.Log(this.GetType() + " moveBricks");
        CraftZoneDisplayedBioBrick[] slotList = _craftDeviceSlot.getCraftZoneDisplayedBioBricks();
        for (int i = 0; i < slotList.Length; i++)
        {
            if (slotList[i] != null)
            {
                slotList[i].transform.localPosition = _bricksTransform[i].localPosition;
            }
        }
    }

    public void startExpandBricks()
    {
        // Debug.Log(this.GetType() + " startExpandBricks");
        StopAllCoroutines();

        lazyInitialize();

       if(gameObject.activeInHierarchy)
        {
            StartCoroutine(expandBricks(50f));
        }
        else
        {
            setPosition(false);
        }
        onBricksStoppedMoving();
    }
}


text: This is the right menu


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of calidad
 *
 * @author Diego
 */
class calidad extends CI_Controller{
    var $base;
    var $css;
    var $jquery;

    public function __construct() {
        parent::__construct();
        $this->base = $this->config->item('base_url');
        $this->load->library(array('session'));
        $this->load->helper(array('url'));
        $this->load->model(array('calidad_model', 'equivalencia_model', 'produccion_model', 'metod_model'));
    }

    function index () {
        if($this->session->userdata('perfil') == FALSE ||
                $this->session->userdata('perfil') != 'Administrador'
                and $this->session->userdata('perfil') != 'Capturista'
                and $this->session->userdata('perfil') != 'Consultor'){
			redirect(base_url().'login');
		}else{
                    $data['datos'] = $this->calidad_model->query();
                    $data['base'] = $this->base;
                    $data['title'] = 'Datos Calidad';
                    $this->load->view('templates/header',$data);
                    $this->load->view('calidad/filtroCalidad.php', $data);
                    $this->load->view('templates/copyright',$data);
                }
        }

    function consultar(){
        if($this->session->userdata('perfil') == FALSE ||
                $this->session->userdata('perfil') != 'Administrador'
                and $this->session->userdata('perfil') != 'Capturista'
                and $this->session->userdata('perfil') != 'Consultor'){
			redirect(base_url().'login');
		}else{
                    $calidad = new CalidadPojo();
                    $calidad->setTxtFecha($this->input->post('fecha', TRUE));
                    $calidad->setTxtTurno($this->input->post('turno', TRUE));
                    $data['datos'] = $this->calidad_model->Buscar($calidad);
                    $data['css'] = $this->css;
                    $data['base'] = $this->base;
                    $data['jquery'] = $this->jquery;
                    $fil['fecha']= $calidad->getTxtFecha();
                    $fil['turno'] = $calidad->getTxtTurno();
                    $this->load->view('/templates/header',$data);
                    $this->load->view('calidad/filtroCalidadB.php',$fil);
                    $this->load->view('calidad/listCalidad.php', $data);
                    $this->load->view('/templates/copyright',$data);
                }
        }

    function delete($idCalidad){
        if($this->session->userdata('perfil') == FALSE ||
                $this->session->userdata('perfil') != 'Administrador'
                and $this->session->userdata('perfil') != 'Capturista'){

                echo '

Lo sentimos!!!
                             El usuario en sesión no cuenta con los permisos para modificar dicha información.

Si cree que es un error Por favor contacte a su administrador!!!

';
                    $data['datos'] = $this->calidad_model->query();
                    $data['base'] = $this->base;
                    $data['title'] = 'Datos Calidad';
                    $this->load->view('templates/header',$data);
                    $this->load->view('calidad/filtroCalidad.php', $data);
                    $this->load->view('templates/copyright',$data);
		}else{
                    if (isset($idCalidad)){
                    $this->calidad_model->delete($idCalidad);
                }
                $this->consultar();
                }
        }

    function insert() {
        if($this->session->userdata('perfil') == FALSE ||
                $this->session->userdata('perfil') != 'Administrador'
                and $this->session->userdata('perfil') != 'Capturista'){

                echo '

Lo sentimos!!!
                             El usuario en sesión no cuenta con los permisos para modificar dicha información.

Si cree que es un error Por favor contacte a su administrador!!!

';
                }else{
                    $calidad = new CalidadPojo();

                    $calidad->setFecha($this->input->post('fecha', TRUE));
                    $calidad->setTurno($this->input->post('turno', TRUE));
                    $calidad->setIdTripulacion($this->input->post('idTripulacion', TRUE));
                    $calidad->setIdLinea($this->input->post('idLinea', TRUE));
                    $calidad->setIdEsmaltador($this->input->post('idEsmaltador', TRUE));
                    $calidad->setIdDisenio($this->input->post('idDisenio', TRUE));
                    $calidad->setIdFormato($this->input->post('idFormato', TRUE));
                        if (empty($calidad->getFecha())){
                            $data['tripulacion'] = $this->metod_model->getTripulacion();
                            $data['linea'] = $this->metod_model->getLinea();
                            $data['esmaltador'] = $this->metod_model->getEsmaltador();
                            $data['disenio'] = $this->metod_model->getDisenio();
                            $data['formato'] = $this->metod_model->getFormato();
                            $this->load->view('calidad/addCalidad.php',$data);
                             $data['title_page'] = 'Captura Calidad';
                            return;
                        }
                    $this->calidad_model->insert($calidad); // Invocamos nuestro metodo de insertar
                    $this->consultar(); // Invocalosa opción listar
                }
        }

    function quer($idCalidad){
        if($this->session->userdata('perfil') == FALSE ||
                $this->session->userdata('perfil') != 'Administrador'
                and $this->session->userdata('perfil') != 'Capturista'){

                echo '

Lo sentimos!!!
                             El usuario en sesión no cuenta con los permisos para modificar dicha información.

Si cree que es un error Por favor contacte a su administrador!!!

';
                }else{
                    $datos['cal']=  $this->calidad_model->que($idCalidad);
                    $datos['tripulacion'] = $this->metod_model->getTripulacion();
                    $datos['linea'] = $this->metod_model->getLinea();
                    $datos['esmaltador'] = $this->metod_model->getEsmaltador();
                    $datos['disenio'] = $this->metod_model->getDisenio();
                    $datos['formato'] = $this->metod_model->getFormato();
                    $this->load->view('calidad/editCalidad.php',$datos);
                }
        }

    function que($idCalidad){
        if($this->session->userdata('perfil') == FALSE ||
                $this->session->userdata('perfil') != 'Administrador'
                and $this->session->userdata('perfil') != 'Capturista'){

                echo '

Lo sentimos!!!
                             El usuario en sesión no cuenta con los permisos para modificar dicha información.

Si cree que es un error Por favor contacte a su administrador!!!

';
                }else{
                    $datos['cal']=  $this->calidad_model->que($idCalidad);
                    $datos['tripulacion'] = $this->metod_model->getTripulacion();
                    $datos['linea'] = $this->metod_model->getLinea();
                    $datos['esmaltador'] = $this->metod_model->getEsmaltador();
                    $datos['disenio'] = $this->metod_model->getDisenio();
                    $datos['formato'] = $this->metod_model->getFormato();
                    $this->load->view('calidad/delCalidad.php',$datos);
                }
        }

    function update($idCalidad){
        if($this->session->userdata('perfil') == FALSE ||
                $this->session->userdata('perfil') != 'Administrador'
                and $this->session->userdata('perfil') != 'Capturista'){

                echo '

Lo sentimos!!!
                             El usuario en sesión no cuenta con los permisos para modificar dicha información.

Si cree que es un error Por favor contacte a su administrador!!!

';
                    $data['datos'] = $this->calidad_model->query();
                    //$data['datos'] = $this->calidad_model->query();
                    $data['base'] = $this->base;
                    $data['title'] = 'Datos Calidad';
                    $this->load->view('templates/header',$data);
                    $this->load->view('calidad/filtroCalidad.php', $data);
                    $this->load->view('templates/copyright',$data);

		}else{
                    $calidad = new CalidadPojo();
                    $calidad->setIdCalidad($idCalidad);
                    $calidad->setFecha($this->input->post('fecha',TRUE));
                    $calidad->setTurno($this->input->post('turno', TRUE));
                    $calidad->setIdTripulacion($this->input->post('idTripulacion', TRUE));
                    $calidad->setIdLinea($this->input->post('idLinea', TRUE));
                    $calidad->setIdEsmaltador($this->input->post('idEsmaltador', TRUE));
                    $calidad->setIdDisenio($this->input->post('idDisenio', TRUE));
                    $calidad->setIdFormato($this->input->post('idFormato', TRUE));
                        if (empty($calidad->getFecha())){
                            $data['tripulacion'] = $this->metod_model->getTripulacion();
                            $data['linea'] = $this->metod_model->getLinea();
                            $data['esmaltador'] = $this->metod_model->getEsmaltador();
                            $data['disenio'] = $this->metod_model->getDisenio();
                            $data['formato'] = $this->metod_model->getFormato();

                            $data['title_page'] = 'Actualiza Captura Calidad';
                            $this->load->view('calidad/editCalidad.php',$data);

                            return;
                        }
                    $this->calidad_model->update($calidad); // Invocamos nuestro metodo de insertar
                    $this->consultar(); // Invocamos nuestro metodo listar
                }
        }

    public function getTripulacion(){
        if($this->input->post('tripulacion')){
            $tripulacion = $this->input->post('tripulacion');
            $tripulaciones = $this->metod_model->getTripulacion($tripulacion);
            foreach ($tripulaciones as $fila){
                    ?>
                    <option value="<?= $fila->Tripulacion ?>"></option>
                    <?php
                }
            }
        }

    public function getLinea(){
        if($this->input->post('linea')){
            $linea = $this->input->post('linea');
            $lineas = $this->metod_model->getLinea($linea);
                foreach ($lineas as $fila){
                    ?>
                    <option value="<?= $fila->Linea ?>"></option>
                    <?php
                }
            }
        }

    public function getEsmaltador(){
        if($this->input->post('esmaltador')){
            $esmaltador = $this->input->post('esmaltador');
            $esmaltadores = $this->metod_model->getEsmaltador($esmaltador);
                foreach ($esmaltadores as $fila){
                    ?>
                    <option value="<?= $fila->Esmaltador ?>"></option>
                    <?php
                }
            }
        }

    public function getDisenio(){
        if($this->input->post('disenio')){
            $disenio = $this->input->post('Disenio');
            $disenios = $this->metod_model->getDisenio($disenio);
                foreach ($disenios as $fila){
                    ?>
                    <option value="<?= $fila->Disenio ?>"></option>
                    <?php
                }
            }
        }

    public function getFormato(){
        if($this->input->post('formato')){
            $formato = $this->input->post('Formato');
            $fomatos = $this->metod_model->getFormato($formato);
                foreach ($fomatos as $fila){
                    ?>
                    <option value="<?= $fila->Formato ?>"></option>
                    <?php
                }
            }
        }
}


text:
from model.contact import ContactGroup
import random
import string
import jsonpickle
import os.path
import getopt
import sys

try:
    opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", "file"])
except getopt.GetoptError as err:
    getopt.usage()
    sys.exit(2)

n = 4
f = "data/contacts.json"

for o, a in opts:
    if o == "-n":
        n = int(a)
    elif o =="-f":
        f=a

def random_string(prefix, maxlen):
    #symbols = string.ascii_letters + string.digits + string.punctuation + " "*10
    symbols = string.ascii_letters + string.digits + " " * 1
    return prefix +"".join([random.choice(symbols) for i in range(random.randrange(maxlen))])

testdata = [ContactGroup(firstname="", lastname="", middlename="", company="TTY", address="Ekaterinburg", home="", work="", mobile="", email="")] + [
    ContactGroup(firstname=random_string("firstname", 10), lastname=random_string("lastname", 10), middlename=random_string("middlename", 10), company=random_string("company", 20),
                 address=random_string("address", 30), home=random_string("home", 10), work=random_string("work", 10), mobile=random_string("mobile", 10),
                 email=random_string("email", 10), email2=random_string("email2", 10))
    for i in range(n)
]

file=os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", f)

with open(file, "w") as out:
    jsonpickle.set_encoder_options("json", indent=2)
    out.write(jsonpickle.encode(testdata))


text:
package com.google.api.gax.tracing;

import com.google.api.core.InternalApi;
import com.google.api.gax.rpc.ResponseObserver;
import com.google.api.gax.rpc.StreamController;
import com.google.common.base.Preconditions;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Nonnull;

/**
 * A {@link ResponseObserver} to mark a started operation trace as finished.
 *
 * <p>The operation will be marked as complete before notifying the wrapped observer. Which means
 * that the span of the instrumentation will not include processing of the innerObserver's
 * onComplete.
 */
@InternalApi
class TracedResponseObserver<ResponseT> implements ResponseObserver<ResponseT> {
  private final ApiTracer tracer;
  private final ResponseObserver<ResponseT> innerObserver;
  private AtomicBoolean wasCancelled;

  TracedResponseObserver(
      @Nonnull ApiTracer tracer, @Nonnull ResponseObserver<ResponseT> innerObserver) {
    this(tracer, innerObserver, new AtomicBoolean());
  }

  TracedResponseObserver(
      @Nonnull ApiTracer tracer,
      @Nonnull ResponseObserver<ResponseT> innerObserver,
      @Nonnull AtomicBoolean wasCancelled) {
    this.tracer = Preconditions.checkNotNull(tracer, "tracer");
    this.innerObserver = Preconditions.checkNotNull(innerObserver, "innerObserver");
    this.wasCancelled = Preconditions.checkNotNull(wasCancelled, "wasCancelled");
  }

  @Override
  public void onStart(final StreamController controller) {
    innerObserver.onStart(
        new StreamController() {
          @Override
          public void cancel() {
            wasCancelled.set(true);
            controller.cancel();
          }

          @Override
          public void disableAutoInboundFlowControl() {
            controller.disableAutoInboundFlowControl();
          }

          @Override
          public void request(int count) {
            controller.request(count);
          }
        });
  }

  @Override
  public void onResponse(ResponseT response) {
    tracer.responseReceived();
    innerObserver.onResponse(response);
  }

  @Override
  public void onError(Throwable t) {
    // Only mark explicit user cancellations. Since the retry logic can also throw
    // CancellationException, we can't simply check that t is an instance of a
    // CancellationException.
    if (wasCancelled.get()) {
      tracer.operationCancelled();
    } else {
      tracer.operationFailed(t);
    }
    innerObserver.onError(t);
  }

  @Override
  public void onComplete() {
    tracer.operationSucceeded();
    innerObserver.onComplete();
  }
}


text:
#if (UNITY_ANDROID || (UNITY_IPHONE && !NO_GPGS))
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace GooglePlayGames.Native.Cwrapper {
internal static class Sentinels {

    [DllImport(SymbolLocation.NativeSymbolLocation)]
    internal static extern /* from(MultiplayerParticipant_t) */ IntPtr Sentinels_AutomatchingParticipant();

}
}
#endif


text:
package org.wso2.carbon.identity.common.internal.cookie;

/**
 * Cookie configuration key.
 */
public class CookieConfigKey {

    private String name;
    private String domain;

    public CookieConfigKey() {
    }

    public CookieConfigKey(String name, String domain) {
        this.name = name;
        this.domain = domain;
    }

    public String getDomain() {
        return domain;
    }

    public void setType(String type) {
        this.domain = type;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        CookieConfigKey that = (CookieConfigKey) o;

        if (!domain.equals(that.domain)) {
            return false;
        }
        return name.equals(that.name);

    }

    @Override
    public int hashCode() {
        int result = domain.hashCode();
        result = 31 * result + name.hashCode();
        return result;
    }
}


text:
/*global describe, beforeEach, it*/

var path    = require('path');
var helpers = require('yeoman-generator').test;

describe('cornelio generator', function () {
  'use strict';
  beforeEach(function (done) {
    helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
      if (err) {
        return done(err);
      }

      this.app = helpers.createGenerator('cornelio:app', [
        '../../app'
      ]);
      done();
    }.bind(this));
  });

  it('creates expected files', function () {
    var expected = [
      'bower.json',
      '.bowerrc',
      '.gitignore',
      '.travis.yml',
      'README.md',
      'Gruntfile.js',
      '.editorconfig',
      '.jshintrc',
      'test/index.html',
      'test/lib/chai.js',
      'test/lib/expect.js',
      'test/lib/mocha/mocha.css',
      'test/lib/mocha/mocha.js',
      'test/spec/test.js',
      'src/index.html',
      'src/.htaccess',
      'src/404.html',
      'src/favicon.ico',
      'src/robots.txt',
      'src/css/main.less',
      'src/js/app.js',
      'src/js/main.js',
      'src/img/logo.png',
      'src/templates/allo.html',
    ];

    helpers.mockPrompt(this.app, {
      'someOption': true
    });
    this.app.options['skip-install'] = true;
    this.app.run({}, function () {
      helpers.assertFile(expected);
    });
  });
});


text:
export const UPSERT_SETTINGS_REQUEST = 'UPSERT_SETTINGS_REQUEST'
export const UPSERT_SETTINGS_RESPONSE = 'UPSERT_SETTINGS_RESPONSE'

export const GET_SETTINGS_REQUEST = 'GET_SETTINGS_REQUEST'
export const GET_SETTINGS_RESPONSE = 'GET_SETTINGS_RESPONSE'

export const GET_INIT_CONF_REQUEST = 'GET_INIT_CONF_REQUEST'
export const GET_INIT_CONF_RESPONSE = 'GET_INIT_CONF_RESPONSE'
export const SAVE_INIT_CONFIG_REQUEST = 'SAVE_INIT_CONFIG_REQUEST'
export const SAVE_INIT_CONFIG_RESPONSE = 'SAVE_INIT_CONFIG_RESPONSE'


text:
require "test_helper"

class AdditionTest < Minitest::Test
  def setup
    @addition = GitDiff::Line::Addition.new("+ addition")
  end

  def test_addition_is_true
    assert @addition.addition?
  end

  def test_deletion_is_false
    refute @addition.deletion?
  end
end


text:
namespace Microsoft.Azure.Management.KubernetesConfiguration.Models
{
    using System.Linq;

    /// <summary>
    /// ARM proxy resource.
    /// </summary>
    public partial class ProxyResource : Resource
    {
        /// <summary>
        /// Initializes a new instance of the ProxyResource class.
        /// </summary>
        public ProxyResource()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the ProxyResource class.
        /// </summary>
        /// <param name="id">Resource Id</param>
        /// <param name="name">Resource name</param>
        /// <param name="type">Resource type</param>
        /// <param name="systemData">Top level metadata
        /// https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources</param>
        public ProxyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData))
            : base(id, name, type, systemData)
        {
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

    }
}


text:
/**
 * @file board_dma_alloc.c
 *
 * Provide the board dma allocator interface.
 */

/************************************************************************************
 * Included Files
 ************************************************************************************/

#include <px4_config.h>
#include "board_config.h"

#include <stdint.h>
#include <errno.h>
#include <nuttx/mm/gran.h>

#include <perf/perf_counter.h>

/************************************************************************************
 * Definitions
 ************************************************************************************/

/************************************************************************************
 * Private Functions
 ************************************************************************************/

/************************************************************************************
 * Public Functions
 ************************************************************************************/

/************************************************************************************
 * Name: board_dma_alloc_init
 *
 * Description:
 *   All boards may optionally provide this API to instantiate a pool of
 *   memory for uses with FAST FS DMA operations.
 *
 ************************************************************************************/
#if defined(BOARD_DMA_ALLOC_POOL_SIZE)

#  if !defined(CONFIG_GRAN) || !defined(CONFIG_FAT_DMAMEMORY)
#    error microSD DMA support requires CONFIG_GRAN and CONFIG_FAT_DMAMEMORY
#  endif

static GRAN_HANDLE dma_allocator;

/*
 * The DMA heap size constrains the total number of things that can be
 * ready to do DMA at a time.
 *
 * For example, FAT DMA depends on one sector-sized buffer per filesystem plus
 * one sector-sized buffer per file.
 *
 * We use a fundamental alignment / granule size of 64B; this is sufficient
 * to guarantee alignment for the largest STM32 DMA burst (16 beats x 32bits).
 */
static uint8_t g_dma_heap[BOARD_DMA_ALLOC_POOL_SIZE] __attribute__((aligned(64)));
static perf_counter_t g_dma_perf;
static uint16_t dma_heap_inuse;
static uint16_t dma_heap_peak_use;
/****************************************************************************
 * Public Functions
 ****************************************************************************/
__EXPORT int board_dma_alloc_init(void)
{
	dma_allocator = gran_initialize(g_dma_heap,
					sizeof(g_dma_heap),
					7,  /* 128B granule - must be > alignment (XXX bug?) */
					6); /* 64B alignment */

	if (dma_allocator == NULL) {
		return -ENOMEM;

	} else {
		dma_heap_inuse = 0;
		dma_heap_peak_use = 0;
		g_dma_perf = perf_alloc(PC_COUNT, "dma_alloc");
	}

	return OK;
}

__EXPORT int board_get_dma_usage(uint16_t *dma_total, uint16_t *dma_used, uint16_t *dma_peak_used)
{
	*dma_total = sizeof(g_dma_heap);
	*dma_used = dma_heap_inuse;
	*dma_peak_used = dma_heap_peak_use;

	return OK;
}
/*
 * DMA-aware allocator stubs for the FAT filesystem.
 */

__EXPORT void *fat_dma_alloc(size_t size);
__EXPORT void fat_dma_free(FAR void *memory, size_t size);

void *
fat_dma_alloc(size_t size)
{
	void *rv = NULL;
	perf_count(g_dma_perf);
	rv = gran_alloc(dma_allocator, size);

	if (rv != NULL) {
		dma_heap_inuse += size;

		if (dma_heap_inuse > dma_heap_peak_use) {
			dma_heap_peak_use = dma_heap_inuse;
		}
	}

	return rv;
}

void
fat_dma_free(FAR void *memory, size_t size)
{
	gran_free(dma_allocator, memory, size);
	dma_heap_inuse -= size;
}
#endif /* defined(BOARD_DMA_ALLOC_POOL_SIZE) */


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>zen3d - dashed lines</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<link type="text/css" rel="stylesheet" href="main.css">

        zen3d - dashed lines


text:
<?php
namespace PhalconX\Php\Lint\Errors;

abstract class AbstractError implements ErrorInterface
{
    private $file;

    private $line;

    public function getFile()
    {
        return $this->file;
    }

    public function setFile($file)
    {
        $this->file = $file;
        return $this;
    }

    public function getLine()
    {
        return $this->line;
    }

    public function setLine($line)
    {
        $this->line = $line;
        return $this;
    }
}


text:
<?php
/**
 * @package  newsletter
 */

/**
 * Create a form that a user can use to unsubscribe from a mailing list
 */
class UnsubscribeController extends Page_Controller
{

    public static $days_unsubscribe_link_alive = 30;

    private static $allowed_actions = array(
        'index',
        'done',
        'undone',
        'resubscribe',
        'Form',
        'ResubscribeForm',
        'sendUnsubscribeLink'
    );

    public function __construct($data = null)
    {
        parent::__construct($data);
    }

    public function init()
    {
        parent::init();
        Requirements::css('newsletter/css/SubscriptionPage.css');
        Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
        Requirements::javascript(THIRDPARTY_DIR . '/jquery-validate/jquery.validate.min.js');
    }

    public static function set_days_unsubscribe_link_alive($days)
    {
        self::$days_unsubscribe_link_alive = $days;
    }

    public static function get_days_unsubscribe_link_alive()
    {
        return self::$days_unsubscribe_link_alive;
    }

    public function RelativeLink($action = null)
    {
        return "unsubscribe/$action";
    }

    private function getRecipient()
    {
        $validateHash = Convert::raw2sql($this->urlParams['ValidateHash']);
        if ($validateHash) {
            $recipient = Recipient::get()->filter("ValidateHash", $validateHash)->first();
            $now = date('Y-m-d H:i:s');
            if ($now <= $recipient->ValidateHashExpired) {
                return $recipient;
            }
        }
    }

    private function getMailingLists($recipient = null)
    {
        $siteConfig = DataObject::get_one("SiteConfig");
        if ($siteConfig->GlobalUnsubscribe) {
            return $mailinglists = $recipient->MailingLists();
        } else {
            $mailinglistIDs = $this->urlParams['IDs'];
            if ($mailinglistIDs) {
                $mailinglistIDs = explode(',', $mailinglistIDs);
                return $mailinglists = DataList::create("MailingList")
                    ->filter(array('ID' => $mailinglistIDs));
            }
        }
    }

    private function getMailingListsByUnsubscribeRecords($recordIDs)
    {
        $recordIDs = explode(',', $recordIDs);
        $unsubscribeRecords = DataList::create("UnsubscribeRecord")
            ->filter(array('ID' => $recordIDs));
        $mailinglists = new ArrayList();
        if ($unsubscribeRecords->count()) {
            foreach ($unsubscribeRecords as $record) {
                $list = DataObject::get_by_id("MailingList", $record->MailingListID);
                if ($list && $list->exists()) {
                    $mailinglists->push($list);
                }
            }
        }
        return $mailinglists;
    }

    public function index()
    {
        $recipient = $this->getRecipient();
        $mailinglists = $this->getMailingLists($recipient);
        if ($recipient && $recipient->exists() && $mailinglists && $mailinglists->count()) {
            $unsubscribeRecordIDs = array();
            $this->unsubscribeFromLists($recipient, $mailinglists, $unsubscribeRecordIDs);
            $url = Director::absoluteBaseURL() . $this->RelativeLink('done') . "/" . $recipient->ValidateHash . "/" .
                    implode(",", $unsubscribeRecordIDs);
            Controller::curr()->redirect($url, 302);
            return $url;
        } else {
            return $this->customise(array(
                'Title' => _t('Newsletter.INVALIDLINK', 'Invalid Link'),
                'Content' => _t('Newsletter.INVALIDUNSUBSCRIBECONTENT', 'This unsubscribe link is invalid')
            ))->renderWith('Page');
        }
    }

    public function done()
    {
        $unsubscribeRecordIDs = $this->urlParams['IDs'];
        $hash = $this->urlParams['ID'];
        if ($unsubscribeRecordIDs) {
            $fields = new FieldList(
                new HiddenField("UnsubscribeRecordIDs", "", $unsubscribeRecordIDs),
                new HiddenField("Hash", "", $hash),
                new LiteralField("ResubscribeText",
                    "Click the \"Resubscribe\" if you unsubscribed by accident and want to re-subscribe")
            );

            $actions = new FieldList(
                new FormAction("resubscribe", "Resubscribe")
            );

            $form = new Form($this, "ResubscribeForm", $fields, $actions);
            $form->setFormAction($this->Link('resubscribe'));
            $mailinglists = $this->getMailingListsByUnsubscribeRecords($unsubscribeRecordIDs);

            if ($mailinglists && $mailinglists->count()) {
                $listTitles = "";
                foreach ($mailinglists as $list) {
                    $listTitles .= "
".$list->Title."
";
                }
                $recipient = $this->getRecipient();
                $title = $recipient->FirstName?$recipient->FirstName:$recipient->Email;
                $content = sprintf(
                    _t('Newsletter.UNSUBSCRIBEFROMLISTSSUCCESS',
                        '
Thank you, %s.

You will no longer receive: %s.'),
                    $title,
                    "
".$listTitles."
"
                );
            } else {
                $content =
                    _t('Newsletter.UNSUBSCRIBESUCCESS', 'Thank you.
You have been unsubscribed successfully');
            }
        }

        return $this->customise(array(
            'Title' => _t('UNSUBSCRIBEDTITLE', 'Unsubscribed'),
            'Content' => $content,
            'Form' => $form
        ))->renderWith('Page');
    }

    /**
    * Unsubscribe the user from the given lists.
    */
    public function resubscribe()
    {
        if (isset($_POST['Hash']) && isset($_POST['UnsubscribeRecordIDs'])) {
            $recipient = DataObject::get_one(
                'Recipient',
                "\"ValidateHash\" = '" . Convert::raw2sql($_POST['Hash']) . "'"
            );
            $mailinglists = $this->getMailingListsByUnsubscribeRecords($_POST['UnsubscribeRecordIDs']);
            if ($recipient && $recipient->exists() && $mailinglists && $mailinglists->count()) {
                $recipient->MailingLIsts()->addMany($mailinglists);
            }
            $url = Director::absoluteBaseURL() . $this->RelativeLink('undone') . "/" . $_POST['Hash']. "/" .
                    $_POST['UnsubscribeRecordIDs'];
            Controller::curr()->redirect($url, 302);
            return $url;
        } else {
            return $this->customise(array(
                'Title' => _t('Newsletter.INVALIDRESUBSCRIBE', 'Invalid resubscrible'),
                'Content' => _t('Newsletter.INVALIDRESUBSCRIBECONTENT', 'This resubscribe link is invalid')
            ))->renderWith('Page');
        }
    }

    public function undone()
    {
        $recipient = $this->getRecipient();
        $mailinglists = $this->getMailingLists($recipient);

        if ($mailinglists && $mailinglists->count()) {
            $listTitles = "";
            foreach ($mailinglists as $list) {
                $listTitles .= "
".$list->Title."
";
            }

            $title = $recipient->FirstName?$recipient->FirstName:$recipient->Email;
            $content = sprintf(
                _t('Newsletter.RESUBSCRIBEFROMLISTSSUCCESS',
                    '
Thank you. %s!

You have been resubscribed to: %s.'),
                $title,
                "
".$listTitles."
"
            );
        } else {
            $content =_t(
                'Newsletter.RESUBSCRIBESUCCESS',
                'Thank you.
You have been resubscribed successfully.'
            );
        }

        return $this->customise(array(
            'Title' => _t('Newsletter.RESUBSCRIBED', 'Resubscribed'),
            'Content' => $content,
        ))->renderWith('Page');
    }

    protected function unsubscribeFromLists($recipient, $lists, &$recordsIDs)
    {
        if ($lists && $lists->count()) {
            foreach ($lists as $list) {
                $recipient->Mailinglists()->remove($list);
                $unsubscribeRecord = new UnsubscribeRecord();
                $unsubscribeRecord->unsubscribe($recipient, $list);
                $recordsIDs[] = $unsubscribeRecord->ID;
            }
        }
    }

    /** Send an email with a link to unsubscribe from all this user's newsletters */
    public function sendUnsubscribeLink(SS_HTTPRequest $request)
    {
        //get the form object (we just need its name to set the session message)
        $form = NewsletterContentControllerExtension::getUnsubscribeFormObject($this);

        $email = Convert::raw2sql($request->requestVar('email'));
        $recipient = Recipient::get()->filter('Email', $email)->First();

        if ($recipient) {
            //get the IDs of all the Mailing Lists this user is subscribed to
            $lists = $recipient->MailingLists()->column('ID');
            $listIDs = implode(',', $lists);

            $days = UnsubscribeController::get_days_unsubscribe_link_alive();
            if ($recipient->ValidateHash) {
                $recipient->ValidateHashExpired = date('Y-m-d H:i:s', time() + (86400 * $days));
                $recipient->write();
            } else {
                $recipient->generateValidateHashAndStore($days);
            }

            $templateData = array(
                'FirstName' => $recipient->FirstName,
                'UnsubscribeLink' =>
                    Director::absoluteBaseURL() . "unsubscribe/index/" . $recipient->ValidateHash . "/$listIDs"
            );
            //send unsubscribe link email
            $email = new Email();
            $email->setTo($recipient->Email);
            $from = Email::getAdminEmail();
            $email->setFrom($from);
            $email->setTemplate('UnsubscribeLinkEmail');
            $email->setSubject(_t(
                'Newsletter.ConfirmUnsubscribeSubject',
                'Confirmation of your unsubscribe request'
            ));
            $email->populateTemplate($templateData);
            $email->send();

            $form->sessionMessage(
                _t(
                    'Newsletter.GoodEmailMessage',
                    'You have been sent an email containing an unsubscribe link'
                ),
                'good'
            );
        } else {
            //not found Recipient, just reload the form
            $form->sessionMessage(_t('Newsletter.BadEmailMessage', 'Email address not found'), "bad");
        }

        Controller::curr()->redirectBack();
    }
}


text:
blynk = {}
blynk.__index = blynk
blynk.commands = { register = 1, login = 2, ping = 6, notify = 14, bridge = 15, property = 19, hardware = 20, tweet = 12, email = 13  }

function blynk.dump(self,c,symb) -- function will be deleted unless "trace" defined "true" in blynk.new()
   local t, i, status_value, cmd = ''
   local f = ''
   local c1=c
   while #c1 > 1 do
       t, i, status_value = struct.unpack(">BI2I2", c1)
       f = f .. ((#f>0) and "\n" or "") .. symb .. ": " .. t .. " "  .. i .. " " .. status_value
       if t ~= 0 and status_value > 0 then
          t, i, cmd = struct.unpack(">BI2I2c0", c1)
          c1 = string.sub(c1,#cmd+6)
          cmd = self:split(cmd)
          f = f .. " '" .. table.concat(cmd, ' ') .. "'"
       else
          c1 = string.sub(c1, 6)
       end
   end
   local bytes = {}
   table.insert(bytes, string.format("0x%x", t))
   table.insert(bytes, string.format("0x%x", i))
   table.insert(bytes, string.format("0x%x", status_value))
   for i=6,#c do
      table.insert(bytes, string.format("%x", string.byte(c,i)))
   end
   print (f .. " -- " .. table.concat(bytes, ' '))
end

function blynk.new(token, setup, trace)  -- options: setup_callback, trace,
   local self = setmetatable({}, blynk)
   self.token = token
   self.timer_id = tmr.create()
   self.message_id = 1
   self.pings = 0
   self.callbacks = {}
   self.message_queue = {}
   if setup == nil then setup = blynk_autogpio end -- if callback = nil, do autogpio
   if setup then setup(self) end -- if callback = false, omit
   if not trace then blynk.dump = nil end -- if no debug tracing, delete function
   if not self.autogpio then blynk_autogpio=nil end  -- if no auto, delete its function
   return self
end

function blynk.connect(self)
   self.conn = net.createConnection(net.TCP, 0 )
   self.conn:on ( "receive", function (s, c)
        if self.callbacks["receive"] ~= nil then self.callbacks["receive"](s,c) end
        local t, i, status_value, cmd = ''
        --uart.write(0,"["..#c.." RX: ") for i=1,#c do uart.write(0,string.format(" %x",string.byte(c,i))) end print("]")
        if self.dump then self:dump(c, "in")  end
        local c1 = c
        while #c1>4 do
            t, i, status_value = struct.unpack(">BI2I2", c1)
            --print ( "type: " .. t .. " id: " .. i .. " status: " .. (status_value or 'nil') )
            if t == 0 then
                self.pings = 0  -- server is answering our pings
            else
                if status_value > 0 then -- ln
                   t, i, cmd = struct.unpack(">BI2I2c0", c1)
                   c1 = string.sub(c1,#cmd+1)
                   cmd = self:split(cmd)
                   local f = self.callbacks[cmd[1]]
                   if f ~= nil then
                      f ( cmd, i )
                   end
                end
            end
            c1 = string.sub(c1,6)
        end

        if not tmr.state(self.timer_id) then
           tmr.register(self.timer_id, 10000, tmr.ALARM_AUTO, function()
               self:queue(self:create_message(6, self:mid(), nil),s)
               self.pings = self.pings+1
               if self.pings > 2 then self.pings = 0 wifi.sta.disconnect() end
           end)
           tmr.start(self.timer_id)
        end
   end)

   self.conn:on ( "sent", function(s)
        self:process_queue(s)
   end)

   self.conn:on ( "connection", function (s)
        print ( "Connected to blynk, logging in")
        self:queue( self:create_message(blynk.commands["login"], self:mid(), self.token), s)
        if self.callbacks["connection"] ~= nil then self.callbacks["connection"](s) end
   end)
   self.conn:on ( "disconnection", function (s,c)
        if tmr.state(self.timer_id) then
           tmr.stop(self.timer_id)
        end
        print ( "Disconnected from blynk", c)
        if self.callbacks["disconnection"] ~= nil then
           self.callbacks["disconnection"](c)
        end
        -- now loop waiting for net to restore ...
        wifi.sta.connect()
        tmr.start(self.timer_id, 3000, 1, function()
           if wifi.sta.getip()~=nil then
             tmr.unregister(self.timer_id)
             print("Network OK") -- so restart blynk
             node.task.post(function() b:connect()  end)
           end
        end)

   end)
   self.conn:connect(8442, "blynk-cloud.com")
   return self
end
-- end of part1
dofile("lib-BLYNK2.lua")