/*

Copyright (C) SYSTAP, LLC DBA Blazegraph 2006-2016.  All rights reserved.

Contact:
     SYSTAP, LLC DBA Blazegraph
     2501 Calvert ST NW #106
     Washington, DC 20008
     licenses@blazegraph.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/
package com.bigdata.btree;

import java.nio.ByteBuffer;
import java.util.UUID;

import com.bigdata.btree.data.ILeafData;
import com.bigdata.io.TestCase3;
import com.bigdata.rawstore.IRawStore;
import com.bigdata.rawstore.RawStoreDelegate;
import com.bigdata.rawstore.SimpleMemoryRawStore;

/**
 * Unit tests for a B+Tree with raw record support enabled (this is where a
 * large byte[] value is written directly onto the backing store
 * rather than being stored within the leaf).
 *
 * @author thompsonbry
 */
public class TestRawRecords extends AbstractBTreeTestCase {

	public TestRawRecords() {
	}

	public TestRawRecords(String name) {
		super(name);
	}

	/**
	 * Unit test for the insert of a large byte[] value into an
	 * index such that it is represented as a raw record on the backing store
	 * rather than inline within the B+Tree leaf.
	 */
	public void test_insertLargeValue() {

        final IRawStore store = new SimpleMemoryRawStore();

        final IndexMetadata metadata = new IndexMetadata(UUID.randomUUID());

        metadata.setRawRecords(true);
        metadata.setMaxRecLen(64);

		final BTree btree = BTree.create(store, metadata);

		assertEquals(64, btree.getMaxRecLen());

		assertTrue(((ILeafData) btree.getRoot()).hasRawRecords());

		final byte[] key = new byte[] { 1 };
		final byte[] val = new byte[btree.getMaxRecLen() + 1];
		r.nextBytes(val);

		// insert an entry under that key.
		assertNull(btree.insert(key, val));

		// examine the root leaf.
		final Leaf root = (Leaf) btree.getRoot();

		// the addr of the raw record.
		final long addr = root.getRawRecord(0/* entryIndex */);

		assertTrue(addr != IRawStore.NULL);

		// read the raw record from the store.
		final ByteBuffer actual = btree.readRawRecord(addr);

		// verify that the expected data were read.
		TestCase3.assertEquals(val, actual);

	}

	/**
	 * Unit test in which we update a small value (inline within the leaf) with
	 * a large value (stored as a raw record).
	 */
	public void test_updateSmallValueWithLargeValue() {

        final IRawStore store = new SimpleMemoryRawStore();

        final IndexMetadata metadata = new IndexMetadata(UUID.randomUUID());

        metadata.setRawRecords(true);
        metadata.setMaxRecLen(64);

		final BTree btree = BTree.create(store, metadata);

		assertEquals(64, btree.getMaxRecLen());

		assertTrue(((ILeafData) btree.getRoot()).hasRawRecords());

		final byte[] key = new byte[] { 1 };
		final byte[] val = new byte[btree.getMaxRecLen() - 1];
		r.nextBytes(val);

		// insert an entry under that key.
		assertNull(btree.insert(key, val));

		// examine the root leaf.
		final Leaf root = (Leaf) btree.getRoot();

		// verify not a raw record.
		assertEquals(IRawStore.NULL,root.getRawRecord(0/* entryIndex */));

		// create a new byte[] which will be handled as a large record.
		final byte[] newval = new byte[btree.getMaxRecLen() + 1];
		r.nextBytes(newval);

		// update the value under that key.
		final byte[] oldval = btree.insert(key, newval);

		// verify the old value was returned.
		assertEquals(val, oldval);

		// the addr of the raw record.
		final long addr = root.getRawRecord(0/* entryIndex */);

		// verify a raw record.
		assertTrue(addr != IRawStore.NULL);

		// read the raw record from the store.
		final ByteBuffer actual = btree.readRawRecord(addr);

		// verify that the expected data were read.
		TestCase3.assertEquals(newval, actual);

	}

	/**
	 * Unit test in which we update a large value (represented directly on the
	 * backing store) with a small value (inline within the leaf). The test
	 * verifies that the original large value is deleted.
	 */
	public void test_updateLargeValueWithSmallValue() {

        final MyRawStore store = new MyRawStore(new SimpleMemoryRawStore());

        final IndexMetadata metadata = new IndexMetadata(UUID.randomUUID());

        metadata.setRawRecords(true);
        metadata.setMaxRecLen(64);

		final BTree btree = BTree.create(store, metadata);

		assertEquals(64, btree.getMaxRecLen());

		assertTrue(((ILeafData) btree.getRoot()).hasRawRecords());

		// create a byte[] which will be handled as a large record.
		final byte[] key = new byte[] { 1 };
		final byte[] val = new byte[btree.getMaxRecLen() + 1];
		r.nextBytes(val);

		// insert an entry under that key.
		assertNull(btree.insert(key, val));

		// examine the root leaf.
		final Leaf root = (Leaf) btree.getRoot();

		// the addr of the raw record.
		final long addr = root.getRawRecord(0/* entryIndex */);

		// verify a raw record.
		assertTrue(addr != IRawStore.NULL);

		// read the raw record from the store.
		final ByteBuffer actual = btree.readRawRecord(addr);

		// verify that the expected data were read.
		TestCase3.assertEquals(val, actual);

		// create a new byte[] which not will be handled as a large record.
		final byte[] newval = new byte[btree.getMaxRecLen() - 1];
		r.nextBytes(newval);

		// setup for the expected delete of the raw record.
		store.expectDelete = addr;

		// update the value under that key.
		final byte[] oldval = btree.insert(key, newval);

		// verify that the record was deleted.
		assertEquals(IRawStore.NULL, store.expectDelete);

		// verify the old value was returned.
		assertEquals(val, oldval);

		// verify not a raw record.
		assertEquals(IRawStore.NULL,root.getRawRecord(0/* entryIndex */));

	}

	/**
	 * Unit test in which we update a large value (represented directly on the
	 * backing store) with another large value (also represented directly on the
	 * store). The test verifies that the original large value is deleted.
	 */
	public void test_updateLargeValueWithLargeValue() {

        final MyRawStore store = new MyRawStore(new SimpleMemoryRawStore());

        final IndexMetadata metadata = new IndexMetadata(UUID.randomUUID());

        metadata.setRawRecords(true);
        metadata.setMaxRecLen(64);

		final BTree btree = BTree.create(store, metadata);

		assertEquals(64, btree.getMaxRecLen());

		assertTrue(((ILeafData) btree.getRoot()).hasRawRecords());

		// create a byte[] which will be handled as a large record.
		final byte[] key = new byte[] { 1 };
		final byte[] val = new byte[btree.getMaxRecLen() + 1];
		r.nextBytes(val);

		// insert an entry under that key.
		assertNull(btree.insert(key, val));

		// examine the root leaf.
		final Leaf root = (Leaf) btree.getRoot();

		// the addr of the raw record.
		final long addr = root.getRawRecord(0/* entryIndex */);

		// verify a raw record.
		assertTrue(addr != IRawStore.NULL);

		// read the raw record from the store.
		final ByteBuffer actual = btree.readRawRecord(addr);

		// verify that the expected data were read.
		TestCase3.assertEquals(val, actual);

		// create a new byte[] which will be handled as a large record.
		final byte[] newval = new byte[btree.getMaxRecLen() + 1];
		r.nextBytes(newval);

		// setup for the expected delete of the raw record.
		store.expectDelete = addr;

		// update the value under that key.
		final byte[] oldval = btree.insert(key, newval);

		// verify that the record was deleted.
		assertEquals(IRawStore.NULL, store.expectDelete);

		// verify the old value was returned.
		assertEquals(val, oldval);

		// the addr of the raw record.
		final long addr2 = root.getRawRecord(0/* entryIndex */);

		// verify a raw record.
		assertTrue(addr2 != IRawStore.NULL);

		// read the raw record from the store.
		final ByteBuffer actual2 = btree.readRawRecord(addr2);

		// verify that the expected data were read.
		TestCase3.assertEquals(newval, actual2);

	}

	/**
	 * Unit test in which we insert a large value (represented directly on the
	 * backing store) and then delete the key under which that value was stored.
	 * The test verifies that the original large value is deleted.
	 */
	public void test_insertLargeValueThenDelete() {

        final MyRawStore store = new MyRawStore(new SimpleMemoryRawStore());

        final IndexMetadata metadata = new IndexMetadata(UUID.randomUUID());

        metadata.setRawRecords(true);
        metadata.setMaxRecLen(64);

		final BTree btree = BTree.create(store, metadata);

		assertEquals(64, btree.getMaxRecLen());

		assertTrue(((ILeafData) btree.getRoot()).hasRawRecords());

		// create a byte[] which will be handled as a large record.
		final byte[] key = new byte[] { 1 };
		final byte[] val = new byte[btree.getMaxRecLen() + 1];
		r.nextBytes(val);

		// insert an entry under that key.
		assertNull(btree.insert(key, val));

		// examine the root leaf.
		final Leaf root = (Leaf) btree.getRoot();

		// the addr of the raw record.
		final long addr = root.getRawRecord(0/* entryIndex */);

		// verify a raw record.
		assertTrue(addr != IRawStore.NULL);

		// read the raw record from the store.
		final ByteBuffer actual = btree.readRawRecord(addr);

		// verify that the expected data were read.
		TestCase3.assertEquals(val, actual);

		// setup for the expected delete of the raw record.
		store.expectDelete = addr;

		// update the value under that key.
		final byte[] oldval = btree.remove(key);

		// verify that the record was deleted.
		assertEquals(IRawStore.NULL, store.expectDelete);

		// verify the old value was returned.
		assertEquals(val, oldval);

	}

	/**
	 * Helper class is used to watch for deletes of raw records from the backing
	 * store.
	 *
	 * @author thompsonbry
	 */
    private static class MyRawStore extends RawStoreDelegate {

        long expectDelete = IRawStore.NULL;

        public MyRawStore(final IRawStore delegate) {
            super(delegate);
        }

        public void delete(long addr) {
            if (expectDelete != IRawStore.NULL) {
                assertEquals(expectDelete, addr);
                expectDelete = IRawStore.NULL;
            }
            delegate.delete(addr);
        }
    }

}

{'repo_name': 'blazegraph/database', 'stars': '501', 'repo_language': 'Java', 'file_name': 'TestOWLSkin.java', 'mime_type': 'text/x-java', 'hash': -788964099183911555, 'source_dataset': 'data'}


//# Population Count (a.k.a. Hamming Weight)

// Returns the number of bits set in the input word.  The popcount is always
// log2(N)+1 bits wide given an N-bit input word.  (e.g.: a 32-bit
// word has a 6-bit popcount, so you can represent the integer "32")

