text:
.class final Landroid/hardware/SystemSensorManager$TriggerEventQueue;
.super Landroid/hardware/SystemSensorManager$BaseEventQueue;
.source "SystemSensorManager.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/hardware/SystemSensorManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = "TriggerEventQueue"
.end annotation

# instance fields
.field private final mListener:Landroid/hardware/TriggerEventListener;

.field private final mTriggerEvents:Landroid/util/SparseArray;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/util/SparseArray",
            "<",
            "Landroid/hardware/TriggerEvent;",
            ">;"
        }
    .end annotation
.end field

# direct methods
.method public constructor <init>(Landroid/hardware/TriggerEventListener;Landroid/os/Looper;Landroid/hardware/SystemSensorManager;)V
    .locals 1
    .param p1, "listener"    # Landroid/hardware/TriggerEventListener;
    .param p2, "looper"    # Landroid/os/Looper;
    .param p3, "manager"    # Landroid/hardware/SystemSensorManager;

    .prologue
    .line 452
    invoke-direct {p0, p2, p3}, Landroid/hardware/SystemSensorManager$BaseEventQueue;-><init>(Landroid/os/Looper;Landroid/hardware/SystemSensorManager;)V

    .line 448
    new-instance v0, Landroid/util/SparseArray;

    invoke-direct {v0}, Landroid/util/SparseArray;-><init>()V

    iput-object v0, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mTriggerEvents:Landroid/util/SparseArray;

    .line 453
    iput-object p1, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mListener:Landroid/hardware/TriggerEventListener;

    .line 454
    return-void
.end method

# virtual methods
.method public addSensorEvent(Landroid/hardware/Sensor;)V
    .locals 4
    .param p1, "sensor"    # Landroid/hardware/Sensor;

    .prologue
    .line 458
    new-instance v0, Landroid/hardware/TriggerEvent;

    iget-object v1, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mManager:Landroid/hardware/SystemSensorManager;

    # getter for: Landroid/hardware/SystemSensorManager;->mTargetSdkLevel:I
    invoke-static {v1}, Landroid/hardware/SystemSensorManager;->access$100(Landroid/hardware/SystemSensorManager;)I

    move-result v1

    invoke-static {p1, v1}, Landroid/hardware/Sensor;->getMaxLengthValuesArray(Landroid/hardware/Sensor;I)I

    move-result v1

    invoke-direct {v0, v1}, Landroid/hardware/TriggerEvent;-><init>(I)V

    .line 460
    .local v0, "t":Landroid/hardware/TriggerEvent;
    iget-object v2, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mTriggerEvents:Landroid/util/SparseArray;

    monitor-enter v2

    .line 461
    :try_start_0
    iget-object v1, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mTriggerEvents:Landroid/util/SparseArray;

    invoke-virtual {p1}, Landroid/hardware/Sensor;->getHandle()I

    move-result v3

    invoke-virtual {v1, v3, v0}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V

    .line 462
    monitor-exit v2

    .line 463
    return-void

    .line 462
    :catchall_0
    move-exception v1

    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method protected dispatchFlushCompleteEvent(I)V
    .locals 0
    .param p1, "handle"    # I

    .prologue
    .line 501
    return-void
.end method

