text:
import AppKit
import vanilla

class TestGridView:

    def __init__(self):
        self.w = vanilla.Window((0, 0))

        columnDescriptions = [
            dict(
                columnPlacement="trailing"
            ),
            dict(
                width=300,
                columnPlacement="fill"
            )
        ]

        self.editText = vanilla.EditText(
            "auto",
            "Type to test callback.",
            callback=self.editTextCallback
        )
        rows = [
            (
                vanilla.TextBox("auto", "TextBox:"),
                vanilla.TextBox("auto", "Hello")
            ),
            (
                vanilla.TextBox("auto", "EditText:"),
                self.editText
            ),
            (
                vanilla.TextBox("auto", "Button:"),
                vanilla.Button("auto", "Button")
            ),
            (
                vanilla.TextBox("auto", "PopUpButton:"),
                vanilla.PopUpButton("auto", ["PopUpButton"])
            ),
            (
                vanilla.TextBox("auto", "ComboBox:"),
                vanilla.ComboBox("auto", ["ComboBox"])
            ),
            (
                vanilla.TextBox("auto", "CheckBox:"),
                vanilla.CheckBox("auto", "CheckBox 1")
            ),
            dict(
                rowPadding=(0, 0),
                cells=(
                    None,
                    vanilla.CheckBox("auto", "CheckBox 2")
                )
            ),
            dict(
                rowPadding=(0, 0),
                cells=(
                    None,
                    vanilla.CheckBox("auto", "CheckBox 3")
                )
            ),
            (
                vanilla.TextBox("auto", "SegmentedButton:"),
                vanilla.SegmentedButton(
                    "auto",
                    [
                        dict(title="One"),
                        dict(title="Two"),
                        dict(title="Three")
                    ],
                    sizeStyle="regular"
                )
            ),
            (
                vanilla.TextBox("auto", "Slider:"),
                vanilla.Slider("auto", minValue=0, maxValue=100, value=50)
            ),
            dict(
                height=100,
                cells=(
                    vanilla.TextBox("auto", "RadioGroup:"),
                    dict(
                        rowAlignment="none",
                        view=vanilla.RadioGroup("auto", ["One", "Two", "Three"])
                    )
                )
            ),
            dict(
                height=100,
                cells=(
                    vanilla.TextBox("auto", "ColorWell:"),
                    dict(
                        width=50,
                        height=75,
                        view=vanilla.ColorWell("auto", color=AppKit.NSColor.redColor())
                    )
                )
            ),
            dict(
                height=100,
                cells=(
                    vanilla.TextBox("auto", "List:"),
                    dict(
                        columnPlacement="fill",
                        rowPlacement="fill",
                        view=vanilla.List("auto", ["One", "Two", "Three"])
                    )
                )
            ),
            dict(
                height=100,
                cells=(
                    vanilla.TextBox("auto", "TextEditor:"),
                    vanilla.TextEditor("auto", "TextEditor")
                )
            ),
            dict(
                height=100,
                cells=(
                    vanilla.TextBox("auto", "Box:"),
                    vanilla.Box("auto", fillColor=AppKit.NSColor.blueColor(), cornerRadius=20)
                )
            ),
        ]
        self.w.gridView = vanilla.GridView(
            "auto",
            rows,
            columnDescriptions=columnDescriptions,
            columnWidth=150,
            columnSpacing=10,
            rowHeight=25,
            rowPadding=(15, 0)
        )
        self.columnCount = len(columnDescriptions)
        self.rowCount = len(rows)

        # append, insert, etc. buttons

        self.appendColumnButton = vanilla.Button("auto", "Append", callback=self.appendColumnButtonCallback)
        self.insertColumnButton = vanilla.Button("auto", "Insert", callback=self.insertColumnButtonCallback)
        self.removeColumnButton = vanilla.Button("auto", "Remove", callback=self.removeColumnButtonCallback)
        self.moveColumnButton = vanilla.Button("auto", "Move", callback=self.moveColumnButtonCallback)
        self.showColumnButton = vanilla.Button("auto", "Show/Hide", callback=self.showColumnButtonCallback)

        self.appendRowButton = vanilla.Button("auto", "Append", callback=self.appendRowButtonCallback)
        self.insertRowButton = vanilla.Button("auto", "Insert", callback=self.insertRowButtonCallback)
        self.removeRowButton = vanilla.Button("auto", "Remove", callback=self.removeRowButtonCallback)
        self.moveRowButton = vanilla.Button("auto", "Move", callback=self.moveRowButtonCallback)
        self.showRowButton = vanilla.Button("auto", "Show/Hide", callback=self.showRowButtonCallback)

        rows = [
            [
                vanilla.TextBox("auto", "Column:"), self.appendColumnButton, self.insertColumnButton, self.removeColumnButton, self.moveColumnButton, self.showColumnButton
            ],
            [
                vanilla.TextBox("auto", "Row:"), self.appendRowButton, self.insertRowButton, self.removeRowButton, self.moveRowButton, self.showRowButton
            ]
        ]
        columnDescriptions = [dict(width=60, columnPlacement="trailing")]
        for i in range(len(rows[0]) - 1):
            columnDescriptions.append({})

        self.w.line = vanilla.HorizontalLine("auto")
        self.w.testButtonGrid = vanilla.GridView(
            "auto",
            rows,
            columnDescriptions=columnDescriptions,
            columnWidth=100,
            columnSpacing=5,
            columnPlacement="fill",
            rowHeight=25
        )

        rules = [
            "H:|-margin-[gridView]-margin-|",
            "H:|[line]|",
            "H:|-margin-[testButtonGrid]-margin-|",
            "V:|"
               "-margin-"
               "[gridView]"
               "-margin-"
               "[line]"
               "-margin-"
               "[testButtonGrid]"
               "-margin-"
              "|"
        ]
        metrics = dict(
            margin=15
        )
        self.w.addAutoPosSizeRules(rules, metrics)
        self.w.open()

    def editTextCallback(self, sender):
        print("editTextCallback:", sender.get())

    # Column Tests

    def _makeRows(self):
        columnIndex = self.w.gridView.getColumnCount()
        rowCount = self.w.gridView.getRowCount()
        rows = [
            vanilla.TextBox(
                "auto",
                "C-{columnIndex}-{rowIndex}".format(
                    columnIndex=columnIndex,
                    rowIndex=rowIndex
                )
            )
            for rowIndex in range(rowCount)
        ]
        return rows

    def appendColumnButtonCallback(self, sender):
        rows = self._makeRows()
        self.w.gridView.appendColumn(rows, columnWidth=50)

    def insertColumnButtonCallback(self, sender):
        rows = self._makeRows()
        self.w.gridView.insertColumn(self.columnCount, rows, columnWidth=50)

    def removeColumnButtonCallback(self, sender):
        if self.w.gridView.getColumnCount() <= self.columnCount:
            # not a limitation of GridView, just a limitation of this test
            print("can't delete one of the main columns")
        else:
            self.w.gridView.removeColumn(self.columnCount)

    def moveColumnButtonCallback(self, sender):
        self.w.gridView.moveColumn(0, 1)

    def showColumnButtonCallback(self, sender):
        visible = self.w.gridView.columnIsVisible(1)
        self.w.gridView.showColumn(1, not visible)

    # Row Tests

    def _makeRow(self):
        columnCount = self.w.gridView.getColumnCount()
        rowIndex = self.w.gridView.getRowCount()
        cells = [
            vanilla.TextBox(
                "auto",
                "R-{columnIndex}-{rowIndex}".format(
                    columnIndex=columnIndex,
                    rowIndex=rowIndex
                )
            )
            for columnIndex in range(columnCount)
        ]
        return cells

    def appendRowButtonCallback(self, sender):
        row = self._makeRow()
        self.w.gridView.appendRow(row)

    def insertRowButtonCallback(self, sender):
        row = self._makeRow()
        self.w.gridView.insertRow(self.rowCount, row)

    def removeRowButtonCallback(self, sender):
        if self.w.gridView.getRowCount() <= self.rowCount:
            # not a limitation of GridView, just a limitation of this test
            print("can't delete one of the main rows")
        else:
            self.w.gridView.removeRow(self.rowCount)

    def moveRowButtonCallback(self, sender):
        self.w.gridView.moveRow(0, 1)

    def showRowButtonCallback(self, sender):
        visible = self.w.gridView.rowIsVisible(1)
        self.w.gridView.showRow(1, not visible)

if __name__ == "__main__":
    import vanilla
    from vanilla.test.testTools import executeVanillaTest
    executeVanillaTest(TestGridView)


text:
class C {
    [Symbol.iterator](x: string): string;
    static [Symbol.iterator](x: number): number;
    [Symbol.iterator](x: any) {
        return undefined;
    }
}