// The algorithm is straightforward: split the input word into bit pairs and
// count the number of bits set in each pair using a lookup table, then extend
// each count to log2(N)+1 bits, and sum all the counts one after
// the other, which expresses a chain of (N/2)-1 small adders (e.g.: 15 6-bit
// adders for a 32-bit input word) rather than the obvious tree of adders,
// which would require more difficult, recursive code. However, the CAD tool
// can reduce the logic (most of the added bits are constant zeros) and
// generate a tree of LUTs and adders with a carry-chain log2(N)+1
// bits long, which is the length of the expected final adder were this a tree
// of adders.

// There are many applications of population count. Think of it as mapping
// bitmasks to the integers, allowing us to use arithmetic operations to
// determine properties.

//## Leaning on Logic Optimization to Reduce User Errors

// When I originally wrote this, the POPCOUNT_WIDTH was a module parameter
// rather than being calculated internally, as the enclosing module needs to
// know the width of the output, so it should calculate log2(N)+1
// and pass it to this module. If the value is smaller than that, then the
// missing bits will not be computed. If the value is larger, the extra bits
// will be always zero.

// However, it turns out that it's error-prone to expect the user to remember
// that the output width should be log2(N)+1 and not
// log2(N). It is easier to leave the output width at WORD_WIDTH as
// this simplifies code and the post-elaboration diagram, and the logic
// optimization of the successive additions automatically infers the
// log2(N)+1 output width and eliminates the redundant logic.
// I left the code as-is, and hardwired the POPCOUNT_WIDTH parameter instead.

//## Portability and Readability

// This implementation depends heavily on Verilog's vector part select
// operation, which might cause difficulties when porting to other HDLs, and
// also means you should read it carefully as some lines are long and have
// a lot of bits being moved around between vectors, but this design choice
// also makes the code easily parameterizable.

