text:
package picard.util;

import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by farjoun on 2/15/18.
 */
public class EditDistanceQueriesTest {

    private Object[][] levensteinDistanceData() {
        return new Object[][]{
                {"one", "ont", 3, 1},
                {"o-e", "oe-", 3, 1},
                {"on-e", "one-", 3, 1},
                {"o-ne", "one-", 3, 1},
                {"o-nce", "once-", 3, 1},
                {"on-ce", "once-", 3, 1},
                {"on-ce", "onc-e", 3, 2},
                {"n-ce", "nc-e", 3, 2},
                {"", "", 2, 0},
                {"ABCA-CABC", "ABCACABC-", 2, 1}, // gaps in the end should be ignored
                {"BC AB- ABC", "-BC AB ABC", 2, 2}, // but not in the beginning
                {"HELLO!", "HELLO!", 2, 0},
                {"very large distances are not measured well",
                        "so this should return the threshold plus 1", 5, 6},
                {"-ELLO", "ELLO-", 3, 1}
        };
    }

    @DataProvider
    private Object[][] levensteinDistanceWithNoCallsData() {
        return new Object[][]{
                {"one", ".ne", 0},
                {"any", "...", 0},
                {"hello", "hell.", 0},
                {"TCTGCAAGGCCAGAAG", "T.TGCAAGGCCAGAAG", 0},
                {       "CGCCTTCC",
                        "C.CCcTCC",    1},
                {       "AATCGCTG",
                        "A.cCGCTG", 1},
                {"goodbye--", "good.bye-", 1},
                {"goodddbye", "good.bye-", 1},
                {"--goodbye", "good.bye-", 3},
        };
    }

    @DataProvider
    public Object[][] levensteinDistanceSymmetricData() {
        final List<Object[]> tests = Arrays.asList(levensteinDistanceData());

        final List<Object[]> symmetricTests = new ArrayList<>(2 * tests.size());
        symmetricTests.addAll(tests);

        tests.forEach(t -> {
            final Object[] newTest = Arrays.copyOf(t, t.length);
            newTest[0] = t[1];
            newTest[1] = t[0];
            symmetricTests.add(newTest);
        });
        return symmetricTests.toArray(new Object[symmetricTests.size()][]);
    }

    @Test(dataProvider = "levensteinDistanceSymmetricData")
    public void levenshteinDistanceTest(final String string1, final String string2, final int threshold, final int expectedDistance) {
        distanceHelper(string1, string2, threshold, expectedDistance);
    }

    @Test(dataProvider = "levensteinDistanceWithNoCallsData")
    public void levenshteinDistanceWithNocallsTest(final String string1, final String string2, final int expectedDistance) {
        distanceHelper(string1, string2, 5, expectedDistance);
    }

    private void distanceHelper(final String string1, final String string2, final int threshold, final int expectedDistance) {
        final byte[] string1Bytes = string1.getBytes();
        final byte[] string2Bytes = string2.getBytes();

        Assert.assertEquals(new SingleBarcodeDistanceMetric(string1Bytes, string2Bytes, null, 0, threshold).freeDistance(), expectedDistance);

        // make sure that the code doesn't modify the input strings...
        Assert.assertEquals(string1Bytes, string1.getBytes());
        Assert.assertEquals(string2Bytes, string2.getBytes());
    }
}


text:
package client

import (
	"errors"

	"golang.org/x/net/context"

	"github.com/keybase/cli"
	"github.com/keybase/client/go/libcmdline"
	"github.com/keybase/client/go/libkb"
	keybase1 "github.com/keybase/client/go/protocol/keybase1"
)

// CmdSimpleFSSymlink is the 'fs ln' command.
type CmdSimpleFSSymlink struct {
	libkb.Contextified
	target string
	link   keybase1.Path
}

// NewCmdSimpleFSSymlink creates a new cli.Command.
func NewCmdSimpleFSSymlink(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
	return cli.Command{
		Name:         "ln",
		ArgumentHelp: "<target> <link>",
		Usage:        "create a symlink from link to target",
		Action: func(c *cli.Context) {
			cl.ChooseCommand(&CmdSimpleFSSymlink{Contextified: libkb.NewContextified(g)}, "ln", c)
			cl.SetNoStandalone()
		},
	}
}

// Run runs the command in client/server mode.
func (c *CmdSimpleFSSymlink) Run() error {
	cli, err := GetSimpleFSClient(c.G())
	if err != nil {
		return err
	}

	ctx := context.TODO()
	arg := keybase1.SimpleFSSymlinkArg{
		Target: c.target,
		Link:   c.link,
	}

	return cli.SimpleFSSymlink(ctx, arg)
}

// ParseArgv gets the required path argument for this command.
func (c *CmdSimpleFSSymlink) ParseArgv(ctx *cli.Context) error {
	nargs := len(ctx.Args())
	if nargs != 2 {
		return errors.New("ln requires exactly 2 arguments")
	}
	targetStr := ctx.Args()[0]
	linkStr := ctx.Args()[1]

	rev := int64(0)
	timeString := ""
	relTimeString := ""
	linkPath, err := makeSimpleFSPathWithArchiveParams(
		linkStr, rev, timeString, relTimeString)
	if err != nil {
		return err
	}

	linkPathType, err := linkPath.PathType()
	if err != nil {
		return err
	}
	if linkPathType != keybase1.PathType_KBFS {
		return errors.New("keybase fs ln: link must be a KBFS path")
	}
	c.link = linkPath

	c.target = targetStr

	return err
}