.method protected dispatchSensorEvent(I[FIJ)V
    .locals 6
    .param p1, "handle"    # I
    .param p2, "values"    # [F
    .param p3, "accuracy"    # I
    .param p4, "timestamp"    # J

    .prologue
    const/4 v5, 0x0

    .line 477
    # getter for: Landroid/hardware/SystemSensorManager;->sHandleToSensor:Landroid/util/SparseArray;
    invoke-static {}, Landroid/hardware/SystemSensorManager;->access$000()Landroid/util/SparseArray;

    move-result-object v3

    invoke-virtual {v3, p1}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/hardware/Sensor;

    .line 478
    .local v1, "sensor":Landroid/hardware/Sensor;
    const/4 v2, 0x0

    .line 479
    .local v2, "t":Landroid/hardware/TriggerEvent;
    iget-object v4, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mTriggerEvents:Landroid/util/SparseArray;

    monitor-enter v4

    .line 480
    :try_start_0
    iget-object v3, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mTriggerEvents:Landroid/util/SparseArray;

    invoke-virtual {v3, p1}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;

    move-result-object v3

    move-object v0, v3

    check-cast v0, Landroid/hardware/TriggerEvent;

    move-object v2, v0

    .line 481
    monitor-exit v4
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 482
    if-nez v2, :cond_0

    .line 483
    const-string v3, "SensorManager"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Error: Trigger Event is null for Sensor: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 497
    :goto_0
    return-void

    .line 481
    :catchall_0
    move-exception v3

    :try_start_1
    monitor-exit v4
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v3

    .line 488
    :cond_0
    iget-object v3, v2, Landroid/hardware/TriggerEvent;->values:[F

    iget-object v4, v2, Landroid/hardware/TriggerEvent;->values:[F

    array-length v4, v4

    invoke-static {p2, v5, v3, v5, v4}, Ljava/lang/System;->arraycopy([FI[FII)V

    .line 489
    iput-wide p4, v2, Landroid/hardware/TriggerEvent;->timestamp:J

    .line 490
    iput-object v1, v2, Landroid/hardware/TriggerEvent;->sensor:Landroid/hardware/Sensor;

    .line 494
    iget-object v3, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mManager:Landroid/hardware/SystemSensorManager;

    iget-object v4, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mListener:Landroid/hardware/TriggerEventListener;

    invoke-virtual {v3, v4, v1, v5}, Landroid/hardware/SystemSensorManager;->cancelTriggerSensorImpl(Landroid/hardware/TriggerEventListener;Landroid/hardware/Sensor;Z)Z

    .line 496
    iget-object v3, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mListener:Landroid/hardware/TriggerEventListener;

    invoke-virtual {v3, v2}, Landroid/hardware/TriggerEventListener;->onTrigger(Landroid/hardware/TriggerEvent;)V

    goto :goto_0
.end method

.method public removeSensorEvent(Landroid/hardware/Sensor;)V
    .locals 3
    .param p1, "sensor"    # Landroid/hardware/Sensor;

    .prologue
    .line 467
    iget-object v1, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mTriggerEvents:Landroid/util/SparseArray;

    monitor-enter v1

    .line 468
    :try_start_0
    iget-object v0, p0, Landroid/hardware/SystemSensorManager$TriggerEventQueue;->mTriggerEvents:Landroid/util/SparseArray;

    invoke-virtual {p1}, Landroid/hardware/Sensor;->getHandle()I

    move-result v2

    invoke-virtual {v0, v2}, Landroid/util/SparseArray;->delete(I)V

    .line 469
    monitor-exit v1

    .line 470
    return-void

    .line 469
    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method


text:
"""check_no_neon.py - Check modules do not contain ARM Neon instructions."""

import argparse
import os
import sys

REPOSITORY_ROOT = os.path.abspath(
    os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir))

sys.path.insert(0, os.path.join(REPOSITORY_ROOT, 'build/android/gyp'))
from util import build_utils  # pylint: disable=wrong-import-position

def main(args):
  parser = argparse.ArgumentParser(
      description='Check modules do not contain ARM Neon instructions.')
  parser.add_argument('objdump', metavar='path/to/ARM/objdump')
  parser.add_argument('objects', metavar='files/to/check/*.o')
  parser.add_argument('--stamp', help='Path to touch on success.')
  opts = parser.parse_args(args)
  ret = os.system(opts.objdump + ' -d --no-show-raw-insn ' +
      opts.objects + ' | grep -q "vld[1-9]\\|vst[1-9]"')

  # Non-zero exit code means no neon.
  if ret and opts.stamp:
    build_utils.Touch(opts.stamp)
  return ret

if __name__ == '__main__':
  sys.exit(0 if main(sys.argv[1:]) != 0 else -1)

redpajama_set_name: RedPajamaGithub


text:
package com.tree_bit.rcdl.blocks.dv;

/**
 * Defining methods a enum containing Minecraft data values has to implement.
 */
public interface IDataValueEnum {

    /**
     * Returns the data value of this setting.
     *
     * @return Data value
     */
    public int getDataValue();

}


text:
title: Alpha And Omega: Uncovering The Past Chapter 3 - RUSHING
layout: chapter
disqus: alpha-and-omega-uncovering-the-past-ch-3
story-name: Alpha And Omega: Uncovering The Past
story-summary: Kate lost her memory and the Western Pack has to get her back but will she come back after she meets Caileb the old Southern Pack Leader?
prev: ch-2
next: ch-4
---

## Chapter 3:  RUSHING ##

"Humphrey wake up Kate's missing!", yelled a voice.
At an instant I was wide awake and outside my den and was asking what happened.
Eve, Kate's mother, answered "Apparently Kate jumped on a caribou's back and it knocked her in the head with the back of its head and she blacked out."

"THEN WHAT ARE WE STILL HERE FOR! I'll get Kerbces, Jet, Vincent, Star, Freden, and Arein. You get the other alphas." I rushed.

"That is where I'm ahead of you." Eve replied as I ran into my den.

"Everyone wake up your mother is missing!" I announced.

As soon as I finished talking they were up and wide awake.

"What happened!", Freden exploded angrily at me.

"First off this is not the time to get pissed off at one another! Second I'll tell you on the way to the search party... EVE YOU STILL OUT THERE!" I said hastily.

"Yes. What is it?" She asked. "I want ALL! possible wolves looking for her." I ordered.

"On it, right away." Eve replied and went off. "Kerbces you go with Eve." I demanded.

For a moment he hesitated then ran off with out a word.

"You five with me." I rushed.

**Kerbces POV**

"Hey grandma wait up!" I yelled. After I said that she flipped right around at me. When I got to her she sternly said "NEVER call me that again!" And ran off.

**Lilly's POV**

"Kate... Kate... Can you hear me!" I yelled, but got no response. When I turn around I see Humphrey giving commands. I couldn't remember him being so serious other than that one time...

"Lilly what's the lead?" Humphrey asked me. Unfortunately we had none except that she maybe in the Northern Territory. When I told him he started flipping out, I couldn't take the yelling, so I slapped him and ran.


text:
import syntaxtree.*;
import typecheck.*;
import codegen.*;

public class J2V {
    public static void main(String args[]) throws ParseException {
        new MiniJavaParser(System.in);
        Goal program = MiniJavaParser.Goal();
        Scope env = new Scope(program);

        program.accept(new FirstPhaseVisitor(), env);
        program.accept(new CodeGenVisitor(), new CodeGenPair(env, new Translator()));
    }
}


text:
// This file is automatically generated.

package adila.db;

/*
 * Micromax UNITE
 *
 * DEVICE: A092
 * MODEL: Micromax A092
 */
final class a092_micromax20a092 {
    public static final String DATA = "Micromax|UNITE|";
}


text:
package org.apache.mina.filter.codec;

/**
 * A special exception that tells the {@link ProtocolDecoder} can keep
 * decoding even after this exception is thrown.
 *

 * Once {@link ProtocolCodecFilter} catches any other type of exception
 * than {@link RecoverableProtocolDecoderException}, it stops calling
 * the {@link ProtocolDecoder#decode(org.apache.mina.core.session.IoSession,
 *        org.apache.mina.core.buffer.IoBuffer, ProtocolDecoderOutput)}
 * immediately and fires an <tt>exceptionCaught</tt> event.
 *

 * On the other hand, if {@link RecoverableProtocolDecoderException} is thrown,
 * it doesn't stop immediately but keeps calling the {@link ProtocolDecoder}
 * as long as the position of the read buffer changes.
 *

 * {@link RecoverableProtocolDecoderException} is useful for a robust
 * {@link ProtocolDecoder} that can continue decoding even after any
 * protocol violation.
 *
 * @author Apache MINA Project
 */
public class RecoverableProtocolDecoderException extends
        ProtocolDecoderException {

    private static final long serialVersionUID = -8172624045024880678L;

    public RecoverableProtocolDecoderException() {
        // Do nothing
    }

    public RecoverableProtocolDecoderException(String message) {
        super(message);
    }

    public RecoverableProtocolDecoderException(Throwable cause) {
        super(cause);
    }

    public RecoverableProtocolDecoderException(String message, Throwable cause) {
        super(message, cause);
    }

}


text:
%
% This function applies a k-medoids algorithm for the given distance matrix

% Author: Celine Scheidt
% Date: April 2009
% Updated: February 2013

function Clustering = kmedoids(D,nbclusters,nbrep)

%% Input Parameters
%   - D: distance matrix to use
%   - nbclusters: number of clusters to construct
%   - nbrep: (optional). Number of k-medoids to be performed. The best cluster
%                       configuration is returned.  Default value is 10.

%% Output Parameters
%   - Clustering: Results of the clustering, which contains:
%        - label: is a vector of length NbModels, which contains the cluster index that each model belongs to
%        - medoids: is a vector of length NbCluster containing the index
%                   of the medoids
%        - weights: is a vector of length NbCluster containing the number
%                   of models in each cluster.
%

% Reference: http://en.wikipedia.org/wiki/K-medoids
%            Kaufman, L. and Rousseeuw, P.J. (1987), Clustering by means of Medoids,
%            in Statistical Data Analysis Based on the –Norm and Related Methods,
%            edited by Y. Dodge, North-Holland, 405–416.

% make sure the distace matrix is squared
if size(D,1) == 1
    D = squareform(D);
end

if nargin < 3
    nbrep = 10;
end

maxIterations = 50;
npoints = size(D,1);
minDistBest = Inf;

for iter = 1:nbrep % nbrep clustering are performed, the best configuration is returned

    % Initalize: randonly select nbclusters from the npoints data points as the medoids
    initMedoids = randsample(npoints,nbclusters);

    % Associate each data point to the closest medoid
    [minDistInit, label] = min(D(initMedoids,:));

    currentMedoids = initMedoids;
    minDistCurrent = minDistInit;

    label_prev = NaN(1,npoints);
    nbIter = 0;

    while any(label ~= label_prev) && nbIter < maxIterations % while cluster configuration is changing and maxIteration not reached

        label_prev = label;

        % For each medoid m
        for m = 1:nbclusters

            NoMedoid = setdiff(1:npoints,currentMedoids);
            NewMedoids = currentMedoids;

             % For each non-medoid data point o
            for o = 1:length(NoMedoid)
                % Swap m and o and compute the cost of the configuration
                NewMedoids(m) = NoMedoid(o);
                [minDist, label] = min(D(NewMedoids,:));
                cost = sum(minDist) - sum(minDistCurrent);

                if cost < 0  % Select the configuration with the lowest cost
                    currentMedoids(m) = NoMedoid(o);
                    [minDistCurrent, label] = min(D(currentMedoids,:));
                end
            end
        end
        nbIter = nbIter+1;
    end

    currentMedoids = sort(currentMedoids);
    [minDist, label] = min(D(currentMedoids,:));

    % Return the best clustering configuration among the nbrep tested
     if sum(minDist) < sum(minDistBest)
        fprintf('minDist % .2f, iter %i \n',sum(minDist),iter)
        minDistBest = minDist;
        labelBest = label;
        currentMedoidsBest = currentMedoids;
    end
end

%% Once the medoids are defined, store the outputs
weights = zeros(nbclusters,1);
for i = 1:nbclusters
    weights(i) = sum(labelBest == i);
end

Clustering.T = labelBest;
Clustering.medoids = currentMedoidsBest';
Clustering.weights = weights;

end


text:
<?php

namespace Celmedia\Toyocosta\MontacargasBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
 * Montacarga
 */
class Montacarga
{
    /**
     * @var integer
     */
    private $id;

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

    /**
     * @var float
     */
    private $precio;

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

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

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

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

    /**
     * @var integer
     */
    private $estado;

    /**
     * @var \DateTime
     */
    private $created;

    /**
     * @var \DateTime
     */
    private $updated;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $galeria;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $cotizaciones;

    /**
     * @var \Celmedia\Toyocosta\MontacargasBundle\Entity\Subcategoria
     */
    private $montacarga_subcategoria;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $imagenes;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->galeria = new \Doctrine\Common\Collections\ArrayCollection();
        $this->cotizaciones = new \Doctrine\Common\Collections\ArrayCollection();
        $this->imagenes = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set modelo
     *
     * @param string $modelo
     * @return Montacarga
     */
    public function setModelo($modelo)
    {
        $this->modelo = $modelo;

        return $this;
    }

    /**
     * Get modelo
     *
     * @return string
     */
    public function getModelo()
    {
        return $this->modelo;
    }

    /**
     * Set precio
     *
     * @param float $precio
     * @return Montacarga
     */
    public function setPrecio($precio)
    {
        $this->precio = $precio;

        return $this;
    }

    /**
     * Get precio
     *
     * @return float
     */
    public function getPrecio()
    {
        return $this->precio;
    }

    /**
     * Set caracteristicas
     *
     * @param string $caracteristicas
     * @return Montacarga
     */
    public function setCaracteristicas($caracteristicas)
    {
        $this->caracteristicas = $caracteristicas;

        return $this;
    }

    /**
     * Get caracteristicas
     *
     * @return string
     */
    public function getCaracteristicas()
    {
        return $this->caracteristicas;
    }

    /**
     * Set formato
     *
     * @param string $formato
     * @return Montacarga
     */
    public function setFormato($formato)
    {
        $this->formato = $formato;

        return $this;
    }

    /**
     * Get formato
     *
     * @return string
     */
    public function getFormato()
    {
        return $this->formato;
    }

    /**
     * Set rawText
     *
     * @param string $rawText
     * @return Montacarga
     */
    public function setRawText($rawText)
    {
        $this->rawText = $rawText;

        return $this;
    }

    /**
     * Get rawText
     *
     * @return string
     */
    public function getRawText()
    {
        return $this->rawText;
    }

    /**
     * Set ficha
     *
     * @param string $ficha
     * @return Montacarga
     */
    public function setFicha($ficha)
    {
        $this->ficha = $ficha;

        return $this;
    }

    /**
     * Get ficha
     *
     * @return string
     */
    public function getFicha()
    {
        return $this->ficha;
    }

    /**
     * Set estado
     *
     * @param integer $estado
     * @return Montacarga
     */
    public function setEstado($estado)
    {
        $this->estado = $estado;

        return $this;
    }

    /**
     * Get estado
     *
     * @return integer
     */
    public function getEstado()
    {
        return $this->estado;
    }

    /**
     * Set created
     *
     * @param \DateTime $created
     * @return Montacarga
     */
    public function setCreated($created)
    {
        $this->created = $created;

        return $this;
    }

    /**
     * Get created
     *
     * @return \DateTime
     */
    public function getCreated()
    {
        return $this->created;
    }

    /**
     * Set updated
     *
     * @param \DateTime $updated
     * @return Montacarga
     */
    public function setUpdated($updated)
    {
        $this->updated = $updated;

        return $this;
    }

    /**
     * Get updated
     *
     * @return \DateTime
     */
    public function getUpdated()
    {
        return $this->updated;
    }

    /**
     * Add galeria
     *
     * @param \Celmedia\Toyocosta\MontacargasBundle\Entity\MontacargaGaleria $galeria
     * @return Montacarga
     */
    public function addGalerium(\Celmedia\Toyocosta\MontacargasBundle\Entity\MontacargaGaleria $galeria)
    {
        $this->galeria[] = $galeria;

        return $this;
    }

    /**
     * Remove galeria
     *
     * @param \Celmedia\Toyocosta\MontacargasBundle\Entity\MontacargaGaleria $galeria
     */
    public function removeGalerium(\Celmedia\Toyocosta\MontacargasBundle\Entity\MontacargaGaleria $galeria)
    {
        $this->galeria->removeElement($galeria);
    }

    /**
     * Get galeria
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getGaleria()
    {
        return $this->galeria;
    }

    /**
     * Add cotizaciones
     *
     * @param \Celmedia\Toyocosta\MontacargasBundle\Entity\MontacargaCotizacion $cotizaciones
     * @return Montacarga
     */
    public function addCotizacione(\Celmedia\Toyocosta\MontacargasBundle\Entity\MontacargaCotizacion $cotizaciones)
    {
        $this->cotizaciones[] = $cotizaciones;

        return $this;
    }

    /**
     * Remove cotizaciones
     *
     * @param \Celmedia\Toyocosta\MontacargasBundle\Entity\MontacargaCotizacion $cotizaciones
     */
    public function removeCotizacione(\Celmedia\Toyocosta\MontacargasBundle\Entity\MontacargaCotizacion $cotizaciones)
    {
        $this->cotizaciones->removeElement($cotizaciones);
    }

    /**
     * Get cotizaciones
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getCotizaciones()
    {
        return $this->cotizaciones;
    }

    /**
     * Set montacarga_subcategoria
     *
     * @param \Celmedia\Toyocosta\MontacargasBundle\Entity\Subcategoria $montacargaSubcategoria
     * @return Montacarga
     */
    public function setMontacargaSubcategoria(\Celmedia\Toyocosta\MontacargasBundle\Entity\Subcategoria $montacargaSubcategoria = null)
    {
        $this->montacarga_subcategoria = $montacargaSubcategoria;

        return $this;
    }

    /**
     * Get montacarga_subcategoria
     *
     * @return \Celmedia\Toyocosta\MontacargasBundle\Entity\Subcategoria
     */
    public function getMontacargaSubcategoria()
    {
        return $this->montacarga_subcategoria;
    }

    /**
     * Add imagenes
     *
     * @param \Application\Sonata\MediaBundle\Entity\GalleryHasMedia $imagenes
     * @return Montacarga
     */
    public function addImagene(\Application\Sonata\MediaBundle\Entity\GalleryHasMedia $imagenes)
    {
        $this->imagenes[] = $imagenes;

        return $this;
    }

    /**
     * Remove imagenes
     *
     * @param \Application\Sonata\MediaBundle\Entity\GalleryHasMedia $imagenes
     */
    public function removeImagene(\Application\Sonata\MediaBundle\Entity\GalleryHasMedia $imagenes)
    {
        $this->imagenes->removeElement($imagenes);
    }

    /**
     * Get imagenes
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getImagenes()
    {
        return $this->imagenes;
    }
    /**
     * @ORM\PrePersist
     */
    public function lifecycleFileUpload()
    {
        // Add your code here
        $this->uploadFilePdf();
    }

    /**
     * Unmapped property to handle file uploads
     */
    private $filePdf;

    /**
     * Sets file.
     *
     * @param UploadedFile $file
     */
    public function setFilePdf(UploadedFile $filePdf = null)
    {
        $this->filePdf = $filePdf;
    }

    /**
     * Get file.
     *
     * @return UploadedFile
     */
    public function getFilePdf()
    {
        return $this->filePdf;
    }

    /**
     * Manages the copying of the file to the relevant place on the server
     */
    public function uploadFilePdf()
    {
        // the file property can be empty if the field is not required
        if (null === $this->getFilePdf()) {
            return;
        }

        // move takes the target directory and target filename as params
        $this->getFilePdf()->move(
           __DIR__.'/../../../../../web/'. 'uploads/montacargas/ficha' ,
            $this->getFilePdf()->getClientOriginalName()
        );

        // set the path property to the filename where you've saved the file
        $this->ficha = $this->getFilePdf()->getClientOriginalName();

        // clean up the file property as you won't need it anymore
        $this->setFilePdf(null);
    }

    public function __toString()
    {
        return $this->getModelo();
    }

}


text:
<?php

namespace League\Flysystem\Util;

use PHPUnit\Framework\TestCase;

$passthru = true;

function class_exists($class_name, $autoload = true)
{
    global $passthru;

    if ($passthru) {
        return \class_exists($class_name, $autoload);
    }

    return false;
}

class UtilMimeTests extends TestCase
{
    public function testNoFinfoFallback()
    {
        global $passthru;
        $passthru = false;
        $this->assertNull(MimeType::detectByContent('string'));
        $passthru = true;
    }

    public function testNoExtension()
    {
        $this->assertEquals('text/plain', MimeType::detectByFileExtension('dir/file'));
    }
}


text:
layout: page
title: Wiley Air Conference
date: 2016-05-24
author: Carl Nunez
tags: weekly links, java
status: published
summary: In fermentum sit amet quam a gravida.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 05/07/2017
  endDate: 05/10/2017
  ctyhocn: SATITHX
  groupCode: WAC
published: true
---
Morbi aliquam viverra egestas. Aenean hendrerit tristique iaculis. Maecenas eleifend hendrerit leo et dictum. Nulla dictum elit et felis pretium, ac mollis urna tempus. Vestibulum in neque nec ante ullamcorper mollis. Fusce ultricies rhoncus dapibus. Nunc ac scelerisque neque, faucibus egestas velit. Suspendisse sagittis placerat congue. Curabitur quis massa augue. Etiam pharetra mi ante, at dictum lacus mattis ut. Morbi tincidunt consectetur dictum.

* Proin laoreet leo id sem rutrum ullamcorper
* Etiam pretium purus in interdum molestie
* Aliquam convallis eros vel dignissim sollicitudin.

Pellentesque sed metus sit amet sapien placerat vestibulum. Suspendisse eu nibh vitae tortor condimentum aliquet et nec nisi. Quisque laoreet nulla ex, sit amet rutrum nibh tincidunt in. Suspendisse finibus tincidunt nisl, at tristique augue congue at. Integer in finibus sem. Fusce elementum accumsan venenatis. Fusce aliquet nisl eu urna tincidunt, in convallis ante hendrerit. Sed sed convallis diam. Cras sodales, tellus mollis porta congue, elit eros tincidunt est, lacinia tempus ligula odio lacinia lorem. Aenean sit amet enim dictum, porta risus eu, commodo magna. Vivamus cursus accumsan ante, quis viverra sapien efficitur eu.
In maximus, nunc dapibus rhoncus facilisis, leo enim suscipit nisl, a scelerisque sem elit et felis. Sed et est pellentesque, rhoncus lacus at, volutpat nulla. In sem tellus, maximus at placerat vel, feugiat sed dolor. Donec diam turpis, auctor non arcu et, maximus porttitor arcu. Aliquam non hendrerit nisl, pellentesque fermentum lacus. Nam a nunc id risus tincidunt viverra quis sed massa. Etiam porttitor ipsum enim, sit amet dictum mauris molestie at. Fusce scelerisque arcu nibh, blandit laoreet lacus egestas luctus. Fusce diam purus, porta non luctus sed, elementum porta est. Etiam at ligula placerat, tincidunt sem in, eleifend mauris. Ut a lacus tincidunt, porttitor erat vitae, ultricies arcu.


text:
package org.r358.poolnetty.pool;

import io.netty.channel.Channel;

import java.util.concurrent.ScheduledFuture;

/**
 * A wrapper for the context.
 * Not thread safe.
 */
public class AvailableChannel
{
    private final long closeAfter;
    private final Channel channel;
    private final int lifespan;
    private final boolean immortal;
    private final ScheduledFuture reaper;

    public AvailableChannel(long closeAfter, Channel channel, int lifespan, boolean immortal, ScheduledFuture reaper)
    {
        this.closeAfter = closeAfter;
        this.channel = channel;
        this.lifespan = lifespan;
        this.immortal = immortal;
        this.reaper = reaper;
    }

    public Channel getChannel()
    {
        return channel;
    }

    public void cancelReaper()
    {
        if (reaper != null)
        {
            reaper.cancel(false); // Should not be an issue as it is all running from the same decoupler within the pool.
        }
    }

    /**
     * Has this context expired.
     *
     * @param notAfter Not after.
     * @return
     */
    public boolean expired(long notAfter)
    {
        return !immortal & notAfter < closeAfter;
    }

    public boolean isImmortal()
    {
        return immortal;
    }

    public int getLifespan()
    {
        return lifespan;
    }
}


text:
<?php

namespace Application;

use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Zend\Validator\AbstractValidator;
use Zend\I18n\Translator\Translator;

class Module
{
    public function onBootstrap(MvcEvent $e)
    {

        $eventManager        = $e->getApplication()->getEventManager();
        $moduleRouteListener = new ModuleRouteListener();
        $moduleRouteListener->attach($eventManager);

        \Locale::setDefault('pt_BR');

        $translator = new Translator();
        $translator->addTranslationFile('phpArray', __DIR__ . '/../../../../vendor/zendframework/zendframework/resources/languages/pt_BR/Zend_Validate.php', 'default', 'pt_BR');
        $translator->addTranslationFile('phpArray', __DIR__ . '/../../../../vendor/zendframework/zendframework/resources/languages/pt_BR/Zend_Captcha.php', 'default', 'pt_BR');
        AbstractValidator::setDefaultTranslator(new \Zend\Mvc\I18n\Translator($translator));
    }

    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }

    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }
}


text:
package org.jenkins.ci.plugins.jenkinslint.check;

import hudson.matrix.MatrixProject;
import hudson.model.Item;
import hudson.model.Project;
import hudson.tasks.Builder;
import hudson.maven.MavenModuleSet;
import hudson.tasks.CommandInterpreter;
import jenkins.model.Jenkins;
import org.jenkins.ci.plugins.jenkinslint.model.AbstractCheck;

import java.util.List;
import java.util.logging.Level;

/**
 * @author Victor Martinez
 */
public class HardcodedScriptChecker extends AbstractCheck {

    public final static int THRESHOLD = 2;

    public HardcodedScriptChecker() {
        super();
        this.setDescription("When setting Jenkins Jobs with Shell/Batch builds you shouldn't hardcoded the script "+
                            "it's recommended to track them in your SCM tool instead.<br/>" +
                            "Otherwise you won't be able to reproduce your CI environment easily.");
        this.setSeverity("Medium");
    }

    public boolean executeCheck(Item item) {
        LOG.log(Level.FINE, "executeCheck " + item);
        boolean found = false;
        if (Jenkins.getInstance().pluginManager.getPlugin("maven-plugin")!=null) {
            if (item instanceof MavenModuleSet) {
                found = isBuilderHarcoded(((MavenModuleSet) item).getPrebuilders());
            }
        }
        if (item instanceof Project) {
            found = isBuilderHarcoded (((Project)item).getBuilders());
        }
        if (item instanceof MatrixProject) {
            found = isBuilderHarcoded (((MatrixProject)item).getBuilders());
        }
        return found;
    }

    private boolean isBuilderHarcoded (List<Builder> builders) {
        boolean found = false;
        if (builders != null && builders.size() > 0 ) {
            for (Builder builder : builders) {
                if (builder instanceof hudson.tasks.Shell || builder instanceof hudson.tasks.BatchFile) {
                    if (isHarcoded (((CommandInterpreter)builder).getCommand(), THRESHOLD)) {
                        found = true;
                    }
                }
            }
        } else {
            found = false;
        }
        return found;
    }

    private boolean isHarcoded (String content, int threshold) {
        if (content != null) {
            return content.split("\r\n|\r|\n").length > threshold;
        } else {
            return false;
        }
    }
}


text:
<?php
/**
 * Export_Expertm_User class
 *
 * @author Christophe Gosiau <christophe@tigron.be>
 * @author Gerry Demaret <gerry@tigron.be>
 * @author David Vandemaele <david@tigron.be>
 */

use \Skeleton\Database\Database;

abstract class Export_Expertm extends Export {

	/**
	 * Numeric
	 *
	 * @access protected
	 * @param int $size
	 * @param string $field
	 */
	protected function num($size, $field) {
		return substr(str_pad($field, $size, '0', STR_PAD_LEFT), 0, 9);
	}

	/**
	 * Alfa-Numeric
	 *
	 * @access protected
	 * @param int $size
	 * @param string $field
	 */
	protected function alf($size, $field) {
		$field = $this->clean_string($field);
		$field = transliterator_transliterate('Latin-ASCII', $field);
		return substr(str_pad($field, $size, ' '), 0, $size);
	}

	/**
	 * Clean string
	 *
	 * @access public
	 * @param string $string
	 * @return string $clean_string
	 */
	protected function clean_string($string) {
		$string = str_replace('.', '', $string);
		$string = str_replace('@', '', $string);
		$string = str_replace('&', '', $string);
		$string = str_replace('-', '', $string);
		$string = str_replace('_', '', $string);
		$string = str_replace('!', '', $string);
		$string = str_replace(',', '', $string);
		$string = str_replace('?', '', $string);
		$string = str_replace("\"", '', $string);
		$string = str_replace(';', '', $string);
		$string = str_replace('*', '', $string);
		$string = str_replace('\'', '', $string);
		$string = str_replace('é', 'e', $string);
		$string = str_replace('è', 'e', $string);
		$string = str_replace('î', 'i', $string);
		$string = str_replace('ë', 'e', $string);
		$string = str_replace('ä', 'a', $string);
		$string = str_replace('â', 'a', $string);
		$string = str_replace('à', 'a', $string);
		$string = str_replace('ç', 'c', $string);
		$string = str_replace('ô', 'o', $string);
		$string = str_replace('ö', 'o', $string);
		$string = str_replace("\r\n", ' ', $string);
		$string = str_replace("\n", ' ', $string);
		$string = trim($string);
		return $string;
	}

	/**
	 * Currency
	 *
	 * @access protected
	 * @param int $size
	 * @param string $val
	 */
	protected function cur($size, $val) {
		$val = sprintf('%0'.($size-5).'.4f', $val);
		$valarr = explode('.', $val);
		$val = str_pad($valarr[0], $size-5, '0', STR_PAD_LEFT);
		$val .= str_pad($valarr[1], 4, '0', STR_PAD_RIGHT).'+';
		$val = str_replace('.', '', $val);
		return $val;
	}

	/**
	 * Boekhoudperiode
	 *
	 * @access protected
	 * @param Date $date
	 * @return string $boekhoudperiode
	 */
	protected function boekhoudperiode($date) {
		try {
			$bookkeeping_start_month = Setting::get_by_name('bookkeeping_start_month')->value;
		} catch (Exception $e) {
			$setting = new Setting();
			$setting->name = 'bookkeeping_start_month';
			$setting->value= 1;
			$setting->save();
			$bookkeeping_start_month = $setting->value;
		}

		try {
			$bookkeeping_vat_period = Setting::get_by_name('bookkeeping_vat_period')->value;
		} catch (Exception $e) {
			$setting = new Setting();
			$setting->name = 'bookkeeping_vat_period';
			$setting->value= 'month';
			$setting->save();
			$bookkeeping_vat_period = $setting->value;
		}

		if ($bookkeeping_vat_period == 'month') {
			$month = date('n', strtotime($date));
			$btw_month = $month - $bookkeeping_start_month + 1;
			if ($btw_month <= 0) {
				$btw_month += 12;
			}
			return $btw_month;
		} else {
			$month = $bookkeeping_start_month;
			$periode = 1;
			$boekhoudperiodes = [];

			for ($i = 1; $i <=12; $i++) {
				$boekhoudperiodes[$month] = $periode;

				$month++;
				if ($i % 3 == 0) {
					$periode ++;
				}
			}

			$cleaned = [];
			foreach ($boekhoudperiodes as $month => $periode) {
				if ($month > 12) {
					$month -= 12;
				}
				$cleaned[$month] = $periode;
			}

			ksort($cleaned);
			return $cleaned[ date('n', strtotime($date)) ];
		}
	}

	/**
	 * BTWmaand
	 *
	 * @access protected
	 * @param Date $date
	 * @return string $btwmaand
	 */
	protected function btwmaand($date) {
		$year = date('Y', strtotime($date));
		$btw_maand = $year . date('m', strtotime($date));
		return $btw_maand;
	}
}


text:
for file in $(find $1 -name '*.md'); do
    cat "$file" | ./print-images-from-md
done


text:
package coursera

import scala.concurrent.{Promise, ExecutionContext, Future}
import scala.async.Async._
import scala.util.{Success, Failure, Try}
import coursera.extensions._

package object combinators {

  def retryI[T](n: Int)(block: =>Future[T]): Future[T] = {
    if (n == 0) {
      Future.failed(new Exception("Sorry"))
    } else {
      block fallbackTo { retryI(n-1) { block } }
    }
  }

  def retryII[T](n: Int)(block: =>Future[T]): Future[T] = {
    val ns: Iterator[Int] = (1 to n).iterator
    val attempts: Iterator[()=>Future[T]] = ns.map(_ => ()=>block)
    val failed: Future[T] = Future.failed(new Exception)
    attempts.foldLeft(failed)((a, block) => a fallbackTo { block() })
  }

  def retryIII[T](n: Int)(block: =>Future[T]): Future[T] = {
    val ns: Iterator[Int] = (1 to n).iterator
    val attempts: Iterator[()=>Future[T]] = ns.map(_ => ()=>block)
    val failed: Future[T] = Future.failed(new Exception)
    attempts.foldRight(()=>failed)((block, a) => ()=> { block() fallbackTo{ a() }}) ()
  }

  def retryIV[T](n: Int)(block: =>Future[T])(implicit executor: ExecutionContext): Future[T] = async {
    var i: Int = 0
    var result: Try[T] = Failure(new Exception("Oops"))

    while (i < n) {
      result = await { block.withTry() }

      result match {
        case Success(s) => { i = i+1  }
        case Failure(f) => { i = n    }
      }
    }

    result.get
  }

  def filterI[T](future: Future[T], predicate: T => Boolean)(implicit executor: ExecutionContext): Future[T] = async{
    val x: T = await{ future }
    if(!predicate(x)) {
      throw new Exception("No such element")
    } else {
      x
    }
  }

  def filterII[T](future: Future[T], predicate: T => Boolean)(implicit executor: ExecutionContext): Future[T] = {
    val p = Promise[T]()
    future.onComplete {
      case Success(s) => {
        if(!predicate(s)) {
          p.failure(new Exception("No such element"))
        } else {
          p.success(s)
        }
      }
      case Failure(f) => { p.failure(f) }
    }
    p.future
  }

  def flatMap[T,S](future: Future[T], selector: T => Future[S])(implicit executor: ExecutionContext): Future[S] = async{
    val x: T = await{ future }
    await{ selector(x) }: S
  }

  def race[T](left: Future[T], right: Future[T])(implicit executor: ExecutionContext): Future[T] = {
    val p = Promise[T]()

    left  onComplete { p.tryComplete }
    right onComplete { p.tryComplete }

    p.future
  }

  def zipI[T, S, R](future: Future[T], other: Future[S], combine: (T, S) => R)
                   (implicit executor: ExecutionContext): Future[R] = async {
    combine(await{ future }: T, await{ other }: S)
  }

  def zipII[T, S, R](future: Future[T], other: Future[S], combine: (T, S) => R)
                    (implicit executor: ExecutionContext): Future[R] = {
    val p = Promise[R]()

    future onComplete {
      case Failure(f) => { p.failure(f) }
      case Success(t) => { other onComplete {
        case Failure(f) => { p.failure(f) }
        case Success(s) => p.success(combine(t,s))
      }}
    }

    p.future
  }

  def never[T]()(implicit executor: ExecutionContext): Future[T] = { Promise[T].future }
}


text:
use std::env;
use std::time::{Duration, Instant};

use mhost::nameserver::NameServerConfigGroup;
use mhost::resolver::{MultiQuery, ResolverConfigGroup, ResolverGroup, ResolverGroupOpts, ResolverOpts};
use mhost::statistics::Statistics;
use mhost::RecordType;

#[tokio::main]
async fn main() {
    let path = env::args()
        .nth(1)
        .unwrap_or_else(|| "contrib/resolvers.txt".to_string());
    let name = env::args().nth(2).unwrap_or_else(|| "www.example.com".to_string());

    let system_resolvers = ResolverGroup::from_system_config(Default::default())
        .await
        .expect("failed to create system resolvers");

    let configs = NameServerConfigGroup::from_file(&system_resolvers, path)
        .await
        .expect("failed to read name server configs from file");
    println!("Loaded {} name servers", configs.len());
    let resolver_configs: ResolverConfigGroup = configs.into();

    let resolver_opts = ResolverOpts {
        retries: 1,
        max_concurrent_requests: 20,
        timeout: Duration::from_secs(1),
        ..Default::default()
    };
    let group_opts = ResolverGroupOpts {
        max_concurrent: 1000,
        ..Default::default()
    };

    let resolvers = ResolverGroup::from_configs(resolver_configs, resolver_opts, group_opts)
        .await
        .expect("failed to create resolvers");
    println!("Created {} resolvers", resolvers.len());

    let mq = MultiQuery::multi_record(name, vec![RecordType::A, RecordType::AAAA, RecordType::TXT])
        .expect("Failed to create multi-query");

    let start_time = Instant::now();
    let lookups = resolvers.lookup(mq).await.expect("failed to execute lookups");
    let total_run_time = Instant::now() - start_time;

    let statistics = lookups.statistics();
    println!(
        "Received {} within {} ms of total run time.",
        statistics,
        total_run_time.as_millis()
    );
    println!("Results:\n{:#?}", &lookups);
}


text:
namespace _01.GetNumberOfRowsInCategories
{
    using System;
    using System.Data.SqlClient;

    /// <summary>
    /// Write a program that retrieves from the Northwind sample database
    /// in MS SQL Server the number of  rows in the Categories table.
    /// </summary>
    public class Program
    {
        public static void Main(string[] args)
        {
            string connectionString = "data source=NIKKI-PC;initial catalog=Northwind;integrated security=True;MultipleActiveResultSets=True;";
            SqlConnection databaseConnection = new SqlConnection(connectionString);
            databaseConnection.Open();
            using (databaseConnection)
            {
                var command = new SqlCommand("SELECT COUNT(*) FROM Categories", databaseConnection);
                int categoryCount = (int)command.ExecuteScalar();

                Console.WriteLine("The number of rows in Categories is: {0}", categoryCount);
            }
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<module codename="org.netbeans.api.xml/1">
    <module_version install_time="1370463699896" last="true" origin="installer" specification_version="1.33.1">
        <file crc="377157071" name="config/Modules/org-netbeans-api-xml.xml"/>
        <file crc="3473231175" name="modules/locale/org-netbeans-api-xml_ja.jar"/>
        <file crc="690707316" name="modules/locale/org-netbeans-api-xml_pt_BR.jar"/>
        <file crc="1943369070" name="modules/locale/org-netbeans-api-xml_ru.jar"/>
        <file crc="1598946073" name="modules/locale/org-netbeans-api-xml_zh_CN.jar"/>
        <file crc="2729731722" name="modules/org-netbeans-api-xml.jar"/>
    </module_version>
</module>


text:
[![Go Report Card](https://goreportcard.com/badge/github.com/hologram-io/hologram-go)](https://goreportcard.com/report/github.com/hologram-io/hologram-go)
[![Build Status](https://travis-ci.org/hologram-io/hologram-go.svg?branch=master)](https://travis-ci.org/hologram-io/hologram-go)

## Introduction
This is a library built for using our REST APIs.

## Installation

One nice thing about Go is how easy it is to work with packages.
First, run:

```go
go get github.com/hologram-io/hologram-go
```

All you need to do after that is add this snippet of code in your source:

```
import (
	<your other imports go here>
	"github.com/hologram-io/hologram-go"
	<your other imports go here>
)
```

in your main folder.

## Unit Tests
Yay! you're ready for some good testing. All of the test cases are located in the
top `test` directory. Mocked data (in JSON) are in the `test/json` directory. To run a unit test,
just type:

```
go test <whichever test here>
```

## Support
Please feel free to [reach out to us](https://hologram.io/) if you have any questions/concerns.

## Credits
Special thanks to the amazing work that @kurrik put in his
[twittergo](https://github.com/kurrik/roomanna/) library. The Errors and Parse
interface/functions were taken from there and modified for our needs.


text:
package com.ctrip.xpipe.service.foundation;

import com.ctrip.xpipe.codec.JsonCodec;
import com.ctrip.xpipe.config.AbstractConfigBean;

import java.util.Map;

/**
 * @author lishanglin
 * date 2021/3/2
 */
public class FoundationConfig extends AbstractConfigBean {

    public static final String KEY_FOUNDATION_GROUP_DC_MAP = "foundation.group.dc.map";

    public Map<String, String> getGroupDcMap() {
        String mappingRule = getProperty(KEY_FOUNDATION_GROUP_DC_MAP, "{}");
        return JsonCodec.INSTANCE.decode(mappingRule, Map.class);
    }

}


text:
#pragma once
#include <aws/rekognition/Rekognition_EXPORTS.h>
#include <aws/rekognition/RekognitionRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/rekognition/model/Image.h>
#include <utility>

namespace Aws
{
namespace Rekognition
{
namespace Model
{

  /**
   */
  class AWS_REKOGNITION_API SearchFacesByImageRequest : public RekognitionRequest
  {
  public:
    SearchFacesByImageRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "SearchFacesByImage"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
ID of the collection to search.

     */
    inline const Aws::String& GetCollectionId() const{ return m_collectionId; }

    /**
     *
ID of the collection to search.

     */
    inline void SetCollectionId(const Aws::String& value) { m_collectionIdHasBeenSet = true; m_collectionId = value; }

    /**
     *
ID of the collection to search.

     */
    inline void SetCollectionId(Aws::String&& value) { m_collectionIdHasBeenSet = true; m_collectionId = std::move(value); }

    /**
     *
ID of the collection to search.

     */
    inline void SetCollectionId(const char* value) { m_collectionIdHasBeenSet = true; m_collectionId.assign(value); }

    /**
     *
ID of the collection to search.

     */
    inline SearchFacesByImageRequest& WithCollectionId(const Aws::String& value) { SetCollectionId(value); return *this;}

    /**
     *
ID of the collection to search.

     */
    inline SearchFacesByImageRequest& WithCollectionId(Aws::String&& value) { SetCollectionId(std::move(value)); return *this;}

    /**
     *
ID of the collection to search.

     */
    inline SearchFacesByImageRequest& WithCollectionId(const char* value) { SetCollectionId(value); return *this;}

    /**
     *
The input image as base64-encoded bytes or an S3 object. If you use the AWS
     * CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is
     * not supported.

     */
    inline const Image& GetImage() const{ return m_image; }

    /**
     *
The input image as base64-encoded bytes or an S3 object. If you use the AWS
     * CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is
     * not supported.

     */
    inline void SetImage(const Image& value) { m_imageHasBeenSet = true; m_image = value; }

    /**
     *
The input image as base64-encoded bytes or an S3 object. If you use the AWS
     * CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is
     * not supported.

     */
    inline void SetImage(Image&& value) { m_imageHasBeenSet = true; m_image = std::move(value); }

    /**
     *
The input image as base64-encoded bytes or an S3 object. If you use the AWS
     * CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is
     * not supported.

     */
    inline SearchFacesByImageRequest& WithImage(const Image& value) { SetImage(value); return *this;}

    /**
     *
The input image as base64-encoded bytes or an S3 object. If you use the AWS
     * CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is
     * not supported.

     */
    inline SearchFacesByImageRequest& WithImage(Image&& value) { SetImage(std::move(value)); return *this;}

    /**
     *
Maximum number of faces to return. The operation returns the maximum number
     * of faces with the highest confidence in the match.

     */
    inline int GetMaxFaces() const{ return m_maxFaces; }

    /**
     *
Maximum number of faces to return. The operation returns the maximum number
     * of faces with the highest confidence in the match.

     */
    inline void SetMaxFaces(int value) { m_maxFacesHasBeenSet = true; m_maxFaces = value; }

    /**
     *
Maximum number of faces to return. The operation returns the maximum number
     * of faces with the highest confidence in the match.

     */
    inline SearchFacesByImageRequest& WithMaxFaces(int value) { SetMaxFaces(value); return *this;}

    /**
     *
(Optional) Specifies the minimum confidence in the face match to return. For
     * example, don't return any matches where confidence in matches is less than
     * 70%.

     */
    inline double GetFaceMatchThreshold() const{ return m_faceMatchThreshold; }

    /**
     *
(Optional) Specifies the minimum confidence in the face match to return. For
     * example, don't return any matches where confidence in matches is less than
     * 70%.

     */
    inline void SetFaceMatchThreshold(double value) { m_faceMatchThresholdHasBeenSet = true; m_faceMatchThreshold = value; }

    /**
     *
(Optional) Specifies the minimum confidence in the face match to return. For
     * example, don't return any matches where confidence in matches is less than
     * 70%.

     */
    inline SearchFacesByImageRequest& WithFaceMatchThreshold(double value) { SetFaceMatchThreshold(value); return *this;}

  private:

    Aws::String m_collectionId;
    bool m_collectionIdHasBeenSet;

    Image m_image;
    bool m_imageHasBeenSet;

    int m_maxFaces;
    bool m_maxFacesHasBeenSet;

    double m_faceMatchThreshold;
    bool m_faceMatchThresholdHasBeenSet;
  };

} // namespace Model
} // namespace Rekognition
} // namespace Aws


text:
/**
 * retryThis method module. Retries the f_ task list from the
 * f_ task retryThis is called from.
 * @module methods/retryThis
 * @param {any} error
 * @return {object} this
 * @example
 * this.f_retryThis('Error');
 */
module.exports = function f_retryThis(error) {
  var err_object = this.f_err('retryThis, ' + error);
  this.f_flow_i-=1;
  this.f_next();

  /**
   * retryThis event. Emits an err_object
   * @event retryThis
   */
  this.emit('retryThis', err_object);

  return this;
};


text:
using FluentScheduler;
using SAA.Negocio;
using SAA.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SAA.Authorization.Schedulers
{
    public class ClearUserTokensExpiredTask : ITask
    {
        private UnitOfWork unit = new UnitOfWork();

        private void Limpar()
        {
            TokenManager.ListTokens.RemoveAll(x => TokenManager.AppUserTokens.Any(y => y.Value.UserToken.Equals(x.Hash)));
            unit.TokenRepository.DeleteRange(x => !x.UserTokenAppTokens.Any());
            unit.SaveChanges();
        }

        public void Execute()
        {
            Limpar();
        }
    }
}


text:
import Paths = require('vs/base/common/paths');
import Json = require('vs/base/common/json');
import { Color } from 'vs/base/common/color';
import { ExtensionData, ITokenColorCustomizations, ITokenColorizationRule, IColorTheme, IColorMap, IThemeExtensionPoint, VS_LIGHT_THEME, VS_HC_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { convertSettings } from 'vs/workbench/services/themes/electron-browser/themeCompatibility';
import { TPromise } from 'vs/base/common/winjs.base';
import nls = require('vs/nls');
import * as types from 'vs/base/common/types';
import * as objects from 'vs/base/common/objects';

import * as plist from 'fast-plist';
import pfs = require('vs/base/node/pfs');

import { Extensions, IColorRegistry, ColorIdentifier, editorBackground, editorForeground } from 'vs/platform/theme/common/colorRegistry';
import { ThemeType } from 'vs/platform/theme/common/themeService';
import { Registry } from 'vs/platform/registry/common/platform';
import { WorkbenchThemeService, IColorCustomizations } from 'vs/workbench/services/themes/electron-browser/workbenchThemeService';
import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages';

let colorRegistry = <IColorRegistry>Registry.as(Extensions.ColorContribution);

const tokenGroupToScopesMap = {
	comments: 'comment',
	strings: 'string',
	keywords: 'keyword',
	numbers: 'constant.numeric',
	types: 'entity.name.type',
	functions: 'entity.name.function',
	variables: 'variable'
};

export class ColorThemeData implements IColorTheme {

	constructor() {
	}

	id: string;
	label: string;
	settingsId: string;
	description?: string;
	get tokenColors(): ITokenColorizationRule[] {
		// Add the custom colors after the theme colors
		// so that they will override them
		return this.themeTokenColors.concat(this.customTokenColors);
	}
	themeTokenColors: ITokenColorizationRule[] = [];
	customTokenColors: ITokenColorizationRule[] = [];
	isLoaded: boolean;
	path?: string;
	extensionData: ExtensionData;
	colorMap: IColorMap = {};
	customColorMap: IColorMap = {};

	public getColor(colorId: ColorIdentifier, useDefault?: boolean): Color {
		let color = this.customColorMap[colorId];
		if (color) {
			return color;
		}
		color = this.colorMap[colorId];
		if (useDefault !== false && types.isUndefined(color)) {
			color = this.getDefault(colorId);
		}
		return color;
	}

	public getDefault(colorId: ColorIdentifier): Color {
		return colorRegistry.resolveDefaultColor(colorId, this);
	}

	public defines(colorId: ColorIdentifier): boolean {
		return this.customColorMap.hasOwnProperty(colorId) || this.colorMap.hasOwnProperty(colorId);
	}

	public setCustomColors(colors: IColorCustomizations) {
		this.customColorMap = {};
		for (let id in colors) {
			let colorVal = colors[id];
			if (typeof colorVal === 'string') {
				this.customColorMap[id] = Color.fromHex(colorVal);
			}
		}
		if (this.themeTokenColors && this.themeTokenColors.length) {
			updateDefaultRuleSettings(this.themeTokenColors[0], this);
		}
	}

	public setCustomTokenColors(customTokenColors: ITokenColorCustomizations) {
		let generalRules: ITokenColorizationRule[] = [];

		let value, settings, scope;
		Object.keys(tokenGroupToScopesMap).forEach(key => {
			value = customTokenColors[key];
			settings = typeof value === 'string'
				? { foreground: value }
				: value;
			scope = tokenGroupToScopesMap[key];

			if (!settings) {
				return;
			}

			generalRules.push({
				scope,
				settings
			});
		});

		const textMateRules: ITokenColorizationRule[] = customTokenColors.textMateRules || [];

		// Put the general customizations such as comments, strings, etc. first so that
		// they can be overriden by specific customizations like "string.interpolated"
		this.customTokenColors = generalRules.concat(textMateRules);
	}

	public ensureLoaded(themeService: WorkbenchThemeService): TPromise<void> {
		if (!this.isLoaded) {
			this.themeTokenColors = [];
			this.colorMap = {};
			if (this.path) {
				return _loadColorThemeFromFile(this.path, this.themeTokenColors, this.colorMap).then(_ => {
					this.isLoaded = true;
					_sanitizeTokenColors(this);
				});
			}
		}
		return TPromise.as(null);
	}

	toThemeFile() {
		if (!this.isLoaded) {
			return '';
		}
		let content = { name: this.label, colors: {}, tokenColors: this.tokenColors };
		for (let key in this.colorMap) {
			content.colors[key] = Color.Format.CSS.formatHexA(this.colorMap[key], true);
		}
		return JSON.stringify(content, null, '\t');
	}

	toStorageData() {
		let colorMapData = {};
		for (let key in this.colorMap) {
			colorMapData[key] = Color.Format.CSS.formatHexA(this.colorMap[key], true);
		}
		// no need to persist custom colors, they will be taken from the settings
		return JSON.stringify({
			id: this.id,
			label: this.label,
			settingsId: this.settingsId,
			selector: this.id.split(' ').join('.'), // to not break old clients
			themeTokenColors: this.themeTokenColors,
			extensionData: this.extensionData,
			colorMap: colorMapData
		});
	}

	hasEqualData(other: ColorThemeData) {
		return objects.equals(this.colorMap, other.colorMap) && objects.equals(this.tokenColors, other.tokenColors);
	}

	get type(): ThemeType {
		let baseTheme = this.id.split(' ')[0];
		switch (baseTheme) {
			case VS_LIGHT_THEME: return 'light';
			case VS_HC_THEME: return 'hc';
			default: return 'dark';
		}
	}
}

export function createUnloadedTheme(id: string): ColorThemeData {
	let themeData = new ColorThemeData();
	themeData.id = id;
	themeData.label = '';
	themeData.settingsId = null;
	themeData.isLoaded = false;
	themeData.themeTokenColors = [{ settings: {} }];
	return themeData;
}

export function fromStorageData(input: string): ColorThemeData {
	try {
		let data = JSON.parse(input);
		let theme = new ColorThemeData();
		for (let key in data) {
			switch (key) {
				case 'colorMap':
					let colorMapData = data[key];
					for (let id in colorMapData) {
						theme.colorMap[id] = Color.fromHex(colorMapData[id]);
					}
					break;
				case 'themeTokenColors':
				case 'id': case 'label': case 'settingsId': case 'extensionData':
					theme[key] = data[key];
					break;
			}
		}
		return theme;
	} catch (e) {
		return null;
	}
}

export function fromExtensionTheme(theme: IThemeExtensionPoint, normalizedAbsolutePath: string, extensionData: ExtensionData): ColorThemeData {
	let baseTheme: string = theme['uiTheme'] || 'vs-dark';

	let themeSelector = toCSSSelector(extensionData.extensionId + '-' + Paths.normalize(theme.path));
	let themeData = new ColorThemeData();
	themeData.id = `${baseTheme} ${themeSelector}`;
	themeData.label = theme.label || Paths.basename(theme.path);
	themeData.settingsId = theme.id || themeData.label;
	themeData.description = theme.description;
	themeData.path = normalizedAbsolutePath;
	themeData.extensionData = extensionData;
	themeData.isLoaded = false;
	return themeData;
}

function toCSSSelector(str: string) {
	str = str.replace(/[^_\-a-zA-Z0-9]/g, '-');
	if (str.charAt(0).match(/[0-9\-]/)) {
		str = '_' + str;
	}
	return str;
}

function _loadColorThemeFromFile(themePath: string, resultRules: ITokenColorizationRule[], resultColors: IColorMap): TPromise<any> {
	if (Paths.extname(themePath) === '.json') {
		return pfs.readFile(themePath).then(content => {
			let errors: Json.ParseError[] = [];
			let contentValue = Json.parse(content.toString(), errors);
			if (errors.length > 0) {
				return TPromise.wrapError(new Error(nls.localize('error.cannotparsejson', "Problems parsing JSON theme file: {0}", errors.map(e => getParseErrorMessage(e.error)).join(', '))));
			}
			let includeCompletes = TPromise.as(null);
			if (contentValue.include) {
				includeCompletes = _loadColorThemeFromFile(Paths.join(Paths.dirname(themePath), contentValue.include), resultRules, resultColors);
			}
			return includeCompletes.then(_ => {
				if (Array.isArray(contentValue.settings)) {
					convertSettings(contentValue.settings, resultRules, resultColors);
					return null;
				}
				let colors = contentValue.colors;
				if (colors) {
					if (typeof colors !== 'object') {
						return TPromise.wrapError(new Error(nls.localize({ key: 'error.invalidformat.colors', comment: ['{0} will be replaced by a path. Values in quotes should not be translated.'] }, "Problem parsing color theme file: {0}. Property 'colors' is not of type 'object'.", themePath)));
					}
					// new JSON color themes format
					for (let colorId in colors) {
						let colorHex = colors[colorId];
						if (typeof colorHex === 'string') { // ignore colors tht are null
							resultColors[colorId] = Color.fromHex(colors[colorId]);
						}
					}
				}
				let tokenColors = contentValue.tokenColors;
				if (tokenColors) {
					if (Array.isArray(tokenColors)) {
						resultRules.push(...tokenColors);
						return null;
					} else if (typeof tokenColors === 'string') {
						return _loadSyntaxTokensFromFile(Paths.join(Paths.dirname(themePath), tokenColors), resultRules, {});
					} else {
						return TPromise.wrapError(new Error(nls.localize({ key: 'error.invalidformat.tokenColors', comment: ['{0} will be replaced by a path. Values in quotes should not be translated.'] }, "Problem parsing color theme file: {0}. Property 'tokenColors' should be either an array specifying colors or a path to a TextMate theme file", themePath)));
					}
				}
				return null;
			});
		});
	} else {
		return _loadSyntaxTokensFromFile(themePath, resultRules, resultColors);
	}
}

function _loadSyntaxTokensFromFile(themePath: string, resultRules: ITokenColorizationRule[], resultColors: IColorMap): TPromise<any> {
	return pfs.readFile(themePath).then(content => {
		try {
			let contentValue = plist.parse(content.toString());
			let settings: ITokenColorizationRule[] = contentValue.settings;
			if (!Array.isArray(settings)) {
				return TPromise.wrapError(new Error(nls.localize('error.plist.invalidformat', "Problem parsing tmTheme file: {0}. 'settings' is not array.")));
			}
			convertSettings(settings, resultRules, resultColors);
			return TPromise.as(null);
		} catch (e) {
			return TPromise.wrapError(new Error(nls.localize('error.cannotparse', "Problems parsing tmTheme file: {0}", e.message)));
		}
	}, error => {
		return TPromise.wrapError(new Error(nls.localize('error.cannotload', "Problems loading tmTheme file {0}: {1}", themePath, error.message)));
	});
}
/**
 * Place the default settings first and add add the token-info rules
 */
function _sanitizeTokenColors(theme: ColorThemeData) {
	let hasDefaultTokens = false;
	let updatedTokenColors: ITokenColorizationRule[] = [updateDefaultRuleSettings({ settings: {} }, theme)];
	theme.tokenColors.forEach(rule => {
		if (rule.scope) {
			if (rule.scope === 'token.info-token') {
				hasDefaultTokens = true;
			}
			updatedTokenColors.push(rule);
		}
	});
	if (!hasDefaultTokens) {
		updatedTokenColors.push(...defaultThemeColors[theme.type]);
	}
	theme.themeTokenColors = updatedTokenColors;
}

function updateDefaultRuleSettings(defaultRule: ITokenColorizationRule, theme: ColorThemeData): ITokenColorizationRule {
	let foreground = theme.getColor(editorForeground) || theme.getDefault(editorForeground);
	let background = theme.getColor(editorBackground) || theme.getDefault(editorBackground);
	defaultRule.settings.foreground = Color.Format.CSS.formatHexA(foreground);
	defaultRule.settings.background = Color.Format.CSS.formatHexA(background);
	return defaultRule;
}

let defaultThemeColors: { [baseTheme: string]: ITokenColorizationRule[] } = {
	'light': [
		{ scope: 'token.info-token', settings: { foreground: '#316bcd' } },
		{ scope: 'token.warn-token', settings: { foreground: '#cd9731' } },
		{ scope: 'token.error-token', settings: { foreground: '#cd3131' } },
		{ scope: 'token.debug-token', settings: { foreground: '#800080' } }
	],
	'dark': [
		{ scope: 'token.info-token', settings: { foreground: '#6796e6' } },
		{ scope: 'token.warn-token', settings: { foreground: '#cd9731' } },
		{ scope: 'token.error-token', settings: { foreground: '#f44747' } },
		{ scope: 'token.debug-token', settings: { foreground: '#b267e6' } }
	],
	'hc': [
		{ scope: 'token.info-token', settings: { foreground: '#6796e6' } },
		{ scope: 'token.warn-token', settings: { foreground: '#008000' } },
		{ scope: 'token.error-token', settings: { foreground: '#FF0000' } },
		{ scope: 'token.debug-token', settings: { foreground: '#b267e6' } }
	],
};


text:
TNT4J Samples

Running Samples
===============================================
* Directory Monitor (`com.jkoolcloud.tnt4j.samples.FolderMonitor`). Monitors a given directory for added, modified, deleted files.
```java
java -Dorg.slf4j.simpleLogger.defaultLogLevel=debug -Dtnt4j.config=config/tnt4j.properties -Dtnt4j.dump.on.vm.shutdown=true -Dtnt4j.dump.provider.default=true -classpath tnt4j-samples*.jar;lib/* com.jkoolcloud.tnt4j.samples.FolderMonitor /temp
```
* Sample Pinger (`com.jkoolcloud.tnt4j.samples.Pinger`). Generate activity ping at a specified interval.
```java
java -Dorg.slf4j.simpleLogger.defaultLogLevel=debug -Dtnt4j.config=config/tnt4j.properties -Dtnt4j.dump.on.vm.shutdown=true -Dtnt4j.dump.provider.default=true -classpath tnt4j-samples*.jar;lib/* com.jkoolcloud.tnt4j.samples.Pinger com.nastel.pinger pingActivity 1000
```

**Command line arguments:**
* `-Dorg.slf4j.simpleLogger.defaultLogLevel=debug` -- default logging level for SLF4J simple logger binding.
* `-Dtnt4j.dump.on.vm.shutdown=true` java property allows application state dumps generated automatically upon VM shutdown.
* `-Dtnt4j.dump.provider.default=true` java property registers all default dump providers (memory, stack, logging stats).
* `-Dtnt4j.formatter.json.newline=true` java property directs `JSONFormatter` to append new line when formatting log entries.

See `<timestamp>.log` and `<vmid>.dump` files for output produced by `com.jkoolcloud.tnt4j.samples.FolderMonitor`.
See `config/tnt4j.properties` for TNT4J configuration: factories, formatters, listeners, etc.

# Project Dependencies
* JDK 1.8+
* TNT4J (https://github.com/Nastel/TNT4J)

These examples require TNT4J. You will therefore need to point TNT4J to it's property file via the -Dtnt4j.config argument. This property file is located here in GitHub under the /config directory. If using JCenter or Maven, it can be found in the zip assembly along with the source code and javadoc.


text:
package uk.ac.ebi.atlas.profiles.writer;

import org.apache.commons.lang3.ArrayUtils;
import uk.ac.ebi.atlas.experimentpage.context.RequestContext;
import uk.ac.ebi.atlas.model.DescribesDataColumns;
import uk.ac.ebi.atlas.model.Expression;
import uk.ac.ebi.atlas.model.Profile;
import uk.ac.ebi.atlas.search.SearchDescription;

import javax.annotation.Nullable;
import java.io.Writer;
import java.util.List;
import java.util.stream.Stream;

import static org.apache.commons.lang3.StringUtils.wrap;

public abstract class ProfilesWriterFactory<D extends DescribesDataColumns,
                                            E extends Expression,
                                            P extends Profile<D, E, P>,
                                            R extends RequestContext<D, ?, ?, ?>> {

    protected abstract String getTsvFileMasthead(R requestContext, String queryDescription);

    protected String[] getProfileIdColumnHeaders(R requestContext) {
        return new String[]{"Gene ID", "Gene Name"};
    }

    protected Stream<String> labelsForColumn(R requestContext, D dataColumnDescriptor) {
        return Stream.of(requestContext.displayNameForColumn(dataColumnDescriptor));
    }

    protected Stream<String> valuesFromColumn(R requestContext, @Nullable E expression) {
        return Stream.of(expression == null ? "" : Double.toString(expression.getLevel()));
    }

    public final ProfilesWriter<P> create(Writer responseWriter, final R requestContext) {
        final List<D> columns = requestContext.getDataColumnsToReturn();
        return new ProfilesWriter<>(
                responseWriter,
                getTsvFileMasthead(requestContext, wrap(SearchDescription.get(requestContext.getGeneQuery()), "'")),
                buildCsvHeaderLine(requestContext, columns),
                prof ->
                        buildCsvRow(
                                prof.identifiers(),
                                columns.stream()
                                       .flatMap(
                                               dataColumnDescriptor ->
                                                       valuesFromColumn(
                                                               requestContext,
                                                               prof.getExpression(dataColumnDescriptor)))
                                       .toArray(String[]::new))
        );
    }

    private String[] buildCsvHeaderLine(final R requestContext, final List<D> columns) {
        return buildCsvRow(
                getProfileIdColumnHeaders(requestContext),
                columns.stream()
                       .flatMap(dataColumnDescriptor -> labelsForColumn(requestContext, dataColumnDescriptor))
                       .toArray(String[]::new));
    }

    private String[] buildCsvRow(String[] rowHeaders, String[] values) {
        return ArrayUtils.addAll(rowHeaders, values);
    }

}


text:
namespace urde::MP1 {
class CFlyingPirate : public CPatterned {
public:
  DEFINE_PATTERNED(FlyingPirate)

  CFlyingPirate(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
                const CActorParameters&, const CPatternedInfo&, CInputStream&, u32);
};
} // namespace urde::MP1


text:
package main

import (
	"fmt"
	"io/ioutil"
	"os"
	"os/exec"
	"path/filepath"
	"strconv"
	"strings"

	"github.com/docker/docker/pkg/integration/checker"
	"github.com/docker/docker/pkg/system"
	"github.com/go-check/check"
)

// user namespaces test: run daemon with remapped root setting
// 1. validate uid/gid maps are set properly
// 2. verify that files created are owned by remapped root
func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *check.C) {
	testRequires(c, DaemonIsLinux, SameHostDaemon, UserNamespaceInKernel)

	c.Assert(s.d.StartWithBusybox("--userns-remap", "default"), checker.IsNil)

	tmpDir, err := ioutil.TempDir("", "userns")
	c.Assert(err, checker.IsNil)

	defer os.RemoveAll(tmpDir)

	// we need to find the uid and gid of the remapped root from the daemon's root dir info
	uidgid := strings.Split(filepath.Base(s.d.root), ".")
	c.Assert(uidgid, checker.HasLen, 2, check.Commentf("Should have gotten uid/gid strings from root dirname: %s", filepath.Base(s.d.root)))
	uid, err := strconv.Atoi(uidgid[0])
	c.Assert(err, checker.IsNil, check.Commentf("Can't parse uid"))
	gid, err := strconv.Atoi(uidgid[1])
	c.Assert(err, checker.IsNil, check.Commentf("Can't parse gid"))

	// writable by the remapped root UID/GID pair
	c.Assert(os.Chown(tmpDir, uid, gid), checker.IsNil)

	out, err := s.d.Cmd("run", "-d", "--name", "userns", "-v", tmpDir+":/goofy", "busybox", "sh", "-c", "touch /goofy/testfile; top")
	c.Assert(err, checker.IsNil, check.Commentf("Output: %s", out))
	user := s.findUser(c, "userns")
	c.Assert(uidgid[0], checker.Equals, user)

	pid, err := s.d.Cmd("inspect", "--format='{{.State.Pid}}'", "userns")
	c.Assert(err, checker.IsNil, check.Commentf("Could not inspect running container: out: %q", pid))
	// check the uid and gid maps for the PID to ensure root is remapped
	// (cmd = cat /proc/<pid>/uid_map | grep -E '0\s+9999\s+1')
	out, rc1, err := runCommandPipelineWithOutput(
		exec.Command("cat", "/proc/"+strings.TrimSpace(pid)+"/uid_map"),
		exec.Command("grep", "-E", fmt.Sprintf("0[[:space:]]+%d[[:space:]]+", uid)))
	c.Assert(rc1, checker.Equals, 0, check.Commentf("Didn't match uid_map: output: %s", out))

	out, rc2, err := runCommandPipelineWithOutput(
		exec.Command("cat", "/proc/"+strings.TrimSpace(pid)+"/gid_map"),
		exec.Command("grep", "-E", fmt.Sprintf("0[[:space:]]+%d[[:space:]]+", gid)))
	c.Assert(rc2, checker.Equals, 0, check.Commentf("Didn't match gid_map: output: %s", out))

	// check that the touched file is owned by remapped uid:gid
	stat, err := system.Stat(filepath.Join(tmpDir, "testfile"))
	c.Assert(err, checker.IsNil)
	c.Assert(stat.UID(), checker.Equals, uint32(uid), check.Commentf("Touched file not owned by remapped root UID"))
	c.Assert(stat.GID(), checker.Equals, uint32(gid), check.Commentf("Touched file not owned by remapped root GID"))

	// use host usernamespace
	out, err = s.d.Cmd("run", "-d", "--name", "userns_skip", "--userns", "host", "busybox", "sh", "-c", "touch /goofy/testfile; top")
	c.Assert(err, checker.IsNil, check.Commentf("Output: %s", out))
	user = s.findUser(c, "userns_skip")
	// userns are skipped, user is root
	c.Assert(user, checker.Equals, "root")
}

// findUser finds the uid or name of the user of the first process that runs in a container
func (s *DockerDaemonSuite) findUser(c *check.C, container string) string {
	out, err := s.d.Cmd("top", container)
	c.Assert(err, checker.IsNil, check.Commentf("Output: %s", out))
	rows := strings.Split(out, "\n")
	if len(rows) < 2 {
		// No process rows founds
		c.FailNow()
	}
	return strings.Fields(rows[1])[0]
}


text:
package ericminio.katas.mastermind;

import ericminio.yop.Yop;
import ericminio.yop.YopTest;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;

public class ExploreYopTest extends YopTest {

    @Override
    protected String getYopFileName() {
        return "explore.yop";
    }

    @Yop(match = "the feedback is (.*)")
    public void expectFeedback(String feedback) {
        assertThat(feedback, equalTo("3, 0"));
    }

}


text:
package com.sissi.pipeline.in.iq.muc.admin.affiliation;

import com.sissi.context.JIDContext;
import com.sissi.pipeline.in.ProxyProcessor;
import com.sissi.protocol.Error;
import com.sissi.protocol.Protocol;
import com.sissi.protocol.ProtocolType;
import com.sissi.protocol.error.ServerError;
import com.sissi.protocol.error.detail.Forbidden;

/**
 * 是否已加入MUC校验(Get)
 *
 * @author kim 2014年3月14日
 */
public class MucCheckAffiliationJoinProcessor extends ProxyProcessor {

	private final Error error = new ServerError().type(ProtocolType.AUTH).add(Forbidden.DETAIL);

	@Override
	public boolean input(JIDContext context, Protocol protocol) {
		return super.ourRelation(context.jid(), super.build(protocol.parent().getTo())).activate() ? true : this.writeAndReturn(context, protocol);
	}

	private boolean writeAndReturn(JIDContext context, Protocol protocol) {
		context.write(protocol.parent().reply().setError(this.error));
		return false;
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace bancdoor._masterPages
{
    public partial class Root : System.Web.UI.MasterPage
    {
        PageBuilder _pb;

        protected void Page_Load(object sender, EventArgs e)
        {
            _pb = new PageBuilder(Server.MapPath("~\\CONFIG\\Application.xml"));
//            litNavigation.Text = _pb.GetNavigation("");

            List<HyperLink> nav = _pb.GetNavigationLinks();

            foreach (HyperLink h in nav)
            {
                navigation.Controls.Add(h);
            }
        }

        public PageBuilder GetPageBuilder()
        {
            return _pb;
        }
    }
}


text:
/*! \file hilbert_curve.h
 *  \brief Cluster points using a Hilbert space filling curve
 */

#pragma once

#include <cusp/detail/config.h>

namespace cusp
{
namespace graph
{
/*! \addtogroup algorithms Algorithms
 *  \ingroup algorithms
 *  \{
 */

/*! \p hilbert_curve : Uses a Hilbert space filling curve to partition
 * a set of points in 2 or 3 dimensional space.
 *
 *
 * \param Set of points in 2 or 3-D space
 * \param number of partitions to construct
 * \param partition assigned to each point
 *
 * \tparam Array coord
 * \tparam size_t num_parts
 * \tparam Array parts
 *
 *  \see http://en.wikipedia.org/wiki/Hilbert_curve
 */
template <class Array2d, class Array1d>
void hilbert_curve(const Array2d& coord, const size_t num_parts, Array1d& parts);

/*! \}
 */

} // end namespace graph
} // end namespace cusp

#include <cusp/graph/detail/hilbert_curve.inl>


text:
import { combineReducers } from 'redux';

import coordinates from '../coordinates';
import address from '../address';

export default combineReducers({
  coordinates,
  address,
});

export const getCoordinates = state => state.coordinates;

export const getAddress = state => state.address;


text:
<!doctype html>

<meta charset="utf-8">
<title>CSE5ITP-Project1-TeamG</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/media_quary.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap-responsive.css"rel="stylesheet" type="text/css" />
<link href="css/style_2.css" rel="stylesheet" type="text/css" />
<link href="css/ticker-style.css" rel="stylesheet" type="text/css" />

<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'>

Victoria Digital Careers

 Home

Teachers

Parents

Students

Carrer Advisors

About Us

Contact

Categories

Digital Careers

The future

Do Good

Be Empowered

Open Doors

Be Connected

                            A mini documentary investigating career opportunities in IT and Technology by http://www.careerplayer.com

The future has never been more exciting!

Technology touches every aspect of our lives. Everything from the way we work and learn through to the way we socialise, pursue careers in Australia and communicate has changed radically over the past few years. Our society has never experienced change on this scale or at this pace. This is why it is essential that every Australian student has the digital skills to remain empowered to be able to pursue careers in Australia as our economy pushes forward at an ever increasing pace. Whether working in mining, law, business, finance, education or medicine – now is the time to take up a Digital Career in Australia.

ICT Games/Quizzes

                            Science and Technology for kids

							IT Quiz - Beginner

							IT Quiz - Advanced

ICT Jobs/Internships

                            Internships - GradConnection

                            Graduate jobs - GradConnection

							ICT jobs - seek

Join Us

Name

                             	<input type="text" name="name" style="width:100%; height:28px;">

E-mail

                             	<input type="text" name="mail" style="width:100%; height:28px;">

News and Activities

Digital Careers leads, participates in....

Promotion

Digital Careers works with students to profile.....

Upcoming Events

	Mon 24 November, 2014, 12:00 AM

Convention 2014: Our Voice, Our Future

Tuesday 18 November, 2014, 2:00pm - 3:30pm

Using resources from home

Tuesday 23 September, 2014, 5:30 pm - 7:30 pm

Graduate ICT Girls Networking and Career Planning Evening
NAB, Melbourne Vic

About Us

                    Victorian Digital Careers is a collaborative state initiative of industry, research, primary, secondary, and tertiary institutions (universities and TAFE), and government focused on reducing the critical shortage of Victorian ICT professionals by raising awareness and interest in ICT careers, and growing and diversifying the pool of tertiary students preparing for a career in the ICT industry.

Staff Profiles

Program Director

The Digital Careers consortium comprises stakeholder organisations...

Address

                    111 Street, Melbourne,  Victoria

Phone: (000) 999-9999

Email: info@Victoria.com

Connect with us

Copyright © 2014, Victoria

Home | About Us | Privacy & policy | Contact


text:
#ifndef LODEN_GUI_LODEN_FONT_HPP
#define LODEN_GUI_LODEN_FONT_HPP

#include "Loden/Engine.hpp"
#include "Loden/GUI/Font.hpp"
#include "Loden/GUI/FontManager.hpp"

namespace Loden
{
namespace GUI
{

/**
* Free type font loader
*/
class LodenFontLoader : public ObjectSubclass<LodenFontLoader, FontLoader>
{
public:
    LodenFontLoader(Engine *engine=nullptr);
    ~LodenFontLoader();

    bool initialize();
    void shutdown();

    bool canLoadFaceFromFile(const std::string &fileName);
    FontFacePtr loadFaceFromFile(const std::string &fileName);

private:
    Engine *engine;
};

} // End of namespace GUI
} // End of namespace Loden

#endif //LODEN_GUI_LODEN_FONT_HPP


text:
/**
 * The controller communication manager:
 *  - provides API to the backend device to use by views
 *
 * @author Edouard Lafargue, ed@lafargue.name
 */

define(function (require) {
    "use strict";

    // linkManager is a reference to the parent link manager
    return function () {

        var self = this;
        var lm = linkManager;
        var streaming = false;
        var streamingText = false;
        var livePoller = null; // Reference to the timer for live streaming
        var textPoller = null; // This is a poller to read from the radio TB buffer.

        var kxpa100 = false; // Keep track of the presence of an amplifier

        //////
        //  Standard API:
        // All link managers need this function:
        //////
        this.getBackendDriverName = function () {
            return 'telepost_lp100a';
        }

        //////
        // End of standard API
        //////

        // All commands below are fully free and depend on
        // the instrument's capabilities

        console.log('Started LP-100A front-end driver..');

    };

});


text:
<?php

namespace Hogosha\Monitor\Renderer;

use Hogosha\Monitor\Guesser\StatusGuesser;
use Hogosha\Monitor\Model\ResultCollection;
use Webmozart\Console\Api\IO\IO;
use Webmozart\Console\UI\Component\Table;

/**
 * @author Guillaume Cavana <guillaume.cavana@gmail.com>
 */
class TableRenderer implements RendererInterface
{
    protected $io;

    /**
     * Constructor.
     *
     * @param IO $io
     */
    public function __construct(IO $io)
    {
        $this->io = $io;
    }

    /**
     * {@inheritdoc}
     */
    public function render(ResultCollection $resultCollection)
    {
        $table = new Table();
        $table
            ->setHeaderRow(['Global Status', 'Status Code', 'Name', 'Response Time', 'Http Error Log', 'Validator Error Log']);

        $statusGuesser = new StatusGuesser();

        foreach ($resultCollection as $result) {
            $color = $statusGuesser->isFailed($result) ? 'red' : 'green';
            $table->addRow([
                $statusGuesser->isFailed($result) ? 'FAIL' : 'OK',
                sprintf(
                    '<bg=%s>%s</>',
                    $color,
                    $result->getStatusCode()
                ),
                $result->getUrl()->getName(),
                $result->getReponseTime(),
                sprintf(
                    '<bg=red>%s</>',
                    $result->getHandlerError()
                ),
                sprintf(
                    '<bg=red>%s</>',
                    $result->getValidatorError()
                ),
            ]);
        }

        $table->render($this->io);
    }
}


text:
namespace anime_downloader.Views.Displays
{
    /// <summary>
    ///     Interaction logic for Misc.xaml
    /// </summary>
    public partial class Misc
    {
        public Misc()
        {
            InitializeComponent();
        }
    }
}


text:
<!--
  ~ *******************************************************************************
  ~   Copyright (c) 2013-2014 Gabriele Mariotti.
  ~
  ~   Licensed under the Apache License, Version 2.0 (the "License");
  ~   you may not use this file except in compliance with the License.
  ~   You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~   Unless required by applicable law or agreed to in writing, software
  ~   distributed under the License is distributed on an "AS IS" BASIS,
  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~   See the License for the specific language governing permissions and
  ~   limitations under the License.
  ~  *****************************************************************************
  -->

<resources>

    <!-- Undo Controller-->

    <string name="list_card_undo_title">Undo</string>
    <!--<string name="undo_card">Card removed</string>-->

    <plurals name="list_card_undo_items">
        <item quantity="one">1 card removed</item>
        <item quantity="other">%d cards removed</item>
    </plurals>

    <!-- Card selected item with CAB -->
    <plurals name="card_selected_items">
        <item quantity="one">1 item selected</item>
        <item quantity="other">%d items selected</item>
    </plurals>

    <!-- Card with List -->
    <string name="card_empty_cardwithlist_text">No data....</string>
    <string name="card_progressbar_cardwithlist_text">Loading data...</string>

</resources>


text:
/**
 * Created by wQ on 2017/4/24.
 */
import { Component } from '@angular/core';

/**
 * This class represents the lazy loaded AboutComponent.
 */
@Component({
  moduleId: module.id,
  selector: 'article2',
  templateUrl: 'article2.component.html',
  styleUrls: ['article2.component.css']
})
export class Article2Component { }


text:
<?php

namespace Pimcore\Console\Command;

use Pimcore\Cache\Tool\Warming;
use Pimcore\Console\AbstractCommand;
use Pimcore\Tool\Admin;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Console command implementation of cache-warming.php
 */
class CacheWarmingCommand extends AbstractCommand
{
    /**
     * @var array
     */
    protected $validTypes = [
        'document',
        'asset',
        'object',
    ];

    /**
     * @var array
     */
    protected $validDocumentTypes = [
        'page',
        'snippet',
        'folder',
        'link',
    ];

    /**
     * @var array
     */
    protected $validAssetTypes = [
        'archive',
        'audio',
        'document',
        'folder',
        'image',
        'text',
        'unknown',
        'video',
    ];

    /**
     * @var array
     */
    protected $validObjectTypes = [
        'object',
        'folder',
        'variant',
    ];

    protected function configure()
    {
        $this
            ->setName('cache:warming')
            ->setDescription('Warm up caches')
            ->addOption(
                'types', 't',
                InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
                sprintf('Perform warming only for this types of elements. Valid options: %s', $this->humanList($this->validTypes)),
                null
            )
            ->addOption(
                'documentTypes', 'd',
                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
                sprintf('Restrict warming to these types of documents. Valid options: %s', $this->humanList($this->validDocumentTypes)),
                null
            )
            ->addOption(
                'assetTypes', 'a',
                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
                sprintf('Restrict warming to these types of assets. Valid options: %s', $this->humanList($this->validAssetTypes)),
                null
            )
            ->addOption(
                'objectTypes', 'o',
                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
                sprintf('Restrict warming to these types of objects. Valid options: %s', $this->humanList($this->validObjectTypes)),
                null
            )
            ->addOption(
                'classes', 'c',
                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
                'Restrict object warming to these classes (only valid for objects!). Valid options: class names of your classes defined in Pimcore',
                null
            )
            ->addOption(
                'maintenanceMode', 'm',
                InputOption::VALUE_NONE,
                'Enable maintenance mode during cache warming'
            )
        ;
    }

    protected function initialize(InputInterface $input, OutputInterface $output)
    {
        parent::initialize($input, $output);
        $this->initializePimcoreLogging();
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->enableMaintenanceMode();

        try {
            $types         = $this->getArrayOption('types', 'validTypes', 'type', true);
            $documentTypes = $this->getArrayOption('documentTypes', 'validDocumentTypes', 'document type');
            $assetTypes    = $this->getArrayOption('assetTypes', 'validAssetTypes', 'asset type');
            $objectTypes   = $this->getArrayOption('objectTypes', 'validObjectTypes', 'object type');
        } catch (\InvalidArgumentException $e) {
            $this->writeError($e->getMessage());
            return 1;
        }

        if (in_array('document', $types)) {
            $this->writeWarmingMessage('document', $documentTypes);
            Warming::documents($documentTypes);
        }

        if (in_array('asset', $types)) {
            $this->writeWarmingMessage('asset', $assetTypes);
            Warming::assets($assetTypes);
        }

        if (in_array('object', $types)) {
            $this->writeWarmingMessage('object', $objectTypes);
            Warming::assets($assetTypes);
        }

        $this->disableMaintenanceMode();
    }

    protected function writeWarmingMessage($type, $types)
    {
        $output = sprintf('Warming <comment>%s</comment> cache', $type);
        if (null !== $types && count($types) > 0) {
            $output .= sprintf(' for types %s', $this->humanList($types, 'and', '<info>%s</info>'));
        } else {
            $output .= sprintf(' for <info>all</info> types');
        }

        $output .= '...';
        $this->output->writeln($output);
    }

    /**
     * A,B,C -> A, B or C (with an optional template for each item)
     *
     * @param $list
     * @param string $glue
     * @param null $template
     * @return string
     */
    protected function humanList($list, $glue = 'or', $template = null)
    {
        if (null !== $template) {
            array_walk($list, function(&$item) use ($template) {
                $item = sprintf($template, $item);
            });
        }

        if (count($list) > 1) {
            $lastElement = array_pop($list);
            return implode(', ', $list) . ' ' . $glue . ' ' . $lastElement;
        } else {
            return implode(', ', $list);
        }
    }

    /**
     * Get one of types, document, asset or object types, handle "all" value
     * and list input validation.
     *
     * @param $option
     * @param $property
     * @param $singular
     * @param bool $fallback
     * @return mixed
     */
    protected function getArrayOption($option, $property, $singular, $fallback = false)
    {
        $input = $this->input->getOption($option);

        // fall back to whole list if fallback is set
        if (!$input || count($input) === 0) {
            if ($fallback) {
                $input = $this->$property;
            } else {
                $input = null;
            }
        }

        if (null !== $input) {
            foreach ($input as $value) {
                if (!in_array($value, $this->$property)) {
                    $message = sprintf('Invalid %s: %s', $singular, $value);
                    throw new \InvalidArgumentException($message);
                }
            }
        }

        return $input;
    }

    /**
     * Enable maintenance mode if --maintenanceMode option was passed
     */
    protected function enableMaintenanceMode()
    {
        // enable maintenance mode if requested
        if ($this->input->getOption('maintenanceMode')) {
            $maintenanceModeId = 'cache-warming-dummy-session-id';

            $this->output->writeln('Activating maintenance mode with ID <comment>%s</comment>...', $maintenanceModeId);

            Admin::activateMaintenanceMode($maintenanceModeId);

            // set the timeout between each iteration to 0 if maintenance mode is on, because
            // we don't have to care about the load on the server
            Warming::setTimoutBetweenIteration(0);
        }
    }

    protected function disableMaintenanceMode()
    {
        if ($this->input->getOption('maintenanceMode')) {
            $this->output->writeln('Deactivating maintenance mode...');
            Admin::deactivateMaintenanceMode();
        }
    }
}


text:
package org.apache.zookeeper;

import java.io.IOException;

import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.auth.login.AppConfigurationEntry;

import org.apache.hadoop.security.tokenauth.TokenAuthCallbackHandler;
import org.apache.hadoop.security.tokenauth.has.HASClient;
import org.apache.hadoop.security.tokenauth.has.HASClientImpl;
import org.apache.hadoop.security.tokenauth.secrets.Secrets;
import org.apache.hadoop.security.tokenauth.token.Token;
import org.apache.hadoop.security.tokenauth.token.TokenUtils;
import org.apache.zookeeper.common.JaasConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TokenAuthZooKeeperCallbackHandler implements
        TokenAuthCallbackHandler {
    private static final Logger LOG = LoggerFactory
            .getLogger(TokenAuthZooKeeperCallbackHandler.class);
    private static String identityServerAddress;
    private static String authorizationServerAddress;
    private static HASClient hasClient;
    private Login login;
    private CallbackHandler callbackHandler;

    public TokenAuthZooKeeperCallbackHandler(AppConfigurationEntry[] entries) {
        JaasConfig jaasConfig = new JaasConfig(entries);
        identityServerAddress = jaasConfig.getIdentityServerAddress();
        authorizationServerAddress = jaasConfig.getAuthorizationServerAddress();
    }

    public TokenAuthZooKeeperCallbackHandler(AppConfigurationEntry[] entries,
            CallbackHandler callbackHandler) {
        this(entries);
        this.callbackHandler = callbackHandler;
    }

    public void setLogin(Login login) {
        this.login = login;
    }

    @Override
    public void handle(Callback[] callbacks) throws IOException,
            UnsupportedCallbackException {
        if (null != callbackHandler) {
            callbackHandler.handle(callbacks);
        }
    }

    @Override
    public HASClient getHASClient() {
        if (null == hasClient) {
            synchronized (HASClient.class) {
                if (null == hasClient) {
                    if (null == identityServerAddress
                            || null == authorizationServerAddress) {
                        throw new IllegalArgumentException(
                                "Identity server or authorization server address is null.");
                    }
                    hasClient = new HASClientImpl(identityServerAddress,
                            authorizationServerAddress);
                }
            }
        }
        return hasClient;
    }

    @Override
    public byte[] getAccessToken(String protocol) throws IOException {
        HASClient hasClient = getHASClient();
        Token token = login.getIdentityToken();
        return hasClient.getAccessToken(token, protocol);
    }

    @Override
    public Secrets getValidationSecrets() throws IOException {
        return login.getValidationSecrets();
    }

}


text:
package com.eaw1805.www.client.events.map;

import com.google.gwt.event.shared.HandlerManager;

public class MapEventManager {

    static public HandlerManager handlerManager = new HandlerManager(null);

    public static void changeZoom(final double zoomLvl) {
        handlerManager.fireEvent(new ZoomEvent(zoomLvl));
    }

    public static void fireRegionChange(final int regionId) {
        handlerManager.fireEvent(new RegionChangedEvent(regionId));
    }

    public static void fireTileImagesLoaded(final int imagesType) {
        handlerManager.fireEvent(new TileImagesLoadedEvent(imagesType));
    }

    public static void addZoomHandler(final ZoomHandler handler) {
        handlerManager.addHandler(ZoomEvent.getType(), handler);
    }

    public static void addRegionChangedHandler(final RegionChangedHandler handler) {
        handlerManager.addHandler(RegionChangedEvent.getType(), handler);
    }

    public static void addTileImagesLoadedHandler(final TileImagesLoadedHandler handler) {
        handlerManager.addHandler(TileImagesLoadedEvent.getType(), handler);
    }

    public static void removeRegionChangedHandler(final RegionChangedHandler handler) {
        handlerManager.removeHandler(RegionChangedEvent.getType(), handler);
    }

}