text:
package org.mousephenotype.www.testing.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;

/**
 *
 * @author mrelac
 *
 * This class encapsulates the code and data necessary to represent the important
 * components of a search page 'diseaseGrid' HTML table for diseases.
 */
public class SearchDiseaseTable extends SearchFacetTable {

    public static final int COL_INDEX_DISEASE_ID      = 0;
    public static final int COL_INDEX_DISEASE_NAME    = 1;
    public static final int COL_INDEX_SOURCE          = 2;
    public static final int COL_INDEX_CURATED_HUMAN   = 3;
    public static final int COL_INDEX_CURATED_MICE    = 4;
    public static final int COL_INDEX_CANDIDATE_IMPC  = 5;
    public static final int COL_INDEX_CANDIDATE_MGI   = 6;
    public static final int COL_INDEX_LAST = COL_INDEX_CANDIDATE_MGI;           // Should always point to the last (highest-numbered) index.

    private final List<DiseaseRow> bodyRows = new ArrayList();
    private final GridMap pageData;

    private final static Map<TableComponent, By> map = new HashMap();
    static {
        map.put(TableComponent.BY_TABLE, By.xpath("//table[@id='diseaseGrid']"));
        map.put(TableComponent.BY_TABLE_TR, By.xpath("//table[@id='diseaseGrid']/tbody/tr"));
        map.put(TableComponent.BY_SELECT_GRID_LENGTH, By.xpath("//select[@name='diseaseGrid_length']"));
    }

    /**
     * Creates a new SearchDiseaseTable instance.
     * @param driver A WebDriver instance pointing to the search
     * facet table with thead and tbody definitions.
     * @param timeoutInSeconds The WebDriver timeout, in seconds
     */
    public SearchDiseaseTable(WebDriver driver, int timeoutInSeconds) {
        super(driver, timeoutInSeconds, SearchDiseaseTable.map);

        pageData = load();
    }

    /**
     * Validates download data against this SearchAnatomyTable
     * instance.
     *
     * @param downloadDataArray The download data used for comparison
     * @return validation status
     */
    @Override
    public PageStatus validateDownload(String[][] downloadDataArray) {
        final Integer[] pageColumns = {
              COL_INDEX_DISEASE_ID
            , COL_INDEX_DISEASE_NAME
            , COL_INDEX_SOURCE
        };
        final Integer[] downloadColumns = {
              DownloadSearchMapDiseases.COL_INDEX_DISEASE_ID
            , DownloadSearchMapDiseases.COL_INDEX_DISEASE_NAME
            , DownloadSearchMapDiseases.COL_INDEX_SOURCE
        };

        return validateDownloadInternal(pageData, pageColumns, downloadDataArray, downloadColumns, driver.getCurrentUrl());
    }

    // PRIVATE METHODS

    /**
     * Pulls all rows of data and column access variables from the search page's
     * 'diseaseGrid' HTML table.
     *
     * @return numRows rows of data and column access variables
     * from the search page's 'diseaseGrid' HTML table.
     */
    private GridMap load() {
        return load(null);
    }

    /**
     * Pulls numRows rows of search page gene facet data and column
     * access variables from the search page's 'diseaseGrid' HTML table.
     *
     * @param numRows the number of GridMap table rows to return,
     * including the heading row. To specify all rows, set numRows
     * to null.
     * @return numRows rows of search page gene facet data and
     * column access variables from the search page's 'diseaseGrid' HTML table.
     */
    private GridMap load(Integer numRows) {
        if (numRows == null)
            numRows = computeTableRowCount();

        String[][] pageArray;

        // Wait for page.
        wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("table#diseaseGrid")));
        int numCols = COL_INDEX_LAST + 1;

        pageArray = new String[numRows][numCols];                               // Allocate space for the data.
        for (int i = 0; i < numCols; i++) {
            pageArray[0][i] = "Column_" + i;                                    // Set the headings.
        }

        // Save the body values.
        List<WebElement> bodyRowElementsList = table.findElements(By.cssSelector("tbody tr"));
        if ( ! bodyRowElementsList.isEmpty()) {
            int sourceRowIndex = 1;

            pageArray[sourceRowIndex][COL_INDEX_DISEASE_ID] = "";               // Insure there is always a non-null value.
            pageArray[sourceRowIndex][COL_INDEX_DISEASE_NAME] = "";             // Insure there is always a non-null value.
            pageArray[sourceRowIndex][COL_INDEX_SOURCE] = "";                   // Insure there is always a non-null value.
            for (WebElement bodyRowElements : bodyRowElementsList) {                                    // diseaseId, diseaseName, source, curatedHuman, curatedMice, candidateIMPC, candidateMGI
                DiseaseRow diseaseRow = new DiseaseRow();
                List<WebElement> bodyRowElementList= bodyRowElements.findElements(By.cssSelector("td"));
                WebElement element = bodyRowElementList.get(0).findElement(By.cssSelector("a"));        // Get 'Disease' element.
                diseaseRow.diseaseIdLink = element.getAttribute("href");
                int pos = diseaseRow.diseaseIdLink.lastIndexOf("/");

                diseaseRow.diseaseId = diseaseRow.diseaseIdLink.substring(pos + 1);                     // Add diseaseId   to row element 0 from 'Disease' element.
                pageArray[sourceRowIndex][COL_INDEX_DISEASE_ID] = diseaseRow.diseaseId;

                diseaseRow.diseaseName = element.getText();
                pageArray[sourceRowIndex][COL_INDEX_DISEASE_NAME] = diseaseRow.diseaseName;

                diseaseRow.source = bodyRowElementList.get(1).getText();
                pageArray[sourceRowIndex][COL_INDEX_SOURCE] = diseaseRow.source;                           // Add source      to row element 2 from 'Source' element.

                sourceRowIndex++;
                bodyRows.add(diseaseRow);
            }
        }

        return new GridMap(pageArray, driver.getCurrentUrl());
    }

    // PRIVATE CLASSES

    private class DiseaseRow {
        private String diseaseId = "";
        private String diseaseIdLink = "";
        private String diseaseName = "";
        private String source = "";
    }

}


text:
import sys, time, readline, multiprocessing
from optparse import OptionParser
from sqlobject import SQLObject, IntCol, StringCol, BLOBCol
from sqlobject.sqlite.sqliteconnection import SQLiteConnection

'''

  mock_client: this is a script that helps testing of SlingshotSMS
  without having a real modem or other infrastructre

'''

class MessageData(SQLObject):
    _connection = SQLiteConnection('slingshotsms.db')
    sent = IntCol(default=None)
    received = IntCol(default=None)
    sender = StringCol()
    text = StringCol()

class OutMessageData(SQLObject):
    _connection = SQLiteConnection('slingshotsms.db')
    number = StringCol()
    text = StringCol()

def sent_watcher():
    while True:
        messages = OutMessageData.select()
        for message in messages:
            print "sent: \n%s\n to %s\n>" % (message.text, message.number)
            message.destroySelf()
        time.sleep(5)

if __name__ == '__main__':
    o = OptionParser(usage='Usage: %prog 19777777 "A message"')
    o.add_option('--i', '--interactive', action='store_true', dest='interactive')
    (opts, args) = o.parse_args()
    if opts.interactive:
        print "Interactive mode: type exit to quit"
        sender = raw_input('[what number should messages originate from?]: ')

        watcher = multiprocessing.Process(target=sent_watcher)
        watcher.start()

        input = True
        while input:
            input = raw_input('> ')
            if input == 'exit':
                watcher.join()
                sys.exit(0)
            MessageData(sender=sender, text=input, sent=int(time.time()))
            print "sent message"
    elif len(args) < 2:
        o.print_usage()
        sys.exit(1)
    else:
        MessageData(sender=args[0], text=args[1], sent=int(time.time()))

redpajama_set_name: RedPajamaGithub


text:
class VectorFilter(object):
    """
    Interface for vector-list filters. They get either (vector, data, distance)
    tupes or (vector, data) tuples and return subsets of them.

    Some filters work on lists of (vector, data, distance) tuples, others work
    on lists of (vector, data) tuples and others work on both types.
    Depending on the configuration of the engine, you have to select the right
    filter chain.

    Filter are chained in the engine, if you specify more than one. This way
    you can combine their functionalities.

    The default filtes in the engine (see engine.py) are a UniqueFilter
    followed by a NearestFilter(10). The UniqueFilter makes sure, that the
    candidate list contains each vector only once and the NearestFilter(10)
    returns the 10 closest candidates (using the distance).

    Which kind you need is very simple to determine: If you use a Distance
    implementation, you have to use filters that take
    (vector, data, distance) tuples. If you however decide to not use Distance
    (Engine with distance=None), you have to use a vector filters that
    process lists of (vector, data) tuples.

    However all filters can handle both input types. They will just return the
    input list if their filter mechanism does not apply on the input type.
    """

    def filter_vectors(self, input_list):
        """
        Returns subset of specified input list.
        """
        raise NotImplementedError


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

.. _to-api-v2-deliveryservice_stats:

*************************
``deliveryservice_stats``
*************************

``GET``
=======
Retrieves time-aggregated statistics on a specific :term:`Delivery Service`.