// GetUsage says what this command needs to operate.
func (c *CmdSimpleFSSymlink) GetUsage() libkb.Usage {
	return libkb.Usage{
		Config:    true,
		KbKeyring: true,
		API:       true,
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>

<info><title>Standard Formular Dekoratoren die mit dem Zend Framework ausgeliefert werden</title></info>

    <para>
        <classname>Zend_Form</classname> wird mit verschiedenen Standard Dekoratoren ausgeliefert.
        Für weitere Informationen über die generelle Verwendung von Dekoratoren, siehe das
        <link linkend="zend.form.decorators">Kapitel über Dekoratoren</link>.
    </para>

<info><title>Zend_Form_Decorator_Callback</title></info>

        <para>
            Der Callback Dekorator kann einen gewünschten Callback ausführen, um Inhalte
            darzustellen. Callbacks sollten über die 'callback' Option spezifiziert werden, die
            dem Dekorator in der Konfiguration übergeben wird, und die jeder gültige
            <acronym>PHP</acronym> Callback Typ sein kann. Callbacks sollten drei Argumente
            akzeptieren, <varname>$content</varname> (den originalen Inhalt der dem Dekorator
            übergeben wird), <varname>$element</varname> (das Element das dekoriert werden soll),
            und ein Array von <varname>$options</varname>. Ein Beispiel Callback:
        </para>

        <programlisting language="php"><![CDATA[
class Util
{
    public static function label($content, $element, array $options)
    {
        return '' . $element->getLabel() . '';
    }
}
]]></programlisting>

        <para>
            Dieser Callback kann mit <methodname>array('Util', 'label')</methodname> spezifiziert
            werden, und würde einige (falsche) <acronym>HTML</acronym> Markups für das Label
            erzeugen. Der Callback Dekorator würde entweder ersetzen, voranstellen, oder dem
            originalen Inhalt den zurückgegebenen Wert anhängen.
        </para>

        <para>
            Der Callback Dekorator erlaubt es, einen <constant>NULL</constant> Wert für die
            'placement' Option zu spezifizieren, welche den originalen Inhalt, mit dem, vom Callback
            zurückgegebenen Wert, ersetzt; 'prepend' und 'append' sind genauso gültig.
        </para>

<info><title>Zend_Form_Decorator_Captcha</title></info>

        <para>
            Der Captcha Dekorator ist für die Verwendung mit dem
            <link linkend="zend.form.standardElements.captcha">CAPTCHA Formularelement</link>. Es
            verwendet die <methodname>render()</methodname> Methode des CAPTCHA Adapters um die
            Ausgabe zu erzeugen.
        </para>

        <para>
            Eine Variante des Captcha Dekorators, 'Captcha_Word', wird auch üblicherweise verwendet,
            und erstellt zwei Elemente, eine Id und eine Eingabe. Die Id zeigt den Identifikator der
            Session gegen den verglichen wird, und die Eingabe ist für die Benutzerverifikation des
            CAPTCHA. Beide werden als einzelnes Element geprüft.
        </para>

<info><title>Zend_Form_Decorator_Description</title></info>

        <para>
            Der Description Dekorator kann verwendet werden, um eine Beschreibung in einem
            <classname>Zend_Form</classname>, <classname>Zend_Form_Element</classname>, oder
            <classname>Zend_Form_DisplayGroup</classname> Element anzuzeigen; es holt die
            Beschreibung, indem es die <methodname>getDescription()</methodname> Methode des
            Objektes verwendet. Übliche Anwendungsfälle sind das Anbieten von UI Hinweisen für
            Elemente.
        </para>

        <para>
            Standardmäßig, wenn keine Beschreibung vorhanden ist, wird keine Ausgabe erzeugt. Wenn
            die Beschreibung vorhanden ist, wird sie standardmäßig in ein <acronym>HTML</acronym>
            <emphasis>p</emphasis> Tag eingebunden, es kann aber ein Tag durch die Übergabe einer
            <property>tag</property> Option spezifiziert werden, bei der Erstellung des Dekorators,
            oder durch Aufruf von <methodname>setTag()</methodname>. Zusätzlich kann eine Klasse für
            das Tag spezifiziert werden, indem die <property>class</property> Option verwendet wird,
            oder durch den Aufruf von <methodname>setClass()</methodname>; standardmäßig wird die
            Klasse 'hint' verwendet.
        </para>

        <para>
            Die Beschreibung wird escaped, indem der Escaping Mechanismus vom View Objekt
            standardmäßig verwendet wird. Das kann, durch die Übergabe eines
            <constant>FALSE</constant> an die 'escape' Option des Dekorators, ausgeschaltet werden,
            oder durch die <methodname>setEscape()</methodname> Methode.
        </para>

<info><title>Zend_Form_Decorator_DtDdWrapper</title></info>

        <para>
            Der Standarddekorator verwendet Definitionslisten (<emphasis><dl></emphasis>) um
            Formularelemente darzustellen. Da Formularelemente in jeder Reihenfolge vorkommen
            können, werden Gruppen und Unterformulare angezeigt und können mit anderen
            Formularelementen interagieren. Um diese speziellen Elementtypen in der Definitionsliste
            zu behalten, erstellt der DtDdWrapper einen neuen, leeren Definitionsausdruck
            (<emphasis><dt></emphasis>) und bettet dessen Inhalt in ein neues Definitionsdatum
            (<emphasis><dd></emphasis>) ein. Die Ausgabe sieht dann wie folgt aus:
        </para>

        <programlisting language="html"><![CDATA[

<fieldset id="subform">
    <legend>Benutzer Information</legend>
    ...
</fieldset>

]]></programlisting>

        <para>
            Dieser Dekorator ersetzt den, ihm angebotenen, Inhalt durch dessen Einbettung in das
            <emphasis><dd></emphasis> Element.
        </para>

<info><title>Zend_Form_Decorator_Errors</title></info>

        <para>
            Element Fehler erhalten ihren eigenen Dekorator mit dem Errors Dekorator. Dieser
            Dekorator ruft den FormErrors View Helfer auf, welcher Fehlermeldungen in einer,
            ungeordneten, Liste (<emphasis><ul></emphasis>) als Listenelement darstellt. Das
            <emphasis><ul></emphasis> Element empfängt eine Klasse von "errors".
        </para>

        <para>
            Der Errors Dekorator kann entwedet vorangestellt oder dem Kontext, der Ihm übergeben
            wurde, angehängt werden.
        </para>

<info><title>Zend_Form_Decorator_Fieldset</title></info>

        <para>
            Anzeigegruppen und Unterformulare zeigen ihren Inhalt standardmäßig in einem Fieldset
            an. Der Fieldset Dekorator prüft, ob entweder eine 'legend' Option oder eine
            <methodname>getLegend()</methodname> Methode in dem registrierten Element vorhanden ist,
            und verwendet dieses als Legende, wenn es nicht leer ist. Jeder Inhalt der übergeben
            wird, wird in ein <acronym>HTML</acronym> Fieldset eingebettet, wobei der originale
            Inhalt ersetzt wird. Alle Attribute die in den angezeigten Elementen gesetzt sind,
            werden dem Fieldset als <acronym>HTML</acronym> Attribute übergeben.
        </para>

<info><title>Zend_Form_Decorator_File</title></info>

        <para>
            File Elemente haben eine spezielle Schreibweise wenn man mehrere File Elemente oder
            Unterformulare verwendet. Der File Decorator wird von
            <classname>Zend_Form_Element_File</classname> verwendet und erlaubt es mehrere File
            Elemente, mit einem einzelnen Methodenaufruf, zu setzen. Er wird automatisch verwendet
            und bestimmt den Namen des Elements.
        </para>

<info><title>Zend_Form_Decorator_Form</title></info>

        <para>
            <classname>Zend_Form</classname> Objekte müssen typischerweise ein
            <acronym>HTML</acronym> <form> Tag darstellen. Der Formular Dekorator
            verweist auf den Formular View Helfer. Er bettet jeden angebotenen Inhalt in ein
            <acronym>HTML</acronym> Formular Element ein, indem die Aktionen und Methoden des
            <classname>Zend_Form</classname> Objektes verwendet werden, und jedes Attribut als
            <acronym>HTML</acronym> Attribut.
        </para>

<info><title>Zend_Form_Decorator_FormElements</title></info>

        <para>
            Formulare, Anzeigegruppen, und Unterformulare sind Sammlungen von Elementen. Um diese
            Elemente darzustellen, verwenden sie den FormElements Dekorator, welche durch alle
            Elemente iteriert, <methodname>render()</methodname> auf jedem aufruft und diese mit dem
            registrierten Trennzeichen verbindet. Es kann an Ihm übergebenen Inhalt entweder
            anhängen oder voranstellen.
        </para>

<info><title>Zend_Form_Decorator_FormErrors</title></info>

        <para>
            Einige Entwickler und Designer bevorzugen es, alle Fehlermeldungen am Beginn des
            Formulars zu gruppieren. Der FormErrors Dekorator erlaubt dies zu tun.
        </para>

        <para>
            Standardmäßig hat die erzeugte Liste von Fehlern das folgende Markup:
        </para>

        <programlisting language="html"><![CDATA[

[Element Überschrift oder Name]

[Fehlermeldung]

[Fehlermeldung]

[Label oder Name des Unterformular-Elements

[Fehlermeldung]

[Fehlermeldung]

]]></programlisting>

        <para>
            Man kann eine Vielzahl von Optionen übergeben, um die erzeugte Ausgabe zu konfigurieren:
        </para>

        <itemizedlist>
            <listitem>
                <para>
                    <property>ignoreSubForms</property>: Ob die Rekursion im Unterformular
                    ausgeschaltet werden soll oder nicht. Standardwert: <constant>FALSE</constant>
                    (erlaubt Rekursion).
                </para>
            </listitem>

            <listitem>
                <para>
                    <property>markupElementLabelEnd</property>: Markup welcher der
                    Elementüberschrift angehängt wird. Standardwert: '</b>'
                </para>
            </listitem>

            <listitem>
                <para>
                    <property>markupElementLabelStart</property>: Markup welcher der
                    Elementüberschrift vorangestellt wird. Standardwert: '<b>'
                </para>
            </listitem>

            <listitem>
                <para>
                    <property>markupListEnd</property>: Markup welcher der Nachrichtenliste
                    angehängt wird. Standardwert: '</ul>'.
                </para>
            </listitem>

            <listitem>
                <para>
                    <property>markupListItemEnd</property>: Markup der individuellen Fehlermeldungen
                    angehängt wird. Standardwert: '</li>'
                </para>
            </listitem>

            <listitem>
                <para>
                    <property>markupListItemStart</property>: Markup der individuellen
                    Fehlermeldungen vorangestellt wird. Standardwert: '<li>'
                </para>
            </listitem>

            <listitem>
                <para>
                    <property>markupListStart</property>: Markup welcher der Nachrichtenliste
                    vorangestellt wird. Standardwert: '<ul class="form-errors">'
                </para>
            </listitem>
        </itemizedlist>

        <para>
            Der FormErrors Dekorator kann entweder angehängt oder dem Inhalt, dem er angehört,
            vorangestellt werden.
        </para>

<info><title>Zend_Form_Decorator_HtmlTag</title></info>

        <para>
            Der HtmlTag Dekorator erlaubt es <acronym>HTML</acronym> Tags anzupassen, um Inhalt zu
            dekorieren; das angepasste Tag wird in der 'tag' Option übergeben, und jede andere
            Option wird als <acronym>HTML</acronym> Attribut für dieses Tag verwendet. Das Tag nimmt
            standardmäßig an, dass es Blocklevel ist, und ersetzt den Inhalt durch dessen Einbettung
            in das gegebene Tag. Trotzdem kann eine Platzierung spezifiziert werden um das Tag
            genauso anzuhängen oder voranzustellen.
        </para>

<info><title>Zend_Form_Decorator_Image</title></info>

        <para>
            Der Image Dekorator erlaubt es eine <acronym>HTML</acronym> Bildeingabe
            (<emphasis><input type="image" ... /></emphasis>) zu erstellen, und es optional in
            einem anderen <acronym>HTML</acronym> Tag darzustellen.
        </para>

        <para>
            Standardmäßig verwendet der Dekorator die 'src' Eigenschaft des Elements als Bildquelle,
            welche mit der <methodname>setImage()</methodname> Methode als Bildquelle gesetzt werden
            kann. Zusätzlich wird das Label des Elements als 'alt' Attribute verwendet, und
            <property>imageValue</property> (welches mit den
            <methodname>setImageValue()</methodname> und <methodname>getImageValue()</methodname>
            Zugriffsmethoden des Bildes manipuliert werden kann) wird für den Wert verwendet.
        </para>

        <para>
            Um ein <acronym>HTML</acronym> Tag zu spezifizieren, dass das Element einbetten soll,
            kann entweder die 'tag' Option an den Dekorator übergeben, oder explizit
            <methodname>setTag()</methodname> aufgerufen werden.
        </para>

<info><title>Zend_Form_Decorator_Label</title></info>

        <para>
            Formularlemente haben tyischerweise ein Label und der Label Dekorator wird verwendet,
            um diese Labels darzustellen. Er ruft den FormLabel View Helfer auf und holt das Label
            des Elements, indem die <methodname>getLabel()</methodname> Methode des Elements
            verwendet wird. Wenn kein Label vorhanden ist, wird es auch nicht darstellt.
            Standardmäßig werden Labels übersetzt, wenn ein Übersetzungsadapter existiert und eine
            Übersetzung für das Label existiert.
        </para>

        <para>
            Optional kann die 'tag' Option spezifiziert werden; wenn vorhanden, bettet sie das
            Label in das Block-Level Tag ein. Wenn die 'tag' Option aber kein Label vorhanden ist,
            wird das Tag ohne Inhalt dargestellt. Es kann definiert werden, dass die Klasse das
            Tag mit der 'class' Option verwendet, oder durch Aufruf von
            <methodname>setClass()</methodname>.
        </para>

        <para>
            Zusätzlich können Präfixe und Suffixe für die Verwendung spezifiziert werden, wenn
            die Elemente angezeigt werden, basierend darauf, ob das Label für ein optionales oder
            benötigtes Element ist. Übliche Verwendungszwecke würden sein, ein ':' dem Label
            anzufügen, oder ein '*' um anzuzeigen, dass das Element benötigt wird. Das kann mit
            den folgenden Optionen und Methoden gemacht werden:
        </para>

        <itemizedlist>
            <listitem>
                <para>
                    <property>optionalPrefix</property>: Setzt den Text, der dem Label vorangestellt
                    wird, wenn das Element optional ist. Kann mit den Zugriffsmethoden
                    <methodname>setOptionalPrefix()</methodname> und
                    <methodname>getOptionalPrefix()</methodname> manipuliert werden.
                </para>
            </listitem>

            <listitem>
                <para>
                    <property>optionalSuffix</property>: Setzt den Text, der dem Label angehängt
                    wird, wenn das Element optional ist. Kann mit den Zugriffsmethoden
                    <methodname>setOptionalSuffix()</methodname> und
                    <methodname>getOptionalSuffix()</methodname> manipuliert werden.
                </para>
            </listitem>

            <listitem>
                <para>
                    <property>requiredPrefix</property>: Setzt den Text, der dem Label vorangestellt
                    wird, wenn das Element benötigt wird. Kann mit den Zugriffsmethoden
                    <methodname>setRequiredPrefix()</methodname> und
                    <methodname>getRequiredPrefix()</methodname> manipuliert werden.
                </para>
            </listitem>

            <listitem>
                <para>
                    <property>requiredSuffix</property>: Setzt den Text, der dem Label angehängt
                    wird, wenn das Element benötigt wird. Kann mit den Zugriffsmethoden
                    <methodname>setRequiredSuffix()</methodname> und
                    <methodname>getRequiredSuffix()</methodname> manipuliert werden.
                </para>
            </listitem>
        </itemizedlist>

        <para>
            Standardmäßig stellt der Label Dekorator, dem angegebenen Inhalt, voran; es kann die
            'placement' Option mit 'append' spezifiziert werden, um es nach dem Inhalt zu
            platzieren.
        </para>

<info><title>Zend_Form_Decorator_PrepareElements</title></info>

        <para>
            Formulare, Anzeigegruppen, und Unterformulare sind Kollektionen von Elementen. Wenn der
            <link linkend="zend.form.standardDecorators.viewScript">ViewScript Dekorator</link>
            verwendet wird, ist es nützlich die Möglichkeit zu haben, das View Objekt, die
            Übersetzung, und alle komplett qualifizierten Namen (wie sie von der Array Schreibweise
            der Unterformulare erkannt werden), rekursiv setzen zu können. Der 'PrepareElements'
            Dekorator kann das für einen erledigen. Typischerweise setzt man ihn als ersten
            Dekorator in der Liste.
        </para>

        <programlisting language="php"><![CDATA[
$form->setDecorators(array(
    'PrepareElements',
    array('ViewScript', array('viewScript' => 'form.phtml')),
));
]]></programlisting>

<info><title>Zend_Form_Decorator_ViewHelper</title></info>

        <para>
            Die meisten Elemente verwenden <classname>Zend_View</classname> Helfer für die
            Darstellung und das wird mit dem View Helfer Dekorator getan. Mit ihm kann ein 'helper'
            Tag spezifiziert werden der explizit den View Helfer setzt, der anzupassen ist; wenn
            keiner angegeben wird, verwendet er das letzte Segment des Klassennamens des Elements um
            den Helfer zu ermitteln, und stellt den String 'form' voran: z.B.
            'Zend_Form_Element_Text' würde nach einem View Helfer 'formText' schauen.
        </para>

        <para>
            Alle Attribute des angegebenen Elements werden dem View Helfer als Attribute des
            Elements übergeben.
        </para>

        <para>
            Standardmäßig fügt dieser Dekorator Inhalt hinten an; es kann die 'placement' Option
            verwendet werden um eine alternative Platzierung zu spezifizieren.
        </para>

<info><title>Zend_Form_Decorator_ViewScript</title></info>

        <para>
            Manchmal ist es gewünscht, ein View Skript für die Erstellung eigener Elemente zu
            verwenden; auf diesem Weg hat man eine sehr detailierte Kontrolle über die Elemente,
            und wandelt das View Skript zu einem Designer um, oder erstellt einfach einen Weg, um
            Einstellungen zu überladen, die auf Modulen basieren (jedes Modul könnte optional die
            View Skripte des Elements überladen um seinen eigenen Zwecken zu entsprechen). Der
            ViewScript Dekorator löst dieses Problem.
        </para>

        <para>
            Der ViewScript Dekorator benötigt eine 'viewScript' Option, entweder angeboten vom
            Dekorator, oder als Attribut des Elements. Er stellt dann das View Skript als
            teilweises Skript, was bedeutet, dass jeder Aufruf von ihm, seinen eigenen
            Geltungsbereich der Variablen hat; keine Variablen von der View werden im Element
            enthalten sein, ausser denen des Elements selbst. Verschiedene Variablen werden dann
            bekannt gegeben:
        </para>

        <itemizedlist>
            <listitem>
                <para><property>element</property>: Das Element, welches dekoriert wird</para>
            </listitem>

            <listitem>
                <para>
                    <property>content</property>: Der Inhalt, der an den Dekorator übergeben wird
                </para>
            </listitem>

            <listitem>
                <para><property>decorator</property>: Das Dekorator Objekt selbst</para>
            </listitem>

            <listitem>
                <para>
                    Zusätzlich werden, alle Optionen, die an den Dekorator mit
                    <methodname>setOptions()</methodname> übergeben und nicht intern verwendet
                    werden, an das View Skript als View Variablen übergeben.
                </para>
            </listitem>
        </itemizedlist>

        <para>
            Als Beispiel, kann das folgende Element hergenommen werden:
        </para>

        <programlisting language="php"><![CDATA[
// Setzt den Dekorator für das Element zu einem einzelnen, ViewScript,
// Dekorator spezifiziert das viewScript als Option, und einige extra
// Optionen:
$element->setDecorators(array(array('ViewScript', array(
    'viewScript' => '_element.phtml',
    'class'      => 'form element'
))));

// ODER das viewScript als Attribut des Elements spezifizieren:
$element->viewScript = '_element.phtml';
$element->setDecorators(array(array('ViewScript',
                                    array('class' => 'form element'))));
]]></programlisting>

        <para>
            Dann könne ein View Skript die das folgende existieren:
        </para>

        <programlisting language="php"><![CDATA[
<div class="<?php echo $this->class ?>">
    <?php echo $this->formLabel($this->element->getName(),
                         $this->element->getLabel()) ?>
    <?php echo $this->{$this->element->helper}(
        $this->element->getName(),
        $this->element->getValue(),
        $this->element->getAttribs()
    ) ?>
    <?php echo $this->formErrors($this->element->getMessages()) ?>

<?php echo $this->element->getDescription() ?>

]]></programlisting>

        <note><info><title>Inhalte mit einem View Skript ersetzen</title></info>

            <para>
                Es kann für das View Skript nützlich sein, den Inhalt der dem Dekorator angeboten
                wird, zu ersetzen -- zum Beispiel wenn man ihn umschliessen will. Das kann man
                erreichen, indem ein <constant>FALSE</constant> für die 'placement' Option des
                Dekorators spezifiziert wird:
            </para>

            <programlisting language="php"><![CDATA[
// Bei Erstellung des Dekorators:
$element->addDecorator('ViewScript', array('placement' => false));

// Zu einer existierenden Dekorator Instanz hinzufügen:
$decorator->setOption('placement', false);

// Zu einem Dekorator hinzufügen, der bereits bei einem Element hinzugefügt ist:
$element->getDecorator('ViewScript')->setOption('placement', false);

// In einem View Skript, das von einem Dekorator verwendet wird:
$this->decorator->setOption('placement', false);
]]></programlisting>
        </note>

        <para>
            Die Verwendung des ViewScript Dekorators wird empfohlen, wenn man eine sehr feinkörnige
            Kontrolle darüber benötigt, wie Elemente dargestellt werden.
        </para>


text:
<?php

namespace Google\AdsApi\Examples\Dfp\v201702\ActivityGroupService;

require '../../../../vendor/autoload.php';

use Google\AdsApi\Common\OAuth2TokenBuilder;
use Google\AdsApi\Dfp\DfpServices;
use Google\AdsApi\Dfp\DfpSession;
use Google\AdsApi\Dfp\DfpSessionBuilder;
use Google\AdsApi\Dfp\Util\v201702\StatementBuilder;
use Google\AdsApi\Dfp\v201702\ActivityGroupStatus;
use Google\AdsApi\Dfp\v201702\ActivityGroupService;

/**
 * This example gets all active activity groups.
 *
 * <p>It is meant to be run from a command line (not as a webpage) and requires
 * that you've setup an `adsapi_php.ini` file in your home directory with your
 * API credentials and settings. See README.md for more info.
 */
class GetActiveActivityGroups {

  public static function runExample(DfpServices $dfpServices,
      DfpSession $session) {
    $activityGroupService =
        $dfpServices->get($session, ActivityGroupService::class);

    // Create a statement to select activity groups.
    $pageSize = StatementBuilder::SUGGESTED_PAGE_LIMIT;
    $statementBuilder = (new StatementBuilder())
        ->where('status = :status')
        ->orderBy('id ASC')
        ->limit($pageSize)
        ->withBindVariableValue('status', ActivityGroupStatus::ACTIVE);

    // Retrieve a small amount of activity groups at a time, paging
    // through until all activity groups have been retrieved.
    $totalResultSetSize = 0;
    do {
      $page = $activityGroupService->getActivityGroupsByStatement(
          $statementBuilder->toStatement());

      // Print out some information for each activity group.
      if ($page->getResults() !== null) {
        $totalResultSetSize = $page->getTotalResultSetSize();
        $i = $page->getStartIndex();
        foreach ($page->getResults() as $activityGroup) {
          printf(
              "%d) Activity group with ID %d and name '%s' was found.\n",
              $i++,
              $activityGroup->getId(),
              $activityGroup->getName()
          );
        }
      }

      $statementBuilder->increaseOffsetBy($pageSize);
    } while ($statementBuilder->getOffset() < $totalResultSetSize);

    printf("Number of results found: %d\n", $totalResultSetSize);
  }

  public static function main() {
    // Generate a refreshable OAuth2 credential for authentication.
    $oAuth2Credential = (new OAuth2TokenBuilder())
        ->fromFile()
        ->build();

    // Construct an API session configured from a properties file and the OAuth2
    // credentials above.
    $session = (new DfpSessionBuilder())
        ->fromFile()
        ->withOAuth2Credential($oAuth2Credential)
        ->build();

    self::runExample(new DfpServices(), $session);
  }
}

GetActiveActivityGroups::main();


text:
<?xml version="1.0" encoding="UTF-8"?>
<testng-results skipped="0" failed="0" total="2" passed="2">
  <reporter-output>
  </reporter-output>
  <suite name="VoteNoFilme Test Suite" duration-ms="13017" started-at="2014-02-12T21:52:47Z" finished-at="2014-02-12T21:53:00Z">
    <groups>
    </groups>
    <test name="unitTests" duration-ms="13017" started-at="2014-02-12T21:52:47Z" finished-at="2014-02-12T21:53:00Z">
      <class name="br.com.ioguisoftware.vnf.model.service.impl.FilmeServiceImplTest">
        <test-method status="PASS" signature="injectDao()[pri:0, instance:br.com.ioguisoftware.vnf.model.service.impl.FilmeServiceImplTest@1776b55]" name="injectDao" is-config="true" duration-ms="267" started-at="2014-02-12T19:52:47Z" finished-at="2014-02-12T19:52:47Z">
          <reporter-output>
          </reporter-output>
        </test-method> <!-- injectDao -->
        <test-method status="PASS" signature="generateFilmes()[pri:0, instance:br.com.ioguisoftware.vnf.model.service.impl.FilmeServiceImplTest@1776b55]" name="generateFilmes" duration-ms="39" started-at="2014-02-12T19:52:47Z" finished-at="2014-02-12T19:52:47Z">
          <reporter-output>
          </reporter-output>
        </test-method> <!-- generateFilmes -->
        <test-method status="PASS" signature="injectDao()[pri:0, instance:br.com.ioguisoftware.vnf.model.service.impl.FilmeServiceImplTest@1776b55]" name="injectDao" is-config="true" duration-ms="6" started-at="2014-02-12T19:52:47Z" finished-at="2014-02-12T19:52:47Z">
          <reporter-output>
          </reporter-output>
        </test-method> <!-- injectDao -->
        <test-method status="PASS" signature="getRandomEnqueteFilmes()[pri:0, instance:br.com.ioguisoftware.vnf.model.service.impl.FilmeServiceImplTest@1776b55]" name="getRandomEnqueteFilmes" duration-ms="12687" started-at="2014-02-12T19:52:47Z" finished-at="2014-02-12T19:53:00Z">
          <reporter-output>
          </reporter-output>
        </test-method> <!-- getRandomEnqueteFilmes -->
      </class> <!-- br.com.ioguisoftware.vnf.model.service.impl.FilmeServiceImplTest -->
    </test> <!-- unitTests -->
  </suite> <!-- VoteNoFilme Test Suite -->
</testng-results>


text:
package com.intellij.debugger.impl;

/**
 * @author Eugene Zhuravlev
 *         Date: Jul 30, 2009
 */
public interface PrioritizedTask
{
	enum Priority
	{
		HIGH, NORMAL, LOW, LOWEST
	}

	Priority getPriority();
}


text:
const { HttpStatusError } = require('common-errors');
const { USERS_ADMIN_ROLE } = require('ms-users/lib/constants');

const notAllowedHttpError = new HttpStatusError(403, 'not enough rights');
const notFoundHttpError = new HttpStatusError(404, 'user not found');
const notFoundError = { statusCode: 404 };

async function adminRequestOwner(request) {
  const { users: { prefix, postfix, audience } } = this.config;
  const { owner } = request.method === 'amqp' ? request.params : request.query;
  const currentUser = request.auth.credentials.metadata[audience];

  if (owner === undefined || owner === currentUser.alias) {
    const { id, alias } = currentUser;

    request.locals.owner = { id, alias };

    return true;
  }

  if (currentUser.roles.includes(USERS_ADMIN_ROLE) !== false) {
    const user = await this.amqp
      .publishAndWait(`${prefix}.${postfix.getMetadata}`, { audience, username: owner, public: true })
      .get(audience)
      .catchThrow(notFoundError, notFoundHttpError);
    const { id, alias } = user;

    request.locals.owner = { id, alias };

    return true;
  }

  throw notAllowedHttpError;
}

module.exports = adminRequestOwner;


text:
#ifndef endlesstunnel_native_engine_hpp
#define endlesstunnel_native_engine_hpp

#include "common.hpp"

struct NativeEngineSavedState {};

class NativeEngine {
    public:
        // create an engine
        NativeEngine(struct android_app *app);
        ~NativeEngine();

        // runs application until it dies
        void GameLoop();

        // returns the JNI environment
        JNIEnv *GetJniEnv();

        // returns the Android app object
        android_app* GetAndroidApp();

        // returns the (singleton) instance
        static NativeEngine* GetInstance();

    private:
        // variables to track Android lifecycle:
        bool mHasFocus, mIsVisible, mHasWindow;

        // are our OpenGL objects (textures, etc) currently loaded?
        bool mHasGLObjects;

        // android API version (0 if not yet queried)
        int mApiVersion;

        // EGL stuff
        EGLDisplay mEglDisplay;
        EGLSurface mEglSurface;
        EGLContext mEglContext;
        EGLConfig mEglConfig;

        // known surface size
        int mSurfWidth, mSurfHeight;

        // android_app structure
        struct android_app* mApp;

        // additional saved state
        struct NativeEngineSavedState mState;

        // JNI environment
        JNIEnv *mJniEnv;

        // is this the first frame we're drawing?
        bool mIsFirstFrame;

        // initialize the display
        bool InitDisplay();

        // initialize surface. Requires display to have been initialized first.
        bool InitSurface();

        // initialize context. Requires display to have been initialized first.
        bool InitContext();

        // kill context
        void KillContext();
        void KillSurface();
        void KillDisplay(); // also causes context and surface to get killed

        bool HandleEglError(EGLint error);

        bool InitGLObjects();
        void KillGLObjects();

        void ConfigureOpenGL();

        bool PrepareToRender();

        void DoFrame();

        bool IsAnimating();

    public:
        // these are public for simplicity because we have internal static callbacks
        void HandleCommand(int32_t cmd);
        bool HandleInput(AInputEvent *event);
};

#endif


text:
from datetime import timedelta
from httplib import (
    OK as HTTP_OK_200,
    NOT_FOUND as HTTP_NOT_FOUND_404,
    FOUND as HTTP_REDIRECT_302
)

from django.test import TestCase
from django.core.urlresolvers import reverse
from django.core import mail
from django.conf import settings
from django.utils import timezone

from django_factory_boy import auth as auth_factories

from assopy.tests.factories.user import UserFactory as AssopyUserFactory
from conference.models import Conference, Talk, Speaker, ConferenceTag
from taggit.models import Tag

# TODO(artcz) add tests for CMS-based CFP page that redirects to the submission
# page tested below

# Using django's TestCase because of assertRedirects
# however we still run it using pytest
class TestCFP(TestCase):
    """
    Test everything related to CFP
    """

    def setUp(self):
        self.conference = Conference.objects.create(
            code=settings.CONFERENCE_CONFERENCE,
            name=settings.CONFERENCE_CONFERENCE,
            # by default start with open CFP
            cfp_start=timezone.now() - timedelta(days=2),
            cfp_end=timezone.now()   + timedelta(days=2)
        )

        # default password is 'password123' per django_factory_boy
        self.user = auth_factories.UserFactory(email='joedoe@example.com',
                                               is_active=True)
        AssopyUserFactory(user=self.user)

        self.form_url = reverse("conference-paper-submission")

    def test_login_required(self):
        login_url = reverse('login') + '?next=' + self.form_url
        response = self.client.get(self.form_url)
        assert response.status_code == HTTP_REDIRECT_302
        self.assertRedirects(response, login_url)

    def test_accessing_cfp_form_before_CFP_is_opened(self):
        self.conference.cfp_start = timezone.now() + timedelta(days=2)
        self.conference.save()
        self.client.login(email='joedoe@example.com', password='password123')

        # TODO(artcz) - this test is correct but I'd expect a different
        # behaviour than 404 here. Something like a template saying "Sorry CFP
        # is not yet opened"
        response = self.client.get(self.form_url, follow=True)
        assert response.status_code == HTTP_NOT_FOUND_404

    def test_accessing_cfp_form_after_CFP_is_closed(self):
        self.conference.cfp_end = timezone.now() - timedelta(days=1)
        self.conference.save()
        self.client.login(email='joedoe@example.com', password='password123')

        # TODO(artcz) - this test is correct but I'd expect a different
        # behaviour than 404 here. Something like a template saying "Sorry CFP
        # is closed"
        response = self.client.get(self.form_url, follow=True)
        assert response.status_code == HTTP_NOT_FOUND_404

    def test_accessing_cfp_form_while_cfp_is_live(self):
        self.client.login(email='joedoe@example.com', password='password123')

        response = self.client.get(self.form_url, follow=True)
        assert response.status_code == HTTP_OK_200
        self.assertTemplateUsed(response, "conference/paper_submission.html")

    def test_post_some_proposals(self):
        assert Talk.objects.all().count() == 0
        self.client.login(email='joedoe@example.com', password='password123')

        assert Speaker.objects.count() == 0
        with self.assertRaises(Speaker.DoesNotExist):
            self.user.speaker

        VALIDATION_FAILED_200     = HTTP_OK_200
        VALIDATION_SUCCESSFUL_303 = 303

        required_proposal_fields = [
            'title', 'abstract', 'abstract_short', 'level', 'tags',
            'slides_agreement', 'video_agreement', 'type',
        ]

        required_speaker_fields = [
            'bio', 'first_name', 'last_name', 'phone',
            'birthday', 'personal_agreement',
        ]

        required_fields_for_first_proposal =\
            required_speaker_fields + required_proposal_fields
        required_fields_for_next_proposal = required_proposal_fields

        def required_fields_not_filled(response, fields):
            """
            Helper function
            """
            errors = response.context['form'].errors

            for f in fields:
                assert errors[f] == ['This field is required.']
                del errors[f]

            # we make sure there are no other errors in the form
            assert errors == {}

        empty_submission = {}
        response = self.client.post(self.form_url, empty_submission)
        assert response.status_code == VALIDATION_FAILED_200
        required_fields_not_filled(response,
                                   required_fields_for_first_proposal)

        dummy_data_in_all_required_fields = {
            f: "foo"
            for f in required_fields_for_first_proposal
        }
        response = self.client.post(self.form_url,
                                    dummy_data_in_all_required_fields)
        assert response.status_code == VALIDATION_FAILED_200

        # birthday, type and level require specific data
        assert {'birthday', 'type', 'level'} ==\
            set(response.context['form'].errors.keys())

        talk_proposal = {
            "type": "t_30",
            'first_name': 'Joe',
            'last_name': 'Doe',
            "birthday": "2018-02-26",
            'bio': "Python developer",
            "title": "Testing EPCON CFP",
            "abstract_short": "Short talk about testing CFP",
            "abstract": "Using django TestCase and pytest",
            "level": "advanced",
            "phone": "41331237",
            "tags": "django, testing, slides",
            "personal_agreement": True,
            "slides_agreement": True,
            "video_agreement": True,
        }

        profile_url = reverse("conference-myself-profile")
        response = self.client.post(self.form_url, talk_proposal)
        assert response.status_code == VALIDATION_SUCCESSFUL_303
        self.assertRedirects(response, profile_url,
                             status_code=303, fetch_redirect_response=False)
        talk_url = Talk.objects.get().get_absolute_url()
        assert talk_url == "/conference/talks/testing-epcon-cfp"

        # At last check if the talk is visible in the list of submitted talks
        response = self.client.get(profile_url, follow=True)
        assert response.status_code == HTTP_OK_200
        self.assertTemplateUsed(response, 'conference/profile.html')
        self.assertContains(response, talk_proposal['title'])
        self.assertContains(response, talk_url)

        # Now that a talk is already proposed, second proposal will look
        # slightly different
        assert Speaker.objects.get()
        response = self.client.get(self.form_url)
        self.assertContains(response, "You have already submitted 1 proposal")

        response = self.client.post(self.form_url, empty_submission)
        required_fields_not_filled(response, required_fields_for_next_proposal)

        talk_proposal = {
            "type": "t_45",
            "title": "More about EPCON testing",
            "abstract_short": "Longer talk about testing",
            "abstract": "Using django TestCase and pytest",
            "level": "advanced",
            "tags": "django, testing, slides",
            "slides_agreement": True,
            "video_agreement": True,
        }

        response = self.client.post(self.form_url, talk_proposal)
        assert response.status_code == VALIDATION_SUCCESSFUL_303
        assert Talk.objects.all().count() == 2

        # check the form again
        response = self.client.get(self.form_url)
        self.assertContains(response, "You have already submitted 2 proposals")

        # NOTE(artcz)(2018-02-27)
        # This assertion checks if we're not sending emails during the
        # submission process.
        # There is a signal that is triggered when new Talk is created
        # (_new_paper_email) and it sends emails to people on the
        # CONFERENCE_TALK_SUBMISSION_NOTIFICATION_EMAIL list.
        # For now this list is empty, so it shouldn't send any emails. If we
        # ever change that (either by removing the signal or putting some
        # emails on that list) – we should update this test
        assert len(mail.outbox) == 0

    def test_ignores_new_tags(self):
        assert Talk.objects.all().count() == 0
        assert ConferenceTag.objects.count() == 0
        assert Tag.objects.count() == 0
        self.client.login(email='joedoe@example.com', password='password123')

        VALIDATION_SUCCESSFUL_303 = 303

        talk_proposal = {
            "type": "t_30",
            'first_name': 'Joe',
            'last_name': 'Doe',
            "birthday": "2018-02-26",
            'bio': "Python developer",
            "title": "Testing EPCON CFP",
            "abstract_short": "Short talk about testing CFP",
            "abstract": "Using django TestCase and pytest",
            "level": "advanced",
            "phone": "41331237",
            "tags": "django, testing, slides",
            "personal_agreement": True,
            "slides_agreement": True,
            "video_agreement": True,
        }

        profile_url = reverse("conference-myself-profile")
        response = self.client.post(self.form_url, talk_proposal)
        assert response.status_code == VALIDATION_SUCCESSFUL_303

        assert ConferenceTag.objects.count() == 0
        assert Tag.objects.count() == 0
        talk = Talk.objects.first()

        assert talk.tags.count() == 0

        assert Speaker.objects.get()

        # second proposal

        talk_proposal = {
            "type": "t_45",
            "title": "More about EPCON testing",
            "abstract_short": "Longer talk about testing",
            "abstract": "Using django TestCase and pytest",
            "level": "advanced",
            "tags": "django, testing, slides",
            "slides_agreement": True,
            "video_agreement": True,
        }

        response = self.client.post(self.form_url, talk_proposal)
        assert response.status_code == VALIDATION_SUCCESSFUL_303

        assert ConferenceTag.objects.count() == 0
        assert Tag.objects.count() == 0

    def test_ignores_new_tags_keeping_predefined_ones(self):
        ConferenceTag.objects.create(name='django')
        ConferenceTag.objects.create(name='love')

        assert Talk.objects.all().count() == 0
        assert ConferenceTag.objects.count() == 2
        assert Tag.objects.count() == 0
        self.client.login(email='joedoe@example.com', password='password123')

        VALIDATION_SUCCESSFUL_303 = 303

        talk_proposal = {
            "type": "t_30",
            'first_name': 'Joe',
            'last_name': 'Doe',
            "birthday": "2018-02-26",
            'bio': "Python developer",
            "title": "Testing EPCON CFP",
            "abstract_short": "Short talk about testing CFP",
            "abstract": "Using django TestCase and pytest",
            "level": "advanced",
            "phone": "41331237",
            "tags": "django, testing, slides",
            "personal_agreement": True,
            "slides_agreement": True,
            "video_agreement": True,
        }

        profile_url = reverse("conference-myself-profile")
        response = self.client.post(self.form_url, talk_proposal)
        assert response.status_code == VALIDATION_SUCCESSFUL_303

        assert ConferenceTag.objects.count() == 2
        talk = Talk.objects.last()

        assert talk.tags.count() == 1

        assert 'django' in talk.tags.all().values_list('name', flat=True)

        # second proposal

        talk_proposal = {
            "type": "t_45",
            "title": "More about EPCON testing",
            "abstract_short": "Longer talk about testing",
            "abstract": "Using django TestCase and pytest",
            "level": "advanced",
            "tags": "love, testing, slides",
            "slides_agreement": True,
            "video_agreement": True,
        }

        response = self.client.post(self.form_url, talk_proposal)
        assert response.status_code == VALIDATION_SUCCESSFUL_303

        assert ConferenceTag.objects.count() == 2

        talk = Talk.objects.first()

        assert talk.tags.count() == 1

        assert talk.title == 'More about EPCON testing'
        assert 'love' in talk.tags.all().values_list('name', flat=True)


text:
#pragma once
#include <aws/eventbridge/EventBridge_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace EventBridge
{
namespace Model
{
  enum class PropagateTags
  {
    NOT_SET,
    TASK_DEFINITION
  };

namespace PropagateTagsMapper
{
AWS_EVENTBRIDGE_API PropagateTags GetPropagateTagsForName(const Aws::String& name);

AWS_EVENTBRIDGE_API Aws::String GetNameForPropagateTags(PropagateTags value);
} // namespace PropagateTagsMapper
} // namespace Model
} // namespace EventBridge
} // namespace Aws


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.11.22 at 01:45:09 PM EST
//

package uk.org.siri.siri_2;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for DelayBandEnumeration.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="DelayBandEnumeration">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}normalizedString">
 *     <enumeration value="delayTwoMinutes"/>
 *     <enumeration value="upToThreeMinutes"/>
 *     <enumeration value="upToFourMinutes"/>
 *     <enumeration value="upToFiveMinutes"/>
 *     <enumeration value="upToEightMinutes"/>
 *     <enumeration value="negligible"/>
 *     <enumeration value="upToTenMinutes"/>
 *     <enumeration value="betweenTenMinutesAndThirtyMinutes"/>
 *     <enumeration value="betweenThirtyMinutesAndOneHour"/>
 *     <enumeration value="betweenOneHourAndThreeHours"/>
 *     <enumeration value="betweenThreeHoursAndSixHours"/>
 *     <enumeration value="longerThanSixHours"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "DelayBandEnumeration")