`default_nettype none

module Population_Count
#(
    parameter WORD_WIDTH        = 0,

    // Don't set at instantiation (see above)
    parameter POPCOUNT_WIDTH    = WORD_WIDTH
)
(
    input   wire    [WORD_WIDTH-1:0]        word_in,
    output  reg     [POPCOUNT_WIDTH-1:0]    count_out
);

    initial begin
        count_out = {POPCOUNT_WIDTH{1'b0}};
    end

// This part of the code never changes regardless of input word width, so to
// keep the code concise, I'll break the rule of always naming constants and
// instead use the literals: a 4-entry table of 2-bit values, converting the
// integer described by a pair of bits into an integer describing the number
// of bits set in that pair of bits (the "paircount"). Since both have 2 bits,
// we can conveniently just replace the input bit pairs by their paircounts.
// We put a ramstyle attribute to tell the CAD tool this should NOT be
// synthesized as a memory, but just as LUT logic. It works without it, but
// I have seen my CAD tool randomly decide to use Block RAM instead.

    (* ramstyle = "logic" *)        // Quartus
    (* ram_style = "distributed" *) // Vivado

    reg [1:0] popcount2bits [0:3];

    initial begin
        popcount2bits[0] = 2'd0;
        popcount2bits[1] = 2'd1;
        popcount2bits[2] = 2'd1;
        popcount2bits[3] = 2'd2;
    end

// Then let's calculate how many pairs of bits we have to process, and the
// zero-padding we will use to extend them to POPCOUNT_WIDTH, so all the
// adders work on the same number of bits. Using the maximum number of
// bits is a lot easier than figuring out the necessary adder bit width at
// each step, and since the padding is constant zero, it wil be optimized
// away during synthesis.

    localparam PAIR_COUNT       = WORD_WIDTH / 2;
    localparam PAIR_WORD_WIDTH  = PAIR_COUNT * 2;
    localparam PAD_WIDTH        = POPCOUNT_WIDTH - 2;
    localparam PAD              = {PAD_WIDTH{1'b0}};

// Then define our working space: a vector of paircounts holding all bit
// pairs (might be less than WORD_WIDTH if its value is odd), and
// a vector of popcount words, one popcount for each paircount. We will
// accumulate popcounts and paircounts into each successive popcount word,
// and the last popcount will hold our final result.

// Veril\*tor can't quite see what we're doing here, so we tell it to ignore
// the apparent combinational loop. (The "*" is so that program doesn't see
// this comment as an erroneous directive.)

    reg [PAIR_WORD_WIDTH-1:0]               paircount   = {PAIR_WORD_WIDTH{1'b0}};
    // verilator lint_off UNOPTFLAT
    reg [(POPCOUNT_WIDTH*PAIR_COUNT)-1:0]   popcount    = {POPCOUNT_WIDTH*PAIR_COUNT{1'b0}};
    // verilator lint_on  UNOPTFLAT

// Finally, if WORD_WIDTH is odd, we will have to account for the last bit not
// in a pair. So let's compute that flag now.

    localparam WORD_WIDTH_IS_ODD = (WORD_WIDTH % 2) == 1;

// Translate the initial bit pair into a paircount and then pad it into
// a popcount value. Doing this also peels out the first iteration of the
// following loop so we can refer to the previous loop index without having
// a negative number (which is not allowed).

    integer i;

    always @(*) begin
        paircount[0 +: 2]               = popcount2bits[word_in[0 +: 2]];
        popcount[0 +: POPCOUNT_WIDTH]   = {PAD,paircount[0 +: 2]};

// Now repeat for all remaining bit pairs, but also accumulate the popcount
// from the previous iteration.  Note the start index due to the peeled-out
// first iteration.

        for(i=1; i < PAIR_COUNT; i=i+1) begin : per_paircount
            paircount[2*i +: 2]                          = popcount2bits[word_in[2*i +: 2]];
            popcount[POPCOUNT_WIDTH*i +: POPCOUNT_WIDTH] = {PAD,paircount[2*i +: 2]} + popcount[POPCOUNT_WIDTH*(i-1) +: POPCOUNT_WIDTH];
        end

// If the input word width was odd, pad up the last bit not in a pair to the
// popcount width and add it to the last popcount.

        if (WORD_WIDTH_IS_ODD == 1'b1) begin
            popcount[POPCOUNT_WIDTH*(PAIR_COUNT-1) +: POPCOUNT_WIDTH] = popcount[POPCOUNT_WIDTH*(PAIR_COUNT-1) +: POPCOUNT_WIDTH] + {{POPCOUNT_WIDTH-1{1'b0}},word_in[WORD_WIDTH-1]};
        end

// Then the last popcount is the total for the whole input word.

        count_out = popcount[POPCOUNT_WIDTH*(PAIR_COUNT-1) +: POPCOUNT_WIDTH];
    end

endmodule

{'repo_name': 'laforest/FPGADesignElements', 'stars': '126', 'repo_language': 'HTML', 'file_name': 'Counter_Gray_Tb.sv', 'mime_type': 'text/plain', 'hash': 8978792651579770706, 'source_dataset': 'data'}


fileFormatVersion: 2
guid: 9ad4faf8f438d034a9eede7ca4087f55
timeCreated: 1561927710
licenseType: Free
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:

{'repo_name': 'radiatoryang/hedera', 'stars': '432', 'repo_language': 'C#', 'file_name': 'Simplifier2D.cs.meta', 'mime_type': 'text/plain', 'hash': -4889574296221796199, 'source_dataset': 'data'}


<?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Command;

use Composer\Json\JsonFile;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
use Composer\Package\PackageInterface;
use Composer\Repository\RepositoryInterface;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * @author Benoît Merlet <benoit.merlet@gmail.com>
 */
class LicensesCommand extends BaseCommand
{
    protected function configure()
    {
        $this
            ->setName('licenses')
            ->setDescription('Show information about licenses of dependencies')
            ->setDefinition(array(
                new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text or json', 'text'),
                new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables search in require-dev packages.'),
            ))
            ->setHelp(<<<EOT
The license command displays detailed information about the licenses of
the installed dependencies.

EOT
            )
        ;
    }

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

        $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'licenses', $input, $output);
        $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);

        $root = $composer->getPackage();
        $repo = $composer->getRepositoryManager()->getLocalRepository();

        if ($input->getOption('no-dev')) {
            $packages = $this->filterRequiredPackages($repo, $root);
        } else {
            $packages = $this->appendPackages($repo->getPackages(), array());
        }

        ksort($packages);
        $io = $this->getIO();

        switch ($format = $input->getOption('format')) {
            case 'text':
                $io->write('Name: <comment>'.$root->getPrettyName().'</comment>');
                $io->write('Version: <comment>'.$root->getFullPrettyVersion().'</comment>');
                $io->write('Licenses: <comment>'.(implode(', ', $root->getLicense()) ?: 'none').'</comment>');
                $io->write('Dependencies:');
                $io->write('');

                $table = new Table($output);
                $table->setStyle('compact');
                $table->getStyle()->setVerticalBorderChar('');
                $table->getStyle()->setCellRowContentFormat('%s  ');
                $table->setHeaders(array('Name', 'Version', 'License'));
                foreach ($packages as $package) {
                    $table->addRow(array(
                        $package->getPrettyName(),
                        $package->getFullPrettyVersion(),
                        implode(', ', $package->getLicense()) ?: 'none',
                    ));
                }
                $table->render();
                break;

            case 'json':
                $dependencies = array();
                foreach ($packages as $package) {
                    $dependencies[$package->getPrettyName()] = array(
                        'version' => $package->getFullPrettyVersion(),
                        'license' => $package->getLicense(),
                    );
                }

                $io->write(JsonFile::encode(array(
                    'name'         => $root->getPrettyName(),
                    'version'      => $root->getFullPrettyVersion(),
                    'license'      => $root->getLicense(),
                    'dependencies' => $dependencies,
                )));
                break;

            default:
                throw new \RuntimeException(sprintf('Unsupported format "%s".  See help for supported formats.', $format));
        }
    }

    /**
     * Find package requires and child requires
     *
     * @param  RepositoryInterface $repo
     * @param  PackageInterface    $package
     * @param  array               $bucket
     * @return array
     */
    private function filterRequiredPackages(RepositoryInterface $repo, PackageInterface $package, $bucket = array())
    {
        $requires = array_keys($package->getRequires());

        $packageListNames = array_keys($bucket);
        $packages = array_filter(
            $repo->getPackages(),
            function ($package) use ($requires, $packageListNames) {
                return in_array($package->getName(), $requires) && !in_array($package->getName(), $packageListNames);
            }
        );

        $bucket = $this->appendPackages($packages, $bucket);

        foreach ($packages as $package) {
            $bucket = $this->filterRequiredPackages($repo, $package, $bucket);
        }

        return $bucket;
    }

    /**
     * Adds packages to the package list
     *
     * @param  array $packages the list of packages to add
     * @param  array $bucket   the list to add packages to
     * @return array
     */
    public function appendPackages(array $packages, array $bucket)
    {
        foreach ($packages as $package) {
            $bucket[$package->getName()] = $package;
        }

        return $bucket;
    }
}

{'repo_name': 'tableless/tableless-old-wp', 'stars': '144', 'repo_language': 'PHP', 'file_name': 'custom-header.js', 'mime_type': 'text/plain', 'hash': -3447001277051868600, 'source_dataset': 'data'}


<?= Contao\Message::generate() ?>

  <a href="<?= Contao\StringUtil::ampersand($this->backUrl) ?>" class="header_back" title="<?= Contao\StringUtil::specialchars($this->backBTTitle) ?>" accesskey="b"><?= $this->backBT ?>

<form id="<?= $this->formId ?>" class="tl_form tl_edit_form" method="post" enctype="multipart/form-data">

    <input type="hidden" name="FORM_SUBMIT" value="<?= $this->formId ?>">
    <input type="hidden" name="REQUEST_TOKEN" value="<?= REQUEST_TOKEN ?>">
    <input type="hidden" name="MAX_FILE_SIZE" value="<?= $this->fileMaxSize ?>">

    <fieldset class="tl_tbox nolegend">

<?= $this->separatorLabel ?>

        <select name="separator" id="separator" class="tl_select" onfocus="Backend.getScrollOffset()">
          <?php foreach ($this->separators as $separator): ?>
            <option value="<?= $separator['value'] ?>"><?= $separator['label'] ?></option>
          <?php endforeach; ?>
        </select>
        <?php if (isset($this->separatorHelp)): ?>

<?= $this->separatorHelp ?>

        <?php endif; ?>

<?= $this->sourceLabel ?>

        <?= $this->uploader ?>
        <?php if (isset($this->sourceHelp)): ?>

<?= $this->sourceHelp ?>

        <?php endif; ?>

    </fieldset>

      <button type="submit" name="save" id="save" class="tl_submit" accesskey="s"><?= $this->submitLabel ?></button>

</form>

{'repo_name': 'contao/core-bundle', 'stars': '114', 'repo_language': 'PHP', 'file_name': 'config', 'mime_type': 'text/plain', 'hash': 6349553789325596619, 'source_dataset': 'data'}


/////////////////////////////////////////////////////////////////////////////
// Copyright (c) Electronic Arts Inc. All rights reserved.
/////////////////////////////////////////////////////////////////////////////

#include "EASTLTest.h"

EA_DISABLE_VC_WARNING(4623 4625 4413 4510)

#include <EASTL/tuple.h>

#if EASTL_TUPLE_ENABLED

namespace TestTupleInternal
{

struct DefaultConstructibleType
{
	static const int defaultVal = 0x1EE7C0DE;
	DefaultConstructibleType() : mVal(defaultVal) {}
	int mVal;
};

struct OperationCountingType
{
	OperationCountingType() : mVal() { ++mDefaultConstructorCalls; }
	OperationCountingType(int x) : mVal(x) { ++mIntConstructorCalls; }
	OperationCountingType(const OperationCountingType& x) : mVal(x.mVal) { ++mCopyConstructorCalls; }
	OperationCountingType(OperationCountingType&& x) : mVal(x.mVal)
	{
		++mMoveConstructorCalls;
		x.mVal = 0;
	}
	OperationCountingType& operator=(const OperationCountingType& x)
	{
		mVal = x.mVal;
		++mCopyAssignmentCalls;
		return *this;
	}
	OperationCountingType& operator=(OperationCountingType&& x)
	{
		mVal = x.mVal;
		x.mVal = 0;
		++mMoveAssignmentCalls;
		return *this;
	}
	~OperationCountingType() { ++mDestructorCalls; }

	int mVal;

	static void ResetCounters()
	{
		mDefaultConstructorCalls = 0;
		mIntConstructorCalls = 0;
		mCopyConstructorCalls = 0;
		mMoveConstructorCalls = 0;
		mCopyAssignmentCalls = 0;
		mMoveAssignmentCalls = 0;
		mDestructorCalls = 0;
	}

	static int mDefaultConstructorCalls;
	static int mIntConstructorCalls;
	static int mCopyConstructorCalls;
	static int mMoveConstructorCalls;
	static int mCopyAssignmentCalls;
	static int mMoveAssignmentCalls;
	static int mDestructorCalls;
};

int OperationCountingType::mDefaultConstructorCalls = 0;
int OperationCountingType::mIntConstructorCalls = 0;
int OperationCountingType::mCopyConstructorCalls = 0;
int OperationCountingType::mMoveConstructorCalls = 0;
int OperationCountingType::mCopyAssignmentCalls = 0;
int OperationCountingType::mMoveAssignmentCalls = 0;
int OperationCountingType::mDestructorCalls = 0;

}  // namespace TestTupleInternal

int TestTuple()
{
	using namespace eastl;
	using namespace TestTupleInternal;

	int nErrorCount = 0;

	static_assert(tuple_size<tuple<int>>::value == 1, "tuple_size<tuple<T>> test failed.");
	static_assert(tuple_size<const tuple<int>>::value == 1, "tuple_size<const tuple<T>> test failed.");
	static_assert(tuple_size<const tuple<const int>>::value == 1, "tuple_size<const tuple<const T>> test failed.");
	static_assert(tuple_size<volatile tuple<int>>::value == 1, "tuple_size<volatile tuple<T>> test failed.");
	static_assert(tuple_size<const volatile tuple<int>>::value == 1, "tuple_size<const volatile tuple<T>> test failed.");
	static_assert(tuple_size<tuple<int, float, bool>>::value == 3, "tuple_size<tuple<T, T, T>> test failed.");

	static_assert(is_same<tuple_element_t<0, tuple<int>>, int>::value, "tuple_element<I, T> test failed.");
	static_assert(is_same<tuple_element_t<1, tuple<float, int>>, int>::value, "tuple_element<I, T> test failed.");
	static_assert(is_same<tuple_element_t<1, tuple<float, const int>>, const int>::value, "tuple_element<I, T> test failed.");
	static_assert(is_same<tuple_element_t<1, tuple<float, volatile int>>, volatile int>::value, "tuple_element<I, T> test failed.");
	static_assert(is_same<tuple_element_t<1, tuple<float, const volatile int>>, const volatile int>::value, "tuple_element<I, T> test failed.");
	static_assert(is_same<tuple_element_t<1, tuple<float, int&>>, int&>::value, "tuple_element<I, T> test failed.");

	{
		tuple<int> aSingleElementTuple(1);
		EATEST_VERIFY(get<0>(aSingleElementTuple) == 1);
		get<0>(aSingleElementTuple) = 2;
		EATEST_VERIFY(get<0>(aSingleElementTuple) == 2);
		get<int>(aSingleElementTuple) = 3;
		EATEST_VERIFY(get<int>(aSingleElementTuple) == 3);

		const tuple<int> aConstSingleElementTuple(3);
		EATEST_VERIFY(get<0>(aConstSingleElementTuple) == 3);
		EATEST_VERIFY(get<int>(aConstSingleElementTuple) == 3);

		tuple<DefaultConstructibleType> aDefaultConstructedTuple;
		EATEST_VERIFY(get<0>(aDefaultConstructedTuple).mVal == DefaultConstructibleType::defaultVal);

		OperationCountingType::ResetCounters();
		tuple<OperationCountingType> anOperationCountingTuple;
		EATEST_VERIFY(OperationCountingType::mDefaultConstructorCalls == 1 &&
					  get<0>(anOperationCountingTuple).mVal == 0);
		get<0>(anOperationCountingTuple).mVal = 1;
		tuple<OperationCountingType> anotherOperationCountingTuple(anOperationCountingTuple);
		EATEST_VERIFY(OperationCountingType::mDefaultConstructorCalls == 1 &&
					  OperationCountingType::mCopyConstructorCalls == 1 &&
					  get<0>(anotherOperationCountingTuple).mVal == 1);
		get<0>(anOperationCountingTuple).mVal = 2;
		anotherOperationCountingTuple = anOperationCountingTuple;
		EATEST_VERIFY(
			OperationCountingType::mDefaultConstructorCalls == 1 && OperationCountingType::mCopyConstructorCalls == 1 &&
			OperationCountingType::mCopyAssignmentCalls == 1 && get<0>(anotherOperationCountingTuple).mVal == 2);

		OperationCountingType::ResetCounters();
		tuple<OperationCountingType> yetAnotherOperationCountingTuple(OperationCountingType(5));
		EATEST_VERIFY(
			OperationCountingType::mMoveConstructorCalls == 1 && OperationCountingType::mDefaultConstructorCalls == 0 &&
			OperationCountingType::mCopyConstructorCalls == 0 && get<0>(yetAnotherOperationCountingTuple).mVal == 5);
	}

	EATEST_VERIFY(OperationCountingType::mDestructorCalls == 4);

	{
		// Test constructor
		tuple<int, float, bool> aTuple(1, 1.0f, true);
		EATEST_VERIFY(get<0>(aTuple) == 1);
		EATEST_VERIFY(get<1>(aTuple) == 1.0f);
		EATEST_VERIFY(get<2>(aTuple) == true);
		EATEST_VERIFY(get<int>(aTuple) == 1);
		EATEST_VERIFY(get<float>(aTuple) == 1.0f);
		EATEST_VERIFY(get<bool>(aTuple) == true);

		get<1>(aTuple) = 2.0f;
		EATEST_VERIFY(get<1>(aTuple) == 2.0f);

		// Test copy constructor
		tuple<int, float, bool> anotherTuple(aTuple);
		EATEST_VERIFY(get<0>(anotherTuple) == 1 && get<1>(anotherTuple) == 2.0f && get<2>(anotherTuple) == true);

		// Test copy assignment
		tuple<int, float, bool> yetAnotherTuple(2, 3.0f, true);
		EATEST_VERIFY(get<0>(yetAnotherTuple) == 2 && get<1>(yetAnotherTuple) == 3.0f &&
					  get<2>(yetAnotherTuple) == true);
		yetAnotherTuple = anotherTuple;
		EATEST_VERIFY(get<0>(yetAnotherTuple) == 1 && get<1>(yetAnotherTuple) == 2.0f &&
					  get<2>(yetAnotherTuple) == true);

		// Test converting 'copy' constructor (from a tuple of different type whose members are each convertible)
		tuple<double, double, bool> aDifferentTuple(aTuple);
		EATEST_VERIFY(get<0>(aDifferentTuple) == 1.0 && get<1>(aDifferentTuple) == 2.0 &&
					  get<2>(aDifferentTuple) == true);

		// Test converting assignment operator (from a tuple of different type whose members are each convertible)
		tuple<double, double, bool> anotherDifferentTuple;
		EATEST_VERIFY(get<0>(anotherDifferentTuple) == 0.0 && get<1>(anotherDifferentTuple) == 0.0 &&
					  get<2>(anotherDifferentTuple) == false);
		anotherDifferentTuple = anotherTuple;
		EATEST_VERIFY(get<0>(anotherDifferentTuple) == 1.0 && get<1>(anotherDifferentTuple) == 2.0 &&
					  get<2>(anotherDifferentTuple) == true);

		// Test default initialization (built in types should be value initialized rather than default initialized)
		tuple<int, float, bool> aDefaultInitializedTuple;
		EATEST_VERIFY(get<0>(aDefaultInitializedTuple) == 0 && get<1>(aDefaultInitializedTuple) == 0.0f &&
					  get<2>(aDefaultInitializedTuple) == false);
	}

	{
		// Test some other cases with typed-getter
		tuple<double, double, bool> aTupleWithRepeatedType(1.0f, 2.0f, true);
		EATEST_VERIFY(get<bool>(aTupleWithRepeatedType) == true);

		tuple<double, bool, double> anotherTupleWithRepeatedType(1.0f, true, 2.0f);
		EATEST_VERIFY(get<bool>(anotherTupleWithRepeatedType) == true);

		tuple<bool, double, double> yetAnotherTupleWithRepeatedType(true, 1.0f, 2.0f);
		EATEST_VERIFY(get<bool>(anotherTupleWithRepeatedType) == true);

		struct floatOne { float val; };
		struct floatTwo { float val; };
		tuple<floatOne, floatTwo> aTupleOfStructs({ 1.0f }, { 2.0f } );
		EATEST_VERIFY(get<floatOne>(aTupleOfStructs).val == 1.0f);
		EATEST_VERIFY(get<floatTwo>(aTupleOfStructs).val == 2.0f);

		const tuple<double, double, bool> aConstTuple(aTupleWithRepeatedType);
		const bool& constRef = get<bool>(aConstTuple);
		EATEST_VERIFY(constRef == true);

		const bool&& constRval = get<bool>(eastl::move(aTupleWithRepeatedType));
		EATEST_VERIFY(constRval == true);
	}

	{
		tuple<int, float> aTupleWithDefaultInit(1, {});

		// tuple construction from pair
		pair<int, float> aPair(1, 2.0f);
		tuple<int, float> aTuple(aPair);
		EATEST_VERIFY(get<0>(aTuple) == 1 && get<1>(aTuple) == 2.0f);
		tuple<double, double> anotherTuple(aPair);
		EATEST_VERIFY(get<0>(anotherTuple) == 1.0 && get<1>(anotherTuple) == 2.0);
		anotherTuple = make_pair(2, 3);
		EATEST_VERIFY(get<0>(anotherTuple) == 2.0 && get<1>(anotherTuple) == 3.0);

		// operators: ==, !=, <
		anotherTuple = aTuple;
		EATEST_VERIFY(aTuple == anotherTuple);
		EATEST_VERIFY(!(aTuple < anotherTuple) && !(anotherTuple < aTuple));
		tuple<double, double> aDefaultInitTuple;
		EATEST_VERIFY(aTuple != aDefaultInitTuple);
		EATEST_VERIFY(aDefaultInitTuple < aTuple);

		tuple<int, int, int> lesserTuple(1, 2, 3);
		tuple<int, int, int> greaterTuple(1, 2, 4);
		EATEST_VERIFY(lesserTuple < greaterTuple && !(greaterTuple < lesserTuple) && greaterTuple > lesserTuple &&
					  !(lesserTuple > greaterTuple));

		tuple<int, float, TestObject> valTup(2, 2.0f, TestObject(2));
		tuple<int&, float&, TestObject&> refTup(valTup);
		tuple<const int&, const float&, const TestObject&> constRefTup(valTup);

		EATEST_VERIFY(get<0>(refTup) == get<0>(valTup));
		EATEST_VERIFY(get<1>(refTup) == get<1>(valTup));
		EATEST_VERIFY(refTup == valTup);
		EATEST_VERIFY(get<0>(refTup) == get<0>(constRefTup));
		EATEST_VERIFY(get<1>(refTup) == get<1>(constRefTup));
		EATEST_VERIFY(constRefTup == valTup);
		EATEST_VERIFY(constRefTup == refTup);

		// swap
		swap(lesserTuple, greaterTuple);
		EATEST_VERIFY(get<2>(lesserTuple) == 4 && get<2>(greaterTuple) == 3);
		swap(greaterTuple, lesserTuple);
		EATEST_VERIFY(lesserTuple < greaterTuple);
	}

	{
		// Test construction of tuple containing a move only type
		static_assert(is_constructible<MoveOnlyType, MoveOnlyType>::value, "is_constructible type trait giving confusing answers.");
		static_assert(is_constructible<MoveOnlyType, MoveOnlyType&&>::value, "is_constructible type trait giving wrong answers.");
		static_assert(is_constructible<MoveOnlyType&&, MoveOnlyType&&>::value, "is_constructible type trait giving bizarre answers.");
		tuple<MoveOnlyType> aTupleWithMoveOnlyMember(1);
		EATEST_VERIFY(get<0>(aTupleWithMoveOnlyMember).mVal == 1);
		get<0>(aTupleWithMoveOnlyMember) = MoveOnlyType(2);
		EATEST_VERIFY(get<0>(aTupleWithMoveOnlyMember).mVal == 2);

		tuple<const MoveOnlyType&> aTupleWithRefToMoveOnlyMember(aTupleWithMoveOnlyMember);
		EATEST_VERIFY(get<0>(aTupleWithRefToMoveOnlyMember).mVal == 2);

		tuple<const MoveOnlyType&> aTupleWithConstRefToGetMoveOnly(get<0>(aTupleWithMoveOnlyMember));
		EATEST_VERIFY(get<0>(aTupleWithConstRefToGetMoveOnly).mVal == 2);

		tuple<MoveOnlyType&> aTupleWithRefToGetMoveOnly(get<0>(aTupleWithMoveOnlyMember));
		EATEST_VERIFY(get<0>(aTupleWithRefToGetMoveOnly).mVal == 2);
	}

	{
		// Tuple helpers

		// make_tuple
		auto makeTuple = make_tuple(1, 2.0, true);
		EATEST_VERIFY(get<0>(makeTuple) == 1 && get<1>(makeTuple) == 2.0 && get<2>(makeTuple) == true);

		// TODO: reference_wrapper implementation needs to be finished to enable this code
		{
			int a = 2;
			float b = 3.0f;
			auto makeTuple2 = make_tuple(ref(a), b);
			get<0>(makeTuple2) = 3;
			get<1>(makeTuple2) = 4.0f;
			EATEST_VERIFY(get<0>(makeTuple2) == 3 && get<1>(makeTuple2) == 4.0f && a == 3 && b == 3.0f);
		}

		// forward_as_tuple
		{
			auto forwardTest = [](tuple<MoveOnlyType&&, MoveOnlyType&&> x) -> tuple<MoveOnlyType, MoveOnlyType>
			{
				return tuple<MoveOnlyType, MoveOnlyType>(move(x));
			};

			tuple<MoveOnlyType, MoveOnlyType> aMovableTuple(
			    forwardTest(forward_as_tuple(MoveOnlyType(1), MoveOnlyType(2))));

			EATEST_VERIFY(get<0>(aMovableTuple).mVal == 1 && get<1>(aMovableTuple).mVal == 2);
		}

		{
			// tie
			int a = 0;
			double b = 0.0f;
			static_assert(is_assignable<const Internal::ignore_t&, int>::value, "ignore_t not assignable");
			static_assert(Internal::TupleAssignable<tuple<const Internal::ignore_t&>, tuple<int>>::value, "Not assignable");
			tie(a, ignore, b) = make_tuple(1, 3, 5);
			EATEST_VERIFY(a == 1 && b == 5.0f);

			// tuple_cat
			auto tcatRes = tuple_cat(make_tuple(1, 2.0f), make_tuple(3.0, true));
			EATEST_VERIFY(get<0>(tcatRes) == 1 && get<1>(tcatRes) == 2.0f && get<2>(tcatRes) == 3.0 &&
					get<3>(tcatRes) == true);

			auto tcatRes2 = tuple_cat(make_tuple(1, 2.0f), make_tuple(3.0, true), make_tuple(5u, '6'));
			EATEST_VERIFY(get<0>(tcatRes2) == 1 && get<1>(tcatRes2) == 2.0f && get<2>(tcatRes2) == 3.0 &&
					get<3>(tcatRes2) == true && get<4>(tcatRes2) == 5u && get<5>(tcatRes2) == '6');

			auto aCattedRefTuple = tuple_cat(make_tuple(1), tie(a, ignore, b));
			get<1>(aCattedRefTuple) = 2;
			EATEST_VERIFY(a == 2);
		}

		{
			// Empty tuple
			tuple<> emptyTuple;
			EATEST_VERIFY(tuple_size<decltype(emptyTuple)>::value == 0);
			emptyTuple = make_tuple();
			auto anotherEmptyTuple = make_tuple();
			swap(anotherEmptyTuple, emptyTuple);
		}
	}

	// test piecewise_construct
	{
		{
			struct local
			{
				local() = default;
				local(int a, int b) : mA(a), mB(b) {}

				int mA = 0;
				int mB = 0;
			};

			auto t = make_tuple(42, 43);

			eastl::pair<local, local> p(eastl::piecewise_construct, t, t);

			EATEST_VERIFY(p.first.mA  == 42);
			EATEST_VERIFY(p.second.mA == 42);
			EATEST_VERIFY(p.first.mB  == 43);
			EATEST_VERIFY(p.second.mB == 43);
		}

		{
			struct local
			{
				local() = default;
				local(int a, int b, int c, int d) : mA(a), mB(b), mC(c), mD(d) {}

				int mA = 0;
				int mB = 0;
				int mC = 0;
				int mD = 0;
			};

			auto t = make_tuple(42, 43, 44, 45);

			eastl::pair<local, local> p(eastl::piecewise_construct, t, t);

			EATEST_VERIFY(p.first.mA  == 42);
			EATEST_VERIFY(p.second.mA == 42);

			EATEST_VERIFY(p.first.mB  == 43);
			EATEST_VERIFY(p.second.mB == 43);

			EATEST_VERIFY(p.first.mC  == 44);
			EATEST_VERIFY(p.second.mC == 44);

			EATEST_VERIFY(p.first.mD  == 45);
			EATEST_VERIFY(p.second.mD == 45);
		}

		{
			struct local1
			{
				local1() = default;
				local1(int a) : mA(a) {}
				int mA = 0;
			};

			struct local2
			{
				local2() = default;
				local2(char a) : mA(a) {}
				char mA = 0;
			};

			auto t1 = make_tuple(42);
			auto t2 = make_tuple('a');

			eastl::pair<local1, local2> p(eastl::piecewise_construct, t1, t2);

			EATEST_VERIFY(p.first.mA  == 42);
			EATEST_VERIFY(p.second.mA == 'a');
		}
	}

	// apply
	{
		// test with tuples
		{
			{
				auto result = eastl::apply([](int i) { return i; }, make_tuple(1));
				EATEST_VERIFY(result == 1);
			}

			{
				auto result = eastl::apply([](int i, int j) { return i + j; }, make_tuple(1, 2));
				EATEST_VERIFY(result == 3);
			}

			{
				auto result = eastl::apply([](int i, int j, int k, int m) { return i + j + k + m; }, make_tuple(1, 2, 3, 4));
				EATEST_VERIFY(result == 10);
			}
		}

		// test with pair
		{
			auto result = eastl::apply([](int i, int j) { return i + j; }, make_pair(1, 2));
			EATEST_VERIFY(result == 3);
		}

		// test with array
		{
			// TODO(rparolin):
			// eastl::array requires eastl::get support before we can support unpacking eastl::arrays with eastl::apply.
			//
			// {
			//     auto result = eastl::apply([](int i) { return i; }, eastl::array<int, 1>{1});
			//     EATEST_VERIFY(result == 1);
			// }
			// {
			//     auto result = eastl::apply([](int i, int j) { return i + j; }, eastl::array<int, 2>{1,2});
			//     EATEST_VERIFY(result == 3);
			// }
			// {
			//     auto result = eastl::apply([](int i, int j, int k, int m) { return i + j + k + m; }, eastl::array<int, 4>{1, 2, 3, 4});
			//     EATEST_VERIFY(result == 10);
			// }
		}
	}

	// Compilation test to make sure that the conditionally-explicit cast works
	{
		eastl::tuple<int, float, TestObject> arrayTup[] = {
			{1, 1.0f, TestObject(1)},
			{2, 2.0f, TestObject(2)},
			{3, 3.0f, TestObject(3)},
			{4, 4.0f, TestObject(4)}
		};
		(void)arrayTup;

#if false
		// the following code should not compile with conditionally-explicit behaviour (but does with fully implicit behaviour)
		eastl::tuple<eastl::vector<float>, float> arrayOfArrayTup[] = {
			{1.0f, 1.0f},
			{2.0f, 2.0f}
		};

		eastl::tuple<eastl::vector<int>, float> arrayOfArrayTup2[] = {
			{1, 1.0f},
			{2, 2.0f}
		};
#endif
	}

	#ifndef EA_COMPILER_NO_STRUCTURED_BINDING
	// tuple structured bindings test
	{
		eastl::tuple<int, int, int> t = {1,2,3};
		auto [x,y,z] = t;
		EATEST_VERIFY(x == 1);
		EATEST_VERIFY(y == 2);
		EATEST_VERIFY(z == 3);
	}
	#endif

	// user regression for tuple_cat
	{
		void* empty = nullptr;
		auto t = eastl::make_tuple(empty, true);
		auto tc = eastl::tuple_cat(eastl::make_tuple("asd", 1), t);

		static_assert(eastl::is_same_v<decltype(tc), eastl::tuple<const char*, int, void*, bool>>, "type mismatch");

		EATEST_VERIFY(eastl::string("asd") == eastl::get<0>(tc));
		EATEST_VERIFY(eastl::get<1>(tc) == 1);
		EATEST_VERIFY(eastl::get<2>(tc) == nullptr);
		EATEST_VERIFY(eastl::get<3>(tc) == true);
	}

	return nErrorCount;
}

#else

int TestTuple() { return 0; }

#endif  // EASTL_TUPLE_ENABLED

EA_RESTORE_VC_WARNING()

{'repo_name': 'electronicarts/EASTL', 'stars': '4878', 'repo_language': 'C++', 'file_name': 'tuple_vector_readme.md', 'mime_type': 'text/x-c++', 'hash': -5371688357889749580, 'source_dataset': 'data'}


--       _________ __                 __
--      /   _____//  |_____________ _/  |______     ____  __ __  ______
--      \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
--      /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
--     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
--             \/                  \/          \//_____/            \/
--  ______________________                           ______________________
--                        T H E   W A R   B E G I N S
--         Stratagus - A free fantasy real time strategy game engine
--
--      (c) Copyright 2016-2020 by Andrettin
--
--      This program is free software; you can redistribute it and/or modify
--      it under the terms of the GNU General Public License as published by
--      the Free Software Foundation; either version 2 of the License, or
--      (at your option) any later version.
--
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warranty of
--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--      GNU General Public License for more details.
--
--      You should have received a copy of the GNU General Public License
--      along with this program; if not, write to the Free Software
--      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
--

DefineFaction("etruscan-tribe", {
	Name = "Etruscan Tribe",
	Civilization = "etruscan",
	Type = "tribe",
	Color = "yellow",
	Adjective = "Etruscan"
})

DefineFaction("etruria", {
	Name = "Etruria",
	Civilization = "etruscan",
	Type = "polity",
	Color = "yellow",
	DefaultTier = "kingdom",
	DevelopsFrom = {"etruscan-tribe"},
	Adjective = "Etruscan"
})

{'repo_name': 'Andrettin/Wyrmsun', 'stars': '153', 'repo_language': 'Lua', 'file_name': 'seasons.txt', 'mime_type': 'text/plain', 'hash': 321964192765197537, 'source_dataset': 'data'}


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="en-us">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>jsonbin - A JSON store as a RESTful service</title>
    <link rel="icon" type="image/png" href="/_/img/favicon.png" sizes="144x144">
    <link rel="stylesheet" href="/_/css/man.css">
    {{#if env.ANALYTICS}}
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

      ga('create', '{{env.ANALYTICS}}', 'auto');
      ga('send', 'pageview');

    </script>
    {{/if}}
  </head>
  <body id="manpage">

{'repo_name': 'remy/jsonbin', 'stars': '315', 'repo_language': 'JavaScript', 'file_name': 'footer.html', 'mime_type': 'text/plain', 'hash': 1636281589333957670, 'source_dataset': 'data'}


/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
 * pkix_ocspchecker.h
 *
 * OcspChecker Object Type Definition
 *
 */

#ifndef _PKIX_OCSPCHECKER_H
#define _PKIX_OCSPCHECKER_H

#include "pkix_tools.h"
#include "pkix_revocationmethod.h"

#ifdef __cplusplus
extern "C" {
#endif

/* NOTE: nbio logic removed. Will be replaced later. */

PKIX_Error *
pkix_OcspChecker_CheckLocal(
        PKIX_PL_Cert *cert,
        PKIX_PL_Cert *issuer,
        PKIX_PL_Date *date,
        pkix_RevocationMethod *checkerObject,
        PKIX_ProcessingParams *procParams,
        PKIX_UInt32 methodFlags,
        PKIX_Boolean chainVerificationState,
        PKIX_RevocationStatus *pRevStatus,
        CERTCRLEntryReasonCode *reasonCode,
        void *plContext);

PKIX_Error *
pkix_OcspChecker_CheckExternal(
        PKIX_PL_Cert *cert,
        PKIX_PL_Cert *issuer,
        PKIX_PL_Date *date,
        pkix_RevocationMethod *checkerObject,
        PKIX_ProcessingParams *procParams,
        PKIX_UInt32 methodFlags,
        PKIX_RevocationStatus *pRevStatus,
        CERTCRLEntryReasonCode *reasonCode,
        void **pNBIOContext,
        void *plContext);

PKIX_Error *
pkix_OcspChecker_Create(PKIX_RevocationMethodType methodType,
                        PKIX_UInt32 flags,
                        PKIX_UInt32 priority,
                        pkix_LocalRevocationCheckFn localRevChecker,
                        pkix_ExternalRevocationCheckFn externalRevChecker,
                        PKIX_PL_VerifyCallback certVerifyFn,
                        pkix_RevocationMethod **pChecker,
                        void *plContext);

/* see source file for function documentation */

PKIX_Error *pkix_OcspChecker_RegisterSelf(void *plContext);

#ifdef __cplusplus
}
#endif

#endif /* _PKIX_OCSPCHECKER_H */

{'repo_name': 'Feodor2/Mypal', 'stars': '149', 'repo_language': 'None', 'file_name': 'moz.build', 'mime_type': 'text/plain', 'hash': -6576446050506190235, 'source_dataset': 'data'}


package org.pepsoft.minecraft;

import java.io.ObjectStreamException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.BitSet;

import static org.pepsoft.minecraft.Constants.*;

/**
 * A database of legacy (pre-1.13) Minecraft block information. Accessed by
 * using the block ID as index in the {@link #BLOCKS} array. Implements the
 * Enumeration pattern, meaning there is only ever one instance of this class
 * for each block ID, allowing use of the equals operator (==) for comparing
 * instances.
 *
 * Created by pepijn on 17-3-15.
 *
 * @deprecated Use {@link Material}
 */
@Deprecated
public final class Block implements Serializable {
    private Block(int id, int transparency, String name, boolean terrain,
                 boolean insubstantial, boolean veryInsubstantial, boolean resource, boolean tileEntity, boolean treeRelated,
                 boolean vegetation, int blockLight, boolean natural) {
        this.id = id;
        this.transparency = transparency;
        this.name = name;
        this.transparent = (transparency == 0);
        this.translucent = (transparency < 15);
        this.opaque = (transparency == 15);
        this.terrain = terrain;
        if (INSUBSTANTIAL_OVERRIDES.get(id)) {
            this.insubstantial = true;
            this.veryInsubstantial = true;
        } else {
            this.insubstantial = insubstantial;
            this.veryInsubstantial = veryInsubstantial;
        }
        this.solid = ! veryInsubstantial;
        this.resource = resource;
        this.tileEntity = tileEntity;
        this.treeRelated = treeRelated;
        this.vegetation = vegetation;
        this.blockLight = blockLight;
        this.lightSource = (blockLight > 0);
        this.natural = natural;

        // Sanity checks
        if ((id < 0) || (id > 4095)
                || (transparency < 0) || (transparency > 15)
                || (insubstantial && (! veryInsubstantial))
                || (blockLight < 0) || (blockLight > 15)
                || (treeRelated && vegetation)) {
            throw new IllegalArgumentException(Integer.toString(id));
        }

        // Determine the category
        if (id == BLK_AIR) {
            category = CATEGORY_AIR;
        } else if ((id == BLK_WATER) || (id == BLK_STATIONARY_WATER) || (id == BLK_LAVA) || (id == BLK_STATIONARY_LAVA)) {
            category = CATEGORY_FLUID;
        } else if (veryInsubstantial) {
            category = CATEGORY_INSUBSTANTIAL;
        } else if (! natural) {
            category = CATEGORY_MAN_MADE;
        } else if (resource) {
            category = CATEGORY_RESOURCE;
        } else {
            category = CATEGORY_NATURAL_SOLID;
        }
    }

    @Override
    public boolean equals(Object o) {
        return o == this;
    }

    @Override
    public int hashCode() {
        return id;
    }

    @Override
    public String toString() {
        return (name != null) ? name : Integer.toString(id);
    }

    /**
     * The block ID.
     */
    public final int id;

    /**
     * How much light the block blocks.
     */
    public final transient int transparency;

    /**
     * The name of the block.
     */
    public final transient String name;

    /**
     * Whether the block is fully transparent ({@link #transparency} == 0)
     */
    public final transient boolean transparent;

    /**
     * Whether the block is translucent ({@link #transparency} < 15)
     */
    public final transient boolean translucent;

    /**
     * Whether the block is fully opaque ({@link #transparency} == 15)
     */
    public final transient boolean opaque;

    /**
     * Whether the block is part of Minecraft-generated natural ground; more
     * specifically whether the block type should be assigned a terrain type
     * when importing a Minecraft map.
     */
    public final transient boolean terrain;

    /**
     * Whether the block is insubstantial, meaning that they are fully
     * transparent, not man-made, removing them would have no effect on the
     * surrounding blocks and be otherwise inconsequential. In other words
     * mostly decorative blocks that users presumably would not mind being
     * removed.
     */
    public final transient boolean insubstantial;

    /**
     * Whether the block is even more insubstantial. Implies
     * {@link #insubstantial} and adds air, water, lava and leaves.
     */
    public final transient boolean veryInsubstantial;

    /**
     * Whether the block is solid (meaning not {@link #insubstantial} or
     * {@link #veryInsubstantial}).
     */
    public final transient boolean solid;

    /**
     * Whether the block is a mineable ore or resource.
     */
    public final transient boolean resource;

    /**
     * Whether the block is a tile entity.
     */
    public final transient boolean tileEntity;

    /**
     * Whether the block is part of or attached to naturally occurring
     * trees or giant mushrooms. Also includes saplings, but not normal
     * mushrooms.
     */
    public final transient boolean treeRelated;

    /**
     * Whether the block is a plant. Excludes {@link #treeRelated} blocks.
     */
    public final transient boolean vegetation;

    /**
     * The amount of blocklight emitted by this block.
     */
    public final transient int blockLight;

    /**
     * Whether the block is a source of blocklight ({@link #blockLight} > 0).
     */
    public final transient boolean lightSource;

    /**
     * Whether the block can occur as part of a pristine Minecraft-generated
     * landscape, excluding artificial structures such as abandoned
     * mineshafts, villages, temples, strongholds, etc.
     */
    public final transient boolean natural;

    /**
     * Type of block encoded in a single category
     */
    public final transient int category;

    private Object readResolve() throws ObjectStreamException {
        return BLOCKS[id];
    }

    public static final Block[] BLOCKS = new Block[4096];

    private static final BitSet INSUBSTANTIAL_OVERRIDES = new BitSet();

    static {
        String insubStr = System.getProperty("org.pepsoft.worldpainter.insubstantialBlocks");
        if (insubStr != null) {
            Arrays.stream(insubStr.split("[, ]+")).forEach(s -> INSUBSTANTIAL_OVERRIDES.set(Integer.parseInt(s)));
        }
    }

    // Tr == Transparency, meaning in this case how much light is *blocked* by the block, 0 being fully transparent and
    // 15 being fully opaque
    static {
        System.arraycopy(new Block[] {
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(  0,  0,                             "Air", false, false,  true, false, false, false, false,  0,  true),
                new Block(  1, 15,                           "Stone",  true, false, false, false, false, false, false,  0,  true),
                new Block(  2, 15,                           "Grass",  true, false, false, false, false, false, false,  0,  true),
                new Block(  3, 15,                            "Dirt",  true, false, false, false, false, false, false,  0,  true),
                new Block(  4, 15,                     "Cobblestone", false, false, false, false, false, false, false,  0, false),
                new Block(  5, 15,                    "Wooden Plank", false, false, false, false, false, false, false,  0, false),
                new Block(  6,  0,                         "Sapling", false,  true,  true, false, false,  true, false,  0, false),
                new Block(  7, 15,                         "Bedrock",  true, false, false, false, false, false, false,  0,  true),
                new Block(  8,  3,                           "Water", false, false,  true, false, false, false, false,  0,  true),
                new Block(  9,  3,                "Stationary Water", false, false,  true, false, false, false, false,  0,  true),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block( 10,  0,                            "Lava", false, false,  true, false, false, false, false, 15,  true),
                new Block( 11,  0,                 "Stationary Lava", false, false,  true, false, false, false, false, 15,  true),
                new Block( 12, 15,                            "Sand",  true, false, false, false, false, false, false,  0,  true),
                new Block( 13, 15,                          "Gravel",  true, false, false, false, false, false, false,  0,  true),
                new Block( 14, 15,                        "Gold Ore",  true, false, false,  true, false, false, false,  0,  true),
                new Block( 15, 15,                        "Iron Ore",  true, false, false,  true, false, false, false,  0,  true),
                new Block( 16, 15,                        "Coal Ore",  true, false, false,  true, false, false, false,  0,  true),
                new Block( 17, 15,                            "Wood", false, false, false, false, false,  true, false,  0,  true),
                new Block( 18,  1,                          "Leaves", false, false,  true, false, false,  true, false,  0,  true),
                new Block( 19, 15,                          "Sponge", false, false, false, false, false, false, false,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block( 20,  0,                           "Glass", false, false, false, false, false, false, false,  0, false),
                new Block( 21, 15,                "Lapis Lazuli Ore",  true, false, false,  true, false, false, false,  0,  true),
                new Block( 22, 15,              "Lapis Lazuli Block", false, false, false, false, false, false, false,  0, false),
                new Block( 23, 15,                       "Dispenser", false, false, false, false,  true, false, false,  0, false),
                new Block( 24, 15,                       "Sandstone",  true, false, false, false, false, false, false,  0,  true),
                new Block( 25, 15,                      "Note Block", false, false, false, false,  true, false, false,  0, false),
                new Block( 26,  0,                             "Bed", false, false, false, false, false, false, false,  0, false),
                new Block( 27,  0,                    "Powered Rail", false, false, false, false, false, false, false,  0, false),
                new Block( 28,  0,                   "Detector Rail", false, false, false, false, false, false, false,  0, false),
                new Block( 29, 15,                   "Sticky Piston", false, false, false, false, false, false, false,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block( 30,  0,                          "Cobweb", false,  true,  true, false, false, false, false,  0, false),
                new Block( 31,  0,                      "Tall Grass", false,  true,  true, false, false, false,  true,  0,  true),
                new Block( 32,  0,                       "Dead Bush", false,  true,  true, false, false, false,  true,  0,  true),
                new Block( 33,  0,                          "Piston", false, false, false, false, false, false, false,  0, false),
                new Block( 34,  0,                "Piston Extension", false, false, false, false,  true, false, false,  0, false),
                new Block( 35, 15,                            "Wool", false, false, false, false, false, false, false,  0, false),
                new Block( 36,  0,                              null, false, false, false, false, false, false, false,  0, false),
                new Block( 37,  0,                       "Dandelion", false,  true,  true, false, false, false,  true,  0,  true),
                new Block( 38,  0,                          "Flower", false,  true,  true, false, false, false,  true,  0,  true),
                new Block( 39,  0,                  "Brown Mushroom", false,  true,  true, false, false, false,  true,  1,  true),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block( 40,  0,                    "Red Mushroom", false,  true,  true, false, false, false,  true,  0,  true),
                new Block( 41, 15,                      "Gold Block", false, false, false, false, false, false, false,  0, false),
                new Block( 42, 15,                      "Iron Block", false, false, false, false, false, false, false,  0, false),
                new Block( 43, 15,                    "Double Slabs", false, false, false, false, false, false, false,  0, false),
                new Block( 44, 15,                            "Slab", false, false, false, false, false, false, false,  0, false),
                new Block( 45, 15,                     "Brick Block", false, false, false, false, false, false, false,  0, false),
                new Block( 46, 15,                             "TNT", false, false, false, false, false, false, false,  0, false),
                new Block( 47, 15,                       "Bookshelf", false, false, false, false, false, false, false,  0, false),
                new Block( 48, 15,               "Mossy Cobblestone", false, false, false, false, false, false, false,  0, false),
                new Block( 49, 15,                        "Obsidian",  true, false, false, false, false, false, false,  0,  true),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block( 50,  0,                           "Torch", false, false, false, false, false, false, false, 14, false),
                new Block( 51,  0,                            "Fire", false,  true,  true, false, false, false, false, 15,  true),
                new Block( 52, 15,                 "Monster Spawner", false, false, false, false,  true, false, false,  0, false),
                new Block( 53, 15,                   "Wooden Stairs", false, false, false, false, false, false, false,  0, false),
                new Block( 54,  0,                           "Chest", false, false, false, false,  true, false, false,  0, false),
                new Block( 55,  0,                   "Redstone Wire", false, false, false, false, false, false, false,  0, false),
                new Block( 56, 15,                     "Diamond Ore",  true, false, false,  true, false, false, false,  0,  true),
                new Block( 57, 15,                   "Diamond Block", false, false, false, false, false, false, false,  0, false),
                new Block( 58, 15,                  "Crafting Table", false, false, false, false, false, false, false,  0, false),
                new Block( 59,  0,                           "Wheat", false,  true,  true, false, false, false,  true,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block( 60, 15,                     "Tilled Dirt",  true, false, false, false, false, false, false,  0, false),
                new Block( 61, 15,                         "Furnace", false, false, false, false,  true, false, false,  0, false),
                new Block( 62, 15,                 "Burning Furnace", false, false, false, false,  true, false, false, 13, false),
                new Block( 63,  0,                       "Sign Post", false, false, false, false,  true, false, false,  0, false),
                new Block( 64,  0,                     "Wooden Door", false, false, false, false, false, false, false,  0, false),
                new Block( 65,  0,                          "Ladder", false, false, false, false, false, false, false,  0, false),
                new Block( 66,  0,                           "Rails", false, false, false, false, false, false, false,  0, false),
                new Block( 67, 15,              "Cobblestone Stairs", false, false, false, false, false, false, false,  0, false),
                new Block( 68,  0,                       "Wall Sign", false, false, false, false,  true, false, false,  0, false),
                new Block( 69,  0,                           "Lever", false, false, false, false, false, false, false,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block( 70,  0,            "Stone Pressure Plate", false, false, false, false, false, false, false,  0, false),
                new Block( 71,  0,                       "Iron Door", false, false, false, false, false, false, false,  0, false),
                new Block( 72,  0,           "Wooden Pressure Plate", false, false, false, false, false, false, false,  0, false),
                new Block( 73, 15,                    "Redstone Ore",  true, false, false,  true, false, false, false,  0,  true),
                new Block( 74, 15,            "Glowing Redstone Ore",  true, false, false, false, false, false, false,  9,  true),
                new Block( 75,  0,            "Redstone Torch (off)", false, false, false, false, false, false, false,  0, false),
                new Block( 76,  0,             "Redstone Torch (on)", false, false, false, false, false, false, false,  7, false),
                new Block( 77,  0,                    "Stone Button", false, false, false, false, false, false, false,  0, false),
                new Block( 78,  0,                            "Snow", false,  true,  true, false, false, false, false,  0,  true),
                new Block( 79,  3,                             "Ice", false, false, false, false, false, false, false,  0,  true),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block( 80, 15,                      "Snow Block",  true,  true,  true, false, false, false, false,  0,  true),
                new Block( 81,  0,                          "Cactus", false,  true,  true, false, false, false,  true,  0,  true),
                new Block( 82, 15,                      "Clay Block",  true, false, false, false, false, false, false,  0,  true),
                new Block( 83,  0,                      "Sugar Cane", false,  true,  true, false, false, false,  true,  0,  true),
                new Block( 84, 15,                         "Jukebox", false, false, false, false,  true, false, false,  0, false),
                new Block( 85,  0,                           "Fence", false, false, false, false, false, false, false,  0, false),
                new Block( 86,  0,                         "Pumpkin", false,  true,  true, false, false, false,  true,  0,  true),
                new Block( 87, 15,                      "Netherrack",  true, false, false, false, false, false, false,  0,  true),
                new Block( 88, 15,                       "Soul Sand",  true, false, false, false, false, false, false,  0,  true),
                new Block( 89, 15,                 "Glowstone Block", false, false, false, false, false, false, false, 15,  true),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block( 90,  0,                          "Portal", false, false, false, false, false, false, false, 11, false),
                new Block( 91, 15,                  "Jack-O-Lantern", false, false, false, false, false, false, false, 15, false),
                new Block( 92,  0,                            "Cake", false, false, false, false, false, false, false,  0, false),
                new Block( 93,  0,         "Redstone Repeater (off)", false, false, false, false, false, false, false,  0, false),
                new Block( 94,  0,          "Redstone Repeater (on)", false, false, false, false, false, false, false,  9, false),
                new Block( 95, 15,                   "Stained Glass", false, false, false, false, false, false, false,  0, false),
                new Block( 96,  0,                        "Trapdoor", false, false, false, false, false, false, false,  0, false),
                new Block( 97, 15,               "Hidden Silverfish",  true, false, false, false, false, false, false,  0,  true),
                new Block( 98, 15,                    "Stone Bricks", false, false, false, false, false, false, false,  0, false),
                new Block( 99, 15,             "Huge Brown Mushroom", false, false, false, false, false,  true, false,  0,  true),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(100, 15,               "Huge Red Mushroom", false, false, false, false, false,  true, false,  0,  true),
                new Block(101,  0,                       "Iron Bars", false, false, false, false, false, false, false,  0, false),
                new Block(102,  0,                      "Glass Pane", false, false, false, false, false, false, false,  0, false),
                new Block(103, 15,                           "Melon", false,  true,  true, false, false, false,  true,  0, false),
                new Block(104,  0,                    "Pumpkin Stem", false,  true,  true, false, false, false,  true,  0, false),
                new Block(105,  0,                      "Melon Stem", false,  true,  true, false, false, false,  true,  0, false),
                new Block(106,  0,                           "Vines", false,  true,  true, false, false,  true, false,  0,  true),
                new Block(107,  0,                      "Fence Gate", false, false, false, false, false, false, false,  0, false),
                new Block(108, 15,                    "Brick Stairs", false, false, false, false, false, false, false,  0, false),
                new Block(109, 15,              "Stone Brick Stairs", false, false, false, false, false, false, false,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(110, 15,                        "Mycelium",  true, false, false, false, false, false, false,  0,  true),
                new Block(111,  0,                        "Lily Pad", false,  true,  true, false, false, false,  true,  0,  true),
                new Block(112, 15,                    "Nether Brick", false, false, false, false, false, false, false,  0, false),
                new Block(113,  0,              "Nether Brick Fence", false, false, false, false, false, false, false,  0, false),
                new Block(114, 15,             "Nether Brick Stairs", false, false, false, false, false, false, false,  0, false),
                new Block(115,  0,                     "Nether Wart", false,  true,  true, false, false, false,  true,  0,  true),
                new Block(116,  0,               "Enchantment Table", false, false, false, false,  true, false, false,  0, false),
                new Block(117,  0,                   "Brewing Stand", false, false, false, false,  true, false, false,  1, false),
                new Block(118,  0,                        "Cauldron", false, false, false, false, false, false, false,  0, false),
                new Block(119,  0,                      "End Portal", false, false, false, false,  true, false, false, 15, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(120, 15,                "End Portal Frame", false, false, false, false, false, false, false,  1, false),
                new Block(121, 15,                       "End Stone",  true, false, false, false, false, false, false,  0,  true),
                new Block(122,  0,                      "Dragon Egg", false, false, false, false, false, false, false,  1, false),
                new Block(123, 15,             "Redstone Lamp (off)", false, false, false, false, false, false, false,  0, false),
                new Block(124, 15,              "Redstone Lamp (on)", false, false, false, false, false, false, false, 15, false),
                new Block(125, 15,              "Wooden Double Slab", false, false, false, false, false, false, false,  0, false),
                new Block(126, 15,                     "Wooden Slab", false, false, false, false, false, false, false,  0, false),
                new Block(127,  0,                     "Cocoa Plant", false,  true,  true, false, false,  true, false,  0,  true),
                new Block(128, 15,                "Sandstone Stairs", false, false, false, false, false, false, false,  0, false),
                new Block(129, 15,                     "Emerald Ore", false, false, false,  true, false, false, false,  0,  true),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(130,  0,                     "Ender Chest", false, false, false, false,  true, false, false,  7, false),
                new Block(131,  0,                   "Tripwire Hook", false, false, false, false, false, false, false,  0, false),
                new Block(132,  0,                        "Tripwire", false, false, false, false, false, false, false,  0, false),
                new Block(133, 15,                   "Emerald Block", false, false, false, false, false, false, false,  0, false),
                new Block(134, 15,                "Pine Wood Stairs", false, false, false, false, false, false, false,  0, false),
                new Block(135, 15,               "Birch Wood Stairs", false, false, false, false, false, false, false,  0, false),
                new Block(136, 15,              "Jungle Wood Stairs", false, false, false, false, false, false, false,  0, false),
                new Block(137, 15,                   "Command Block", false, false, false, false,  true, false, false,  0, false),
                new Block(138, 15,                          "Beacon", false, false, false, false,  true, false, false, 15, false),
                new Block(139,  0,                "Cobblestone Wall", false, false, false, false, false, false, false,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(140,  0,                      "Flower Pot", false, false, false, false,  true, false, false,  0, false),
                new Block(141,  0,                         "Carrots", false,  true,  true, false, false, false,  true,  0, false),
                new Block(142,  0,                        "Potatoes", false,  true,  true, false, false, false,  true,  0, false),
                new Block(143,  0,                   "Wooden Button", false, false, false, false, false, false, false,  0, false),
                new Block(144,  0,                            "Head", false, false, false, false,  true, false, false,  0, false),
                new Block(145, 15,                           "Anvil", false, false, false, false, false, false, false,  0, false),
                new Block(146,  0,                   "Trapped Chest", false, false, false, false,  true, false, false,  0, false),
                new Block(147,  0, "Weighted Pressure Plate (light)", false, false, false, false, false, false, false,  0, false),
                new Block(148,  0, "Weighted Pressure Plate (heavy)", false, false, false, false, false, false, false,  0, false),
                new Block(149,  0, "Redstone Comparator (unpowered)", false, false, false, false,  true, false, false,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(150,  0,   "Redstone Comparator (powered)", false, false, false, false,  true, false, false,  0, false),
                new Block(151,  0,                 "Daylight Sensor", false, false, false, false,  true, false, false,  0, false),
                new Block(152, 15,                  "Redstone Block", false, false, false, false, false, false, false,  0, false),
                new Block(153, 15,               "Nether Quartz Ore",  true, false, false,  true, false, false, false,  0,  true),
                new Block(154,  0,                          "Hopper", false, false, false, false,  true, false, false,  0, false),
                new Block(155, 15,                    "Quartz Block", false, false, false, false, false, false, false,  0, false),
                new Block(156, 15,                   "Quartz Stairs", false, false, false, false, false, false, false,  0, false),
                new Block(157,  0,                  "Activator Rail", false, false, false, false, false, false, false,  0, false),
                new Block(158,  0,                         "Dropper", false, false, false, false,  true, false, false,  0, false),
                new Block(159, 15,              "Stained Terracotta",  true, false, false, false, false, false, false,  0,  true),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(160,  0,              "Stained Glass Pane", false, false, false, false, false, false, false,  0, false),
                new Block(161,  1,                        "Leaves 2", false, false,  true, false, false,  true, false,  0,  true),
                new Block(162, 15,                          "Wood 2", false, false, false, false, false,  true, false,  0,  true),
                new Block(163, 15,              "Acacia Wood Stairs", false, false, false, false, false, false, false,  0, false),
                new Block(164, 15,            "Dark Oak Wood Stairs", false, false, false, false, false, false, false,  0, false),
                new Block(165,  0,                     "Slime Block", false, false, false, false, false, false, false,  0, false),
                new Block(166,  0,                         "Barrier", false, false, false, false, false, false, false,  0, false),
                new Block(167,  0,                   "Iron Trapdoor", false, false, false, false, false, false, false,  0, false),
                new Block(168, 15,                      "Prismarine", false, false, false, false, false, false, false,  0, false),
                new Block(169, 15,                     "Sea Lantern", false, false, false, false, false, false, false, 15, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(170, 15,                        "Hay Bale", false, false, false, false, false, false, false,  0, false),
                new Block(171,  0,                          "Carpet", false, false, false, false, false, false, false,  0, false),
                new Block(172, 15,                      "Terracotta",  true, false, false, false, false, false, false,  0,  true),
                new Block(173, 15,                      "Coal Block", false, false, false, false, false, false, false,  0, false),
                new Block(174, 15,                      "Packed Ice", false, false, false, false, false, false, false,  0,  true),
                new Block(175,  0,                    "Large Flower", false,  true,  true, false, false, false,  true,  0,  true),
                new Block(176,  0,                 "Standing Banner", false, false, false, false,  true, false, false,  0, false),
                new Block(177,  0,                     "Wall Banner", false, false, false, false,  true, false, false,  0, false),
                new Block(178,  0,        "Inverted Daylight Sensor", false, false, false, false,  true, false, false,  0, false),
                new Block(179, 15,                   "Red Sandstone",  true, false, false, false, false, false, false,  0,  true),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(180, 15,            "Red Sandstone Stairs", false, false, false, false, false, false, false,  0, false),
                new Block(181, 15,       "Double Red Sandstone Slab", false, false, false, false, false, false, false,  0, false),
                new Block(182, 15,              "Red Sandstone Slab", false, false, false, false, false, false, false,  0, false),
                new Block(183,  0,            "Pine Wood Fence Gate", false, false, false, false, false, false, false,  0, false),
                new Block(184,  0,           "Birch Wood Fence Gate", false, false, false, false, false, false, false,  0, false),
                new Block(185,  0,          "Jungle Wood Fence Gate", false, false, false, false, false, false, false,  0, false),
                new Block(186,  0,        "Dark Oak Wood Fence Gate", false, false, false, false, false, false, false,  0, false),
                new Block(187,  0,          "Acacia Wood Fence Gate", false, false, false, false, false, false, false,  0, false),
                new Block(188,  0,                 "Pine Wood Fence", false, false, false, false, false, false, false,  0, false),
                new Block(189,  0,                "Birch Wood Fence", false, false, false, false, false, false, false,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(190,  0,               "Jungle Wood Fence", false, false, false, false, false, false, false,  0, false),
                new Block(191,  0,             "Dark Oak Wood Fence", false, false, false, false, false, false, false,  0, false),
                new Block(192,  0,               "Acacia Wood Fence", false, false, false, false, false, false, false,  0, false),
                new Block(193,  0,                  "Pine Wood Door", false, false, false, false, false, false, false,  0, false),
                new Block(194,  0,                 "Birch Wood Door", false, false, false, false, false, false, false,  0, false),
                new Block(195,  0,                "Jungle Wood Door", false, false, false, false, false, false, false,  0, false),
                new Block(196,  0,                "Acacia Wood Door", false, false, false, false, false, false, false,  0, false),
                new Block(197,  0,              "Dark Oak Wood Door", false, false, false, false, false, false, false,  0, false),
                new Block(198,  0,                         "End Rod", false, false, false, false, false, false, false, 14, false),
                new Block(199,  0,                    "Chorus Plant", false,  true,  true,  false, false, false, true,  0,  true),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(200,  0,                   "Chorus Flower", false,  true,  true,  false, false, false, true,  0,  true),
                new Block(201, 15,                    "Purpur Block", false, false, false, false, false, false, false,  0, false),
                new Block(202, 15,                   "Purpur Pillar", false, false, false, false, false, false, false,  0, false),
                new Block(203, 15,                   "Purpur Stairs", false, false, false, false, false, false, false,  0, false),
                new Block(204, 15,              "Double Purpur Slab", false, false, false, false, false, false, false,  0, false),
                new Block(205, 15,                     "Purpur Slab", false, false, false, false, false, false, false,  0, false),
                new Block(206, 15,                "End Stone Bricks", false, false, false, false, false, false, false,  0, false),
                new Block(207,  0,                       "Beetroots", false,  true,  true, false, false, false,  true,  0, false),
                new Block(208, 15,                      "Grass Path",  true, false, false, false, false, false, false,  0, false),
                new Block(209, 15,                     "End Gateway", false, false, false, false, false, false, false,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(210, 15,         "Repeating Command Block", false, false, false, false,  true, false, false,  0, false),
                new Block(211, 15,             "Chain Command Block", false, false, false, false,  true, false, false,  0, false),
                new Block(212,  3,                     "Frosted Ice", false, false, false, false, false, false, false,  0, false),
                new Block(213, 15,                     "Magma Block",  true, false, false, false, false, false, false,  3,  true),
                new Block(214, 15,               "Nether Wart Block", false, false, false, false, false, false, false,  0, false),
                new Block(215, 15,                "Red Nether Brick", false, false, false, false, false, false, false,  0, false),
                new Block(216, 15,                      "Bone Block", false, false, false, false, false, false, false,  0,  true),
                new Block(217,  0,                  "Structure Void", false,  true,  true, false, false, false, false,  0, false),
                new Block(218,  0,                        "Observer", false, false, false, false, false, false, false,  0, false),
                new Block(219,  0,               "White Shulker Box", false, false, false, false, true,  false, false,  0, false),
//                         ID,  0,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(220,  0,              "Orange Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(221,  0,             "Magenta Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(222,  0,          "Light Blue Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(223,  0,              "Yellow Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(224,  0,                "Lime Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(225,  0,                "Pink Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(226,  0,                "Grey Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(227,  0,          "Light Grey Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(228,  0,                "Cyan Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(229,  0,              "Purple Shulker Box", false, false, false, false, true,  false, false,  0, false),
//                         ID,  0,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(230,  0,                "Blue Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(231,  0,               "Brown Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(232,  0,               "Green Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(233,  0,                 "Red Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(234,  0,               "Black Shulker Box", false, false, false, false, true,  false, false,  0, false),
                new Block(235, 15,         "White Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(236, 15,        "Orange Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(237, 15,       "Magenta Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(238, 15,    "Light Blue Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(239, 15,        "Yellow Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(240, 15,          "Lime Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(241, 15,          "Pink Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(242, 15,          "Grey Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(243, 15,    "Light Grey Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(244, 15,          "Cyan Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(245, 15,        "Purple Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(246, 15,          "Blue Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(247, 15,         "Brown Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(248, 15,         "Green Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(249, 15,           "Red Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
                new Block(250, 15,         "Black Glazed Terracotta", false, false, false, false, false, false, false,  0, false),
                new Block(251, 15,                        "Concrete", false, false, false, false, false, false, false,  0, false),
                new Block(252, 15,                 "Concrete Powder", false, false, false, false, false, false, false,  0, false),
                new Block(253,  0,                              null, false, false, false, false, false, false, false,  0, false),
                new Block(254,  0,                              null, false, false, false, false, false, false, false,  0, false),
                new Block(255, 15,                 "Structure Block", false, false, false, false,  true, false, false,  0, false),
//                         ID, Tr,                      Display Name, Terra, Insub, VryIn, Resou, TileE, TreeR, Veget, Li, Natural
        }, 0, BLOCKS, 0, 256);

        for (int i = 256; i < 4096; i++) {
            BLOCKS[i] = new Block(i, 15, null, false, false, false, false, false, false, false, 0, false);
        }
    }

    public static final String[] BLOCK_TYPE_NAMES = new String[HIGHEST_KNOWN_BLOCK_ID + 1];
    public static final int[] BLOCK_TRANSPARENCY = new int[256];
    public static final int[] LIGHT_SOURCES = new int[256];

    static {
        for (int i = 0; i < 256; i++) {
            BLOCK_TYPE_NAMES[i] = BLOCKS[i].name;
            BLOCK_TRANSPARENCY[i] = BLOCKS[i].transparency;
            LIGHT_SOURCES[i] = BLOCKS[i].blockLight;
        }
    }

    public static final int CATEGORY_AIR           = 0;
    public static final int CATEGORY_FLUID         = 1;
    public static final int CATEGORY_INSUBSTANTIAL = 2;
    public static final int CATEGORY_MAN_MADE      = 3;
    public static final int CATEGORY_RESOURCE      = 4;
    public static final int CATEGORY_NATURAL_SOLID = 5;

    private static final long serialVersionUID = 3037884633022467720L;
}

{'repo_name': 'Captain-Chaos/WorldPainter', 'stars': '155', 'repo_language': 'Java', 'file_name': 'AttributeKeyVO.java', 'mime_type': 'text/x-java', 'hash': 4024499595696436185, 'source_dataset': 'data'}


Resistive

Able to withstand the action or effect of something.

{'repo_name': 'Showndarya/Hacktoberfest', 'stars': '177', 'repo_language': 'Python', 'file_name': 'Complacent_adjective.json', 'mime_type': 'text/plain', 'hash': 2392323513636051494, 'source_dataset': 'data'}


var $ = require('../internals/export');
var sign = require('../internals/math-sign');

var abs = Math.abs;
var pow = Math.pow;

// `Math.cbrt` method
// https://tc39.github.io/ecma262/#sec-math.cbrt
$({ target: 'Math', stat: true }, {
  cbrt: function cbrt(x) {
    return sign(x = +x) * pow(abs(x), 1 / 3);
  }
});

{'repo_name': 'zloirock/core-js', 'stars': '13117', 'repo_language': 'JavaScript', 'file_name': 'adapter-pure.js', 'mime_type': 'text/plain', 'hash': -6997760199632237539, 'source_dataset': 'data'}


<?php
/**
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
 * @link      https://cakephp.org CakePHP(tm) Project
 * @since     3.3.0
 * @license   https://opensource.org/licenses/mit-license.php MIT License
 */
namespace App;

use Cake\Core\Configure;
use Cake\Core\Exception\MissingPluginException;
use Cake\Error\Middleware\ErrorHandlerMiddleware;
use Cake\Http\BaseApplication;
use Cake\Routing\Middleware\AssetMiddleware;
use Cake\Routing\Middleware\RoutingMiddleware;

/**
 * Application setup class.
 *
 * This defines the bootstrapping logic and middleware layers you
 * want to use in your application.
 */
class Application extends BaseApplication
{
    /**
     * {@inheritDoc}
     */
    public function bootstrap()
    {
        // Call parent to load bootstrap from files.
        parent::bootstrap();

        if (PHP_SAPI === 'cli') {
            $this->bootstrapCli();
        }

        /*
         * Only try to load DebugKit in development mode
         * Debug Kit should not be installed on a production system
         */
        if (Configure::read('debug')) {
            $this->addPlugin(\DebugKit\Plugin::class);
        }

        // Load more plugins here
    }

    /**
     * Setup the middleware queue your application will use.
     *
     * @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to setup.
     * @return \Cake\Http\MiddlewareQueue The updated middleware queue.
     */
    public function middleware($middlewareQueue)
    {
        $middlewareQueue
            // Catch any exceptions in the lower layers,
            // and make an error page/response
            ->add(new ErrorHandlerMiddleware(null, Configure::read('Error')))

            // Handle plugin/theme assets like CakePHP normally does.
            ->add(new AssetMiddleware([
                'cacheTime' => Configure::read('Asset.cacheTime')
            ]))

            // Add routing middleware.
            // If you have a large number of routes connected, turning on routes
            // caching in production could improve performance. For that when
            // creating the middleware instance specify the cache config name by
            // using it's second constructor argument:
            // `new RoutingMiddleware($this, '_cake_routes_')`
            ->add(new RoutingMiddleware($this));

        return $middlewareQueue;
    }

    /**
     * @return void
     */
    protected function bootstrapCli()
    {
        try {
            $this->addPlugin('Bake');
        } catch (MissingPluginException $e) {
            // Do not halt if the plugin is missing
        }

        $this->addPlugin('Migrations');

        // Load more plugins here
    }
}

{'repo_name': 'cloudfoundry/php-buildpack', 'stars': '125', 'repo_language': 'PHP', 'file_name': 'server-defaults.conf', 'mime_type': 'text/plain', 'hash': 1449580905881700039, 'source_dataset': 'data'}


//
//     Generated by class-dump 3.5 (64 bit) (Debug version compiled Jun  9 2015 22:53:21).
//
//     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2014 by Steve Nygard.
//

#import <swiftCore/SwiftObject.h>

@interface ControlStrip.SleepButton : SwiftObject
{
}

@end

{'repo_name': 'w0lfschild/macOS_headers', 'stars': '304', 'repo_language': 'None', 'file_name': 'NSTextFinderBarContainer-Protocol.h', 'mime_type': 'text/x-objective-c', 'hash': -6414039582253238804, 'source_dataset': 'data'}