//// [symbolProperty42.js]
class C {
    [Symbol.iterator](x) {
        return undefined;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.sap.hcp.cf.logging.common.converter;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertThat;

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

import com.sap.hcp.cf.logging.common.helper.StacktraceGenerator;

public class DefaultStacktraceConverterTest extends AbstractConverterTest {

    private String expectedString;
    StringBuilder stringBuilder = new StringBuilder();

    @Test
    public void testNull() {
        DefaultStacktraceConverter dstc = new DefaultStacktraceConverter();
        assertThat(formatStacktrace(dstc, null), is(EMPTY));
    }

    @Test
    public void testSynthetic() throws Exception {
        DefaultStacktraceConverter dstc = new DefaultStacktraceConverter();
        String actual = formatStacktrace(dstc, new NullPointerException());
        assertThat(actual, not(is(EMPTY)));
        assertThat(arrayElem(actual, 0).toString(), is(NullPointerException.class.getName()));
    }

    @Test
    public void testReal() throws Exception {
        DefaultStacktraceConverter dstc = new DefaultStacktraceConverter();

        try {
            throw new ArrayIndexOutOfBoundsException();
        } catch (ArrayIndexOutOfBoundsException ex) {
            String actual = formatStacktrace(dstc, ex);
            assertThat(actual, not(is(EMPTY)));
            assertThat(arrayElem(actual, 0).toString(), containsString(ex.getClass().getName()));
        }
    }

    @Test
    public void compareCompleteStacktraceWithExpectation() throws InterruptedException {
        Thread thread = new Thread(new Runnable() {

            @Override
            public void run() {
                DefaultStacktraceConverter converter = new DefaultStacktraceConverter(4000);
                StacktraceGenerator generator = new StacktraceGenerator(5, 10, 5);
                converter.convert(generator.generateException(), stringBuilder);
            }
        });
        thread.start();
        thread.join();
        expectedString = "[\"java.lang.IllegalArgumentException: too long\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f3IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f3IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f3IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f3IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f3IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f3IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.generateException(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.converter.DefaultStacktraceConverterTest$X.run(DefaultStacktraceConverterTest.java:X)\"," + //
                         "\"\\tat java.lang.Thread.run(Thread.java:X)\"]";
        Assert.assertEquals(expectedString, stringBuilder.toString().replaceAll(":\\d+\\)", ":X)").//
                                                         replaceAll("\\$\\d", "\\$X"));
    }

    @Test
    public void compareTruncatedStacktraceWithExpectation() throws InterruptedException {
        Thread thread = new Thread(new Runnable() {

            @Override
            public void run() {
                DefaultStacktraceConverter converter = new DefaultStacktraceConverter(2000);
                StacktraceGenerator generator = new StacktraceGenerator(5, 20, 5);
                converter.convert(generator.generateException(), stringBuilder);
            }
        });
        thread.start();
        thread.join();
        expectedString = "[\"-------- STACK TRACE TRUNCATED --------\"," + //
                         "\"java.lang.IllegalArgumentException: too long\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f3IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f3IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f3IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f3IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"-------- OMITTED --------\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f2IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.f1IsASimpleFunctionWithAnExceptionallyLongName(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.helper.StacktraceGenerator.generateException(StacktraceGenerator.java:X)\"," + //
                         "\"\\tat com.sap.hcp.cf.logging.common.converter.DefaultStacktraceConverterTest$X.run(DefaultStacktraceConverterTest.java:X)\"," + //
                         "\"\\tat java.lang.Thread.run(Thread.java:X)\"]";
        Assert.assertEquals(expectedString, stringBuilder.toString().replaceAll(":\\d+\\)", ":X)").//
                                                         replaceAll("\\$\\d", "\\$X"));
    }

}


text:
<?php

namespace Puli\Manager\Conflict;

use Puli\Manager\Api\Module\ModuleList;
use RuntimeException;

/**
 * A directed, acyclic graph of module names.
 *
 * Modules can be added with {@link addModuleName()}. Edges between these modules
 * can then be added using {@link addEdge()}. Both ends of an edge must have
 * been defined before the edge is added.
 *
 * ```php
 * $graph = new DependencyGraph();
 * $graph->addModuleName('acme/core');
 * $graph->addModuleName('acme/blog');
 * $graph->addModuleName('acme/blog-extension1');
 * $graph->addModuleName('acme/blog-extension2');
 * $graph->addDependency('acme/blog', 'acme/core');
 * $graph->addDependency('acme/blog-extension1', 'acme/blog');
 * $graph->addDependency('acme/blog-extension2', 'acme/blog');
 * $graph->addDependency('acme/blog-extension2', 'acme/blog-extension1');
 * ```
 *
 * You can use {@link getPath()} and {@link hasPath()} to check whether a path
 * exists from one module to the other:
 *
 * ```php
 * // ...
 *
 * $graph->hasPath('acme/blog-extension1', 'acme/blog');
 * // => true
 *
 * $graph->hasPath('acme/blog-extension2', 'acme/blog-extension1');
 * // => false
 *
 * $graph->getPath('acme/blog-extension2', 'acme/core');
 * // => array('acme/core', 'acme/blog', 'acme/blog-extension2')
 * ```
 *
 * With {@link getSortedModuleNames()}, you can sort the modules such that the
 * dependencies defined via the edges are respected:
 *
 * ```php
 * // ...
 *
 * $graph->getSortedModuleNames();
 * // => array('acme/core', 'acme/blog', 'acme/blog-extension1', 'acme/blog-extension2')
 * ```
 *
 * @since  1.0
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class DependencyGraph
{
    /**
     * Stores the names of all modules (vertices) as keys.
     *
     * @var array
     */
    private $moduleNames = array();

    /**
     * Stores the edges in the keys of a multi-dimensional array.
     *
     * The first dimension stores the module names, the second dimension the
     * names of the dependencies.
     *
     * @var array
     */
    private $dependencies = array();

    /**
     * Creates an override graph for the given modules.
     *
     * @param ModuleList $modules The modules to load.
     *
     * @return static The created override graph.
     */
    public static function forModules(ModuleList $modules)
    {
        $graph = new static($modules->getModuleNames());

        foreach ($modules as $module) {
            if (null === $module->getModuleFile()) {
                continue;
            }

            foreach ($module->getModuleFile()->getDependencies() as $dependency) {
                if ($graph->hasModuleName($dependency)) {
                    $graph->addDependency($module->getName(), $dependency);
                }
            }
        }

        // Do we have a root module?
        if (null === $modules->getRootModule()) {
            return $graph;
        }

        // Make sure we have numeric, ascending keys here
        $moduleOrder = array_values($modules->getRootModule()->getModuleFile()->getModuleOrder());

        // Each module overrides the previous one in the list
        for ($i = 1, $l = count($moduleOrder); $i < $l; ++$i) {
            $dependency = $moduleOrder[$i - 1];
            $moduleName = $moduleOrder[$i];

            if ($graph->hasModuleName($dependency)) {
                $graph->addDependency($moduleName, $dependency);
            }
        }

        return $graph;
    }

    /**
     * Creates a new graph.
     *
     * @param string[] $moduleNames The module names stored in the nodes of
     *                              the graph.
     */
    public function __construct(array $moduleNames = array())
    {
        $this->addModuleNames($moduleNames);
    }

    /**
     * Adds a module name to the graph.
     *
     * @param string $moduleName The module name.
     *
     * @throws RuntimeException If the module name already exists.
     */
    public function addModuleName($moduleName)
    {
        if (isset($this->moduleNames[$moduleName])) {
            throw new RuntimeException(sprintf(
                'The module "%s" was added to the graph twice.',
                $moduleName
            ));
        }

        $this->moduleNames[$moduleName] = true;
        $this->dependencies[$moduleName] = array();
    }

    /**
     * Adds a list of module names to the graph.
     *
     * @param string[] $moduleNames The module names.
     *
     * @throws RuntimeException If a module name already exists.
     */
    public function addModuleNames(array $moduleNames)
    {
        foreach ($moduleNames as $moduleName) {
            $this->addModuleName($moduleName);
        }
    }

    /**
     * Returns whether a module name exists in the graph.
     *
     * @param string $moduleName The module name.
     *
     * @return bool Whether the module name exists.
     */
    public function hasModuleName($moduleName)
    {
        return isset($this->moduleNames[$moduleName]);
    }

    /**
     * Returns all module names in the graph.
     *
     * @return array All module names in the graph.
     */
    public function getModuleNames()
    {
        return $this->moduleNames;
    }

    /**
     * Returns the sorted module names.
     *
     * The names are sorted such that if a module m1 depends on a module m2,
     * then m2 comes before m1 in the sorted set.
     *
     * If module names are passed, only those module names are sorted. Otherwise
     * all module names are sorted.
     *
     * @param string[] $namesToSort The module names which should be sorted.
     *
     * @return string[] The sorted module names.
     *
     * @throws RuntimeException If any of the passed module names does not
     *                          exist in the graph.
     */
    public function getSortedModuleNames(array $namesToSort = array())
    {
        if (count($namesToSort) > 0) {
            $namesToSort = array_flip($namesToSort);

            foreach ($namesToSort as $module => $_) {
                if (!isset($this->moduleNames[$module])) {
                    throw new RuntimeException(sprintf(
                        'The module "%s" does not exist in the graph.',
                        $module
                    ));
                }
            }
        } else {
            $namesToSort = $this->moduleNames;
        }

        $sorted = array();

        // Do a topologic sort
        // Start with any module and process until no more are left
        while (false !== reset($namesToSort)) {
            $this->sortModulesDFS(key($namesToSort), $namesToSort, $sorted);
        }

        return $sorted;
    }

    /**
     * Adds a dependency from one to another module.
     *
     * @param string $moduleName The module name.
     * @param string $dependency The name of the dependency.
     */
    public function addDependency($moduleName, $dependency)
    {
        if (!isset($this->moduleNames[$dependency])) {
            throw new RuntimeException(sprintf(
                'The module "%s" does not exist in the graph.',
                $dependency
            ));
        }

        if (!isset($this->moduleNames[$moduleName])) {
            throw new RuntimeException(sprintf(
                'The module "%s" does not exist in the graph.',
                $moduleName
            ));
        }

        if (null !== ($path = $this->getPath($dependency, $moduleName))) {
            $last = array_pop($path);

            throw new CyclicDependencyException(sprintf(
                'A cyclic dependency was discovered between the modules "%s" '.
                'and "%s". Please check the "override" keys defined in these '.
                'modules.',
                implode('", "', $path),
                $last
            ));
        }

        $this->dependencies[$moduleName][$dependency] = true;
    }

    /**
     * Removes a dependency from one to another module.
     *
     * @param string $moduleName The module name.
     * @param string $dependency The name of the dependency.
     */
    public function removeDependency($moduleName, $dependency)
    {
        unset($this->dependencies[$moduleName][$dependency]);
    }

    /**
     * Returns whether a module directly depends on another module.
     *
     * @param string $moduleName The module name.
     * @param string $dependency The name of the dependency.
     * @param bool   $recursive  Whether to take recursive dependencies into
     *                           account.
     *
     * @return bool Whether an edge exists from the origin to the target module.
     */
    public function hasDependency($moduleName, $dependency, $recursive = true)
    {
        if ($recursive) {
            return $this->hasPath($moduleName, $dependency);
        }

        return isset($this->dependencies[$moduleName][$dependency]);
    }

    /**
     * Returns whether a path exists from a module to a dependency.
     *
     * @param string $moduleName The module name.
     * @param string $dependency The name of the dependency.
     *
     * @return bool Whether a path exists from the origin to the target module.
     */
    public function hasPath($moduleName, $dependency)
    {
        // does not exist in the graph
        if (!isset($this->dependencies[$moduleName])) {
            return false;
        }

        // adjacent node
        if (isset($this->dependencies[$moduleName][$dependency])) {
            return true;
        }

        // DFS
        foreach ($this->dependencies[$moduleName] as $predecessor => $_) {
            if ($this->hasPath($predecessor, $dependency)) {
                return true;
            }
        }

        return false;
    }

    /**
     * Returns the path from a module name to a dependency.
     *
     * @param string $moduleName The module name.
     * @param string $dependency The name of the dependency.
     *
     * @return null|string[] The sorted module names on the path or `null` if no
     *                       path was found.
     */
    public function getPath($moduleName, $dependency)
    {
        if ($this->getPathDFS($moduleName, $dependency, $reversePath)) {
            return array_reverse($reversePath);
        }

        return null;
    }

    /**
     * Finds a path between modules using Depth-First Search.
     *
     * @param string $moduleName  The end module name.
     * @param string $dependency  The start module name.
     * @param array  $reversePath The path in reverse order.
     *
     * @return bool Whether a path was found.
     */
    private function getPathDFS($moduleName, $dependency, &$reversePath = array())
    {
        // does not exist in the graph
        if (!isset($this->dependencies[$moduleName])) {
            return false;
        }

        $reversePath[] = $moduleName;

        // adjacent node
        if (isset($this->dependencies[$moduleName][$dependency])) {
            $reversePath[] = $dependency;

            return true;
        }

        // DFS
        foreach ($this->dependencies[$moduleName] as $predecessor => $_) {
            if ($this->getPathDFS($predecessor, $dependency, $reversePath)) {
                return true;
            }
        }

        return false;
    }

    /**
     * Topologically sorts the given module name into the output array.
     *
     * The resulting array is sorted such that all predecessors of the module
     * come before the module (and their predecessors before them, and so on).
     *
     * @param string $currentName The current module name to sort.
     * @param array  $namesToSort The module names yet to be sorted.
     * @param array  $output      The output array.
     */
    private function sortModulesDFS($currentName, array &$namesToSort, array &$output)
    {
        unset($namesToSort[$currentName]);

        // Before adding the module itself to the path, add all predecessors.
        // Do so recursively, then we make sure that each module is visited
        // in the path before any of its successors.
        foreach ($this->dependencies[$currentName] as $predecessor => $_) {
            // The module was already processed. Either the module is on the
            // path already, then we're good. Otherwise, we have a cycle.
            // However, addEdge() guarantees that the graph is cycle-free.
            if (isset($namesToSort[$predecessor])) {
                $this->sortModulesDFS($predecessor, $namesToSort, $output);
            }
        }

        $output[] = $currentName;
    }
}


text:
@font-face {
	font-family: 's11-fp';
	src: url('../fonts/s11-fp.eot');
	src: local('☺'), url('../fonts/s11-fp.woff') format('woff'), url('../fonts/s11-fp.ttf') format('truetype'), url('../fonts/s11-fp.svg') format('svg');
	font-weight: normal;
	font-style: normal;
}

/* dashboard icon */
#toplevel_page_formidable .wp-menu-image:before,
.wp-media-buttons .add_media span.wp-media-buttons-icon.frm-buttons-icon:before {
	font-family: 's11-fp' !important;
	content: '\e601';
	text-shadow: none;
}
.frm_inactive_menu{
    opacity:.5;
    filter:alpha(opacity=50);
}

/* media box button */
.wp-media-buttons .button.frm_insert_form{padding-left:5px;}

.wp-media-buttons .add_media span.wp-media-buttons-icon.frm-buttons-icon{
	background:none;
}

/* Upgrade notice */
#frm_install_message, .frm_previous_install{padding:7px;}
.frm_deauthorize_link .spinner{
    display:inline-block;
    margin-top:0;
    float:none;
}
.frm_plugin_updating{line-height:24px;}
.frm_plugin_updating .frm_spinner{float:left;display:block;}

.frm_hidden, input.frm_hidden{display:none;}

/* Admin Bar */
#wpadminbar #wp-admin-bar-frm-forms > .ab-item:before{font-family:'s11-fp' !important;content:'\e601';top:2px;}

/* Popup shortcode builder */
#frm_insert_form_content{margin:20px;}
#frm_popup_content .spinner{
	float: left;
	position: absolute;
	top: 16px;
	left: 300px;
}
#frm_popup_content .media-frame .attachments-browser{overflow:scroll;}
#frm_popup_content .howto{display:block;}
#frm_popup_content .media-menu .active .howto, .media-menu .active:hover .howto{font-weight:normal;}
#frm_shortcode_options{padding:16px;}
#frm_shortcode_options .frm_left_label{
	float:left;
	width:200px;
}
#frm_shortcode_options.media-embed .setting span{float:left;}
#frm_shortcode_options h4{margin:3px 0 0;}
#frm_popup_content .media-toolbar-primary{width:33% !important;}
#frm_popup_content .media-toolbar-secondary{width:60%;}
#frm_complete_shortcode{margin-top:15px;width:100%;}
.frm_box_line{border-bottom:1px solid #ddd;display:block;margin:15px 0 0;}


text:
package org.wso2.siddhi.storm;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.siddhi.core.event.Event;
import org.wso2.siddhi.query.api.definition.StreamDefinition;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;

public class ConsumingQueuedEventSource implements QueuedEventSource {
    private static Log log = LogFactory.getLog(ConsumingQueuedEventSource.class);
    private final StreamDefinition streamDefinition;
    private String tracerPrefix = "";
    private ConcurrentLinkedQueue<Object[]> eventQueue;

    public ConsumingQueuedEventSource(StreamDefinition streamDefinition) {
        this.streamDefinition = streamDefinition;
        this.eventQueue = new ConcurrentLinkedQueue<Object[]>();
    }

    public StreamDefinition getStreamDefinition() {
        return streamDefinition;
    }

    public void consumeEvents(Object[][] events) {
        for (Object[] eventData : events) {
            eventQueue.offer(eventData);
        }

    }

    public void consumeEvents(Event[] events) {
        for (Event event : events) {
            eventQueue.offer(event.getData());
        }
    }

    public void consumeEvent(Object[] eventData) {
        eventQueue.offer(eventData);
    }

    public void consumeEvent(Event event) {
        eventQueue.offer(event.getData());
    }

    @Override
    public Object[] getEvent() {
        return eventQueue.poll();
    }

    @Override
    public List<Object[]> getAllEvents() {
        List<Object[]> eventList = new ArrayList<Object[]>(StormProcessorConstants.MAX_BATCH_SIZE);
        Object[] currentEvent;
        int batchCount = 0;
        while ((currentEvent = eventQueue.poll()) != null && batchCount++ < StormProcessorConstants.MAX_BATCH_SIZE) {
            eventList.add(currentEvent);
        }

        return eventList;
    }

    @Override
    public String getStreamId() {
        return this.streamDefinition.getStreamId();
    }
}


text:
const INPUTS = {
  inputSelectPlaceholder: 'Selecteer',
  inputPasswordPlaceholder: 'Wachtwoord',
  inputEncryptedPlaceholder: 'Beveiligde Sleutel',
  authPrivateKeyPlaceholder: 'Voer je private key hier in',
  authWatchPlaceholder: 'Vul hier een NEO adres in',
}

const MISCELLANEOUS = {
  'auth.cancel': 'Annuleren',
  'auth.ledger.connectLedger':
    'Verbind en ontgrendel je Ledger-apparaat',
  'auth.ledger.navigateToNeoApp':
    'Navigeer naar de NEO-app op je apparaat',
  'auth.ledger.retry': 'Opnieuw proberen?',
  'auth.ledger.fetchAddress': 'Haal extra adressen op',
  publicAddress: 'Publiek adres',
  'auth.import.recoveryInstructions':
    'Upload hier een JSON-wallet-herstelbestand om je accounts aan Neon toe te voegen. Deze optie is ook beschikbaar op de pagina Instellingen.',
  importFile: 'Bestand importeren',
  dashboardTokenBalancesPrice: 'PRIJS',
  dashboardTokenBalancesHoldings: 'AANTAL',
  settingsLanguageLabel: 'TAAL',
  addToken: 'Token Toevoegen',
  contactsPageLabel: 'Contacten Beheren',
  newContact: 'Nieuw Contact',
  deleteLabel: 'Verwijderen',

  addToContacts: 'Toevoegen aan contacten',
  contactName: 'Naam',
  enterAContactName: 'Voer naam in',
  enterAWalletAddress: 'Voer wallet adres in',
  contactWalletAddress: 'Wallet adres',
  editAContact: 'Pas een contact aan',
  modifyDetails: 'Details aanpassen',
  removeContact: 'Verwijder contact',
  saveContactButtonText: 'Sla contact op',

  editContactDisclaimer:
    'Controleer of je het adres correct hebt ingevoerd om ervoor te zorgen dat je geen bezit verliest',
  addAContact: 'Voeg een contact toe',
  addContactDetails: 'Voeg contact-details toe',
  confirmRemoveContact: 'Bevestig het verwijderen van contact',
  modalActionConfirm: 'Akkoord',
  modalActionCancel: 'Annuleren',
  newsPageLabel: 'Niews',
  networkSettingsLabel: 'Netwerk Instellingen',

  walletManagerNoLocalInfo:
    'Het lijkt erop dat je geen wallet-informatie lokaal hebt opgeslagen',

  walletManagerRemoveWallet: 'Wallet verwijderen',

  selectAssets: 'Selecteer assets',
  priorityTransfer: 'Prioriteitstransactie',

  editRecipients: 'Pas ontvanger aan',
  confirmAndSend: 'Bevestigen en verzenden',
  fee: 'Vergoeding:',
  sendMoreAssets: 'Verstuur meer assets',
  transactionId: 'Transactie ID:',
  numberofTransactionsPending:
    '{transferCount, number} {transferCount, plural, one {Transactie} other {Transacties}} in afwachting',
  assetRecipients:
    'Asset {transferCount, plural, one {Ontvanger} other {Ontvangers}}',
  confirmation: 'Confirmation',
  confirmationRecipient:
    '{transferCount, number} {transferCount, plural, one {Ontvanger} other {Ontvangers}}',
  completeExclaim: 'Bevestigd!',
  sendQRExplanation:
  // eslint-disable-next-line
    "Dus je hebt een QR-code gekregen? Klik op Foto nemen en hou de QR-Code voor je camera.",
  captureQR: 'Foto nemen',
  captureQRCaps: 'FOTO NEMEN',

  networkConfigTooltipUpdateSettings: 'Instelling bijwerken',
  networkConfigTooltipPublicKey: 'PUBLIC KEY:',
  networkConfigTooltipAddress: 'ADRES:',

  noOptionsMessage: 'Geen opties',
  isLoadingMessage: 'Bezig met laden...',

  nothingToSeeHere: 'Niks te zien hier!',

  noAvailableAssetsToSend: 'Geen assets aanwezig om te verzenden',
  sendErrorLabel: 'Fout!',
  automaticNodeSelectionTooltip: 'Sta NEON toe automatisch een node te selecteren',

  depositAssets:
    'Stort assets  compatibel met de NEO-blockchain  met als adres:',
  copyAddressTooltip: 'Kopieer wallet adres',
  walletQrCodes: 'Wallet QR-Code',

  noClaimableGas: 'Adres heeft geen claimbaar GAS',
  claimTimeDisclaimer: 'Je kunt GAS elke 5 minuten claimen',
  claimUnavailableInWatch: 'GAS claims zijn niet beschikbaar in Alleen-lezen Mode',
  takeMeBack: 'Terug',

  splitKeyWalletInstructions:
    'Met de importoptie Gesplitste Sleutel kunnen gebruikers een nieuw NEO-account aanmaken door de private key van een bestaand account te combineren met een aparte private key.',
  splitKeyWalletNamePlaceholder: 'Voer je nieuwe Gesplitste Sleutel wallet naam in...',
  chooseAccount: 'Kies een bestaande account',
  nextStep: 'Volgende stap',
  previousStep: 'Vorige stap',
  privateKey: 'Private key',
}

const ERRORS = {
  'errors.contact.nameNull': "Naam kan niet leeg zijn.",
  'errors.contact.nameLength': 'Naam is te lang.',
  'errors.contact.nameDupe':
    'Je hebt al een account opgeslagen met die naam.',
  'errors.contact.invalidAddress': 'Adres is niet geldig.',
  'errors.contact.contactExists':
    'Je hebt als een contact met deze naam.',

  'errors.password.length': `Wachtwoord moet tenminste {PASS_MIN_LENGTH, number} tekens bevatten.`,
  'errors.password.match': 'Wachtwoorden moeten overeen komen.',
  'errors.request.fractional': `Je kunt niet een gedeelte van {asset} opvragen.`,
  'errors.request.validDecimals': `Je kunt {asset} tot maximaal {validDecimals, number} aanvragen.`,
  'errors.request.max': `Je kunt niet meer dan 100.000.000 {asset} aanvragen.`,
  'errors.request.min': `Je kunt niet 0 {asset} aanvragen.`,
  'errors.network.general': 'Oops! Iets ging verkeerd.',
  'errors.encrypt.valid': 'De private sleutel is niet geldig.',

  'errors.send.balance': `Je hebt niet genoeg in je wallet om {total} {asset} te verzenden.`,
  'errors.send.network': 'Een netwerk probleem is opgetreden.',
  'errors.send.number': 'Aantal moet nummeriek zijn.',
  'errors.send.fraction': 'Je knt geen gedeelte van een NEO verzenden.',
  'errors.send.negative': `Je kunt geen negatieve aantallen {asset} verzenden`,
  'errors.send.zero': `Je kunt geen 0 {asset} verzenden.`,
  'errors.send.decimal': `Je kunt {asset} tot maximaal {decimalCount, number} verzenden.`,
  'errors.send.invalidAddress': 'Je moet een geldig NEO adres invoeren..',
  'errors.send.blackListed':
    'Adres is geblacklist, dit is een bekend phising adres.',
}

const NOTIFICATIONS = {
  'notifications.success.receivedBlockchainInfo':
    'Laatste blockchain informatie opgevraagd.',
  'notifications.success.accountSaved': 'Account opgeslagen!',
  'notifications.success.updatedWalletName': 'Wallet naam opgeslagen..',
  'notifications.failure.blockchainInfoFailure':
    'Het is niet gelukt om blockchain informatie op te halen.',
}

const AUTH = {
  authLogin: 'Inloggen',
  authSaved: 'OPGESLAGEN',
  authPrivate: 'PRIVATE KEY',
  authEncrypted: 'VERSLEUTELD',
  authWatch: 'ALLEEN LEZEN',
  authLedger: 'LEDGER',
  authCreateWallet: 'Maak wallet',
  authImportWallet: 'Importeer wallet',
  authScanQRButton: 'Scan QR-Code',
  authLoginButton: 'Inloggen',
  authLedgerFirstStep: 'Verbind en ontgrendel je Ledger-apparaat',
  authLedgerSecondStep: 'Navigeer naar de NEO-app op je apparaat',
  authLedgerAddressLabel: 'PUBLIEK ADRES',
}

const WALLET_CREATION = {
  createANewWallet: 'Maak nieuwe wallet',
  walletCreationInstruction: 'Voer details in',
  walletCreationWalletNameLabel: 'WALLET NAAM',
  walletCreationWalletNamePlaceholder: 'Wallet naam',
  walletCreationWalletPasswordLabel: 'Wachtwoord',
  walletCreationWalletPasswordPlaceholder: 'Wachtwoord',
  walletCreationWalletPasswordConfirmLabel: 'Herhaal wachtwoord',
  walletCreationWalletPasswordConfirmPlaceholder: 'Wachtwoord nogmaals',
  walletCreationButton: 'Maak wallet',
  walletCreatedHeader: 'Wallet aangemaakt!',
  walletImportedHeader: 'Wallet aangemaakt!',
  walletCreatedDisclaimer:
    'Bewaar deze details! Als je deze inloggegevens kwijtraakt, heb je geen toegang meer tot je assets.',
  privateKeyLabel: 'PRIVATE KEY',
  encryptedKeyLabel: 'BEVEILIGDE SLEUTEL',
  addressLabel: 'PUBLIEK ADRES',
  splitKeyLabel: 'GESPLITSTE SLEUTEL',
  recoverWalletLabel: 'HERSTEL WALLET',
  print: 'Print',
  generateQrCodes: 'Genereer QR-Codes',
  copyCodeImage: 'Kopieer Code Image',
}

const DASHBOARD = {
  dashboardBalancePanelLabel: 'Token overzicht',
  dashboardAssetsPanelLabel: 'Systeem assets',
  dashboardAssetsTotal: 'TOTAAL',
  dashboardMarketDataLabel: 'Marktdata',
  dashboardValueLabel: 'Totale walletwaarde',
  dashboardAddressLabel: 'Adres:',
  dashboardPriceNotAvailable: 'N.v.t.',
  dashboardGasClaimButton: 'Claim {amount} GAS',
  dashboardManageWallets: 'Beheer wallets',
  dashboardRefresh: 'Verversen',
  dashboardTokenBalancesToken: 'Token',
  dashboardMarketData1Day: '1 DAG',
  dashboardMarketData1Week: '1 WEEK',
  dashboardMarketData1Month: '1 MAAND',
}

const SIDEBAR = {
  sidebarWallet: 'Wallet',
  sidebarActivity: 'Activiteit',
  sidebarSend: 'Verzenden',
  sidebarReceive: 'Ontvangen',
  sidebarContacts: 'Contacten',
  sidebarTokenSale: 'Token Verkoop',
  sidebarNews: 'Nieuws',
  sidebarSettings: 'Instellingen',
  sidebarLogout: 'Uitloggen',
  sidebarCurrentBlock: 'HUIDIG BLOK',
}

const MANAGE_WALLETS = {
  manageWalletsLabel: 'Beheer wallets',
  manageWalletsImport: 'Importeren',
  manageWalletsCreate: 'Maak',
  manageWalletsEdit: 'Aanpassen',
  manageWalletsEditWallet: 'Pas wallet aan',
  manageWalletsEditWalletInstructions: 'Wijzig details',
  manageWalletsEditWalletNameLabel: 'WALLET NAAM',
  manageWalletsEditWalletNamePlaceholder: 'Wallet naam',
  manageWalletsEditWalletAddressLabel: 'WALLET ADRES',
  manageWalletsEditWalletSave: 'Wijzigingen opslaan',
}

const ACTIVITY = {
  activityAddAddress: 'Toevoegen',
  activityViewTx: 'Bekijken',
  activityPageLabel: 'Alle activiteiten',
  activityExport: 'Exporteren',
}

const RECEIVE = {
  recieveSelectMethod: 'Selecteer stortingsmethode',
  receiveAssetsAddressLabel: 'Jouw publieke adres',
  receivePageLabel: 'Ontvang assets',
  receiveYourAddressTabLabel: 'JOUW ADRES',
  receiveCopyCodeButton: 'Copy Code Afbeelding',
  receiveDisclaimer:
    'Stuur alleen assets die compatibel zijn met de NEO-blockchain (NEO, GAS, etc.). Het verzenden van andere assets zal resulteren in permanent verlies.',
  receiveRequestTabAssets: 'VERZOEK ASSETS',
  recieveWhyUseQRLabel: 'Waarom een QR-Code gebruiken??',
  receiveQRExplanation:
    '
Ooit assets naar het verkeerde adres gestuurd vanwege een foutief karakter in het wallet-adres?

Zo niet, dan heb je mazzel - maar het gebeurt veel te vaak.

Hier bij CoZ willen we ervoor zorgen dat mensen die jou betalen, het juiste adres krijgen. Je kunt een QR-code genereren om assets aan te vragen, zodat ze jou kunnen helpen.

 Elke code die je genereert, bevat je openbare wallet-adres, een aantal en een referentie - allemaal door jou ingesteld.
',
}

const REQUEST_ASSETS = {
  requestAssetLabel: 'ASSET',
  requestAssetAmountLabel: 'Aantal',
  requestAssetAmount: 'AANTAL',
  requestAssetDepositLabel: 'SORT IN DEZE WALLET',
  requestAssetRefLabel: 'REFERENTIE',
  requestAssetRefPlaceholder: 'Voeg een notitie toe...',
  requestAssetQRButton: 'Genereer QR-Code',
  requestAssetYourQRHeader: 'Jou QR Code',
  requestAssetsPaymentDetails: 'BETAALVERZOEK DETAILS',
  requestAssetsYourQRLabel: 'Jouw QR-Code',
  requestAssetsRefLabel: 'REFERENTIE',
  requestAssetsAddressLabel: 'ADRES',
  requestAssetsAmountLabel: 'AANTAL',
  requestAssetsAssetLabel: 'ASSET',
}

const TRANSACTION_FEE = {
  transactionFeeQuestion: 'PRIORITEER JOUW TRANSACTIE MET EEN VERGOEDING?',
  fast: 'Snel',
  faster: 'Sneller',
  fastest: 'Snelst',
  sendWithFee: 'Verstuur {itemCount, plural, one {asset} other {assets}} met vergoeding',
  sendWithoutFee:
    'Verstuur {itemCount, plural, one {asset} other {assets}} zonder vergoeding',
  Asset: 'Asset',
  assets: 'Assets',
}

const SEND = {
  sendPageLabel: 'Verstuur assets',
  sendImport: 'Importeren',
  sendEnterQRCode: 'Voer QR-Code in',
  sendAdd: 'Voeg ontvanger toe',
  sendAssetLabel: 'ASSET',
  sendAmountLabel: 'AANTAL',
  sendAddressLabel: 'ONTVANGER ADRES',
  sendAddressPlaceholder: 'Voeg wallet toe of selecteer contact',
  sendTranfer: 'TRANSACTIE',
  sendMaxAmount: 'MAX',
  sendTransferPlural: 'TRANSACTIES',
  sendAsset: 'asset',
  sendAssets: 'assets',
  sendRecipient: 'ontvanger',
  sendRecipients: 'ontvangers',
  sendAssetCapital: 'Asset',
  sendAssetsCapital: 'Assets',
  sendRecipientCapital: 'ONTVANGER',
  sendRecipientsCapital: 'ONTVANGERS',
  sendCompleteNotification:
    'Transactie in behandeling! Je saldo wordt automatisch bijgewerkt zodra de blockchain het heeft verwerkt.',
  sendSelectAssets:
    '{transferCount, number} van {maxNumberOfRecipients, number} Ontvangers',
  sendTransferMessage:
    '{transferCount, number} {transferCount, plural, one {sendTransfer} other {sendTransferPlural}} in afwachting',
  sendBroadcasting: 'Transactie uitzenden naar netwerk...',
  sendDisclaimer:
    'Controleer en zorg ervoor dat je de juiste gegevens hebt ingevoerd om verlies van assets te voorkomen.',
  sendActivityLink:
    'Kijk op het tabblad Activiteit om de status van je transactie te zien.',

  sendCompletion:
    'Voltooid! {transferCount, number} {transferCount, plural, one {sendAsset} other {sendAssets}} naar {transferCount, plural, one {sendRecipient} other {sendRecipients}}',
}

const SETTINGS = {
  settingsNetworkConfigLabel: 'NETWERK CONFIGURATIE',
  settingCurrencyLabel: 'VALUTA',
  settingsThemeLabel: 'THEMA',
  settingsSoundLabel: 'GELUID',
  settingsEncryptLink: 'BEVEILIG EEN SLEUTEL',
  recoverWallet: 'HERSTEL WALLET',
  settingsRecoverWalletLink: 'IMPORTEREN',
  settingsBackUpLinkLabel: 'BACKUP WALLET',
  settingsBackUpLink: 'EXPORTEREN',
  settingsManageLabel: 'Beheer je Neon wallet',
  settingsCommunity: 'Community ondersteuning',
  settingsDonationLink: 'Gemaakt door CoZ. Donaties:',
}

const NETWORK_SETTINGS = {
  networkSettingsInstructions:
    'Beheer alle netwerkinstellingen met betrekking tot de interactie tussen Neon en de blockchain',
  networkSettingsNodeSelectLabel: 'NODE SELECTIE',
  networkSettingsExplorerLabel: 'BLOK VERKENNER',
  networkSettingsCurrentLabel: 'HUIDIG NETWERK',
  networkSettingsAutomatic: 'AUTOMATISCH',
}

const NODE_SELECTION = {
  nodeSelectPanelHeader: 'Node Selectie',
  nodeSelectionInstructions:
    'Als je prestatieproblemen ondervindt, selecteer je hieronder een aangepaste node',
  nodeSelectSelectAutomatically: 'Selecteer automatisch',
  nodeSelectInfo: 'Top {nodeCount, number} nodes getoont',
  nodeSelectBlockHeight: 'Blok hoogte',
}

const ENCRYPT_KEY = {
  encryptPanelHeader: 'Beveilig een sleutel',
  encryptInstructions: 'Kies een wachtwoord om een bestaande sleutel te beveiligen',
  encryptStep1Label: '1) VOER DE PRIVATE KEY IN DIE JE WILT BEVEILIGEN',
  encryptStep1Placeholder: 'Voer private key in',
  encryptStep2Label: '2) VERZIN WACHTWOORD',
  encryptStep2Placeholder: 'Voer wachtwoord in',
  encryptStep3Label: '3) NOGMAALS JE WACHTWOORD',
  encryptStep3Placeholder: 'Voer je wachtwoord in',
  encryptButton: 'Genereer beveiligde sleutel',
}

const TOKEN_SALE = {
  tokenSalePageHeader: 'Doe mee in Tokenverkoop',
  tokenSaleDisclaimer1:
    'Lees en bevestig deze verklaringen om door te gaan',
  tokenSaleDisclaimer2:
    'Ik begrijp dat het meerdere keren indienen van NEO of GAS kan leiden tot verlies van assets of tot een vertraagde terugbetaling kan leiden, afhankelijk van het beleid van het ICO-bedrijf.',
  tokenSaleDisclaimer3:
    'Ik begrijp dat sommige verkopen alleen NEO of GAS accepteren, en ik heb gecontroleerd welke wordt geaccepteerd.',
  tokenSaleDisclaimer4:
    'Ik begrijp dat als ik NEO of GAS stuur naar een tokenverkoop die al is afgelopen, ik mijn NEO / GAS zal verliezen en niet zal worden terugbetaald.',
  // eslint-disable-next-line
  tokenSaleDisclaimer5: `Ik begrijp dat City of Zion (CoZ) niet verantwoordelijk is voor het gebruik van deze functie, en ik de licenties van deze software heb geraadpleegd.`,
}

export default {
  ...AUTH,
  ...INPUTS,
  ...WALLET_CREATION,
  ...DASHBOARD,
  ...SIDEBAR,
  ...MANAGE_WALLETS,
  ...ACTIVITY,
  ...RECEIVE,
  ...REQUEST_ASSETS,
  ...TRANSACTION_FEE,
  ...SEND,
  ...SETTINGS,
  ...NETWORK_SETTINGS,
  ...NODE_SELECTION,
  ...ENCRYPT_KEY,
  ...TOKEN_SALE,
  ...MISCELLANEOUS,
  ...ERRORS,
  ...NOTIFICATIONS,
}


text:
- [Introduction](#introduction)
- [Building A Command](#building-a-command)
- [Registering Commands](#registering-commands)
- [Calling Other Commands](#calling-other-commands)

## Introduction

In addition to the commands provided with Artisan, you may also build your own custom commands for working with your application. You may store your custom commands in the `app/commands` directory; however, you are free to choose your own storage location as long as your commands can be autoloaded based on your `composer.json` settings.

## Building A Command

### Generating The Class

To create a new command, you may use the `command:make` Artisan command, which will generate a command stub to help you get started:

#### Generate A New Command Class

	php artisan command:make FooCommand

By default, generated commands will be stored in the `app/commands` directory; however, you may specify custom path or namespace:

	php artisan command:make FooCommand --path=app/classes --namespace=Classes

When creating the command, the `--command` option may be used to assign the terminal command name:

	php artisan command:make AssignUsers --command=users:assign

If you need to create a command for a [workbench package](/docs/packages), use the `--bench` switch:

	php artisan command:make AssignUsers --bench="vendor/package"

### Writing The Command

Once your command is generated, you should fill out the `name` and `description` properties of the class, which will be used when displaying your command on the `list` screen.

The `fire` method will be called when your command is executed. You may place any command logic in this method.

### Arguments & Options

The `getArguments` and `getOptions` methods are where you may define any arguments or options your command receives. Both of these methods return an array of commands, which are described by a list of array options.

When defining `arguments`, the array definition values represent the following:

	array($name, $mode, $description, $defaultValue)

The argument `mode` may be any of the following: `InputArgument::REQUIRED` or `InputArgument::OPTIONAL`.

When defining `options`, the array definition values represent the following:

	array($name, $shortcut, $mode, $description, $defaultValue)

For options, the argument `mode` may be: `InputOption::VALUE_REQUIRED`, `InputOption::VALUE_OPTIONAL`, `InputOption::VALUE_IS_ARRAY`, `InputOption::VALUE_NONE`.

The `VALUE_IS_ARRAY` mode indicates that the switch may be used multiple times when calling the command:

	php artisan foo --option=bar --option=baz

The `VALUE_NONE` option indicates that the option is simply used as a "switch":

	php artisan foo --option

### Retrieving Input

While your command is executing, you will obviously need to access the values for the arguments and options accepted by your application. To do so, you may use the `argument` and `option` methods:

#### Retrieving The Value Of A Command Argument

	$value = $this->argument('name');

#### Retrieving All Arguments

	$arguments = $this->argument();

#### Retrieving The Value Of A Command Option

	$value = $this->option('name');

#### Retrieving All Options

	$options = $this->option();

### Writing Output

To send output to the console, you may use the `info`, `comment`, `question` and `error` methods. Each of these methods will use the appropriate ANSI colors for their purpose.

#### Sending Information To The Console

	$this->info('Display this on the screen');

#### Sending An Error Message To The Console

	$this->error('Something went wrong!');

### Asking Questions

You may also use the `ask` and `confirm` methods to prompt the user for input:

#### Asking The User For Input

	$name = $this->ask('What is your name?');

#### Asking The User For Secret Input

	$password = $this->secret('What is the password?');

#### Asking The User For Confirmation

	if ($this->confirm('Do you wish to continue? [yes|no]'))
	{
		//
	}

You may also specify a default value to the `confirm` method, which should be `true` or `false`:

	$this->confirm($question, true);

## Registering Commands

Once your command is finished, you need to register it with Artisan so it will be available for use. This is typically done in the `app/start/artisan.php` file. Within this file, you may use the `Artisan::add` method to register the command:

#### Registering An Artisan Command

	Artisan::add(new CustomCommand);

If your command is registered in the application [IoC container](/docs/ioc), you may use the `Artisan::resolve` method to make it available to Artisan:

#### Registering A Command That Is In The IoC Container

	Artisan::resolve('binding.name');

## Calling Other Commands

Sometimes you may wish to call other commands from your command. You may do so using the `call` method:

#### Calling Another Command

	$this->call('command:name', array('argument' => 'foo', '--option' => 'bar'));


text:
package ru.bk.beito3.fixbehavior.itemframe;

import cn.nukkit.Player;
import cn.nukkit.blockentity.BlockEntity;
import cn.nukkit.blockentity.BlockEntityItemFrame;
import cn.nukkit.event.EventHandler;
import cn.nukkit.event.EventPriority;
import cn.nukkit.event.Listener;
import cn.nukkit.event.server.DataPacketReceiveEvent;
import cn.nukkit.item.Item;
import cn.nukkit.level.Level;
import cn.nukkit.math.Vector3;
import cn.nukkit.network.protocol.ItemFrameDropItemPacket;

public class EventListener implements Listener {

    @EventHandler(priority = EventPriority.MONITOR)
    public void onDataPacket(DataPacketReceiveEvent event) {
        if (event.getPacket().pid() == 0x47) {//ItemFrameDropPacket
            if (!(event.getPacket() instanceof ItemFrameDropItemPacket)) {
                return;
            }

            ItemFrameDropItemPacket pk = (ItemFrameDropItemPacket) event.getPacket();
            Player player = event.getPlayer();

            Vector3 pos = new Vector3(pk.x, pk.y, pk.z);

            Level level = player.getLevel();

            BlockEntity tile = level.getBlockEntity(pos);
            if (tile instanceof BlockEntityItemFrame) {
                BlockEntityItemFrame itemframe = (BlockEntityItemFrame) tile;

                if (itemframe.getItem().getId() == Item.AIR) {//Break the ItemFrame
                    level.useBreakOn(pos, player.getInventory().getItemInHand(), player, true);
                }
            }
        }
    }
}


text:
#import <CoreData/NSSQLSelectIntermediate.h>

// Not exported
@interface NSSQLReadOnlySelectIntermediate : NSSQLSelectIntermediate
{
    _Bool _onlyFetchesAggregates;
}

- (id)generateSQLStringInContext:(id)arg1;
- (_Bool)onlyFetchesAggregates;

@end


text:
<form novalidate name="addTripItineraryForm">

    <md-input-container>
        Name
        <input type="text" ng-model="tripItinerary.name" ng-model-options="{ getterSetter: true }" required name="name" />

The trip itinerary name is required

    </md-input-container>
    <md-input-container>
        Note
        <textarea ng-model="tripItinerary.note" ng-model-options="{ getterSetter: true }" name="note"></textarea>
    </md-input-container>

        <md-button type="submit" class="md-raised md-primary md-icon-button" ng-click="addTripItinerary()" ng-disabled="addTripItineraryForm.$invalid">
            <ng-md-icon icon="add" style="fill: white"></ng-md-icon>
        </md-button>
        <md-button class="md-raised md-primary md-hue-1 md-icon-button" ng-click="resetTripItinerary()">
            <ng-md-icon icon="undo" style="fill: white"></ng-md-icon>
        </md-button>

</form>


text:
package org.drools.benchmarks.session;

import org.drools.benchmarks.common.util.RuntimeUtil;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.Warmup;

/**
 * Benchmarks firing on a ksession created from an empty kbase
 */
@Warmup(iterations = 80000)
@Measurement(iterations = 10000)
public class EmptySessionFireBenchmark extends AbstractEmptySessionBenchmark {

    @Setup(Level.Iteration)
    public void setupSession() {
        kieSession = RuntimeUtil.createKieSession(kieBase);
    }

    @Benchmark
    public int testFire() {
        return kieSession.fireAllRules();
    }
}


text:
author:
  display_name: Data Queen
  email: ugrc@utah.gov
tags:
  - address
  - data
  - geocoding
  - location
  - roads
  - service
  - topography
date: 2015-08-06 16:21:38 -0600
title: Utah SGID Statewide Roads Data Layer Updates 8/6/2015
published: false
categories:
  - Featured
  - SGID Blog
---
Updates were made recently to the SGID10.Transportation.Roads feature class that resides on the Utah SGID ArcSDE database server.

Geocoding services and ArcGIS Server Applications & Web Services are now using the updated SGID10.Transportation.Roads feature class.

The following highlights what has been updated:

County Updates:

- **Carbon:** Received centerline update 7/14/2015: added new roads, road name and address range changes since last comprehensive update on 7/3/2014; geocoding improvements
- **Daggett:** Received centerline update 7/2/2015: added new roads, road name and address range changes since last comprehensive update on 4/8/2014; geocoding improvements
- **Piute:** Received centerline update 7/2/2015: added new roads, road name and address range changes since last comprehensive update on 4/6/2015; geocoding improvements
- **Salt Lake:** Received VECC's centerline update 7/22/2015: added new roads, road name and address range changes since last comprehensive update on 1/28/2015; geocoding improvements
- **Utah:** Received centerline update 8/3/2015: added new roads since last update on 6/22/2015; geocoding improvements
- **Washington:** Received centerline update 7/28/2015: added new roads since last update on 6/18/2015; geocoding improvements
- **Weber:** Received centerline update 7/30/2015: added new roads, road name and address range changes since last update on 6/23/2015; geocoding improvements

Misc:

- Updated the ZIPLEFT and ZIPRIGHT fields to reflect the newly created 84009 Zip Code in Salt Lake County

Blue Stakes of Utah Feedback:

- **Davis:** geocoding improvements
- **Salt Lake:** geocoding improvements
- **Utah:** geocoding improvements


text:
package cz.jan.maly.utils;

import com.google.common.io.Files;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.SerializationUtils;

import java.io.*;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

/**
 * A simple class with generic serialize and deserialize method implementations
 *
 * @author pankaj
 */
public class SerializationUtil {

    /**
     * Get all files with extension in folder
     *
     * @param directoryName
     * @return
     */
    public static Set<File> getAllFilesInFolder(String directoryName, String extension) {
        File directory = new File(directoryName);

        //get all the files from a directory
        File[] fList = directory.listFiles();
        if (fList == null) {
            return new HashSet<>();
        }
        return Arrays.stream(directory.listFiles()).filter(File::isFile)
                .filter(file -> Files.getFileExtension(file.getPath()).equals(extension))
                .collect(Collectors.toSet());
    }

    /**
     * Deserialize to <T> from given file
     *
     * @param fileName
     * @param <T>
     * @return
     * @throws IOException
     * @throws ClassNotFoundException
     */
    public static <T> T deserialize(String fileName) throws Exception {
        GZIPInputStream giz = new GZIPInputStream(new FileInputStream(fileName));
        byte[] bytes = IOUtils.toByteArray(giz);
        giz.close();
//        FileInputStream fis = new FileInputStream(fileName);
//        byte[] bytes = IOUtils.toByteArray(fis);
//        fis.close();
        return (T) SerializationUtils.deserialize(bytes);
    }

    /**
     * Deserialize to <T> from given file
     *
     * @param inputStream
     * @param <T>
     * @return
     * @throws IOException
     * @throws ClassNotFoundException
     */
    public static <T> T deserialize(InputStream inputStream) throws Exception {
        GZIPInputStream giz = new GZIPInputStream(inputStream);
        byte[] bytes = IOUtils.toByteArray(giz);
        giz.close();
        return (T) SerializationUtils.deserialize(bytes);
    }

    /**
     * Serialize the given object and save it to file
     *
     * @param object
     * @param fileName
     * @param <T>
     * @throws IOException
     */
    public static <T extends Serializable> void serialize(T object, String fileName) throws Exception {
        GZIPOutputStream gz = new GZIPOutputStream(new FileOutputStream(fileName));
        ObjectOutputStream oos = new ObjectOutputStream(gz);
        oos.writeObject(object);
        oos.flush();
        oos.close();
    }

}


text:
##########################################################################
#
# Copyright 2011 Jose Fonseca
# Copyright 2008-2010 VMware, Inc.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
##########################################################################/

"""GLX tracing generator."""

from gltrace import GlTracer
from specs.stdapi import Module, API
from specs.glapi import glapi
from specs.glxapi import glxapi

class GlxTracer(GlTracer):

    def isFunctionPublic(self, function):
        # The symbols visible in libGL.so can vary, so expose them all
        return True

    getProcAddressFunctionNames = [
        "glXGetProcAddress",
        "glXGetProcAddressARB",
    ]

    createContextFunctionNames = [
        'glXCreateContext',
        'glXCreateContextAttribsARB',
        'glXCreateContextWithConfigSGIX',
        'glXCreateNewContext',
    ]

    destroyContextFunctionNames = [
        'glXDestroyContext',
    ]

    makeCurrentFunctionNames = [
        'glXMakeCurrent',
        'glXMakeContextCurrent',
        'glXMakeCurrentReadSGI',
    ]

    def traceFunctionImplBody(self, function):
        if function.name in self.destroyContextFunctionNames:
            print '    gltrace::releaseContext((uintptr_t)ctx);'

        GlTracer.traceFunctionImplBody(self, function)

        if function.name in self.createContextFunctionNames:
            print '    if (_result != NULL)'
            print '        gltrace::createContext((uintptr_t)_result);'

        if function.name in self.makeCurrentFunctionNames:
            print '    if (_result) {'
            print '        if (ctx != NULL)'
            print '            gltrace::setContext((uintptr_t)ctx);'
            print '        else'
            print '            gltrace::clearContext();'
            print '    }'

        if function.name == 'glXBindTexImageEXT':
            # FIXME: glXBindTexImageEXT gets called frequently, so we should
            # avoid recording the same data over and over again somehow, e.g.:
            # - get the pixels before and after glXBindTexImageEXT, and only
            #   emit emitFakeTexture2D when it changes
            # - keep a global hash of the pixels
            # FIXME: Handle mipmaps
            print r'''
                unsigned glx_target = 0;
                _glXQueryDrawable(display, drawable, GLX_TEXTURE_TARGET_EXT, &glx_target);
                GLenum target;
                switch (glx_target) {
                // FIXME
                //case GLX_TEXTURE_1D_EXT:
                //    target = GL_TEXTURE_1D;
                //    break;
                case GLX_TEXTURE_2D_EXT:
                    target = GL_TEXTURE_2D;
                    break;
                case GLX_TEXTURE_RECTANGLE_EXT:
                    target = GL_TEXTURE_RECTANGLE;
                    break;
                default:
                    os::log("apitrace: warning: %s: unsupported GLX_TEXTURE_TARGET_EXT 0x%u\n", __FUNCTION__, glx_target);
                    target = GL_NONE;
                    break;
                }
                GLint level = 0;
                GLint internalformat = GL_NONE;
                _glGetTexLevelParameteriv(target, level, GL_TEXTURE_INTERNAL_FORMAT, &internalformat);
                // XXX: GL_TEXTURE_INTERNAL_FORMAT cannot be trusted on NVIDIA
                // -- it sometimes returns GL_BGRA, even though GL_BGR/BGRA is
                // not a valid internal format.
                switch (internalformat) {
                case GL_BGR:
                    internalformat = GL_RGB;
                    break;
                case GL_BGRA:
                    internalformat = GL_RGBA;
                    break;
                }
                GLint width = 0;
                _glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
                GLint height = 0;
                _glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
                GLint border = 0;
                // XXX: We always use GL_RGBA format to read the pixels because:
                // - some implementations (Mesa) seem to return bogus results
                //   for GLX_TEXTURE_FORMAT_EXT
                // - hardware usually stores GL_RGB with 32bpp, so it should be
                //   faster to read/write
                // - it is more robust against GL_(UN)PACK_ALIGNMENT state
                //   changes
                // The drawback is that traces will be slightly bigger.
                GLenum format = GL_RGBA;
                GLenum type = GL_UNSIGNED_BYTE;
                if (target && internalformat && height && width) {
                    // FIXME: This assumes (UN)PACK state (in particular
                    // GL_(UN)PACK_ROW_LENGTH) is set to its defaults. We
                    // really should temporarily reset the state here (and emit
                    // according fake calls) to cope when its not. At very
                    // least we need a heads up warning that this will cause
                    // problems.
                    GLint alignment = 4;
                    GLint row_stride = _align(width * 4, alignment);
                    GLvoid * pixels = malloc(height * row_stride);
                    _glGetTexImage(target, level, format, type, pixels);
            '''
            self.emitFakeTexture2D()
            print r'''
                    free(pixels);
                }
            '''

if __name__ == '__main__':
    print
    print '#include <stdlib.h>'
    print '#include <string.h>'
    print
    print '#include <dlfcn.h>'
    print
    print '#include "trace_writer_local.hpp"'
    print
    print '// To validate our prototypes'
    print '#define GL_GLEXT_PROTOTYPES'
    print '#define GLX_GLXEXT_PROTOTYPES'
    print
    print '#include "glproc.hpp"'
    print '#include "glsize.hpp"'
    print

    module = Module()
    module.mergeModule(glxapi)
    module.mergeModule(glapi)
    api = API()
    api.addModule(module)
    tracer = GlxTracer()
    tracer.traceApi(api)

    print r'''

/*
 * Invoke the true dlopen() function.
 */
static void *_dlopen(const char *filename, int flag)
{
    typedef void * (*PFN_DLOPEN)(const char *, int);
    static PFN_DLOPEN dlopen_ptr = NULL;

    if (!dlopen_ptr) {
        dlopen_ptr = (PFN_DLOPEN)dlsym(RTLD_NEXT, "dlopen");
        if (!dlopen_ptr) {
            os::log("apitrace: error: dlsym(RTLD_NEXT, \"dlopen\") failed\n");
            return NULL;
        }
    }

    return dlopen_ptr(filename, flag);
}

/*
 * Several applications, such as Quake3, use dlopen("libGL.so.1"), but
 * LD_PRELOAD does not intercept symbols obtained via dlopen/dlsym, therefore
 * we need to intercept the dlopen() call here, and redirect to our wrapper
 * shared object.
 */
extern "C" PUBLIC
void * dlopen(const char *filename, int flag)
{
    void *handle;

    handle = _dlopen(filename, flag);

    const char * libgl_filename = getenv("TRACE_LIBGL");

    if (filename && handle && !libgl_filename) {
        if (0) {
            os::log("apitrace: warning: dlopen(\"%s\", 0x%x)\n", filename, flag);
        }

        // FIXME: handle absolute paths and other versions
        if (strcmp(filename, "libGL.so") == 0 ||
            strcmp(filename, "libGL.so.1") == 0) {

            // Use the true libGL.so handle instead of RTLD_NEXT from now on
            _libGlHandle = handle;

            // Get the file path for our shared object, and use it instead
            static int dummy = 0xdeedbeef;
            Dl_info info;
            if (dladdr(&dummy, &info)) {
                os::log("apitrace: redirecting dlopen(\"%s\", 0x%x)\n", filename, flag);
                handle = _dlopen(info.dli_fname, flag);
            } else {
                os::log("apitrace: warning: dladdr() failed\n");
            }
        }
    }

    return handle;
}

'''


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Sora | Replays</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

Replays @ Sora

An archive of replays that needed chronicling, were saved during Showdown Replays server downtime, et cetera. Use Ctrl+F to look for specific replays.

Pokebank OU

ABootToTheHead vs Sora Terrors

araquanid is stupid | 13 December 2016

Balanced Hackmons

Sora Gasp vs Arjunb

The absolute madman | 19 October 2016

Monotype

Sora Revan vs Sora Ninjarisu

electric genie man FUCKIGN DIES | 15 September 2016

OU

RU Honchkrows vs Not Tempest

IPL Season 4 Round Robin | 09 May 2016

Champion's Challenge

Sora Revan vs Gasp

Hall of Fame Entry | 30 April 2016


text:
namespace {
using base::android::GetClass;
using base::android::MethodID;
using base::android::ScopedJavaLocalRef;

struct MethodIdentifier {
  const char* class_name;
  const char* method;
  const char* jni_signature;

  bool operator<(const MethodIdentifier& other) const {
    int r = strcmp(class_name, other.class_name);
    if (r < 0) {
      return true;
    } else if (r > 0) {
      return false;
    }

    r = strcmp(method, other.method);
    if (r < 0) {
      return true;
    } else if (r > 0) {
      return false;
    }

    return strcmp(jni_signature, other.jni_signature) < 0;
  }
};

typedef std::map<MethodIdentifier, jmethodID> MethodIDMap;

const base::subtle::AtomicWord kUnlocked = 0;
const base::subtle::AtomicWord kLocked = 1;
base::subtle::AtomicWord g_method_id_map_lock = kUnlocked;
JavaVM* g_jvm = NULL;
// Leak the global app context, as it is used from a non-joinable worker thread
// that may still be running at shutdown. There is no harm in doing this.
base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject> >::Leaky
    g_application_context = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<MethodIDMap> g_method_id_map = LAZY_INSTANCE_INITIALIZER;

std::string GetJavaExceptionInfo(JNIEnv* env, jthrowable java_throwable) {
  ScopedJavaLocalRef<jclass> throwable_clazz =
      GetClass(env, "java/lang/Throwable");
  jmethodID throwable_printstacktrace =
      MethodID::Get<MethodID::TYPE_INSTANCE>(
          env, throwable_clazz.obj(), "printStackTrace",
          "(Ljava/io/PrintStream;)V");

  // Create an instance of ByteArrayOutputStream.
  ScopedJavaLocalRef<jclass> bytearray_output_stream_clazz =
      GetClass(env, "java/io/ByteArrayOutputStream");
  jmethodID bytearray_output_stream_constructor =
      MethodID::Get<MethodID::TYPE_INSTANCE>(
          env, bytearray_output_stream_clazz.obj(), "<init>", "()V");
  jmethodID bytearray_output_stream_tostring =
      MethodID::Get<MethodID::TYPE_INSTANCE>(
          env, bytearray_output_stream_clazz.obj(), "toString",
          "()Ljava/lang/String;");
  ScopedJavaLocalRef<jobject> bytearray_output_stream(env,
      env->NewObject(bytearray_output_stream_clazz.obj(),
                     bytearray_output_stream_constructor));

  // Create an instance of PrintStream.
  ScopedJavaLocalRef<jclass> printstream_clazz =
      GetClass(env, "java/io/PrintStream");
  jmethodID printstream_constructor =
      MethodID::Get<MethodID::TYPE_INSTANCE>(
          env, printstream_clazz.obj(), "<init>",
          "(Ljava/io/OutputStream;)V");
  ScopedJavaLocalRef<jobject> printstream(env,
      env->NewObject(printstream_clazz.obj(), printstream_constructor,
                     bytearray_output_stream.obj()));

  // Call Throwable.printStackTrace(PrintStream)
  env->CallVoidMethod(java_throwable, throwable_printstacktrace,
      printstream.obj());

  // Call ByteArrayOutputStream.toString()
  ScopedJavaLocalRef<jstring> exception_string(
      env, static_cast<jstring>(
          env->CallObjectMethod(bytearray_output_stream.obj(),
                                bytearray_output_stream_tostring)));

  return ConvertJavaStringToUTF8(exception_string);
}

}  // namespace

namespace base {
namespace android {

JNIEnv* AttachCurrentThread() {
  DCHECK(g_jvm);
  JNIEnv* env = NULL;
  jint ret = g_jvm->AttachCurrentThread(&env, NULL);
  DCHECK_EQ(JNI_OK, ret);
  return env;
}

void DetachFromVM() {
  // Ignore the return value, if the thread is not attached, DetachCurrentThread
  // will fail. But it is ok as the native thread may never be attached.
  if (g_jvm)
    g_jvm->DetachCurrentThread();
}

void InitVM(JavaVM* vm) {
  DCHECK(!g_jvm);
  g_jvm = vm;
}

void InitApplicationContext(const JavaRef<jobject>& context) {
  DCHECK(g_application_context.Get().is_null());
  g_application_context.Get().Reset(context);
}

const jobject GetApplicationContext() {
  DCHECK(!g_application_context.Get().is_null());
  return g_application_context.Get().obj();
}

ScopedJavaLocalRef<jclass> GetClass(JNIEnv* env, const char* class_name) {
  jclass clazz = env->FindClass(class_name);
  CHECK(!ClearException(env) && clazz) << "Failed to find class " << class_name;
  return ScopedJavaLocalRef<jclass>(env, clazz);
}

bool HasClass(JNIEnv* env, const char* class_name) {
  ScopedJavaLocalRef<jclass> clazz(env, env->FindClass(class_name));
  if (!clazz.obj()) {
    ClearException(env);
    return false;
  }
  bool error = ClearException(env);
  DCHECK(!error);
  return true;
}

template<MethodID::Type type>
jmethodID MethodID::Get(JNIEnv* env,
                        jclass clazz,
                        const char* method_name,
                        const char* jni_signature) {
  jmethodID id = type == TYPE_STATIC ?
      env->GetStaticMethodID(clazz, method_name, jni_signature) :
      env->GetMethodID(clazz, method_name, jni_signature);
  CHECK(base::android::ClearException(env) || id) <<
      "Failed to find " <<
      (type == TYPE_STATIC ? "static " : "") <<
      "method " << method_name << " " << jni_signature;
  return id;
}

// If |atomic_method_id| set, it'll return immediately. Otherwise, it'll call
// into ::Get() above. If there's a race, it's ok since the values are the same
// (and the duplicated effort will happen only once).
template<MethodID::Type type>
jmethodID MethodID::LazyGet(JNIEnv* env,
                            jclass clazz,
                            const char* method_name,
                            const char* jni_signature,
                            base::subtle::AtomicWord* atomic_method_id) {
  COMPILE_ASSERT(sizeof(subtle::AtomicWord) >= sizeof(jmethodID),
                 AtomicWord_SmallerThan_jMethodID);
  subtle::AtomicWord value = base::subtle::Acquire_Load(atomic_method_id);
  if (value)
    return reinterpret_cast<jmethodID>(value);
  jmethodID id = MethodID::Get<type>(env, clazz, method_name, jni_signature);
  base::subtle::Release_Store(
      atomic_method_id, reinterpret_cast<subtle::AtomicWord>(id));
  return id;
}

// Various template instantiations.
template jmethodID MethodID::Get<MethodID::TYPE_STATIC>(
    JNIEnv* env, jclass clazz, const char* method_name,
    const char* jni_signature);

template jmethodID MethodID::Get<MethodID::TYPE_INSTANCE>(
    JNIEnv* env, jclass clazz, const char* method_name,
    const char* jni_signature);

template jmethodID MethodID::LazyGet<MethodID::TYPE_STATIC>(
    JNIEnv* env, jclass clazz, const char* method_name,
    const char* jni_signature, base::subtle::AtomicWord* atomic_method_id);

template jmethodID MethodID::LazyGet<MethodID::TYPE_INSTANCE>(
    JNIEnv* env, jclass clazz, const char* method_name,
    const char* jni_signature, base::subtle::AtomicWord* atomic_method_id);

jfieldID GetFieldID(JNIEnv* env,
                    const JavaRef<jclass>& clazz,
                    const char* field_name,
                    const char* jni_signature) {
  jfieldID field_id = env->GetFieldID(clazz.obj(), field_name, jni_signature);
  CHECK(!ClearException(env) && field_id) << "Failed to find field " <<
      field_name << " " << jni_signature;
  return field_id;
}

bool HasField(JNIEnv* env,
              const JavaRef<jclass>& clazz,
              const char* field_name,
              const char* jni_signature) {
  jfieldID field_id = env->GetFieldID(clazz.obj(), field_name, jni_signature);
  if (!field_id) {
    ClearException(env);
    return false;
  }
  bool error = ClearException(env);
  DCHECK(!error);
  return true;
}

jfieldID GetStaticFieldID(JNIEnv* env,
                          const JavaRef<jclass>& clazz,
                          const char* field_name,
                          const char* jni_signature) {
  jfieldID field_id =
      env->GetStaticFieldID(clazz.obj(), field_name, jni_signature);
  CHECK(!ClearException(env) && field_id) << "Failed to find static field " <<
      field_name << " " << jni_signature;
  return field_id;
}

jmethodID GetMethodIDFromClassName(JNIEnv* env,
                                   const char* class_name,
                                   const char* method,
                                   const char* jni_signature) {
  MethodIdentifier key;
  key.class_name = class_name;
  key.method = method;
  key.jni_signature = jni_signature;

  MethodIDMap* map = g_method_id_map.Pointer();
  bool found = false;

  while (base::subtle::Acquire_CompareAndSwap(&g_method_id_map_lock,
                                              kUnlocked,
                                              kLocked) != kUnlocked) {
    base::PlatformThread::YieldCurrentThread();
  }
  MethodIDMap::const_iterator iter = map->find(key);
  if (iter != map->end()) {
    found = true;
  }
  base::subtle::Release_Store(&g_method_id_map_lock, kUnlocked);

  // Addition to the map does not invalidate this iterator.
  if (found) {
    return iter->second;
  }

  ScopedJavaLocalRef<jclass> clazz(env, env->FindClass(class_name));
  jmethodID id = MethodID::Get<MethodID::TYPE_INSTANCE>(
      env, clazz.obj(), method, jni_signature);

  while (base::subtle::Acquire_CompareAndSwap(&g_method_id_map_lock,
                                              kUnlocked,
                                              kLocked) != kUnlocked) {
    base::PlatformThread::YieldCurrentThread();
  }
  // Another thread may have populated the map already.
  std::pair<MethodIDMap::const_iterator, bool> result =
      map->insert(std::make_pair(key, id));
  DCHECK_EQ(id, result.first->second);
  base::subtle::Release_Store(&g_method_id_map_lock, kUnlocked);

  return id;
}

bool HasException(JNIEnv* env) {
  return env->ExceptionCheck() != JNI_FALSE;
}

bool ClearException(JNIEnv* env) {
  if (!HasException(env))
    return false;
  env->ExceptionDescribe();
  env->ExceptionClear();
  return true;
}

void CheckException(JNIEnv* env) {
  if (!HasException(env)) return;

  // Exception has been found, might as well tell breakpad about it.
  jthrowable java_throwable = env->ExceptionOccurred();
  if (!java_throwable) {
    // Do nothing but return false.
    CHECK(false);
  }

  // Clear the pending exception, since a local reference is now held.
  env->ExceptionDescribe();
  env->ExceptionClear();

  // Set the exception_string in BuildInfo so that breakpad can read it.
  // RVO should avoid any extra copies of the exception string.
  base::android::BuildInfo::GetInstance()->set_java_exception_info(
      GetJavaExceptionInfo(env, java_throwable));

  // Now, feel good about it and die.
  CHECK(false);
}

}  // namespace android
}  // namespace base


text:
Imports BVSoftware.Bvc5.Core

Partial Class BVAdmin_Catalog_GiftCertificateInstanceEdit
    Inherits BaseAdminPage

    Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
        Me.PageTitle = "Gift Certificate Edit"
        Me.CurrentTab = AdminTabType.Catalog
        ValidateCurrentUserHasPermission(Membership.SystemPermissions.OrdersEdit)
    End Sub

    Protected Sub Page_PreLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreLoad
        If Request.QueryString("id") Is Nothing Then
            Response.Redirect("~/BVAdmin/Catalog/GiftCertificates.aspx")
        Else
            ViewState("id") = Request.QueryString("id")
            If Not Page.IsPostBack Then
                Dim GiftCertificate As Catalog.GiftCertificate = Catalog.GiftCertificate.FindByBvin(ViewState("id"))
                If GiftCertificate IsNot Nothing Then
                    InitializeEntry(GiftCertificate)
                Else
                    Response.Redirect("~/BVAdmin/Catalog/GiftCertificates.aspx")
                End If
            End If
        End If
    End Sub

    Protected Sub InitializeEntry(ByVal gc As Catalog.GiftCertificate)
        IssueDateModifierField.InitializeValue(gc.DateIssued)
    End Sub

    Protected Sub SaveChangesImageButton_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles SaveChangesImageButton.Click
        Dim giftCertificate As Catalog.GiftCertificate = Catalog.GiftCertificate.FindByBvin(ViewState("id"))
        If giftCertificate IsNot Nothing Then
            Dim originalDate As Date = giftCertificate.DateIssued
            giftCertificate.DateIssued = IssueDateModifierField.ApplyChanges(giftCertificate.DateIssued)
            If Catalog.GiftCertificate.Update(giftCertificate) Then

                AuditLog.LogEvent(BVSoftware.Commerce.Metrics.AuditLogSourceModule.Payment, _
                                   BVSoftware.Commerce.Metrics.AuditLogEntrySeverity.Information, _
                                    "Gift Certificate Edit", "Gift certificate issue date for certificate " & giftCertificate.CertificateCode & _
                                      " was changed from " & _
                                        originalDate.ToShortDateString & " to " & giftCertificate.DateIssued.ToShortDateString)
                Response.Redirect("~/BVAdmin/Catalog/GiftCertificates.aspx")
            Else
                MessageBox1.ShowError("An error occurred while trying to update the gift certificate")
                MessageBox2.ShowError("An error occurred while trying to update the gift certificate")
            End If
        Else
            MessageBox1.ShowError("An error occurred while trying to update the gift certificate")
            MessageBox2.ShowError("An error occurred while trying to update the gift certificate")
        End If
    End Sub

    Protected Sub CancelImageButton_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles CancelImageButton.Click
        Response.Redirect("~/BVAdmin/Catalog/GiftCertificates.aspx")
    End Sub
End Class


text:
package com.amazonaws.services.apprunner.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum TracingVendor {

    AWSXRAY("AWSXRAY");

    private String value;

    private TracingVendor(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return TracingVendor corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static TracingVendor fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (TracingVendor enumEntry : TracingVendor.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
<?php

namespace core;

/**
 * Class Router
 * @package core
 */
class Router
{
    private static $allowed_rest_methods = ['GET', 'POST', 'PUT', 'DELETE'];

    /**
     * Array
     * (
     *   [editOrders] => Array (
     *     [request_methods] => Array (
     *       [0] => PUT
     *       [1] => POST
     *     )
     *     [request_uri] => /orders/edit
     *     [parameters] => Array (
     *       [id] => 17
     *       [group] => fruits
     *     )
     *     [class] => Order
     *     [action] => edit
     *   )
     * )
     * (
     * @request_methods array. Array whose elements are in the list $allowed_rest_methods. Ex.: ['GET', 'POST']
     * @request_uri string
     * @parameters array
     * @class string
     * @action string. Method of @class
     */
    private $routes = [];

    /**
     * @var string
     */
    private $controller_name = '';

    /**
     * @var string
     */
    private $method_name = '';

    /**
     * @var array
     */
    private $parameters = [];

    /**
     * @var \core\generic\Controller
     */
    private $controller;

    public function __construct() {}

    /**
     * Add route to internal array
     * @param string $name
     * @param array $descriptor
     */
    public function addRoute($name, $descriptor)
    {
        $this->routes[$name] = $descriptor;
    }

    /**
     * Get all available REST methods
     * @return array
     */
    public static function getAllowedRestMethods()
    {
        return self::$allowed_rest_methods;
    }

    /**
     * Get all available routes
     * @return array
     */
    public function getRoutes()
    {
        return $this->routes;
    }

    /**
     * Executes a method with the parameters defined in the URL
     * @throws \RuntimeException
     */
    public function execAction()
    {
        if (!method_exists($this->controller_name, $this->method_name)) {
            throw new \RuntimeException("Method {$this->method_name} in class {$this->controller_name} not exist", 500);
        }
        $this->checkParameters();
        $this->controller = new $this->controller_name;
        call_user_func_array([$this->controller, $this->method_name], $this->parameters);
    }

    /**
     * Looking for a suitable controller and method also defines the parameters of the method from URI
     * @throws \RuntimeException
     */
    public function getActionFromURI()
    {
        $script_path = str_replace(
            'index.php',
            '',
            str_replace('//index.php', '/index.php', $_SERVER['SCRIPT_NAME'])
        );
        $request_uri = str_replace($script_path, '', $_SERVER['REQUEST_URI']);
        $http_action = str_replace(['index.php?/', 'index.php?'], '', $request_uri);
        $action = strtoupper($_SERVER['REQUEST_METHOD']) . ':/' . $http_action;

        foreach($this->routes as $route => $description)
        {
            if (preg_match($this->createPattern($description), $action) > 0)
            {
                $this->controller_name  = $description['class'];
                $this->method_name = $description['action'];
                $this->parameters  = $description['parameters'];
                $this->parseParameters(
                    ltrim($http_action, '/'),
                    ltrim($description['request_uri'], '/')
                );
                return;
            }
        }
        throw new \RuntimeException('Unable to resolve the request ' . $action, 404);
    }

    /**
     * Looking for a suitable controller and method also defines the parameters of the method
     * from command line.
     * @throws \RuntimeException
     */
    public function getActionFromCommandLine()
    {
        if (isset($_SERVER['argv']) && count($_SERVER['argv']) >= 3)
        {
            $params = $_SERVER['argv'];
            $this->setControllerName($params[1]);
            $this->setMethodName($params[2]);
            array_shift($params);
            array_shift($params);
            array_shift($params);
            $method_params = [];
            foreach($params as $param)
            {
                $a = explode('=', $param);
                if (sizeof($a) < 2) {
                    App::failure(400, $this->makeErrorMessageForInvalidParamsCLI());
                }
                $method_params[$a[0]] = $a[1];
            }

            $this->setParameters($method_params);
        } else {
            $message = 'Not enough parameters.' . PHP_EOL . 'Syntax:'
                . ' php console.php controller methods [param1=value1 [ ... ]]' . PHP_EOL;
            App::failure(400, $message);
        }
    }

    /**
     * Create regexp pattern for matching with URL
     * @param array $description
     * @return string
     */
    private function createPattern($description)
    {
         // Examples:
         // $url = 'POST:/abcdef/1/aa';
         // $pattern = '/^(GET|POST):\/abcdef\/\w+\/\w+$/';
        $pattern = '/^(';
        for($i = 0; $i < count($description['request_methods']); $i++) {
            $pattern .= $description['request_methods'][$i] .
                (($i == (count($description['request_methods'])-1)) ? '' : '|');
        }
        $pattern .= '):' . str_replace('/', '\/', $description['request_uri']);
        for($i = 0; $i < count($description['parameters']); $i++) {
            $pattern .= '\w+' . (($i < (count($description['parameters']) - 1)) ? '\/' : '');
        }
        return ($pattern . '$/i');
    }

    /**
     * Extracts parameters from URL and fills the array with the parameters $this->parameters
     * @param string $http_action
     * @param string $request_uri
     */
    private function parseParameters($http_action, $request_uri)
    {
        $params = explode('/', substr($http_action, strlen($request_uri)));
        $i = 0;
        foreach($this->parameters as $param => $value)
        {
            $this->parameters[$param] = (isset($params[$i]) ? $params[$i] : '');
            $i++;
        }
    }

    /**
     * @return string
     */
    public function controllerName()
    {
        return $this->controller_name;
    }

    /**
     * @param string $controller_name
     */
    public function setControllerName($controller_name)
    {
        $this->controller_name = $controller_name;
    }

    /**
     * @return string
     */
    public function methodName()
    {
        return $this->method_name;
    }

    /**
     * @param $method_name
     */
    public function setMethodName($method_name)
    {
        $this->method_name = $method_name;
    }

    /**
     * @return string
     */
    public function getActionName()
    {
        return $this->controllerName() . '::' . $this->methodName();
    }

    /**
     * @return generic\Controller
     */
    public function controller()
    {
        return $this->controller;
    }

    /**
     * @param array $parameters
     */
    public function setParameters($parameters)
    {
        $this->parameters = $parameters;
    }

    private function checkParameters()
    {
        $method = new \ReflectionMethod($this->controllerName(), $this->methodName());
        $params = $method->getParameters();
        foreach($params as $param)
        {
            if (!$param->isOptional() && !isset($this->parameters[$param->getName()])) {
                throw new \RuntimeException($this->makeErrorMessageForInvalidParams(), 400);
            }
        }
    }

    private function makeErrorMessageForInvalidParams()
    {
        return Utils::isCLI()
            ? $this->makeErrorMessageForInvalidParamsCLI()
            : $this->makeErrorMessageForInvalidParamsWeb();
    }

    private function makeErrorMessageForInvalidParamsCLI()
    {
        $params = (new \ReflectionMethod($this->controllerName(), $this->methodName()))
            ->getParameters();
        $message = 'Not enough parameters.' . PHP_EOL . 'Syntax:' . PHP_EOL
            . 'php crystal.php '
            . $this->controllerName() . ' '
            . $this->methodName();
        /** @var \ReflectionParameter $param */
        foreach($params as $param) {
            if ($param->isOptional()) {
                $message .= ' [' . $param->getName() . '=value]';
            } else {
                $message .= ' ' . $param->getName() . '=value';
            }
        }
        return $message;
    }

    private function makeErrorMessageForInvalidParamsWeb()
    {
        $params = (new \ReflectionMethod($this->controllerName(), $this->methodName()))
            ->getParameters();
        $message = 'Required parameters: ';
        /** @var \ReflectionParameter $param */
        foreach($params as $param) {
            if ($param->isOptional()) {
                $message .= '[&' . $param->getName() . '=value]';
            } else {
                $message .= '&' . $param->getName() . '=value';
            }
        }
        return $message;
    }
}