@XmlEnum
public enum DelayBandEnumeration {

    @XmlEnumValue("delayTwoMinutes")
    DELAY_TWO_MINUTES("delayTwoMinutes"),
    @XmlEnumValue("upToThreeMinutes")
    UP_TO_THREE_MINUTES("upToThreeMinutes"),
    @XmlEnumValue("upToFourMinutes")
    UP_TO_FOUR_MINUTES("upToFourMinutes"),
    @XmlEnumValue("upToFiveMinutes")
    UP_TO_FIVE_MINUTES("upToFiveMinutes"),
    @XmlEnumValue("upToEightMinutes")
    UP_TO_EIGHT_MINUTES("upToEightMinutes"),
    @XmlEnumValue("negligible")
    NEGLIGIBLE("negligible"),
    @XmlEnumValue("upToTenMinutes")
    UP_TO_TEN_MINUTES("upToTenMinutes"),
    @XmlEnumValue("betweenTenMinutesAndThirtyMinutes")
    BETWEEN_TEN_MINUTES_AND_THIRTY_MINUTES("betweenTenMinutesAndThirtyMinutes"),
    @XmlEnumValue("betweenThirtyMinutesAndOneHour")
    BETWEEN_THIRTY_MINUTES_AND_ONE_HOUR("betweenThirtyMinutesAndOneHour"),
    @XmlEnumValue("betweenOneHourAndThreeHours")
    BETWEEN_ONE_HOUR_AND_THREE_HOURS("betweenOneHourAndThreeHours"),
    @XmlEnumValue("betweenThreeHoursAndSixHours")
    BETWEEN_THREE_HOURS_AND_SIX_HOURS("betweenThreeHoursAndSixHours"),
    @XmlEnumValue("longerThanSixHours")
    LONGER_THAN_SIX_HOURS("longerThanSixHours");
    private final String value;