:Auth. Required: Yes
:Roles Required: None\ [#tenancy]_
:Response Type:  Object

Request Structure
-----------------
.. table:: Request Query Parameters

	+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
	| Name                | Required          | Description                                                                                |
	+=====================+===================+===========================================================================================================================================================================================+
	| deliveryService     | yes\ [#ds-param]_ | Either the :ref:`ds-xmlid` of a :term:`Delivery Service` for which statistics will be aggregated or the integral, unique identifier of said :term:`Delivery Service`                      |
	+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
	| deliveryServiceName | yes\ [#ds-param]_ | The :ref:`ds-xmlid` of the :term:`Delivery Service` for which statistics will be aggregated                                                                                |
	+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
	| endDate             | yes               | The date and time until which statistics shall be aggregated in :rfc:`3339` format (with or without sub-second precision), the number of nanoseconds since the Unix                       |
	|                     |                   | Epoch, or in the same, proprietary format as the ``lastUpdated`` fields prevalent throughout the Traffic Ops API                                                                          |
	+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
	| exclude             | no                | Either "series" to omit the data series from the result, or "summary" to omit the summary data from the result - directly corresponds to fields in the                                    |
	|                     |                   | `Response Structure`_                                                                                |
	+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
	| interval            | no                | Specifies the interval within which data will be "bucketed"; e.g. when requesting data from 2019-07-25T00:00:00Z to 2019-07-25T23:59:59Z with an interval of "1m",                        |
	|                     |                   | the resulting data series (assuming it is not excluded) should contain                                                                                |
	|                     |                   | :math:`24\frac{\mathrm{hours}}{\mathrm{day}}\times60\frac{\mathrm{minutes}}{\mathrm{hour}}\times1\mathrm{day}\times1\frac{\mathrm{minute}}{\mathrm{data point}}=1440\mathrm{data\;points}`|
	|                     |                   | The allowed values for this parameter are valid InfluxQL duration literal strings matching :regexp:`^\d+[mhdw]$`                                                                          |
	|                     |                   |                                                                                |
	+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
	| limit               | no                | A natural number indicating the maximum amount of data points should be returned in the ``series`` object                                                                                |
	+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
	| metricType          | yes               | The metric type being reported - one of:                                                                                |
	|                     |                   |                                                                                |
	|                     |                   | kbps                                                                                |
	|                     |                   |   The total traffic rate in kilobytes per second served by the :term:`Delivery Service`                                                                                |
	|                     |                   | tps_total                                                                                |
	|                     |                   |   The total traffic rate in transactions per second served by the :term:`Delivery Service`                                                                                |
	|                     |                   | tps_2xx                                                                                |
	|                     |                   |   The total traffic rate in transactions per second serviced with 200-299 HTTP status codes                                                                                |
	|                     |                   | tps_3xx                                                                                |
	|                     |                   |   The total traffic rate in transactions per second serviced with 300-399 HTTP status codes                                                                                |
	|                     |                   | tps_4xx                                                                                |
	|                     |                   |   The total traffic rate in transactions per second serviced with 400-499 HTTP status codes                                                                                |
	|                     |                   | tps_5xx                                                                                |
	|                     |                   |   The total traffic rate in transactions per second serviced with 500-599 HTTP status codes                                                                                |
	|                     |                   |                                                                                |
	+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
	| offset              | no                | A natural number of data points to drop from the beginning of the returned data set                                                                                |
	+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
	| orderby             | no                | Though one struggles to imagine why, this can be used to specify "time" to sort data points by their "time" (which is the default behavior)                                               |
	+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
	| startDate           | yes               | The date and time from which statistics shall be aggregated in :rfc:`3339` format (with or without sub-second precision), the number of nanoseconds since the Unix                        |
	|                     |                   | Epoch, or in the same, proprietary format as the ``lastUpdated`` fields prevalent throughout the Traffic Ops API                                                                          |
	+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

.. _v2-deliveryservice_stats-get-request-example:
.. code-block:: http
	:caption: Request Example

	GET /api/2.0/deliveryservice_stats?deliveryServiceName=demo1&startDate=2019-07-22T17:55:00Z&endDate=2019-07-22T17:56:00.000Z&metricType=tps_total HTTP/1.1
	User-Agent: python-requests/2.20.1
	Accept-Encoding: gzip, deflate
	Accept: application/json;timestamp=unix, application/json;timestamp=rfc;q=0.9, application/json;q=0.8, */*;q=0.7
	Connection: keep-alive
	Cookie: mojolicious=...

Content Format
""""""""""""""
It's important to note in :ref:`v2-deliveryservice_stats-get-request-example` the use of a complex "Accept" header. This endpoint accepts two special media types in the "Accept" header that instruct it on how to format the timestamps associated with the returned data. Specifically, Traffic Ops will recognize the special, optional, non-standard parameter of :mimetype:`application/json`: ``timestamp``. The values of this parameter are restricted to one of

rfc
	Returned timestamps will be formatted according to :rfc:`3339` (no sub-second precision).
unix
	Returned timestamps will be formatted as the number of nanoseconds since the Unix Epoch (midnight on January 1\ :sup:`st` 1970 UTC).

	.. impl-detail:: The endpoint passes back nanoseconds, specifically, because that is the form used both by InfluxDB, which is used to store the data being served, and Go's standard library. Clients may need to convert the value to match their own standard libraries - e.g. the :js:class:`Date` class in Javascript expects milliseconds.

The default behavior - when only e.g. :mimetype:`application/json` or :mimetype:`*/*` is given - is to use :rfc:`3339` formatting. It will, however, respect quality parameters. It is suggested that clients request timestamps they can handle specifically, rather than relying on this default behavior, as it **is subject to change** and is in fact **expected to invert in the next major release** as string-based time formats become deprecated.

.. seealso:: For more information on the "Accept" HTTP header, consult `its dedicated page on MDN <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept>`_.

Response Structure
------------------
:series: An object containing the actual data series and information necessary for working with it.

	:columns: This is an array of names of the columns of the data contained in the "values" array - should always be ``["time", "sum_count"]``
	:count:   The number of data points contained in the "values" array
	:name:    The name of the data set. Should always match :samp:`{metric}.ds.1min` where ``metric`` is the requested ``metricType``
	:values:  The actual array of data points. Each represents a length of time specified by the ``interval`` query parameter

		:time:  The time at which the measurement was taken. This corresponds to the *beginning* of the interval. This time comes in the format of either an :rfc:`3339`-formatted string, or a number containing the number of nanoseconds since the Unix Epoch depending on the "Accept" header sent by the client, according to the rules outlined in `Content Format`_.
		:value: The value of the requested ``metricType`` at the time given by ``time``. This will always be a floating point number, unless no data is available for the data interval, in which case it will be ``null``

:summary: An object containing summary statistics describing the data series

	:average:                The arithmetic mean of the data's values
	:count:                  The number of measurements taken within the requested timespan. This is, in general, **not** the same as the ``count`` field of the ``series`` object, as it reflects the number of underlying, un-"bucketed" data points, and is therefore dependent on the implementation of Traffic Stats.
	:fifthPercentile:        Data points with values less than or equal to this number constitute the "bottom" 5% of the data set
	:max:                    The maximum value that can be found in the requested data set
	:min:                    The minimum value that can be found in the requested data set
	:ninetyEighthPercentile: Data points with values greater than or equal to this number constitute the "top" 2% of the data set
	:ninetyFifthPercentile:  Data points with values greater than or equal to this number constitute the "top" 5% of the data set
	:totalKiloBytes:         When the ``metricType`` requested is ``kbps``, this will contain the total number of kilobytes transferred by the :term:`Delivery Service` within the requested time window. Note that fractional amounts are possible, as the data transfer rate will almost certainly not be cleanly divided by the requested time range.
	:totalTransactions:      When the ``metricType`` requested is **not** ``kbps``, this will contain the total number of transactions completed by the :term:`Delivery Service` within the requested time window. Note that fractional amounts are possible, as the transaction rate will almost certainly not be cleanly divided by the requested time range.

.. code-block:: http
	:caption: Response Example

	HTTP/1.1 200 OK
	Access-Control-Allow-Credentials: true
	Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
	Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
	Access-Control-Allow-Origin: *
	Content-Encoding: gzip
	Content-Type: application/json
	Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
	Whole-Content-Sha512: zXJGjcYuu6HxWINVp8HA1gL31J3ukry5wCsTDNxtP/waC6rSD8h10KJ9jEAtRzJ9owOSVPvKaA/2bRu/QeuCpQ==
	X-Server-Name: traffic_ops_golang/
	Date: Mon, 22 Jul 2019 17:57:14 GMT
	Transfer-Encoding: chunked

	{ "response": {
		"series": {
			"columns": [
				"time",
				"sum_count"
			],
			"count": 2,
			"name": "tps_total.ds.1min",
			"tags": {
				"cachegroup": "total"
			},
			"values": [
				[
					1563818100000000000,
					0
				],
				[
					1563818160000000000,
					0
				]
			]
		},
		"source": "TrafficStats",
		"summary": {
			"average": 0,
			"count": 2,
			"fifthPercentile": 0,
			"max": 0,
			"min": 0,
			"ninetyEighthPercentile": 0,
			"ninetyFifthPercentile": 0,
			"totalKiloBytes": null,
			"totalTransactions": 0
		},
		"version": "1.2"
	}}

.. [#tenancy] This endpoint respects :term:`Tenancy`, and users whose :term:`Tenant` does not have access to a :term:`Delivery Service` will be unable to view the statistics of said :term:`Delivery Service`.
.. [#ds-param] Either ``deliveryServiceName`` or ``deliveryService`` *must* be present, but if both are ``deliveryServiceName`` will be used and ``deliveryService`` will be ignored.


text:
package io.github.redpanda4552.SimpleEgg.util;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
import org.bukkit.inventory.meta.ItemMeta;

/**
 * In keeping with tradition, Spigot's attempts to retrofit only create more
 * problems...
 *
 * Damage is no longer stored on the itemstack, but the itemmeta. Fine, except
 * that's a lie, itemmeta doesn't store this property. It's stored in
 * Damageable. Which, per the Javadocs, is not implemented by itemmeta, OR any
 * of it's subinterfaces.
 *
 * Even better, there's literally no other interface or class that implements
 * Damageable. Maybe it's implemented by the actual classes of CraftBukkit???
 *
 * But, in natural trades I haven't even seen damaged items. So I guess for now
 * we'll just roll with this. But if the need ever comes about, hopefully there
 * is a more, permanent? Solution than this.
 */
public class ItemStackConverter {

    public static String toString(ItemStack itemStack) {
        String ret = new String(itemStack.getType().toString());
        int damage = 0;
        ret += "-" + itemStack.getAmount() + "-";

        if (!itemStack.hasItemMeta())
            return ret + damage;

        ItemMeta baseMeta = itemStack.getItemMeta();

        if (baseMeta instanceof Damageable)
            damage = ((Damageable) baseMeta).getDamage();

        ret += damage;

        if (baseMeta.hasDisplayName())
            ret += "-" + baseMeta.getDisplayName();

        ret += "-";

        if (baseMeta instanceof EnchantmentStorageMeta) {
            EnchantmentStorageMeta ESMeta = (EnchantmentStorageMeta) itemStack.getItemMeta();

            for (Enchantment enchantment : ESMeta.getStoredEnchants().keySet())
                ret += enchantment.getKey().getKey() + "/" + ESMeta.getStoredEnchants().get(enchantment) + "-";
        } else {
            for (Enchantment enchantment : baseMeta.getEnchants().keySet())
                ret += enchantment.getKey().getKey() + "/" + baseMeta.getEnchantLevel(enchantment) + "-";
        }

        return ret.substring(0, ret.lastIndexOf("-")); // Trim extra - off
    }

    public static ItemStack fromString(String string) {
        ItemStack ret = null;
        String[] itemStackParts = string.split("-");

        try {
            Material resultMaterial = Material.valueOf(itemStackParts[0]);
            int resultAmount = Integer.parseInt(itemStackParts[1]);
            int durability = Integer.parseInt(itemStackParts[2]);
            ret = new ItemStack(resultMaterial, resultAmount);
            ItemMeta baseMeta = Bukkit.getItemFactory().getItemMeta(resultMaterial);

            if (baseMeta instanceof Damageable)
                ((Damageable) baseMeta).setDamage(durability);

            if (baseMeta instanceof EnchantmentStorageMeta) {
                EnchantmentStorageMeta ESMeta = (EnchantmentStorageMeta) baseMeta;

                for (int i = 3; i < itemStackParts.length; i++) {
                    String[] enchantParts = itemStackParts[i].split("/");
                    ESMeta.addStoredEnchant(Enchantment.getByKey(NamespacedKey.minecraft(enchantParts[0])), Integer.parseInt(enchantParts[1]), true);
                }

                ret.setItemMeta(ESMeta);
            } else {
                for (int i = 3; i < itemStackParts.length; i++) {
                    String[] enchantParts = itemStackParts[i].split("/");
                    baseMeta.addEnchant(Enchantment.getByKey(NamespacedKey.minecraft(enchantParts[0])), Integer.parseInt(enchantParts[1]), true);
                }

                ret.setItemMeta(baseMeta);
            }
        } catch (IllegalArgumentException e) {
            throw new IllegalArgumentException("Provided string cannot be converted to an ItemStack!", e);
        }

        return ret;
    }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable disable

using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.PooledObjects;
using System.Collections.Immutable;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.CSharp
{
    internal sealed class ScriptLocalScopeBinder : LocalScopeBinder
    {
        private readonly Labels _labels;

        internal ScriptLocalScopeBinder(Labels labels, Binder next) : base(next)
        {
            _labels = labels;
        }

        internal override Symbol ContainingMemberOrLambda
        {
            get { return _labels.ScriptInitializer; }
        }

        protected override ImmutableArray<LabelSymbol> BuildLabels()
        {
            return _labels.GetLabels();
        }

        internal override bool IsLabelsScopeBinder
        {
            get
            {
                return true;
            }
        }

        internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
        {
            throw ExceptionUtilities.Unreachable;
        }

        internal override ImmutableArray<LocalFunctionSymbol> GetDeclaredLocalFunctionsForScope(CSharpSyntaxNode scopeDesignator)
        {
            throw ExceptionUtilities.Unreachable;
        }

        // Labels potentially shared across multiple ScriptLocalScopeBinder instances.
        internal new sealed class Labels
        {
            private readonly SynthesizedInteractiveInitializerMethod _scriptInitializer;
            private readonly CompilationUnitSyntax _syntax;
            private ImmutableArray<LabelSymbol> _lazyLabels;

            internal Labels(SynthesizedInteractiveInitializerMethod scriptInitializer, CompilationUnitSyntax syntax)
            {
                _scriptInitializer = scriptInitializer;
                _syntax = syntax;
            }

            internal SynthesizedInteractiveInitializerMethod ScriptInitializer
            {
                get { return _scriptInitializer; }
            }

            internal ImmutableArray<LabelSymbol> GetLabels()
            {
                if (_lazyLabels == null)
                {
                    ImmutableInterlocked.InterlockedInitialize(ref _lazyLabels, GetLabels(_scriptInitializer, _syntax));
                }
                return _lazyLabels;
            }

            private static ImmutableArray<LabelSymbol> GetLabels(SynthesizedInteractiveInitializerMethod scriptInitializer, CompilationUnitSyntax syntax)
            {
                var builder = ArrayBuilder<LabelSymbol>.GetInstance();
                foreach (var member in syntax.Members)
                {
                    if (member.Kind() != SyntaxKind.GlobalStatement)
                    {
                        continue;
                    }
                    LocalScopeBinder.BuildLabels(scriptInitializer, ((GlobalStatementSyntax)member).Statement, ref builder);
                }
                return builder.ToImmutableAndFree();
            }
        }
    }
}


text:
package com.badlogic.gdx.graphics.glutils;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import java.util.HashMap;
import java.util.Map;

import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.Texture.TextureWrap;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.BufferUtils;
import com.badlogic.gdx.utils.Disposable;
import com.badlogic.gdx.utils.GdxRuntimeException;

/**

 * Encapsulates OpenGL ES 2.0 frame buffer objects. This is a simple helper class which should cover most FBO uses. It will
 * automatically create a texture for the color attachment and a renderbuffer for the depth buffer. You can get a hold of the
 * texture by {@link FrameBuffer#getColorBufferTexture()}. This class will only work with OpenGL ES 2.0.
 *

 *
 *

 * FrameBuffers are managed. In case of an OpenGL context loss, which only happens on Android when a user switches to another
 * application or receives an incoming call, the framebuffer will be automatically recreated.
 *

 *
 *

 * A FrameBuffer must be disposed if it is no longer needed
 *

 *
 * @author mzechner */
public class FrameBuffer implements Disposable {
	/** the frame buffers **/
	private final static Map<Application, Array<FrameBuffer>> buffers = new HashMap<Application, Array<FrameBuffer>>();

	/** the color buffer texture **/
	protected Texture colorTexture;

	/** the default framebuffer handle, a.k.a screen. */
	private static int defaultFramebufferHandle;
	/** true if we have polled for the default handle already. */
	private static boolean defaultFramebufferHandleInitialized = false;

	/** the framebuffer handle **/
	private int framebufferHandle;

	/** the depthbuffer render object handle **/
	private int depthbufferHandle;

	/** width **/
	protected final int width;

	/** height **/
	protected final int height;

	/** depth **/
	protected final boolean hasDepth;

	/** format **/
	protected final Pixmap.Format format;

	/** Creates a new FrameBuffer having the given dimensions and potentially a depth buffer attached.
	 *
	 * @param format the format of the color buffer; according to the OpenGL ES 2.0 spec, only
	 * RGB565, RGBA4444 and RGB5_A1 are color-renderable
	 * @param width the width of the framebuffer in pixels
	 * @param height the height of the framebuffer in pixels
	 * @param hasDepth whether to attach a depth buffer
	 * @throws GdxRuntimeException in case the FrameBuffer could not be created */
	public FrameBuffer (Pixmap.Format format, int width, int height, boolean hasDepth) {
		this.width = width;
		this.height = height;
		this.format = format;
		this.hasDepth = hasDepth;
		build();

		addManagedFrameBuffer(Gdx.app, this);
	}

	/**
	 * Override this method in a derived class to set up the backing texture as you like.
	 */
	protected void setupTexture() {
		colorTexture = new Texture(width, height, format);
		colorTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
		colorTexture.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge);
	}

	private void build () {
		if (!Gdx.graphics.isGL20Available()) throw new GdxRuntimeException("GL2 is required.");

		GL20 gl = Gdx.graphics.getGL20();

		// iOS uses a different framebuffer handle! (not necessarily 0)
		if (!defaultFramebufferHandleInitialized) {
			defaultFramebufferHandleInitialized = true;
		   if (Gdx.app.getType() == ApplicationType.iOS) {
		     IntBuffer intbuf = ByteBuffer.allocateDirect(16 * Integer.SIZE / 8).order(ByteOrder.nativeOrder()).asIntBuffer();
		     gl.glGetIntegerv(GL20.GL_FRAMEBUFFER_BINDING, intbuf);
		     defaultFramebufferHandle = intbuf.get(0);
		   }
		   else {
		     defaultFramebufferHandle = 0;
		   }
		}

		setupTexture();

		IntBuffer handle = BufferUtils.newIntBuffer(1);
		gl.glGenFramebuffers(1, handle);
		framebufferHandle = handle.get(0);

		if (hasDepth) {
			handle.clear();
			gl.glGenRenderbuffers(1, handle);
			depthbufferHandle = handle.get(0);
		}

		gl.glBindTexture(GL20.GL_TEXTURE_2D, colorTexture.getTextureObjectHandle());

		if (hasDepth) {
			gl.glBindRenderbuffer(GL20.GL_RENDERBUFFER, depthbufferHandle);
			gl.glRenderbufferStorage(GL20.GL_RENDERBUFFER, GL20.GL_DEPTH_COMPONENT16, colorTexture.getWidth(),
				colorTexture.getHeight());
		}

		gl.glBindFramebuffer(GL20.GL_FRAMEBUFFER, framebufferHandle);
		gl.glFramebufferTexture2D(GL20.GL_FRAMEBUFFER, GL20.GL_COLOR_ATTACHMENT0, GL20.GL_TEXTURE_2D,
			colorTexture.getTextureObjectHandle(), 0);
		if (hasDepth) {
			gl.glFramebufferRenderbuffer(GL20.GL_FRAMEBUFFER, GL20.GL_DEPTH_ATTACHMENT, GL20.GL_RENDERBUFFER, depthbufferHandle);
		}
		int result = gl.glCheckFramebufferStatus(GL20.GL_FRAMEBUFFER);

		gl.glBindRenderbuffer(GL20.GL_RENDERBUFFER, 0);
		gl.glBindTexture(GL20.GL_TEXTURE_2D, 0);
		gl.glBindFramebuffer(GL20.GL_FRAMEBUFFER, defaultFramebufferHandle);

		if (result != GL20.GL_FRAMEBUFFER_COMPLETE) {
			colorTexture.dispose();
			if (hasDepth) {
				handle.clear();
				handle.put(depthbufferHandle);
				handle.flip();
				gl.glDeleteRenderbuffers(1, handle);
			}

			colorTexture.dispose();
			handle.clear();
			handle.put(framebufferHandle);
			handle.flip();
			gl.glDeleteFramebuffers(1, handle);

			if (result == GL20.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)
				throw new IllegalStateException("frame buffer couldn't be constructed: incomplete attachment");
			if (result == GL20.GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS)
				throw new IllegalStateException("frame buffer couldn't be constructed: incomplete dimensions");
			if (result == GL20.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)
				throw new IllegalStateException("frame buffer couldn't be constructed: missing attachment");
			if (result == GL20.GL_FRAMEBUFFER_UNSUPPORTED)
				throw new IllegalStateException("frame buffer couldn't be constructed: unsupported combination of formats");
			throw new IllegalStateException("frame buffer couldn't be constructed: unknown error " + result);
		}
	}

	/** Releases all resources associated with the FrameBuffer. */
	public void dispose () {
		GL20 gl = Gdx.graphics.getGL20();

		IntBuffer handle = BufferUtils.newIntBuffer(1);

		colorTexture.dispose();
		if (hasDepth) {
			handle.put(depthbufferHandle);
			handle.flip();
			gl.glDeleteRenderbuffers(1, handle);
		}

		handle.clear();
		handle.put(framebufferHandle);
		handle.flip();
		gl.glDeleteFramebuffers(1, handle);

		if (buffers.get(Gdx.app) != null) buffers.get(Gdx.app).removeValue(this, true);
	}

	/** Makes the frame buffer current so everything gets drawn to it. */
	public void begin () {
		Gdx.graphics.getGL20().glViewport(0, 0, colorTexture.getWidth(), colorTexture.getHeight());
		Gdx.graphics.getGL20().glBindFramebuffer(GL20.GL_FRAMEBUFFER, framebufferHandle);
	}

	/** Unbinds the framebuffer, all drawing will be performed to the normal framebuffer from here on. */
	public void end () {
		Gdx.graphics.getGL20().glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
		Gdx.graphics.getGL20().glBindFramebuffer(GL20.GL_FRAMEBUFFER, defaultFramebufferHandle);
	}

	/** @return the color buffer texture */
	public Texture getColorBufferTexture () {
		return colorTexture;
	}

	/** @return the height of the framebuffer in pixels */
	public int getHeight () {
		return colorTexture.getHeight();
	}

	/** @return the width of the framebuffer in pixels */
	public int getWidth () {
		return colorTexture.getWidth();
	}

	private static void addManagedFrameBuffer (Application app, FrameBuffer frameBuffer) {
		Array<FrameBuffer> managedResources = buffers.get(app);
		if (managedResources == null) managedResources = new Array<FrameBuffer>();
		managedResources.add(frameBuffer);
		buffers.put(app, managedResources);
	}

	/** Invalidates all frame buffers. This can be used when the OpenGL context is lost to rebuild all managed frame buffers. This
	 * assumes that the texture attached to this buffer has already been rebuild! Use with care. */
	public static void invalidateAllFrameBuffers (Application app) {
		if (Gdx.graphics.getGL20() == null) return;

		Array<FrameBuffer> bufferArray = buffers.get(app);
		if (bufferArray == null) return;
		for (int i = 0; i < bufferArray.size; i++) {
			bufferArray.get(i).build();
		}
	}

	public static void clearAllFrameBuffers (Application app) {
		buffers.remove(app);
	}

	public static StringBuilder getManagedStatus (final StringBuilder builder) {
		builder.append("Managed buffers/app: { ");
		for (Application app : buffers.keySet()) {
			builder.append(buffers.get(app).size);
			builder.append(" ");
		}
		builder.append("}");
		return builder;
	}

	public static String getManagedStatus () {
		return getManagedStatus(new StringBuilder()).toString();
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.hirisun.hea.common.model">
    <class name="SystemCode" table="EDC_SYSTEM_CODE">
       	<id name="id" type="java.lang.String">
            <column name="ID" />
            <generator class="uuid.hex"/>
        </id>
        <many-to-one name="parentSystemCode" class="com.hirisun.hea.common.model.SystemCode" column="PARENT_ID" fetch="select"/>
        <property name="regCode" type="java.lang.String">
            <column name="REG_CODE" />
        </property>
         <property name="regType" type="java.lang.String">
            <column name="REG_TYPE"/>
        </property>

        <property name="regName" type="java.lang.String">
            <column name="REG_NAME" length="200" not-null="true" />
        </property>
        <property name="regDesc" type="java.lang.String">
            <column name="REG_DESC" length="500" />
        </property>
        <property name="regProp" type="java.lang.String">
            <column name="REG_PROP" length="50" />
        </property>
        <property name="regOrder" type="java.lang.Integer">
            <column name="REG_ORDER"/>
        </property>
        <property name="regValue" type="java.lang.String">
            <column name="REG_VALUE" length="1000" />
        </property>
        <property name="parentId" type="java.lang.String" insert="false" update="false">
            <column name="PARENT_ID" length="32" />
        </property>
        <property name="indexLevel" type="java.lang.Integer">
            <column name="INDEXLEVEL" />
        </property>
        <property name="haschild" type="java.lang.Integer">
            <column name="HASCHILD" />
        </property>
        <property name="levelCode" type="java.lang.String">
            <column name="LEVEL_CODE" />
        </property>
        <property name="param1" type="string">
        	<column name="PARAM1"/>
        </property>
        <property name="param2" type="string">
        	<column name="PARAM2"/>
        </property>
        <property name="param3" type="string">
        	<column name="PARAM3"/>
        </property>
        <property name="param4" type="string">
        	<column name="PARAM4"/>
        </property>
        <property name="param5" type="string">
        	<column name="PARAM5"/>
        </property>

        <set name="subSystemCodes" inverse="true" cascade="all" order-by="reg_Order">
        	<key column="PARENT_ID"/>
        	<one-to-many class="com.hirisun.hea.common.model.SystemCode"/>
        </set>
    </class>
</hibernate-mapping>


text:
package io.github.atimothee.doodles.helpers;

import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import android.util.Log;

import io.github.atimothee.doodles.R;

/**
 * Created by Timo on 3/4/15.
 */
public class AccountHelper {
    private static final String LOG_TAG = AccountHelper.class.getSimpleName();
    private Context mContext;

    public AccountHelper(Context mContext){
        this.mContext = mContext;
    }

    public Account CreateSyncAccount() {
        // Create the account type and default account
        Account newAccount = new Account(
                mContext.getString(R.string.account), mContext.getString(R.string.account_type));
        // Get an instance of the Android account manager
        AccountManager accountManager =
                (AccountManager) mContext.getSystemService(
                        mContext.ACCOUNT_SERVICE);
        /*
         * Add the account and account type, no password or user data
         * If successful, return the Account object, otherwise report an error.
         */
        if (accountManager.addAccountExplicitly(newAccount, null, null)) {
            /*
             * If you don't set android:syncable="true" in
             * in your <provider> element in the manifest,
             * then call context.setIsSyncable(account, AUTHORITY, 1)
             * here.
             */
        } else {
            /*
             * The account exists or some other error occurred. Log this, report it,
             * or handle it internally.
             */
            Log.e(LOG_TAG, "Account exists or some other error occured!");
        }
        return newAccount;
    }
}


text:
<?php namespace App\Models\Access\Role\Traits\Attribute;

/**
 * Class RoleAttribute
 * @package App\Models\Access\Role\Traits\Attribute
 */
trait RoleAttribute {

    /**
     * @return string
     */
    public function getEditButtonAttribute() {
        if (access()->can('edit-roles'))
            return 'id).'" class="btn btn-xs btn-primary"> ';
        return '';
    }

    /**
     * @return string
     */
    public function getDeleteButtonAttribute() {
        if ($this->id != 1) //Cant delete master admin role
            if (access()->can('delete-roles'))
                return 'id).'" class="btn btn-xs btn-danger" data-method="delete">';
        return '';
    }

    /**
     * @return string
     */
    public function getActionButtonsAttribute() {
        return $this->getEditButtonAttribute().
        $this->getDeleteButtonAttribute();
    }
}


text:
//
//  NSDate+LinkBlock.h
//  LinkBlockProgram
//
//  Created by NOVO on 15/9/3.
//  Copyright (c) 2015年 NOVO. All rights reserved.
//

#import <Foundation/Foundation.h>

#define NSDateNew ([NSDate date])
@interface NSObject(NSDateLinkBlock)
/** 日期转字符串 */
@property (nonatomic,copy) NSString*        (^dateToStrWithFormat)(NSString* formatStr);
@property (nonatomic,copy) NSTimeInterval   (^dateTimeIntervalSince1970)();
@property (nonatomic,copy) NSDateComponents*(^dateComponentsAll)();

#pragma mark - 获取日期项的值
@property (nonatomic,copy) NSInteger         (^dateYear)();
@property (nonatomic,copy) NSInteger         (^dateMonth)();
@property (nonatomic,copy) NSInteger         (^dateDay)();
@property (nonatomic,copy) NSInteger         (^dateHour)();
@property (nonatomic,copy) NSInteger         (^dateMinut)();
@property (nonatomic,copy) NSInteger         (^dateSec)();

#pragma mark - 计算年月日时分秒的差
@property (nonatomic,copy) NSInteger        (^dateMinusYear)(NSDate* date);
@property (nonatomic,copy) NSInteger        (^dateMinusMonth)(NSDate* date);
@property (nonatomic,copy) NSInteger        (^dateMinusDay)(NSDate* date);
@property (nonatomic,copy) NSInteger        (^dateMinusHour)(NSDate* date);
@property (nonatomic,copy) NSInteger        (^dateMinusMinut)(NSDate* date);
@property (nonatomic,copy) NSInteger        (^dateMinusSec)(NSDate* date);

#pragma mark - 增/减年月日时分秒
@property (nonatomic,copy) NSDate*          (^dateAddTimeInterval)(NSTimeInterval timeInterval);
@property (nonatomic,copy) NSDate*          (^dateAddYear)(NSInteger year);
@property (nonatomic,copy) NSDate*          (^dateAddMonth)(NSInteger month);
@property (nonatomic,copy) NSDate*          (^dateAddDay)(NSInteger day);
@property (nonatomic,copy) NSDate*          (^dateAddHour)(NSInteger hour);
@property (nonatomic,copy) NSDate*          (^dateAddMinut)(NSInteger minut);
@property (nonatomic,copy) NSDate*          (^dateAddSec)(NSInteger sec);

#pragma mark - 设置年月日时分秒
@property (nonatomic,copy) NSDate*        (^dateSetYear)(NSInteger year);
@property (nonatomic,copy) NSDate*        (^dateSetMonth)(NSInteger month);
@property (nonatomic,copy) NSDate*        (^dateSetDay)(NSInteger day);
@property (nonatomic,copy) NSDate*        (^dateSetHour)(NSInteger hour);
@property (nonatomic,copy) NSDate*        (^dateSetMinut)(NSInteger minut);
@property (nonatomic,copy) NSDate*        (^dateSetSec)(NSInteger sec);
/** 获取日期的当天起点时间,相对GMT(格林威尼),24小时制 */
@property (nonatomic,copy) NSDate*          (^dateDayAtStart)();
/** 获取日期的当天结束时间,相对GMT(格林威尼),24小时制 */
@property (nonatomic,copy) NSDate*          (^dateDayAtEnd)();
/** 获取当前时区下补充了于GTM(格林威尼)时差后的日期对象 */
@property (nonatomic,copy) NSDate*          (^dateCurrentZone)();
/** 判断闰年 */
@property (nonatomic,copy) BOOL             (^dateIsLeapYear)();
/** 判断是否在本日 */
@property (nonatomic,copy) BOOL             (^dateIsInToday)();
/** 判断是否为本月 */
@property (nonatomic,copy) BOOL             (^dateIsInMonth)();

@end


text:
class DownloadService;

// Singleton that owns all DownloadServices and associates them with
// Profiles. Listens for the Profile's destruction notification and cleans up
// the associated DownloadService.
class DownloadServiceFactory : public BrowserContextKeyedServiceFactory {
 public:
  // Returns the DownloadService for |context|, creating if not yet created.
  static DownloadService* GetForBrowserContext(
      content::BrowserContext* context);

  static DownloadServiceFactory* GetInstance();

 protected:
  // BrowserContextKeyedServiceFactory:
  virtual KeyedService* BuildServiceInstanceFor(
      content::BrowserContext* profile) const OVERRIDE;
  virtual content::BrowserContext* GetBrowserContextToUse(
      content::BrowserContext* context) const OVERRIDE;

 private:
  friend struct DefaultSingletonTraits<DownloadServiceFactory>;

  DownloadServiceFactory();
  virtual ~DownloadServiceFactory();
};

#endif  // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_FACTORY_H_


text:
package com.bright.contenter.template.macro;

import com.bright.contenter.template.TemplateMacroManager;
import com.bright.util.base.reflect.ObjectSnooper;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import freemarker.core.Environment;
import freemarker.template.ObjectWrapper;
import freemarker.template.TemplateDirectiveBody;
import freemarker.template.TemplateDirectiveModel;
import freemarker.template.TemplateException;
import freemarker.template.TemplateModel;

public class ContentMacroData implements TemplateDirectiveModel {

    @Override
    public void execute(Environment e, Map map, TemplateModel[] tms, TemplateDirectiveBody tdb) throws TemplateException, IOException {
        RequestScope rscope = (RequestScope) e.getCustomAttribute("requestScope");
        QueryHandler queryHandler = (QueryHandler) e.getCustomAttribute("request");

        String providerName = map.get("provider").toString();
        String actionName = map.get("method").toString();
        String dataname = map.get("return").toString();

        try {
            Object provider = TemplateMacroManager.getTemplateMacroManager().getProviderInstance(providerName);
            if (provider != null) {
                HashMap<String, Object> mapx = new HashMap<String, Object>();
                mapx.put("out", e.getOut());
                mapx.put("request", rscope.getRequest());
                mapx.put("queryHandler", queryHandler);
                mapx.put("tagParameters", map);

                ObjectSnooper obj = ObjectSnooper.snoop(provider);
                obj.sett(mapx);
                obj.set(rscope.getParameters());
                Object result = obj.trigger(actionName);

                HashMap<String, Object> xxtmap = new HashMap<String, Object>();
                Object xtt = obj.gett("local");
                if (xtt != null) {
                    xxtmap = (HashMap<String, Object>) xtt;
                }
                e.setVariable(dataname, ObjectWrapper.DEFAULT_WRAPPER.wrap(result));
                e.setVariable(dataname + "_local", ObjectWrapper.DEFAULT_WRAPPER.wrap(xxtmap));
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        if (null != tdb) {
            tdb.render(e.getOut());
        }
    }
}


text:
<?php

namespace Vegas\Tests\Acl\Adapter\Mysql\Model;

use Vegas\Security\Acl\Adapter\Mysql\Model\AclAccessList,
    Vegas\Security\Acl\Adapter\Mysql\Model\AclRole,
    Vegas\Security\Acl\Adapter\Mysql\Model\AclResource,
    Vegas\Security\Acl\Adapter\Mysql\Model\AclResourceAccess;
use Phalcon\Acl;

class AclResourceTest extends \PHPUnit_Framework_TestCase
{
    public function testCreateResource()
    {
        $resource = new AclResource;
        $resource->initialize();

        $this->assertNull($resource->id);

        $result = $resource->save([
            'name'          => 'CreatedResource',
            'description'   => 'Sample description',
            'scope'         => ''
        ]);

        $this->assertTrue($result);
        $this->assertEquals(AclResource::DIRTY_STATE_PERSISTENT, $resource->getDirtyState());
    }

    public function testInitialize()
    {

    }

    /**
     * @depends testCreateResource
     */
    public function testFindByNameMethod()
    {
        $this->assertFalse(AclResource::findFirstByName('NonExistingResource'));

        $resource = AclResource::findFirstByName('CreatedResource');
        $this->assertInstanceOf('\Vegas\Security\Acl\Adapter\Mysql\Model\AclResource', $resource);
    }

    /**
     * @depends testCreateResource
     */
    public function testCreateRelatedModels()
    {
//        $this->markTestSkipped('Db table field types has to be resolved with model field types');
        $resourceModel = AclResource::findFirstByName('CreatedResource');

        $roleModel = new AclRole;
        $roleModel->create([
            'name'          => 'guest',
            'description'   => '',
            'removable'     => 1
        ]);
        $this->assertEquals(AclRole::DIRTY_STATE_PERSISTENT, $roleModel->getDirtyState());

        $accessModel = new AclResourceAccess;
        $accessModel->create([
            'acl_resource_id'   => $resourceModel->id,
            'name'              => 'index',
            'description'       => '',
            'inherit'           => ''
        ]);
        $this->assertEquals(AclResourceAccess::DIRTY_STATE_PERSISTENT, $accessModel->getDirtyState());

        $aclModel = new AclAccessList;
        $aclModel->create([
            'acl_role_id'            => $roleModel->id,
            'acl_resource_id'        => $resourceModel->id,
            'acl_resource_access_id' => $accessModel->id,
            'allowed'                => Acl::ALLOW
        ]);
        $this->assertEquals(AclAccessList::DIRTY_STATE_PERSISTENT, $aclModel->getDirtyState());
    }

    /**
     * @depends testCreateRelatedModels
     */
    public function testGetRelatedModels()
    {
        $resource = AclResource::findFirstByName('CreatedResource');
        $this->assertInstanceOf('\Vegas\Security\Acl\Adapter\Mysql\Model\AclResource', $resource);

        $this->assertEquals(1, count($resource->getAccessLists()));

        $this->assertEquals(1, count($resource->getResourceAccesses()));
    }

    /**
     * @depends testCreateRelatedModels
     */
    public function testGetResourceAccessesArray()
    {
        $resource = AclResource::findFirstByName('CreatedResource');
        $this->assertInstanceOf('\Vegas\Security\Acl\Adapter\Mysql\Model\AclResource', $resource);

        $this->assertInternalType('array', $resource->getAccessesAsArray());
        foreach ($resource->getAccessesAsArray() as $access) {
            $this->assertArrayHasKey('access_name', $access);
            $this->assertArrayHasKey('access_description', $access);
        }
    }
}


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace AlphaFS.UnitTest
{
   partial class SizeTest
   {
      // Pattern: <class>_<function>_<scenario>_<expected result>

      [TestMethod]
      public void AlphaFS_Directory_GetSize_NoStreamsOnRootFolder_LocalAndNetwork_Success()
      {
         AlphaFS_Directory_GetSize_NoStreamsOnRootFolder(false, false);
         AlphaFS_Directory_GetSize_NoStreamsOnRootFolder(true, false);
      }

      [TestMethod]
      public void AlphaFS_Directory_GetSize_NoStreamsOnRootFolder_Recursive_LocalAndNetwork_Success()
      {
         AlphaFS_Directory_GetSize_NoStreamsOnRootFolder(false, true);
         AlphaFS_Directory_GetSize_NoStreamsOnRootFolder(true, true);
      }

      private void AlphaFS_Directory_GetSize_NoStreamsOnRootFolder(bool isNetwork, bool recurse)
      {
         using (var tempRoot = new TemporaryDirectory(isNetwork))
         {
            var folder = tempRoot.CreateTree(5);

            Console.WriteLine("Input Directory Path: [{0}]", folder.FullName);

            var folderSize = Alphaleonis.Win32.Filesystem.Directory.GetSize(folder.FullName, false, recurse);

            Console.WriteLine("\n\tTotal Directory size ({0}recursive): [{1:N0} bytes ({2})]\n", recurse ? string.Empty : "non-", folderSize, Alphaleonis.Utils.UnitSizeToText(folderSize));

            var folderProps = Alphaleonis.Win32.Filesystem.Directory.GetProperties(folder.FullName, Alphaleonis.Win32.Filesystem.DirectoryEnumerationOptions.FilesAndFolders | Alphaleonis.Win32.Filesystem.DirectoryEnumerationOptions.Recursive);

            var count = 0;
            foreach (var key in folderProps.Keys)
               Console.WriteLine("\t\t#{0:000}\t{1, -17} = [{2}]", ++count, key, folderProps[key]);

            Assert.AreEqual(10, folderProps["Total"]);

            Assert.AreEqual(5, folderProps["Directory"]);

            Assert.AreEqual(5, folderProps["File"]);

            Assert.AreNotEqual(0, folderSize);

            if (recurse)
               Assert.AreEqual(folderProps["Size"], folderSize);
            else
               Assert.AreNotEqual(folderProps["Size"], folderSize);
         }

         Console.WriteLine();
      }
   }
}


text:
<!DOCTYPE html>

    <title>{{ page.title }}</title>
    <link rel="stylesheet" href="/css/main.css">
    <link rel="stylesheet" href="http://yandex.st/highlightjs/8.0/styles/github.min.css">

{{ site.name }}

        home

      {{ content }}

            Your Name

            What You Are

            you@example.com

            bitbucket.org/yourusername

            twitter.com/yourusername


text:
module Data.Type.Some where

import Data.Typeable

data Some :: (k -> k' -> *) -> k' -> * where
  Some :: f b a -> Some f a

deriving instance Typeable Some

withSome :: Some f a -> (forall b. f b a -> r) -> r
withSome (Some x) k = k x


text:
package com.sksamuel.elastic4s

import com.sksamuel.elastic4s.ElasticDsl._
import org.scalatest.mock.MockitoSugar
import org.scalatest.{ FlatSpec, Matchers }
import scala.collection.JavaConverters._

/** @author Stephen Samuel */
class SearchTest extends FlatSpec with MockitoSugar with ElasticSugar with Matchers {

  client.execute {
    bulk(
      index into "music/bands" fields (
        "name" -> "coldplay",
        "singer" -> "chris martin",
        "drummer" -> "will champion",
        "guitar" -> "johnny buckland"
      ),
      index into "music/artists" fields (
        "name" -> "kate bush",
        "singer" -> "kate bush"
      ),
      index into "music/bands" fields (
        "name" -> "jethro tull",
        "singer" -> "ian anderson",
        "guitar" -> "martin barre",
        "keyboards" -> "johnny smith"
      ) id 45
    )
  }.await

  refresh("music")
  blockUntilCount(3, "music")

  "a search query" should "find an indexed document that matches a string query" in {
    val resp = client.execute {
      search in "music" -> "bands" query "anderson"
    }.await
    assert(1 === resp.getHits.totalHits())
  }

  it should "find an indexed document in the given type only" in {
    val resp1 = client.execute {
      search in "music" -> "bands" query "kate"
    }.await
    assert(0 === resp1.getHits.totalHits())

    val resp2 = client.execute {
      search in "music" -> "artists" query "kate"
    }.await
    assert(1 === resp2.getHits.totalHits())
  }

  it should "return specified fields" in {
    val resp1 = client.execute {
      search in "music/bands" query "jethro" fields "singer"
    }.await
    assert(resp1.getHits.getHits.exists(_.getFields.get("singer").getValues.contains("ian anderson")))
  }

  it should "support source includes" in {
    val resp1 = client.execute {
      search in "music/bands" query "jethro" sourceInclude ("keyboards", "guit*")
    }.await
    val map = resp1.getHits.getHits()(0).sourceAsMap.asScala
    map.contains("keyboards") shouldBe true
    map.contains("guitar") shouldBe true
    map.contains("singer") shouldBe false
    map.contains("name") shouldBe false
  }

  it should "support source excludes" in {
    val resp1 = client.execute {
      search in "music/bands" query "jethro" sourceExclude ("na*", "guit*")
    }.await
    val map = resp1.getHits.getHits()(0).sourceAsMap.asScala
    map.contains("keyboards") shouldBe true
    map.contains("guitar") shouldBe false
    map.contains("singer") shouldBe true
    map.contains("name") shouldBe false
  }
}


text:
package com.papier.jurani;

import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

/**
 * Created by Angellica on 3/21/2016.
 */
public class RandomTruthActivity extends AppCompatActivity {

    private int i = 0;
    private String [] player;
    private String [] truth = {"Kesan pertama kamu terhadap...", "Apa yang paling kamu nggak suka dari...", "Kenapa kamu suka sama...",
                                "Kepada kamu, apa kesalahan terbesar yang pernah dilakukan oleh...", "Ke mana kamu bakal honeymoon kalo pergi sama...",
                                "Ceritakan fakta memalukan yang kamu tahu tentang...", "Apa yang kamu lakukan kalo kamu terjebak di pulau sebulan bersama...",
                                "Menurut kamu, apa kebiasaan paling menyebalkan dari...", "Kebohongan apa yang pernah kamu katakan ke...",
                                "Sifat apa yang pengen kamu ubah dari...", "Ceritakan pengalaman memalukan kamu bersama...", "Ceritakan pengalaman berteman kamu dan...",
                                "Kamu lebih pilih nolong kucing tenggelam atau kasih duit 100rb ke...", "Menurut kamu, cantik/ganteng kah si...",
                                "Menurut kamu, lebih pinter kamu atau...", "Sifat apa yang paling kamu kagumi dari...", "Sampaikan semua hal yang kamu pendam selama ini terhadap..."};
    private String chosenPlayer;
    private String chosenTruth;
    private TextView randTruth;
    private Button stop;
    private Thread runThread;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_random_truth);
        Toolbar toolbar = (Toolbar) findViewById(R.id.random_truth_toolbar);
        setSupportActionBar(toolbar);

        player = getIntent().getStringArrayExtra("player");

        chosenPlayer = getIntent().getExtras().getString("chosen");

        randTruth = (TextView) findViewById(R.id.random_truth);
        Runnable runName = new Runnable() {
            @Override
            public void run() {
                while (i < truth.length) {
                    try {
                        Thread.sleep(10);
                        randTruth.post(new Runnable() {
                            @Override
                            public void run() {
                                randTruth.setText(truth[i]);
                                if (i == truth.length-1) {
                                    i = 0;
                                } else {
                                    i += 1;
                                }
                            }
                        });
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }

                }
            }
        };

        runThread = new Thread(runName);
        runThread.start();

        stop = (Button) findViewById(R.id.stop_button_random_truth);
        stop.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                runThread.interrupt();
                chosenTruth = randTruth.getText().toString();
                Intent goChoose = new Intent (getApplicationContext(), RandomTargetActivity.class);
                goChoose.putExtra("player", player);
                goChoose.putExtra("chosen", chosenPlayer);
                goChoose.putExtra("task", chosenTruth);
                startActivity(goChoose);
                finish();
            }
        });

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_help) {
            Intent goToHelp = new Intent (getApplicationContext(), HelpActivity.class);
            startActivity(goToHelp);
            return true;
        } else if (id == R.id.action_developer) {
            Intent goToDev = new Intent (getApplicationContext(), DeveloperActivity.class);
            startActivity(goToDev);
            return true;
        } else if (id == R.id.action_reset) {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setMessage("Apakah kamu yakin ingin me-reset permainan?").setTitle("Reset");
            builder.setPositiveButton("Ya", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    Intent goToFirst = new Intent(getApplicationContext(), MainActivity.class);
                    startActivity(goToFirst);
                    finish();
                }
            });
            builder.setNegativeButton("Tidak", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    closeContextMenu();
                }
            });

            AlertDialog dialog = builder.create();
            dialog.show();

            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}


text:
package main

import (
	"os"
	"strings"

	"golang.org/x/sys/unix"
)

func validBinary(path string) bool {
	var stat unix.Stat_t
	if err := unix.Stat(path, &stat); nil != err {
		// Can't stat file
		return false
	}
	if (stat.Mode&unix.S_IFMT) != unix.S_IFREG && (stat.Mode&unix.S_IFMT) != unix.S_IFLNK {
		// Not a regular file or symlink
		return false
	}
	if 0 == stat.Mode&unix.S_IRUSR || 0 == stat.Mode&unix.S_IXUSR {
		// Not readable or not executable
		return false
	}
	return true
}

func findBinary(prefix, binary string) string {
	for _, part1 := range []string{"usr/local/", "usr/", ""} {
		for _, part2 := range []string{"sbin", "bin"} {
			path := "/" + part1 + part2 + "/" + binary
			if validBinary(prefix + path) {
				return path
			}
		}
	}
	return ""
}

func modifyEnv(oldEnv []string) []string {
	var newEnv []string
	for _, e := range oldEnv {
		if !strings.HasPrefix(e, "PATH=") {
			newEnv = append(newEnv, e)
		}
	}
	newEnv = append(newEnv, "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
	return newEnv
}

func main() {
	// First modify argv0 to strip off any absolute or relative paths
	argv := os.Args
	binary := argv[0]
	idx := strings.LastIndexByte(binary, '/')
	if 0 <= idx {
		binary = binary[idx+1:]
	}
	// Now implement the path search logic, but in the host's filesystem
	argv0 := findBinary("/host", binary)
	if "" == argv0 {
		panic(binary + " not found")
	}
	// Chroot in the the host's FS
	if err := unix.Chroot("/host"); nil != err {
		panic(err)
	}
	// Change cwd to the root
	if err := unix.Chdir("/"); nil != err {
		panic(err)
	}
	// Exec the intended binary
	if err := unix.Exec(argv0, argv, modifyEnv(os.Environ())); nil != err {
		panic(err)
	}
}


text:
/**
 * User: 0xor1    http://github.com/0xor1
 * Date: 16/05/13
 */

(function(NS){

    var ns = window[NS] = window[NS] || {}
        ;

    //just used to wrap the control in a div element with 100% width and height and auto overflow and store the name and icon
    ns.ControlWrapper = function(control, name, icon){

        ns.Dom.call(this,{ class: 'control-wrapper', style: { width: '100%', height: '100%', background: '#fff', overflow: 'auto'} });

        this.control = control;
        this.name = name;
        this.icon = icon;

        this.domRoot().appendChild(control.domRoot());
    };

    ns.ControlWrapper.prototype = Object.create(ns.Dom.prototype);

})(NS);


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.0, user-scalable=0, minimal-ui">
  <meta name="description" content="bootstrap admin template">
  <meta name="author" content="">
  <title>Blog Widgets | Remark Admin Template</title>
  <link rel="apple-touch-icon" href="../../assets/images/apple-touch-icon.png">
  <link rel="shortcut icon" href="../../assets/images/favicon.ico">

  <link rel="stylesheet" href="../../../global/css/bootstrap.min.css">
  <link rel="stylesheet" href="../../../global/css/bootstrap-extend.min.css">
  <link rel="stylesheet" href="../../assets/css/site.min.css">

  <link rel="stylesheet" href="../../../global/vendor/animsition/animsition.css">
  <link rel="stylesheet" href="../../../global/vendor/asscrollable/asScrollable.css">
  <link rel="stylesheet" href="../../../global/vendor/switchery/switchery.css">
  <link rel="stylesheet" href="../../../global/vendor/intro-js/introjs.css">
  <link rel="stylesheet" href="../../../global/vendor/slidepanel/slidePanel.css">
  <link rel="stylesheet" href="../../../global/vendor/flag-icon-css/flag-icon.css">
  <link rel="stylesheet" href="../../../global/vendor/waves/waves.css">
  <link rel="stylesheet" href="../../../global/vendor/plyr/plyr.css">

  <link rel="stylesheet" href="../../../global/fonts/material-design/material-design.min.css">
  <link rel="stylesheet" href="../../../global/fonts/brand-icons/brand-icons.min.css">
  <link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Roboto:300,400,500,300italic'>

      <button type="button" class="navbar-toggle hamburger hamburger-close navbar-toggle-left hided"
      data-toggle="menubar">
        Toggle navigation

      </button>
      <button type="button" class="navbar-toggle collapsed" data-target="#site-navbar-collapse"
      data-toggle="collapse">

      </button>

         Remark

      <button type="button" class="navbar-toggle collapsed" data-target="#site-navbar-search"
      data-toggle="collapse">
        Toggle Search

      </button>

                  Toggle menubar

              Toggle fullscreen

              Toggle Search

            Mega

UI Kit

                              Animation

                              Buttons

                              Colors

                              Dropdowns

                              Icons

                              Lightbox

                              Modals

                              Panels

                              Overlay

                              Tooltips

                              Scrollable

                              Typography

Media
                        4

Accordion

                                Collapsible Group Item #1

                              De moveat laudatur vestra parum doloribus labitur sentire partes, eripuit praesenti
                              congressus ostendit alienae, voluptati ornateque
                              accusamus clamat reperietur convicia albucius.

                                Collapsible Group Item #2

                              Praestabiliorem. Pellat excruciant legantur ullum leniter vacare foris voluptate
                              loco ignavi, credo videretur multoque choro fatemur
                              mortis animus adoptionem, bello statuat expediunt
                              naturales.

                                Collapsible Group Item #3

                              Horum, antiquitate perciperet d conspectum locus obruamus animumque perspici probabis
                              suscipere. Desiderat magnum, contenta poena desiderant
                              concederetur menandri damna disputandum corporum.

                   English

                   French

                   Chinese

                   German

                   Dutch

                 Profile

                 Billing

                 Settings

                 Logout

              5

NOTIFICATIONS

                New 5

A new order has been placed

                          <time class="media-meta" datetime="2015-06-12T20:50:48+08:00">5 hours ago</time>

Completed the task

                          <time class="media-meta" datetime="2015-06-11T18:29:20+08:00">2 days ago</time>

Settings updated

                          <time class="media-meta" datetime="2015-06-11T14:05:00+08:00">2 days ago</time>

Event started

                          <time class="media-meta" datetime="2015-06-10T13:50:18+08:00">3 days ago</time>

Message received

                          <time class="media-meta" datetime="2015-06-10T12:34:48+08:00">3 days ago</time>

                    All notifications

              3

MESSAGES

                New 3

Mary Adams

                            <time datetime="2015-06-17T20:22:05+08:00">30 minutes ago</time>

Anyways, i would like just do it

Caleb Richards

                            <time datetime="2015-06-17T12:30:30+08:00">12 hours ago</time>

I checheck the document. But there seems

June Lane

                            <time datetime="2015-06-16T18:38:40+08:00">2 days ago</time>

Lorem ipsum Id consectetur et minim

Edward Fletcher

                            <time datetime="2015-06-15T20:34:48+08:00">3 days ago</time>

Dolor et irure cupidatat commodo nostrud nostrud.

                    See all messages

        <form role="search">

              <input type="text" class="form-control" name="site-search" placeholder="Search...">
              <button type="button" class="input-search-close icon md-close" data-target="#site-navbar-search"
              data-toggle="collapse" aria-label="Close"></button>

        </form>

General

                Dashboard

                Layouts

                    Menu Collapsed

                    Menu Expended

                    Grid Scaffolding

                    Layout Grid

                    Different Headers

                    Panel Transition

                    Boxed Layout

                    Two Columns

                    Menubar Flipped

                    Menubar Native Scrolling

                    Page Aside Fixed

                Pages

                    Errors

                        400

                        403

                        404

                        500

                        503

                    FAQ

                    Gallery

                    Gallery Grid

                    Search Result

                    Maps

                        Google Maps

                        Vector Maps

                    Maintenance

                    Forgot Password

                    Lockscreen

                    Login

                    Register

                    Login V2

                    Register V2

                      new

                    Login V3

                    Register V3

                    User List

                    Invoice

                    Blank Page

                    Email

                    Code Editor

                    Profile

                    Sitemap

Elements

                Basic UI

                    Panel

                        Panel Structure

                        Panel Actions

                        Panel Portlets

                    Buttons

                    Dropdowns

                    Icons

                    List

                    Tooltip & Popover

                    Modals

                    Tabs & Accordions

                    Images

                    Badges & Labels

                    Progress Bars

                    Carousel

                    Typography

                    Colors

                    Utilties

                Advanced UI

                    Tour

                    Animation

                    Highlight

                    Lightbox

                    Scrollable

                    Rating

                    Context Menu

                    Alertify

                    Masonry

                    Treeview

                    Toastr

                    Vector Maps

                    Google Maps

                    Sortable & Nestable

                    Bootbox & Sweetalert

                Structure

                    Alerts

                    Ribbon

                    Pricing Tables

                    Overlay

                    Cover

                    Simple Timeline

                    Timeline

                    Step

                    Comments

                    Media

                    Chat

                    Testimonials

                    Nav

                    Navbars

                    Blockquotes

                    Pagination

                    Breadcrumbs

                Widgets

                    Statistics Widgets

                    Data Widgets

                    Blog Widgets

                    Chart Widgets

                    Social Widgets

                    Weather Widgets

                Forms

                    General Elements

                    Material Elements

                    Advanced Elements

                    Form Layouts

                    Form Wizard

                    Form Validation

                    Form Masks

                    Form Editable

                    Editors

                        Summernote

                        Markdown

                        Ace Editor

                    Image Cropping

                    File Uploads

                Tables

                    Basic Tables

                    Bootstrap Tables

                    floatThead

                    Responsive Tables

                    Editable Tables

                    jsGrid

                    FooTable

                    DataTables

                Chart

                    Chart.js

                    Gauges

                    Flot

                    Peity

                    Sparkline

                    Morris

                    Chartist.js

                    Rickshaw

                    Pie Progress

                    C3

Apps

                Apps

                    Contacts

                    Calendar

                    Notebook

                    Taskboard

                    Documents

                        Articles

                        Categories

                        Article

                    Forum

                    Message

                    Projects

                    Mailbox

                    Media

                    Work

                    Location

Angular UI

                Angular UI

                  new

              Milestone
              30%

              Release
              60%

              Mailbox

              Calendar

              Contacts

              Media

              Documents

              Project

              Forum

              Dashboard

Blog Widgets

Home

Widgets

Blog

        <button type="button" class="btn btn-sm btn-primary btn-round">
          Settings

        </button>

Possumus fugiendum verborum

Jan 16, 2015

Munere dictum dissentio dicturam mediocriterne honesta, morbi delectus
                rationibus periculum opinor propterea intuemur poetarum efficeretur
                interpretaris, labefactant aeternum reformidans, laborum inquit
                laus. Dolor fana conficiuntque efficerent persequeris quos dicas
                essent. Aristippus tollunt nollem clamat similique corpore gerendarum
                quas initiis, possum.

                READ MORE

                    25

                    18

                    Previous

                    Next

Expleantur manu graecam

Feb 21, 2015

Adiungimus acutum iudicatum aliud aegritudinem, tritani ignavi incidant
                quaeritur transferrem loqueretur delectatio, appetere, eruditi.
                Eamque quaeso diuturnum. Atomis quietae quamquam cadere arbitrantur
                magnam referuntur utramque aristippi, filium eidola, iudicat veniamus,
                noctesque invenerit, alia factorum aristoteli phaedrum parta quicquid
                morbi animadversionem.

                READ MORE

                    63

                    24

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer
                  nec odio. Praesent libero. Sed cursus ante dapibus diam.

Mar 8, 2015

Haeret voluptatibus docere disciplina divitiarum erant certa libenter
                dicere nollem, istam nutu rogatiuncula proficiscuntur viderer versatur
                voluptas, litteras tamque, captet idque. Chaere definitiones scriptorem
                expetendas. Futura sumitur, irridente operosam evertitur personae
                successionem doctissimos, enim exaudita quoquo, terentii cursu
                expediunt similia.

                READ MORE

                    37

                    20

              <audio controls style="width: 100%">

                <source type="audio/mp3" src="https://cdn.selz.com/plyr/1.0/logistics-96-sample.mp3">
                <source type="audio/ogg" src="https://cdn.selz.com/plyr/1.0/logistics-96-sample.ogg">

                Download
              </audio>

Fana graeca amentur

Apr 15, 2015

Appellantur possent inmensae meo beatus angoribus, philosophorum
                terroribus quamvis aiunt praestabiliorem intellegere platone falsarum
                inscientia imperio, synephebos clarorum notissima cognosci odit
                insolens liberalitati saepti efficiat, laetetur motum incurreret.
                Admissum aspernandum, esset filium putamus tuo cernantur vacillare
                atomis referri prorsus aliquod.

                READ MORE

                    123

                    66

              <video poster="../../assets/examples/images/poster.jpg" controls crossorigin>

                <source type="video/mp4" src="https://cdn.selz.com/plyr/1.0/movie.mp4">
                <source type="video/webm" src="https://cdn.selz.com/plyr/1.0/movie.webm">

                <track kind="captions" label="English" srclang="en" src="//cdn.selz.com/plyr/1.0/en.vtt"
                default>

                  Download
              </video>

Consistat conetur verborum

May 15, 2015

Metuamus repudiandae, temeritas multoque utilitate laudari declarant
                inducitur cupiditates, illa maximisque parvam intellegitur cupio
                copulationesque placet infinitum nullo bella. Iucundo voluptate
                physico uterque videor sensus diligenter. Diuturnum graecos utuntur
                voluerint durissimis. Consectetur.

                READ MORE

                    19

                    71

Dolemus vero fames

Jun 15, 2015

Personae romano, deditum, diu veniam totam aequo, voluptaria maluisset
                cotidie gravis quando liberiusque placatae, ars dicitis potius,
                ordiamur aegritudo conquisitis sicine omnibus specie habendus iuvaret
                contemnere brute, concedo potuimus tractatas inquam effici. Praeclara
                responsum provocatus m domo desiderat. Quid natum.

                Read More

                    63

                    26

                  5

                  8

Persequeris malorum Pariter

July 15, 2015

Magnus tuentur consuetudinum impediente praeterierunt volunt noris
                  aegritudo, ultimum macedonum minimum quoniam vocet habendus sitne
                  putet fortitudinem. Vocant equidem nos perfruique distinguique
                  torquatos fugiendus conturbamur, dolorem quisquam reiciat eorumque,
                  maledicta, amicitiae damna conspectum penitus chremes synephebos
                  suscipiantur conectitur. Approbantibus privamur.

                  READ MORE

                By
                Heather Harper
                05, 2015

                  3 Comments

Singulos flagitem cupiditatibus

Geometria eae servare dicat, amicitiam, dixissem principio coniuncta
                adhibuit quantumcumque placeat easque, fidem gloriatur statuat
                perspecta ferantur greges propemodum quieti, turpius vituperatoribus
                complectitur leguntur vidisse assiduitas insolens audeam urbes
                futuris. Arbitrium dicere multavit. Sola nullas. Animus si orestem
                distinguique geometriaque.

                    253

                    115

                   Read More

                June Lane /
                News /
                Jun 21, 2015

Plurimum attico latine

Pervenias fatendum epicureis parentes tollit nostra levis homini
                quietus affirmatis, temperantiamque suscepi electram effectrices
                miser nomini expetendam istis. Aristippi idque, cohaerescent servata
                constituto afficit voluptas debilitatem individua sequi, metu cedentem
                obruamus ignavi motus exercendi partus corrumpit lectorem, desideraturam
                officia incidant.

                    21

                    35

                   Read More

                    July 28, 2015

Iudicem fieri maximeque aliud vacuitate.

                  <button type="button" class="btn btn-info">READ MORE</button>

© 2015 Remark

      Crafted with  by amazingSurge


text:
#pragma once

#include <chrono>

#include "envoy/common/time.h"

#include "common/common/lock_guard.h"
#include "common/common/thread.h"

namespace Envoy {
namespace Extensions {
namespace Tracers {
namespace XRay {

/**
 * Simple token-bucket algorithm that enables counting samples/traces used per second.
 */
class Reservoir {
public:
  /**
   * Creates a new reservoir that allows up to |traces_per_second| samples.
   */
  explicit Reservoir(uint32_t traces_per_second)
      : traces_per_second_(traces_per_second), used_(0) {}

  Reservoir(const Reservoir& other)
      : traces_per_second_(other.traces_per_second_), used_(other.used_),
        time_point_(other.time_point_) {}

  Reservoir& operator=(const Reservoir& other) {
    if (this == &other) {
      return *this;
    }
    traces_per_second_ = other.traces_per_second_;
    used_ = other.used_;
    time_point_ = other.time_point_;
    return *this;
  }

  /**
   * Determines whether all samples have been used up for this particular second.
   * Every second, this reservoir starts over with a full bucket.
   *
   * @param now Used to compare against the last recorded time to determine if it's still within the
   * same second.
   */
  bool take(Envoy::MonotonicTime now) {
    Envoy::Thread::LockGuard lg(sync_);
    const auto diff = now - time_point_;
    if (diff > std::chrono::seconds(1)) {
      used_ = 0;
      time_point_ = now;
    }

    if (used_ >= traces_per_second_) {
      return false;
    }

    ++used_;
    return true;
  }

private:
  uint32_t traces_per_second_;
  uint32_t used_;
  Envoy::MonotonicTime time_point_;
  Envoy::Thread::MutexBasicLockable sync_;
};

} // namespace XRay
} // namespace Tracers
} // namespace Extensions
} // namespace Envoy


text:
<!DOCTYPE html>
<html lang="en">
  <head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="../main.css" rel="stylesheet">
  </head>
  <body>
    <div class="main" style="width:800px; height: 600px; margin: 0 auto; border: #e3e4e5; background:#e3e4e5;">

    </div>
    <script src="../main.js"></script>
  </body>
</html>


text:
ACCEPTED

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

#### Published in
Mycotaxon 19: 147 (1984)

#### Original name
Periconia persicae Schwein., 1822

### Remarks
null


text:
<?php namespace BookStack\Exceptions;

class AuthException extends PrettyException {}