    DelayBandEnumeration(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static DelayBandEnumeration fromValue(String v) {
        for (DelayBandEnumeration c: DelayBandEnumeration.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }

}


text:
#import "COCopier.h"
#import "COItem.h"

@implementation COCopier

- (NSArray *)directDescendentItemUUIDsForUUID: (ETUUID *)aUUID
                                    fromGraph: (id <COItemGraph>)source
{
    NSMutableSet *result = [NSMutableSet set];
    COItem *item = [source itemForUUID: aUUID];

    for (NSString *key in item.attributeNames)
    {
        COType type = [item typeForAttribute: key];

        if (COTypePrimitivePart(type) == kCOTypeCompositeReference)
        {
            [result addObjectsFromArray: [item allObjectsForAttribute: key]];
        }
        else if (COTypePrimitivePart(type) == kCOTypeReference)
        {
            for (ETUUID *refUUID in [item allObjectsForAttribute: key])
            {
                if ([refUUID isKindOfClass: [ETUUID class]])
                {
                    COItem *refItem = [source itemForUUID: refUUID];

                    if ([[refItem valueForAttribute: kCOItemIsSharedProperty] isEqual: @NO])
                    {
                        [result addObject: refUUID];
                    }
                }
            }
        }
    }

    return result.allObjects;
}

- (void)collectItemAndAllDescendents: (ETUUID *)aUUID
                               inSet: (NSMutableSet *)dest
                           fromGraph: (id <COItemGraph>)source
{
    if ([dest containsObject: aUUID])
        return;

    [dest addObject: aUUID];

    for (ETUUID *child in [self directDescendentItemUUIDsForUUID: aUUID fromGraph: source])
    {
        [self collectItemAndAllDescendents: child
                                     inSet: dest
                                 fromGraph: source];
    }
}

- (NSSet *)itemAndAllDescendents: (ETUUID *)aUUID
                       fromGraph: (id <COItemGraph>)source
{
    NSMutableSet *result = [NSMutableSet set];
    [self collectItemAndAllDescendents: aUUID inSet: result fromGraph: source];
    return result;
}

- (NSSet *)itemUUIDsToCopyForItemItemWithUUID: (ETUUID *)aUUID
                                    fromGraph: (id <COItemGraph>)source
                                      toGraph: (id <COItemGraph>)dest
{
    NSSet *compositeObjectCopySet = [self itemAndAllDescendents: aUUID fromGraph: source];
    NSMutableSet *result = [NSMutableSet setWithSet: compositeObjectCopySet];

    for (ETUUID *uuid in compositeObjectCopySet)
    {
        COItem *item = [source itemForUUID: uuid];

        // FIXME: This isn't intuitive... we just copy one layer deep of non-composite references
        // FIXME: referencedItemUUIDs ignores composite references, which sounds wrong! Test!
        for (ETUUID *referenced in item.referencedItemUUIDs)
        {
            if (![compositeObjectCopySet containsObject: referenced])
            {
                if ([dest itemForUUID: referenced] == nil)
                {
                    // If not in dest, copy it
                    [result addObject: referenced];
                }
            }
        }
    }
    return result;
}

- (ETUUID *)copyItemWithUUID: (ETUUID *)aUUID
                   fromGraph: (id <COItemGraph>)source
                     toGraph: (id <COItemGraph>)dest
{
    NILARG_EXCEPTION_TEST(aUUID);
    return [self copyItemsWithUUIDs: @[aUUID] fromGraph: source toGraph: dest][0];
}

- (NSArray *)copyItemsWithUUIDs: (NSArray *)uuids
                      fromGraph: (id <COItemGraph>)source
                        toGraph: (id <COItemGraph>)dest
{
    NILARG_EXCEPTION_TEST(uuids);
    NILARG_EXCEPTION_TEST(source);
    NILARG_EXCEPTION_TEST(dest);

    NSMutableSet *uuidsToCopy = [NSMutableSet new];

    for (ETUUID *uuid in uuids)
    {
        [uuidsToCopy unionSet: [self itemUUIDsToCopyForItemItemWithUUID: uuid
                                                              fromGraph: source
                                                                toGraph: dest]];
    }

    NSMutableDictionary *mapping = [NSMutableDictionary dictionary];

    for (ETUUID *oldUUID in uuidsToCopy)
    {
        mapping[oldUUID] = [ETUUID UUID];
    }

    NSMutableArray *result = [NSMutableArray array];

    for (ETUUID *uuid in uuidsToCopy)
    {
        COItem *oldItem = [source itemForUUID: uuid];
        COItem *newItem = [oldItem mutableCopyWithNameMapping: mapping];
        [result addObject: newItem];
    }

    [dest insertOrUpdateItems: result];

    return [uuids mappedCollectionWithBlock: ^(id inputUUID) { return mapping[inputUUID]; }];
}

@end


text:
//
//	FLViewContentsDescriptor.h
//	FishLamp
//
//	Created by Mike Fullerton on 2/15/10.
//	Copyright (c) 2013 GreenTongue Software LLC, Mike Fullerton.
//  The FishLamp Framework is released under the MIT License: http://fishlamp.com/license
//

#import "FLCocoaUIRequired.h"
#import "FLRectLayout.h"

typedef enum {
	FLViewContentItemInvalid,
	FLViewContentItemNone,
	FLViewContentItemToolbar,
	FLViewContentItemTabBar,
	FLViewContentItemNavigationBar
} FLViewContentItem;

//#define FLViewContentsDescriptorPadding 1

@interface FLViewContentsDescriptor : NSObject<NSCopying, NSMutableCopying, NSCoding> {
@private
	struct {
        FLViewContentItem topItem:8;
        FLViewContentItem bottomItem:8;
        unsigned int hasStatusBar;
    } _flags;

	UIEdgeInsets _padding;
}

@property (readonly, assign, nonatomic) BOOL hasStatusBar;
@property (readonly, assign, nonatomic) FLViewContentItem topItem;
@property (readonly, assign, nonatomic) FLViewContentItem bottomItem;
@property (readonly, assign, nonatomic) UIEdgeInsets padding;

@property (readonly, assign, nonatomic) BOOL isValid;
@property (readonly, assign, nonatomic) BOOL isEmpty;

- (id) initWithTop:(FLViewContentItem) top
    bottom:(FLViewContentItem) bottom
    hasStatusBar:(BOOL) hasStatusBar;

- (id) initWithTop:(FLViewContentItem) top
    bottom:(FLViewContentItem) bottom
    hasStatusBar:(BOOL) hasStatusBar
    padding:(UIEdgeInsets) padding;

- (id) initWithViewContentsDescriptor:(FLViewContentsDescriptor*) original;

+ (id) viewContentsDescriptor;

+ (id) viewContentsDescriptorWithTop:(FLViewContentItem) top
    bottom:(FLViewContentItem) bottom
    hasStatusBar:(BOOL) hasStatusBar;

+ (id) viewContentsDescriptorWithTop:(FLViewContentItem) top
    bottom:(FLViewContentItem) bottom
    hasStatusBar:(BOOL) hasStatusBar
    padding:(UIEdgeInsets) padding;

+ (id) viewContentsDescriptorWithViewContentsDescriptor:(FLViewContentsDescriptor*) original;

+ (FLViewContentsDescriptor*) emptyDescriptor;

+ (FLViewContentsDescriptor*) descriptorWithStatusBar;

+ (FLViewContentsDescriptor*) descriptorWithTopStatusAndToolbar;

+ (FLViewContentsDescriptor*) descriptorWithTopStatusAndToolbarAndBottomTabBar;

+ (FLViewContentsDescriptor*) descriptorWithTopStatusAndToolbarAndBottomToolbar;

@end

@interface FLMutableViewContentsDescriptor : FLViewContentsDescriptor

+ (FLMutableViewContentsDescriptor*) mutableViewContentsDescriptor;

@property (readwrite, assign, nonatomic) BOOL hasStatusBar;
@property (readwrite, assign, nonatomic) FLViewContentItem topItem;
@property (readwrite, assign, nonatomic) FLViewContentItem bottomItem;
@property (readwrite, assign, nonatomic) UIEdgeInsets padding;

@end

@interface SDKViewController (FLViewContentsDescriptor)

@property (readwrite, retain, nonatomic) FLViewContentsDescriptor* viewContentsDescriptor; // if not set, will get it from parentViewController or return emptyContentsDescriptor.

#if IOS
@property (readonly, assign, nonatomic) BOOL viewEnclosesStatusBar; // defaults to YES
- (CGFloat) statusBarInset; // returns according to settings and if it's visible.
#endif

- (CGFloat) contentViewInsetTop; // topItem + statusBarInset (if any)
- (CGFloat) contentViewInsetRight;
- (CGFloat) contentViewInsetLeft;
- (CGFloat) contentViewInsetBottom;

- (UIEdgeInsets) contentViewInsets;

- (CGRect) contentViewFrameInBounds:(CGRect) bounds;

@end

/*
extern
const FLViewContentsDescriptor FLViewContentsDescriptorInvalid;

extern
const struct FLViewContentsDescriptor FLViewContentsDescriptorNone;

NS_INLINE
BOOL FLViewContentsDescriptorEqualToViewContentsDescriptor(FLViewContentsDescriptor lhs, FLViewContentsDescriptor rhs)
{
	return lhs.top == rhs.top && lhs.bottom == rhs.bottom;
}

NS_INLINE
FLViewContentsDescriptor FLViewContentsDescriptorMake(	FLViewContentItem top,
								FLViewContentItem bottom)
{
#if FLViewContentsDescriptorPadding
	 FLViewContentsDescriptor contents = { top, bottom, { 0, 0, 0, 0 } };
#else
	 FLViewContentsDescriptor contents = { top, bottom };
#endif
	return contents;
}

#if FLViewContentsDescriptorPadding
NS_INLINE
FLViewContentsDescriptor FLViewContentsDescriptorMakeWithItemsAndPadding( FLViewContentItem top,
											FLViewContentItem bottom,
											UIEdgeInsets padding)
{
	FLViewContentsDescriptor contents;
	contents.top = top;
	contents.bottom = bottom;
	contents.padding = padding;
	return contents;
}

NS_INLINE
FLViewContentsDescriptor FLViewContentsDescriptorMakeWithPadding( UIEdgeInsets padding)
{
	FLViewContentsDescriptor contents;
	contents.top = FLViewContentItemNone;
	contents.bottom = FLViewContentItemNone;
	contents.padding = padding;
	return contents;
}
#endif
NS_INLINE
BOOL FLViewContentsDescriptorIsEmpty( FLViewContentsDescriptor contents)
{
#if FLViewContentsDescriptorPadding
	return	contents.top == FLViewContentItemNone && contents.padding.top == 0 &&
			contents.bottom == FLViewContentItemNone && contents.padding.bottom == 0;
#else
	return	contents.top == FLViewContentItemNone &&
			contents.bottom == FLViewContentItemNone;
#endif
}

//NS_INLINE
//BOOL FLViewContentsDescriptorTopIsValid(FLViewContentsDescriptor contents)
//{
//	  return contents.top != FLViewContentItemInvalid;
//}
//
//NS_INLINE
//BOOL FLViewContentsDescriptorBottomIsValid(FLViewContentsDescriptor contents)
//{
//	  return contents.bottom != FLViewContentItemInvalid;
//}

NS_INLINE
BOOL FLViewContentsDescriptorIsValid( FLViewContentsDescriptor contents)
{
	return !FLViewContentsDescriptorEqualToViewContentsDescriptor(contents, FLViewContentsDescriptorInvalid);
}

//NS_INLINE
//BOOL FLViewContentsDescriptorHasLayout( FLViewContentsDescriptor contents)
//{
//	  return FLViewContentsDescriptorIsEmpty(contents);
//}

#if FLViewContentsDescriptorPadding
NS_INLINE
CGFloat FLViewContentsDescriptorMinWidth(CGFloat width, FLViewContentsDescriptor contents)
{
	return width + contents.padding.left + contents.padding.right;
}

NS_INLINE
CGFloat FLViewContentsDescriptorMinHeight(CGFloat height, FLViewContentsDescriptor contents)
{
	return height + contents.padding.top + contents.padding.bottom;
}
#endif

extern CGFloat FLViewContentsDescriptorCalculateTop( FLViewContentsDescriptor contents);
extern CGFloat FLViewContentsDescriptorCalculateBottom( FLViewContentsDescriptor contents);
extern CGRect FLViewContentsDescriptorCalculateContainerRect(CGRect bounds, FLViewContentsDescriptor contents);

#if FLViewContentsDescriptorPadding
extern UIEdgeInsets FLViewContentsDescriptorPaddingForRectLayout(FLViewContentsDescriptor contents);
#else
NS_INLINE
UIEdgeInsets FLViewContentsDescriptorPaddingForRectLayout(FLViewContentsDescriptor contents)
{
	return UIEdgeInsetsMake(FLViewContentsDescriptorCalculateTop(contents), 0, FLViewContentsDescriptorCalculateBottom(contents), 0);
}
#endif

NS_INLINE
CGRect FLViewContentsDescriptorCalculateRectVertically(CGRect containeeRect,
	CGRect containerRect,
	FLViewContentsDescriptor contents,
	FLRectLayout rectLayout)
{
	return FLRectPositionRectInRectVerticallyWithPadding(rectLayout, containerRect, containeeRect, FLViewContentsDescriptorPaddingForRectLayout(contents));
}

NS_INLINE
CGRect FLViewContentsDescriptorCalculateRectHorizonally(CGRect containeeRect,
	CGRect containerRect,
	FLViewContentsDescriptor contents,
	FLRectLayout rectLayout)
{
	return FLRectPositionRectInRectHorizontallyWithPadding(rectLayout, containerRect, containeeRect, FLViewContentsDescriptorPaddingForRectLayout(contents));
}

NS_INLINE
CGRect FLViewContentsDescriptorCalculateRect(
	CGRect containeeRect,
	CGRect containerRect,
	FLViewContentsDescriptor contents,
	FLRectLayout rectLayout)
{
	return FLViewContentsDescriptorCalculateRectVertically(
		FLViewContentsDescriptorCalculateRectHorizonally(containeeRect, containerRect, contents, rectLayout),
		containerRect,
		contents,
		rectLayout);
}
*/


text:
@implementation VerifyDetailNewHViewController
- (void)setData{
    self.titleForNav = @"样品信息";
}

- (void)viewDidLoad{
    [super viewDidLoad];

    [self setSubViews];
    [self dataRequest];

}

- (void)setSubViews{
    self.table = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, DeviceWidth, DeviceHeight-64) style:UITableViewStylePlain];
    self.table.separatorStyle = UITableViewStylePlain;
    self.table.delegate = self;
    self.table.dataSource = self;
    [self.view addSubview:self.table];

    [self.table registerClass:[VerifyDetailNewHVCCell class] forCellReuseIdentifier:[VerifyDetailNewHVCCell cellIdentifier]];

}

- (void)dataRequest{
    NSDictionary *params = @{
                             @"ConsignId":_consignId,
                             @"Token":[LoginUtil token]
                             };
    APIConnection *connection = [[RPAPI sharedInstance]connectionWithApiName:APIMETHOD_RP_VERIFY_DETAIL_SAMPLE params:params];
    [connection setOnSuccess:^(id result) {

        @try {
            _dataDic = result[kAPIConnectionStandartDataKey][0];
            [self makeNewData:_dataDic];

            [SVProgressHUD dismiss];
            [self.table reloadData];

        }
        @catch (NSException *exception) {
            [SVProgressHUD dismissWithError:@"数据错误!"];
            [self.navigationController popViewControllerAnimated:YES];
        }
    }];
    [connection setOnFailed:^(NSError *error) {
        NSString *errorDescription = [error localizedDescription];
        [SVProgressHUD dismissWithError:STRING_FORMAT(@"%@",errorDescription) afterDelay:2.5f];
        [self.navigationController popViewControllerAnimated:YES];
    }];
    [SVProgressHUD show];
    [connection startAsynchronous];
}

- (void)makeNewData:(NSDictionary *)dicData{
    NSArray *titleArray = @[@"规格名称",@"强度等级名称",@"收样日期",@"检测设备",@"检测日期",@"样品检测结论",@"评定依据",@"检测方法",@"报告编号"];
    NSMutableArray *arrayContent = [NSMutableArray arrayWithObjects:dicData[@"SpecName"],dicData[@"GradeName"],dicData[@"StartDate"],dicData[@"Equipment"],dicData[@"DetectionDate"],dicData[@"Exam_Result"],dicData[@"AccessRuleCode"],dicData[@"DetectonRule"],dicData[@"ReportID"], nil];
    self.arrayData = [[NSMutableArray alloc] initWithCapacity:0];
    for (int i =0; i<titleArray.count; i++) {
        XSCellModel *cellModel = [[XSCellModel alloc] init];
        cellModel.title = titleArray[i];
        cellModel.content = arrayContent[i];
        if (i%2==0) {
            cellModel.tagColor = YES;

        }else{
            cellModel.tagColor = NO;
        }
        [self.arrayData addObject:cellModel];
    }
}

#pragma mark ----UITableViewDelegate----
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.arrayData.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    VerifyDetailNewHVCCell *cell = [tableView dequeueReusableCellWithIdentifier:[VerifyDetailNewHVCCell cellIdentifier]];
    id model = [self.arrayData objectAtIndex:indexPath.row];
    [cell reloadDataForCell:model];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    id model = [self.arrayData objectAtIndex:indexPath.row];
    NSString * text = [NSString stringWithFormat:@"%@:%@",((XSCellModel *)model).title,((XSCellModel *)model).content];
    CGFloat heightContent = [NSString calculateTextHeight:DeviceWidth-36-15 Content:text font:themeFont17];
    heightContent = heightContent+5>28?heightContent:kscaleDeviceHeight(17);

    return kscaleDeviceHeight(23)+heightContent;
}

@end


text:
declare namespace Jymfony.Component.OptionsResolver.Exception {
    /**
     * Thrown when the value of an option does not match its validation rules.
     *
     * You should make sure a valid value is passed to the option.
     */
    export class InvalidOptionsException extends InvalidArgumentException {
    }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>

<!--
  ~ This file is part of the Bruery Platform.
  ~
  ~ (c) Viktore Zara <viktore.zara@gmail.com>
  ~ (c) Mell Zamora <mellzamora@outlook.com>
  ~
  ~ Copyright (c) 2016. For the full copyright and license information, please view the LICENSE  file that was distributed with this source code.
  -->

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="bruery.user.change_password.form" factory-method="createNamed" factory-service="form.factory" class="Symfony\Component\Form\Form">
            <argument>%bruery.user.change_password.form.name%</argument>
            <argument>%bruery.user.change_password.form.type%</argument>
            <argument>null</argument>
            <argument type="collection">
                <argument key="validation_groups">%bruery.user.change_password.form.validation_groups%</argument>
                <argument key="translation_domain">BrueryUserBundle</argument>
            </argument>
        </service>

        <service id="bruery.user.change_password.form.type" class="Bruery\UserBundle\Form\Type\ChangePasswordFormType">
            <tag name="form.type" alias="bruery_user_change_password" />
            <argument>%fos_user.model.user.class%</argument>
        </service>

        <service id="bruery.user.change_password.form.handler.default" class="Bruery\UserBundle\Form\Handler\ChangePasswordFormHandler" scope="request" public="false">
            <argument type="service" id="bruery.user.change_password.form" />
            <argument type="service" id="request" />
            <argument type="service" id="fos_user.user_manager" />
        </service>
    </services>

</container>


text:
package de.tudarmstadt.ukp.clarin.webanno.ui.mm;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;

import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument;
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.AjaxCallback;

public class SettingsWindow extends ModalWindow {

    private static final long serialVersionUID = -6911254813496835955L;

    private boolean closeButtonClicked;

    private transient AjaxCallback onChangeAction;

    private transient Runnable onChangeLocalAction;

    private final SourceDocument doc;

    public SettingsWindow(String id, SourceDocument doc) {
        super(id);
        this.doc = doc;

        setInitialWidth(600);
        setInitialHeight(450);
        setResizable(true);
        setWidthUnit("px");
        setHeightUnit("px");
        setTitle("Settings");
        setCssClassName("w_blue w_flex");
        setCloseButtonCallback((target) -> {
            closeButtonClicked = true;
            return true;
        });
    }

    @Override
    public void show(IPartialPageRequestHandler aTarget) {
        closeButtonClicked = false;

        setWindowClosedCallback((target) -> {
            if (!closeButtonClicked) {
                onConfirmInternal(target);
            }
        });

        setContent(new SettingsWindowContent(getContentId(), this) {
            private static final long serialVersionUID = -3434069761864809703L;

            @Override
            protected void onCancel(AjaxRequestTarget aTarget) {
                closeButtonClicked = true;
            }
        });

        super.show(aTarget);
    }

    public AjaxCallback getOnChangeAction() {
        return onChangeAction;
    }

    public void setOnChangeAction(AjaxCallback aOnChangeAction) {
        onChangeAction = aOnChangeAction;
    }

    public Runnable getOnChangeLocalAction() {
        return onChangeLocalAction;
    }

    public void setOnChangeLocalAction(Runnable onChangeLocalAction) {
        this.onChangeLocalAction = onChangeLocalAction;
    }

    protected void onConfirmInternal(AjaxRequestTarget aTarget) {
        boolean closeOk = true;

        if(onChangeLocalAction != null)
            onChangeLocalAction.run();

        // Invoke callback if one is defined
        if (onChangeAction != null)
            try {
                onChangeAction.accept(aTarget);
            }
            catch (Exception e) {
                closeOk = false;
            }

        if (closeOk)
            close(aTarget);
    }

    public boolean isCloseButtonClicked() {
        return closeButtonClicked;
    }

    public void setCloseButtonClicked(boolean closeButtonClicked) {
        this.closeButtonClicked = closeButtonClicked;
    }

    public SourceDocument getSourceDocument()
    {
        return doc;
    }
}


text:
<?php

namespace Routes;
use \Routes    as Routes;
use \Atlantis  as Atlantis;
use \Nether    as Nether;
use \ReCaptcha as ReCaptcha;

use \Atlantis\Site\Error\Inline as InlineError;

class Join
extends Atlantis\Site\PublicWeb {

	public function
	Index():
	Void {

		if(Nether\Option::Get('Atlantis.User.Join.Mode') == Atlantis\Prototype\User::JoinModeInvite)
		$this->Goto('/invite');

		if($this->Post->Action)
		$this->HandleJoin();

		$this->Surface->Area('join/index');
		return;
	}

	protected function
	HandleJoin():
	Void {

		// check if they can fool google into believing they are real.

		$Human = new ReCaptcha\ReCaptcha(Nether\Option::Get('Google.ReCaptcha.Secret'));
		$CVal = $this->Post->{'g-recaptcha-response'};
		$IP = $_SERVER['REMOTE_ADDR'];

		if(!$Human->Verify($CVal,$IP)->IsSuccess()) {
			$this->Errors->Push(new InlineError([
				'Message' => 'Failed to validate as human.'
			]));
			return;
		}

		// then see if they were able to figure out how to fill in a form.
		// the user auth class will kick out various exceptions it does
		// all the checking we need atm.

		try {
			$User = Atlantis\Prototype\User::Insert([
				'Alias'     => $this->Post->Alias,
				'Email'     => $this->Post->Email,
				'Password1' => $this->Post->Password1,
				'Password2' => $this->Post->Password2
			]);
		}

		catch(Atlantis\Error $Doh) {
			$this->Errors->Push(new InlineError([
				'Message' => $Doh->GetMessage()
			]));
			return;
		}

		// huzzah for you.

		$this->LogInfo('User Joined',[
			'ID'    => $User->ID,
			'Alias' => $User->Alias
		]);

		Atlantis\Prototype\User::LaunchSession($User);
		$this->Goto('/');
		return;
	}

}


text:
/*

*/
var ParsedComponents = require('../../result').ParsedComponents;
var Refiner = require('../refiner').Refiner;

var PATTERN = new RegExp("^\\s*(de|[aà]|es[ts]a)?\\s*$");

function isDateOnly(result) {
    return !result.start.isCertain('hour');
}

function isTimeOnly(result) {
    return !result.start.isCertain('month') && !result.start.isCertain('weekday');
}

function isAbleToMerge(text, prevResult, curResult) {
    var textBetween = text.substring(prevResult.index + prevResult.text.length, curResult.index);
    return textBetween.match(PATTERN);
}

function mergeResult(text, dateResult, timeResult){

    var beginDate = dateResult.start;
    var beginTime = timeResult.start;

    var beginDateTime = beginDate.clone();
    beginDateTime.assign('hour', beginTime.get('hour'));
    beginDateTime.assign('minute', beginTime.get('minute'));
    beginDateTime.assign('second', beginTime.get('second'));

    if (beginTime.isCertain('meridiem')) {
        beginDateTime.assign('meridiem', beginTime.get('meridiem'));
    } else if (
        beginTime.get('meridiem') !== undefined &&
        beginDateTime.get('meridiem') === undefined
    ) {
        beginDateTime.imply('meridiem', beginTime.get('meridiem'));
    }

    if (beginDateTime.get('meridiem') == 1 && beginDateTime.get('hour') < 12) {
        beginDateTime.assign('hour', beginDateTime.get('hour') + 12);
    }

    if (dateResult.end != null || timeResult.end != null) {

        var endDate   = dateResult.end == null ? dateResult.start : dateResult.end;
        var endTime   = timeResult.end == null ? timeResult.start : timeResult.end;

        var endDateTime = endDate.clone();
        endDateTime.assign('hour', endTime.get('hour'));
        endDateTime.assign('minute', endTime.get('minute'));
        endDateTime.assign('second', endTime.get('second'));

        if (endTime.isCertain('meridiem')) {
            endDateTime.assign('meridiem', endTime.get('meridiem'));
        } else if (beginTime.get('meridiem') != null) {
            endDateTime.imply('meridiem', endTime.get('meridiem'));
        }

        if (dateResult.end == null && endDateTime.date().getTime() < beginDateTime.date().getTime()) {
            // Ex. 9pm - 1am
            if (endDateTime.isCertain('day')) {
                endDateTime.assign('day', endDateTime.get('day') + 1);
            } else {
                endDateTime.imply('day', endDateTime.get('day') + 1);
            }
        }

        dateResult.end = endDateTime;
    }

    dateResult.start = beginDateTime;

    var startIndex = Math.min(dateResult.index, timeResult.index);
    var endIndex = Math.max(
            dateResult.index + dateResult.text.length,
            timeResult.index + timeResult.text.length);

    dateResult.index = startIndex;
    dateResult.text  = text.substring(startIndex, endIndex);

    for (var tag in timeResult.tags) {
        dateResult.tags[tag] = true;
    }
    dateResult.tags['PTBRMergeDateTimeRefiner'] = true;
    return dateResult;
}

exports.Refiner = function PTBRMergeDateTimeRefiner() {
    Refiner.call(this);

    this.refine = function(text, results, opt) {

        if (results.length < 2) return results;

        var mergedResult = [];
        var currResult = null;
        var prevResult = null;

        for (var i = 1; i < results.length; i++) {

            currResult = results[i];
            prevResult = results[i-1];

            if (isDateOnly(prevResult) && isTimeOnly(currResult)
                    && isAbleToMerge(text, prevResult, currResult)) {

                prevResult = mergeResult(text, prevResult, currResult);
                currResult = null;
                i += 1;

            } else if (isDateOnly(currResult) && isTimeOnly(prevResult)
                    && isAbleToMerge(text, prevResult, currResult)) {

                prevResult = mergeResult(text, currResult, prevResult);
                currResult = null;
                i += 1;
            }

            mergedResult.push(prevResult);
        }

        if (currResult != null) {
            mergedResult.push(currResult);
        }

        return mergedResult;
    }
}


text:
struct INuiSensor;
namespace kinect_device {

class DepthKinectStream : public BaseKinectStream
{
public:
	DepthKinectStream(KinectStreamImpl* pStreamImpl);

	virtual void frameReceived(NUI_IMAGE_FRAME& imageFrame, NUI_LOCKED_RECT &LockedRect);

	virtual OniStatus convertDepthToColorCoordinates(StreamBase* colorStream, int depthX, int depthY, OniDepthPixel depthZ, int* pColorX, int* pColorY);

	virtual OniStatus getProperty(int propertyId, void* data, int* pDataSize);

	virtual OniStatus setProperty(int propertyId, const void* data, int dataSize);

	virtual OniBool isPropertySupported(int propertyId);

	virtual void notifyAllProperties();

private:
	xnl::Array<int> m_mappedCoordsBuffer;

	void populateFrameImageMetadata(OniFrame* pFrame, int dataUnitSize);
	void copyDepthPixelsStraight(const NUI_DEPTH_IMAGE_PIXEL* source, int numPoints, OniFrame* pFrame);
	void copyDepthPixelsWithImageRegistration(const NUI_DEPTH_IMAGE_PIXEL* source, int numPoints, OniFrame* pFrame);

	OniStatus setNearMode(OniBool value);
	OniStatus getNearMode(OniBool* pValue);
};
} // namespace kinect_device
#endif //_DEPTH_KINECT_STREAM_H_


text:
<?php
function stripslashes_deep($val)
{
    return is_array($val) ? array_map('stripslashes_deep', $val) : stripslashes($val);
}

function add_magic_quotes($val)
{
    return is_array($val) ? array_map('add_magic_quotes', $val) : addslashes($val);
}

function openfile($filename, $check = 1, $method = "rb")
{
    $check && strpos($filename, '..') !== false && exit('What are you doing?');
    if ($handle = @fopen($filename, $method)) {
        flock($handle, LOCK_SH);
        $filedata = @fread($handle, filesize($filename));
        fclose($handle);
    }
    return $filedata;
}

function writefile($filename, $data, $check = 1, $method = "rb+", $iflock = 1, $chmod = 1)
{
    $check && strpos($filename, '..') !== false && exit('What are you doing?');
    touch($filename);
    $handle = fopen($filename, $method);
    if ($iflock) {
        flock($handle, LOCK_EX);
    }
    fwrite($handle, $data);
    if ($method == "rb+") ftruncate($handle, strlen($data));
    fclose($handle);
    $chmod && @chmod($filename, 0777);
}

?>


text:
class CourseSurveyQuestionnaire < SurveyQuestionnaire
  after_initialize :post_initialization

  @print_name = 'Course Survey'

  class << self
    attr_reader :print_name
  end

  def post_initialization
    self.display_type = 'Course Survey'
  end
end


text:
using AngleSharp.Html.Dom;
using AngleSharp.Html.Parser;
using MorseCode.ITask;

namespace WizBot.Modules.Searches.GoogleScrape;

public sealed class GoogleScrapeService : SearchServiceBase, INService
{
    private static readonly HtmlParser _googleParser = new(new()
    {
        IsScripting = false,
        IsEmbedded = false,
        IsSupportingProcessingInstructions = false,
        IsKeepingSourceReferences = false,
        IsNotSupportingFrames = true
    });

    private readonly IHttpClientFactory _httpFactory;

    public GoogleScrapeService(IHttpClientFactory httpClientFactory)
        => _httpFactory = httpClientFactory;

    public override async ITask<ISearchResult?> SearchAsync(string? query)
    {
        ArgumentNullException.ThrowIfNull(query);

        query = Uri.EscapeDataString(query)?.Replace(' ', '+');

        var fullQueryLink = $"https://www.google.ca/search?q={query}&safe=on&lr=lang_eng&hl=en&ie=utf-8&oe=utf-8";

        using var msg = new HttpRequestMessage(HttpMethod.Get, fullQueryLink);
        msg.Headers.Add("User-Agent",
            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36");
        msg.Headers.Add("Cookie", "CONSENT=YES+shp.gws-20210601-0-RC2.en+FX+423;");

        using var http = _httpFactory.CreateClient();
        http.DefaultRequestHeaders.Clear();

        using var response = await http.SendAsync(msg);
        await using var content = await response.Content.ReadAsStreamAsync();

        using var document = await _googleParser.ParseDocumentAsync(content);
        var elems = document.QuerySelectorAll("div.g, div.mnr-c > div > div");

        var resultsElem = document.QuerySelector("#result-stats");
        var resultsArr = resultsElem?.TextContent.Split("results");
        var totalResults = resultsArr?.Length is null or 0
            ? null
            : resultsArr[0];

        var time = resultsArr is null or {Length: < 2}
            ? null
            : resultsArr[1]
              .Replace("(", string.Empty)
              .Replace("seconds)", string.Empty);

        //var time = resultsElem.Children.FirstOrDefault()?.TextContent
        //^ this doesn't work for some reason, <nobr> is completely missing in parsed collection
        if (!elems.Any())
            return default;

        var results = elems.Select(elem =>
                           {
                               var aTag = elem.QuerySelector("a");

                               if (aTag is null)
                                   return null;

                               var url = ((IHtmlAnchorElement)aTag).Href;
                               var title = aTag.QuerySelector("h3")?.TextContent;

                               var txt = aTag.ParentElement
                                             ?.NextElementSibling
                                             ?.QuerySelector("span")
                                             ?.TextContent
                                             .StripHtml()
                                         ?? elem
                                            ?.QuerySelectorAll("span")
                                            .Skip(3)
                                            .FirstOrDefault()
                                            ?.TextContent
                                            .StripHtml();
                                             // .Select(x => x.TextContent.StripHtml())
                                             // .Join("\n");

                               if (string.IsNullOrWhiteSpace(url)
                                   || string.IsNullOrWhiteSpace(title)
                                   || string.IsNullOrWhiteSpace(txt))
                                   return null;

                               return new PlainSearchResultEntry
                               {
                                   Title = title,
                                   Url = url,
                                   DisplayUrl = url,
                                   Description = txt
                               };
                           })
                           .Where(x => x is not null)
                           .ToList();

        // return new GoogleSearchResult(results.AsReadOnly(), fullQueryLink, totalResults);

        return new PlainGoogleScrapeSearchResult()
        {
            Answer = null,
            Entries = results!,
            Info = new PlainSearchResultInfo()
            {
                SearchTime = time ?? "?",
                TotalResults = totalResults ?? "?"
            }
        };
    }

    // someone can mr this
    public override ITask<IImageSearchResult?> SearchImagesAsync(string query)
        => throw new NotSupportedException();
}


text:
package com.google.gerrit.server.change;

import org.eclipse.jgit.nls.NLS;
import org.eclipse.jgit.nls.TranslationBundle;

public class ChangeMessages extends TranslationBundle {
  public static ChangeMessages get() {
    return NLS.getBundleFor(ChangeMessages.class);
  }

  public String revertChangeDefaultMessage;
  public String revertSubmissionDefaultMessage;
  public String revertSubmissionUserMessage;
  public String revertSubmissionOfRevertSubmissionUserMessage;

  public String reviewerCantSeeChange;
  public String reviewerInvalid;
  public String reviewerNotFoundUserOrGroup;

  public String groupRemovalIsNotAllowed;
  public String groupIsNotAllowed;
  public String groupHasTooManyMembers;
  public String groupManyMembersConfirmation;
}


text:
import org.junit.runner._
import org.openqa.selenium.phantomjs.PhantomJSDriver
import org.specs2.mutable._
import org.specs2.runner._
import play.api.test._

/**
 * add your integration spec here.
 * An integration test will fire up a whole play application in a real (or headless) browser
 */
@RunWith(classOf[JUnitRunner])
class IntegrationSpec extends Specification {

  "Application" should {

    "work from within a browser" in new WithPhantomJs {

      browser.goTo("http://localhost:" + port)

      browser.pageSource must contain("GitHubスカウターオンライン")
    }
  }
}


text:
require "norn/util/memory-store"
require "norn/util/percentage"

module Norn
  class Mana < MemoryStore
    include Percentage
  end
end


text:
#include "unity.h"
#include "../ofp_queue_config_handler.h"
#include "handler_test_utils.h"
#include "lagopus/pbuf.h"
#include "../channel_mgr.h"

static uint32_t s_port;
static struct packet_queue_list s_packet_queue_list;

void
setUp(void) {
  TAILQ_INIT(&s_packet_queue_list);
}

void
tearDown(void) {
}

static lagopus_result_t
s_ofp_queue_get_config_request_handle_wrap(struct channel *channel,
    struct pbuf *pbuf,
    struct ofp_header *xid_header,
    struct ofp_error *error) {
  return ofp_queue_get_config_request_handle(channel, pbuf,
         xid_header, error);
}

static lagopus_result_t
s_ofp_queue_get_config_reply_create_wrap(struct channel *channel,
    struct pbuf **pbuf,
    struct ofp_header *xid_header) {
  return ofp_queue_get_config_reply_create(channel, pbuf, s_port,
         &s_packet_queue_list,
         xid_header);
}

void
test_prologue(void) {
  lagopus_result_t r;
  const char *argv0 =
    ((IS_VALID_STRING(lagopus_get_command_name()) == true) ?
     lagopus_get_command_name() : "callout_test");
  const char *const argv[] = {
    argv0, NULL
  };

#define N_CALLOUT_WORKERS	1
  (void)lagopus_mainloop_set_callout_workers_number(N_CALLOUT_WORKERS);
  r = lagopus_mainloop_with_callout(1, argv, NULL, NULL,
                                    false, false, true);
  TEST_ASSERT_EQUAL(r, LAGOPUS_RESULT_OK);
  channel_mgr_initialize();
}
void
test_ofp_queue_get_config_handle_normal_pattern(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  ret = check_packet_parse(
          s_ofp_queue_get_config_request_handle_wrap,
          "04 16 00 10 00 00 00 10 ff ff ff ff 00 00 00 00");
  /* <---------------------> ofp_header
   * <> version
   *    <> type
   *       <---> length
   *             <---------> xid
   *                         <---------> port 0xffffffff -> OFPP_ANY
   *                                     <----------> padding
   */
  TEST_ASSERT_EQUAL_MESSAGE(
    LAGOPUS_RESULT_OK, ret,
    "ofp_queue_get_config_request_handle(normal) error.");
}

void
test_ofp_queue_get_config_handle_invalid_length(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error;
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
  /* no body. */
  ret = check_packet_parse_expect_error(
          s_ofp_queue_get_config_request_handle_wrap,
          "04 16 00 08 00 00 00 10",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "no-body error");
}

void
test_ofp_queue_get_config_handle_invalid_length1(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error;
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
  /* invalid body (no pad) */
  ret = check_packet_parse_expect_error(
          s_ofp_queue_get_config_request_handle_wrap,
          "04 16 00 0c 00 00 00 10 ff ff ff ff",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "invalid-body error");
}

void
test_ofp_queue_get_config_handle_invalid_length2(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error;
  ofp_error_set(&expected_error, OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
  /* invalid body (over size) */
  ret = check_packet_parse_expect_error(
          s_ofp_queue_get_config_request_handle_wrap,
          "04 16 00 12 00 00 00 10 ff ff ff ff 00 00 00 00 "
          "ff ff",
          &expected_error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OFP_ERROR, ret,
                            "invalid-body error");
}

void
test_ofp_queue_get_config_handle_invalid_too_large_port(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct ofp_error expected_error;
  ofp_error_set(&expected_error, OFPET_QUEUE_OP_FAILED, OFPQOFC_BAD_PORT);
  ret = check_packet_parse_expect_error(
          s_ofp_queue_get_config_request_handle_wrap,
          "04 16 00 10 00 00 00 10 ff ff ff 01 00 00 00 00",
          &expected_error);
  /* <---------------------> ofp_header
   * <> version
   *    <> type
   *       <---> length
   *             <---------> xid
   *                         <---------> port 0xffffff0x -> OFPP_MAX + 1
   *                                     <----------> padding
   */
  TEST_ASSERT_EQUAL_MESSAGE(
    LAGOPUS_RESULT_OFP_ERROR, ret,
    "too large port should case error.");
}

void
test_ofp_queue_get_config_handle_null(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct channel *channel = channel_alloc_ip4addr("127.0.0.1", "1000", 0x01);
  struct pbuf *pbuf = pbuf_alloc(65535);
  struct ofp_header ofp_header;
  struct ofp_error error;

  ret = ofp_queue_get_config_request_handle(NULL, pbuf, &ofp_header, &error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
                            "NULL-check error. (channel)");

  ret = ofp_queue_get_config_request_handle(channel, NULL, &ofp_header, &error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
                            "NULL-check error. (pbuf)");

  ret = ofp_queue_get_config_request_handle(channel, pbuf, NULL, &error);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
                            "NULL-check error. (ofp_header)");

  ret = ofp_queue_get_config_request_handle(channel, pbuf, &ofp_header, NULL);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
                            "NULL-check error. (ofp_error)");
  channel_free(channel);
  pbuf_free(pbuf);
}

void
test_ofp_queue_get_config_reply_create(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  /* OFPP_ANY */
  s_port = 0xffffffff;
  ret = check_packet_create(
          s_ofp_queue_get_config_reply_create_wrap,
          "04 17 00 10 00 00 00 10 ff ff ff ff 00 00 00 00");
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OK, ret,
                            "create ofpp_any error.");

  /* OFPP_FLOOD */
  s_port = 0xfffffffb;
  ret = check_packet_create(
          s_ofp_queue_get_config_reply_create_wrap,
          "04 17 00 10 00 00 00 10 ff ff ff fb 00 00 00 00");
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OK, ret,
                            "create ofpp_flood error.");

  /* port 0 */
  s_port = 0x00000000;
  ret = check_packet_create(
          s_ofp_queue_get_config_reply_create_wrap,
          "04 17 00 10 00 00 00 10 00 00 00 00 00 00 00 00");
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_OK, ret,
                            "create port 0 error.");
}

void
test_ofp_queue_get_config_reply_create_null(void) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;
  struct channel *channel = channel_alloc_ip4addr("127.0.0.1", "1000", 0x01);
  struct pbuf *pbuf = pbuf_alloc(65535);
  static struct packet_queue_list packet_queue_list;
  struct ofp_header ofp_header;

  ret = ofp_queue_get_config_reply_create(NULL, &pbuf, 0,
                                          &packet_queue_list,
                                          &ofp_header);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
                            "NULL-check error. (channel)");

  ret = ofp_queue_get_config_reply_create(channel, NULL, 0,
                                          &packet_queue_list,
                                          &ofp_header);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
                            "NULL-check error. (pbuf)");

  ret = ofp_queue_get_config_reply_create(channel, &pbuf, 0,
                                          NULL, &ofp_header);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
                            "NULL-check error. (packet_queue_list)");

  ret = ofp_queue_get_config_reply_create(channel, &pbuf, 0,
                                          &packet_queue_list,
                                          NULL);
  TEST_ASSERT_EQUAL_MESSAGE(LAGOPUS_RESULT_INVALID_ARGS, ret,
                            "NULL-check error. (ofp_header)");

  channel_free(channel);
  pbuf_free(pbuf);
}
void
test_epilogue(void) {
  lagopus_result_t r;
  channel_mgr_finalize();
  r = global_state_request_shutdown(SHUTDOWN_GRACEFULLY);
  TEST_ASSERT_EQUAL(r, LAGOPUS_RESULT_OK);
  lagopus_mainloop_wait_thread();
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

namespace HoloToolkit.Unity.SharingWithUNET
{
    /// <summary>
    /// This script exists as a stub to allow other scripts to find
    /// the shared world anchor transform.
    /// </summary>
    public class SharedCollection : SingleInstance<SharedCollection>
    {

    }
}


text:
/**
 * @param {array} items
 * @param {function?} shouldEnd
 *
 * @return {function}
 *
 * linkFunc(func1, func2, func3)
 * linkFunc([func1, func2], (lastResult) => shouldEnd)
 */
export default function linkFuncs(items, ...rest) {
  const mayHaveShouldEnd = Array.isArray(items);
  const shouldEnd = mayHaveShouldEnd && typeof rest[0] === 'function' ? rest[0] : false;
  const funcs = (mayHaveShouldEnd ? items : [items].concat(rest)).filter(item => typeof item === 'function');
  return shouldEnd ? withShouldEnd(funcs, shouldEnd) : withoutShouldEnd(funcs);
}
function withShouldEnd(funcs, shouldEnd) {
  const lastIndex = funcs.length - 1;
  return (...params) => {
    let result, index = 0;
    for (; index <= lastIndex; index++) {
      result = funcs[index].apply(null, params);
      if (index === lastIndex || shouldEnd(result)) return result;
    }
  };
}
function withoutShouldEnd(funcs) {
  return (...params) => funcs.reduce((result, func) => func.apply(null, params), params);
}