text:
package org.ethereum.core;

import org.ethereum.config.BlockchainNetConfig;
import org.ethereum.crypto.HashUtil;
import org.ethereum.util.FastByteComparisons;
import org.ethereum.util.RLP;
import org.ethereum.util.RLPList;
import org.ethereum.util.Utils;
import org.spongycastle.util.Arrays;
import org.spongycastle.util.BigIntegers;
import org.spongycastle.util.encoders.Hex;

import java.math.BigInteger;
import java.util.List;

import static org.ethereum.util.ByteUtil.toHexString;

/**
 * Block header is a value object containing
 * the basic information of a block
 */
public class BlockHeader {

    public static final int NONCE_LENGTH = 8;
    public static final int HASH_LENGTH = 32;
    public static final int ADDRESS_LENGTH = 20;
    public static final int MAX_HEADER_SIZE = 592;

    /* The SHA3 256-bit hash of the parent block, in its entirety */
    private final byte[] parentHash;
    /* The SHA3 256-bit hash of the uncles list portion of this block */
    private byte[] unclesHash;
    /* The 160-bit address to which all fees collected from the
     * successful mining of this block be transferred; formally */
    private byte[] coinbase;
    /* The SHA3 256-bit hash of the root node of the state trie,
     * after all transactions are executed and finalisations applied */
    private byte[] stateRoot;
    /* The SHA3 256-bit hash of the root node of the trie structure
     * populated with each transaction in the transaction
     * list portion, the trie is populate by [key, val] --> [rlp(index), rlp(tx_recipe)]
     * of the block */
    private byte[] txTrieRoot;
    /* The SHA3 256-bit hash of the root node of the trie structure
     * populated with each transaction recipe in the transaction recipes
     * list portion, the trie is populate by [key, val] --> [rlp(index), rlp(tx_recipe)]
     * of the block */
    private byte[] receiptTrieRoot;

    /*todo: comment it when you know what the fuck it is*/
    private byte[] logsBloom;
    /* A scalar value corresponding to the difficulty level of this block.
     * This can be calculated from the previous block's difficulty level
     * and the timestamp */
    private byte[] difficulty;
    /* A scalar value equal to the reasonable output of Unix's time()
     * at this block's inception */
    private long timestamp;
    /* A scalar value equal to the number of ancestor blocks.
     * The genesis block has a number of zero */
    private long number;
    /* A scalar value equal to the current limit of gas expenditure per block */
    private byte[] gasLimit;
    /* A scalar value equal to the total gas used in transactions in this block */
    private long gasUsed;

    private byte[] mixHash;

    /* An arbitrary byte array containing data relevant to this block.
     * With the exception of the genesis block, this must be 32 bytes or fewer */
    private byte[] extraData;
    /* A 256-bit hash which proves that a sufficient amount
     * of computation has been carried out on this block */
    private byte[] nonce;

    private byte[] hashCache;

    public BlockHeader(final byte[] encoded) {
        this((RLPList) RLP.decode2(encoded).get(0));
    }

    public BlockHeader(final RLPList rlpHeader) {

        this.parentHash = rlpHeader.get(0).getRLPData();
        this.unclesHash = rlpHeader.get(1).getRLPData();
        this.coinbase = rlpHeader.get(2).getRLPData();
        this.stateRoot = rlpHeader.get(3).getRLPData();

        this.txTrieRoot = rlpHeader.get(4).getRLPData();
        if (this.txTrieRoot == null)
            this.txTrieRoot = HashUtil.INSTANCE.getEMPTY_TRIE_HASH();

        this.receiptTrieRoot = rlpHeader.get(5).getRLPData();
        if (this.receiptTrieRoot == null)
            this.receiptTrieRoot = HashUtil.INSTANCE.getEMPTY_TRIE_HASH();

        this.logsBloom = rlpHeader.get(6).getRLPData();
        this.difficulty = rlpHeader.get(7).getRLPData();

        final byte[] nrBytes = rlpHeader.get(8).getRLPData();
        final byte[] glBytes = rlpHeader.get(9).getRLPData();
        final byte[] guBytes = rlpHeader.get(10).getRLPData();
        final byte[] tsBytes = rlpHeader.get(11).getRLPData();

        this.number = nrBytes == null ? 0 : (new BigInteger(1, nrBytes)).longValue();

        this.gasLimit = glBytes;
        this.gasUsed = guBytes == null ? 0 : (new BigInteger(1, guBytes)).longValue();
        this.timestamp = tsBytes == null ? 0 : (new BigInteger(1, tsBytes)).longValue();

        this.extraData = rlpHeader.get(12).getRLPData();
        this.mixHash = rlpHeader.get(13).getRLPData();
        this.nonce = rlpHeader.get(14).getRLPData();
    }

    public BlockHeader(final byte[] parentHash, final byte[] unclesHash, final byte[] coinbase,
                       final byte[] logsBloom, final byte[] difficulty, final long number,
                       final byte[] gasLimit, final long gasUsed, final long timestamp,
                       final byte[] extraData, final byte[] mixHash, final byte[] nonce) {
        this.parentHash = parentHash;
        this.unclesHash = unclesHash;
        this.coinbase = coinbase;
        this.logsBloom = logsBloom;
        this.difficulty = difficulty;
        this.number = number;
        this.gasLimit = gasLimit;
        this.gasUsed = gasUsed;
        this.timestamp = timestamp;
        this.extraData = extraData;
        this.mixHash = mixHash;
        this.nonce = nonce;
        this.stateRoot = HashUtil.INSTANCE.getEMPTY_TRIE_HASH();
    }

    public boolean isGenesis() {
        return this.getNumber() == Genesis.Companion.getNUMBER();
    }

    public byte[] getParentHash() {
        return parentHash;
    }

    public byte[] getUnclesHash() {
        return unclesHash;
    }

    public void setUnclesHash(final byte[] unclesHash) {
        this.unclesHash = unclesHash;
        hashCache = null;
    }

    public byte[] getCoinbase() {
        return coinbase;
    }

    public void setCoinbase(final byte[] coinbase) {
        this.coinbase = coinbase;
        hashCache = null;
    }

    public byte[] getStateRoot() {
        return stateRoot;
    }

    public void setStateRoot(final byte[] stateRoot) {
        this.stateRoot = stateRoot;
        hashCache = null;
    }

    public byte[] getTxTrieRoot() {
        return txTrieRoot;
    }

    public byte[] getReceiptsRoot() {
        return receiptTrieRoot;
    }

    public void setReceiptsRoot(final byte[] receiptTrieRoot) {
        this.receiptTrieRoot = receiptTrieRoot;
        hashCache = null;
    }

    public void setTransactionsRoot(final byte[] stateRoot) {
        this.txTrieRoot = stateRoot;
        hashCache = null;
    }

    public byte[] getLogsBloom() {
        return logsBloom;
    }

    public void setLogsBloom(final byte[] logsBloom) {
        this.logsBloom = logsBloom;
        hashCache = null;
    }

    public byte[] getDifficulty() {
        return difficulty;
    }

    public void setDifficulty(final byte[] difficulty) {
        this.difficulty = difficulty;
        hashCache = null;
    }

    public BigInteger getDifficultyBI() {
        return new BigInteger(1, difficulty);
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(final long timestamp) {
        this.timestamp = timestamp;
        hashCache = null;
    }

    public long getNumber() {
        return number;
    }

    public void setNumber(final long number) {
        this.number = number;
        hashCache = null;
    }

    public byte[] getGasLimit() {
        return gasLimit;
    }

    public void setGasLimit(final byte[] gasLimit) {
        this.gasLimit = gasLimit;
        hashCache = null;
    }

    public long getGasUsed() {
        return gasUsed;
    }

    public void setGasUsed(final long gasUsed) {
        this.gasUsed = gasUsed;
        hashCache = null;
    }

    public byte[] getMixHash() {
        return mixHash;
    }

    public void setMixHash(final byte[] mixHash) {
        this.mixHash = mixHash;
        hashCache = null;
    }

    public byte[] getExtraData() {
        return extraData;
    }

    public void setExtraData(final byte[] extraData) {
        this.extraData = extraData;
        hashCache = null;
    }

    public byte[] getNonce() {
        return nonce;
    }

    public void setNonce(final byte[] nonce) {
        this.nonce = nonce;
        hashCache = null;
    }

    public byte[] getHash() {
        if (hashCache == null) {
            hashCache = HashUtil.INSTANCE.sha3(getEncoded());
        }
        return hashCache;
    }

    public byte[] getEncoded() {
        return this.getEncoded(true); // with nonce
    }

    public byte[] getEncodedWithoutNonce() {
        return this.getEncoded(false);
    }

    private byte[] getEncoded(final boolean withNonce) {
        final byte[] parentHash = RLP.encodeElement(this.parentHash);

        final byte[] unclesHash = RLP.encodeElement(this.unclesHash);
        final byte[] coinbase = RLP.encodeElement(this.coinbase);

        final byte[] stateRoot = RLP.encodeElement(this.stateRoot);

        if (txTrieRoot == null) this.txTrieRoot = HashUtil.INSTANCE.getEMPTY_TRIE_HASH();
        final byte[] txTrieRoot = RLP.encodeElement(this.txTrieRoot);

        if (receiptTrieRoot == null) this.receiptTrieRoot = HashUtil.INSTANCE.getEMPTY_TRIE_HASH();
        final byte[] receiptTrieRoot = RLP.encodeElement(this.receiptTrieRoot);

        final byte[] logsBloom = RLP.encodeElement(this.logsBloom);
        final byte[] difficulty = RLP.encodeBigInteger(new BigInteger(1, this.difficulty));
        final byte[] number = RLP.encodeBigInteger(BigInteger.valueOf(this.number));
        final byte[] gasLimit = RLP.encodeElement(this.gasLimit);
        final byte[] gasUsed = RLP.encodeBigInteger(BigInteger.valueOf(this.gasUsed));
        final byte[] timestamp = RLP.encodeBigInteger(BigInteger.valueOf(this.timestamp));

        final byte[] extraData = RLP.encodeElement(this.extraData);
        if (withNonce) {
            final byte[] mixHash = RLP.encodeElement(this.mixHash);
            final byte[] nonce = RLP.encodeElement(this.nonce);
            return RLP.encodeList(parentHash, unclesHash, coinbase,
                    stateRoot, txTrieRoot, receiptTrieRoot, logsBloom, difficulty, number,
                    gasLimit, gasUsed, timestamp, extraData, mixHash, nonce);
        } else {
            return RLP.encodeList(parentHash, unclesHash, coinbase,
                    stateRoot, txTrieRoot, receiptTrieRoot, logsBloom, difficulty, number,
                    gasLimit, gasUsed, timestamp, extraData);
        }
    }

    public byte[] getUnclesEncoded(final List<BlockHeader> uncleList) {

        final byte[][] unclesEncoded = new byte[uncleList.size()][];
        int i = 0;
        for (final BlockHeader uncle : uncleList) {
            unclesEncoded[i] = uncle.getEncoded();
            ++i;
        }
        return RLP.encodeList(unclesEncoded);
    }

    public byte[] getPowBoundary() {
        return BigIntegers.asUnsignedByteArray(32, BigInteger.ONE.shiftLeft(256).divide(getDifficultyBI()));
    }

    public byte[] calcPowValue() {

        // nonce bytes are expected in Little Endian order, reverting
        final byte[] nonceReverted = Arrays.reverse(nonce);
        final byte[] hashWithoutNonce = HashUtil.INSTANCE.sha3(getEncodedWithoutNonce());

        final byte[] seed = Arrays.concatenate(hashWithoutNonce, nonceReverted);
        final byte[] seedHash = HashUtil.INSTANCE.sha512(seed);

        final byte[] concat = Arrays.concatenate(seedHash, mixHash);
        return HashUtil.INSTANCE.sha3(concat);
    }

    public BigInteger calcDifficulty(final BlockchainNetConfig config, final BlockHeader parent) {
        return config.getConfigForBlock(getNumber()).
                calcDifficulty(this, parent);
    }

    public String toString() {
        return toStringWithSuffix("\n");
    }

    private String toStringWithSuffix(final String suffix) {
        return "  hash=" + toHexString(getHash()) + suffix +
                "  parentHash=" + toHexString(parentHash) + suffix +
                "  unclesHash=" + toHexString(unclesHash) + suffix +
                "  coinbase=" + toHexString(coinbase) + suffix +
                "  stateRoot=" + toHexString(stateRoot) + suffix +
                "  txTrieHash=" + toHexString(txTrieRoot) + suffix +
                "  receiptsTrieHash=" + toHexString(receiptTrieRoot) + suffix +
                "  difficulty=" + toHexString(difficulty) + suffix +
                "  number=" + number + suffix +
                "  gasLimit=" + toHexString(gasLimit) + suffix +
                "  gasUsed=" + gasUsed + suffix +
                "  timestamp=" + timestamp + " (" + Utils.longToDateTime(timestamp) + ")" + suffix +
                "  extraData=" + toHexString(extraData) + suffix +
                "  mixHash=" + toHexString(mixHash) + suffix +
                "  nonce=" + toHexString(nonce) + suffix;
    }

    public String toFlatString() {
        return toStringWithSuffix("");
    }

    public String getShortDescr() {
        return "#" + getNumber() + " (" + Hex.toHexString(getHash()).substring(0,6) + " <~ "
                + Hex.toHexString(getParentHash()).substring(0,6) + ")";
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        final BlockHeader that = (BlockHeader) o;
        return FastByteComparisons.equal(getHash(), that.getHash());
    }

    @Override
    public int hashCode() {
        return Arrays.hashCode(getHash());
    }
}


text:
package io.quarkus.it.hibernate.multitenancy.fruit;

import static io.restassured.RestAssured.given;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.arrayContaining;
import static org.hamcrest.Matchers.arrayWithSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;

import javax.ws.rs.core.Response.Status;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import io.restassured.http.ContentType;
import io.restassured.response.Response;

/**
 * Test various Hibernate Multitenancy operations running in Quarkus
 */
@QuarkusTest
public class HibernateTenancyFunctionalityTest {

    @BeforeEach
    public void cleanup() {

        deleteIfExists("", "Dragonfruit");
        deleteIfExists("", "Gooseberry");
        deleteIfExists("/mycompany", "Damson");
        deleteIfExists("/mycompany", "Grapefruit");

    }

    @Test
    public void testAddDeleteDefaultTenant() throws Exception {

        // Create fruit for default 'base' tenant
        given().with().body(new Fruit("Delete")).contentType(ContentType.JSON).when().post("/fruits").then()
                .assertThat().statusCode(is(Status.CREATED.getStatusCode()));

        // Get it
        Fruit newFruit = findByName("", "Delete");

        // Delete it
        given().pathParam("id", newFruit.getId()).contentType("application/json").accept("application/json")
                .when().delete("/fruits/{id}").then().assertThat().statusCode(is(Status.NO_CONTENT.getStatusCode()));

    }

    @Test
    public void testGetFruitsDefaultTenant() throws Exception {

        Fruit[] fruits = given().when().get("/fruits").then().assertThat()
                .statusCode(is(Status.OK.getStatusCode())).extract()
                .as(Fruit[].class);
        assertThat(fruits, arrayContaining(new Fruit(2, "Apple"), new Fruit(3, "Banana"), new Fruit(1, "Cherry")));

    }

    @Test
    public void testGetFruitsTenantMycompany() throws Exception {

        Fruit[] fruits = given().when().get("/mycompany/fruits").then().assertThat()
                .statusCode(is(Status.OK.getStatusCode())).extract()
                .as(Fruit[].class);
        assertThat(fruits, arrayWithSize(3));
        assertThat(fruits, arrayContaining(new Fruit(2, "Apricots"), new Fruit(1, "Avocado"), new Fruit(3, "Blackberries")));

    }

    @Test
    public void testPostFruitDefaultTenant() throws Exception {

        // Create fruit for default 'base' tenant
        Fruit newFruit = new Fruit("Dragonfruit");
        given().with().body(newFruit).contentType(ContentType.JSON).when().post("/fruits").then()
                .assertThat()
                .statusCode(is(Status.CREATED.getStatusCode()));

        // Getting it directly should return the new fruit
        Fruit dragonFruit = findByName("", newFruit.getName());
        assertThat(dragonFruit, not(is(nullValue())));

        // Getting fruit list should also contain the new fruit
        Fruit[] baseFruits = given().when().get("/fruits").then().assertThat()
                .statusCode(is(Status.OK.getStatusCode())).extract()
                .as(Fruit[].class);
        assertThat(baseFruits, arrayWithSize(4));
        assertThat(baseFruits,
                arrayContaining(new Fruit(2, "Apple"), new Fruit(3, "Banana"), new Fruit(1, "Cherry"), dragonFruit));

        // The other tenant should NOT have the new fruit
        Fruit[] mycompanyFruits = given().when().get("/mycompany/fruits").then().assertThat()
                .statusCode(is(Status.OK.getStatusCode()))
                .extract().as(Fruit[].class);
        assertThat(mycompanyFruits, arrayWithSize(3));
        assertThat(mycompanyFruits,
                arrayContaining(new Fruit(2, "Apricots"), new Fruit(1, "Avocado"), new Fruit(3, "Blackberries")));

        // Getting it directly should also NOT return the new fruit
        assertThat(findByName("/mycompany", newFruit.getName()), is(nullValue()));

    }

    @Test
    public void testUpdateFruitDefaultTenant() throws Exception {

        // Create fruits for both tenants

        Fruit newFruitBase = new Fruit("Dragonfruit");
        given().with().body(newFruitBase).contentType(ContentType.JSON).when().post("/fruits").then()
                .assertThat()
                .statusCode(is(Status.CREATED.getStatusCode()));
        Fruit baseFruit = findByName("", newFruitBase.getName());
        assertThat(baseFruit, not(is(nullValue())));

        Fruit newFruitMycompany = new Fruit("Damson");
        given().with().body(newFruitMycompany).contentType(ContentType.JSON).when().post("/mycompany/fruits")
                .then().assertThat()
                .statusCode(is(Status.CREATED.getStatusCode()));
        Fruit mycompanyFruit = findByName("/mycompany", newFruitMycompany.getName());
        assertThat(mycompanyFruit, not(is(nullValue())));

        // Update both

        String baseFruitName = "Gooseberry";
        baseFruit.setName(baseFruitName);
        given().with().body(baseFruit).contentType(ContentType.JSON).when()
                .put("/fruits/{id}", baseFruit.getId()).then().assertThat()
                .statusCode(is(Status.OK.getStatusCode()));

        String mycompanyFruitName = "Grapefruit";
        mycompanyFruit.setName(mycompanyFruitName);
        given().with().body(mycompanyFruit).contentType(ContentType.JSON).when()
                .put("/mycompany/fruits/{id}", mycompanyFruit.getId())
                .then().assertThat().statusCode(is(Status.OK.getStatusCode()));

        // Check if we can get them back and they only exist for one tenant

        assertThat(findByName("", baseFruitName), is(not(nullValue())));
        assertThat(findByName("/mycompany", baseFruitName), is(nullValue()));

        assertThat(findByName("/mycompany", mycompanyFruitName), is(not(nullValue())));
        assertThat(findByName("", mycompanyFruitName), is(nullValue()));

    }

    private Fruit findByName(String tenantPath, String name) {
        Response response = given().when().get(tenantPath + "/fruitsFindBy?type=name&value={name}", name);
        if (response.getStatusCode() == Status.OK.getStatusCode()) {
            return response.as(Fruit.class);
        }
        return null;
    }

    private void deleteIfExists(String tenantPath, String name) {
        Fruit dragonFruit = findByName(tenantPath, name);
        if (dragonFruit != null) {
            given().pathParam("id", dragonFruit.getId()).when().delete(tenantPath + "/fruits/{id}").then()
                    .assertThat()
                    .statusCode(is(Status.NO_CONTENT.getStatusCode()));
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
using Leak.Common;
using Leak.Networking.Core;
using Leak.Tasks;

namespace Leak.Connector
{
    public class PeerConnectorTaskReject : LeakTask<PeerConnectorContext>
    {
        private readonly NetworkAddress remote;

        public PeerConnectorTaskReject(NetworkAddress remote)
        {
            this.remote = remote;
        }

        public void Execute(PeerConnectorContext context)
        {
            context.Hooks.CallConnectionRejected(remote);
        }
    }
}


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

import java.io.IOException;

import org.jsmpp.PDUStringException;
import org.jsmpp.SMPPConstant;
import org.jsmpp.bean.Bind;
import org.jsmpp.bean.Command;
import org.jsmpp.bean.EnquireLinkResp;
import org.jsmpp.extra.PendingResponse;
import org.jsmpp.extra.SessionState;
import org.jsmpp.session.BaseResponseHandler;
import org.jsmpp.session.ServerResponseHandler;
import org.jsmpp.util.DefaultDecomposer;
import org.jsmpp.util.PDUDecomposer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author uudashr
 *
 */
class SMPPServerSessionOpen implements SMPPServerSessionState {
    private static final Logger logger = LoggerFactory.getLogger(SMPPServerSessionOpen.class);
    private static final String INVALID_PROCESS_FOR_OPEN_SESSION = "Invalid process for open session state";
    private static final PDUDecomposer pduDecomposer = new DefaultDecomposer();

    @Override
    public SessionState getSessionState() {
        return SessionState.OPEN;
    }

    @Override
    public void processBind(Command pduHeader, byte[] pdu,
            ServerResponseHandler responseHandler) throws IOException {

        try {
            Bind bind = pduDecomposer.bind(pdu);
            responseHandler.processBind(bind);
        } catch (PDUStringException e) {
            responseHandler.sendNegativeResponse(pduHeader.getCommandId(), e.getErrorCode(), pduHeader.getSequenceNumber());
        } catch (IllegalArgumentException e) {
            // TODO uudashr: might not need anymore
            responseHandler.sendNegativeResponse(pduHeader.getCommandId(), SMPPConstant.STAT_ESME_RINVCMDID, pduHeader.getSequenceNumber());
        }
    }

    @Override
    public void processDeliverSmResp(Command pduHeader, byte[] pdu,
            ServerResponseHandler responseHandler) throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processQuerySm(Command pduHeader, byte[] pdu,
            ServerResponseHandler responseHandler)
            throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processSubmitSm(Command pduHeader, byte[] pdu,
            ServerResponseHandler responseHandler)
            throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processSubmitMulti(Command pduHeader, byte[] pdu,
            ServerResponseHandler responseHandler) throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processEnquireLink(Command pduHeader, byte[] pdu,
            BaseResponseHandler responseHandler) throws IOException {
        responseHandler.sendEnquireLinkResp(pduHeader.getSequenceNumber());
    }

    @Override
    public void processEnquireLinkResp(Command pduHeader, byte[] pdu,
            BaseResponseHandler responseHandler) throws IOException {
        PendingResponse<Command> pendingResp = responseHandler
            .removeSentItem(pduHeader.getSequenceNumber());
        if (pendingResp != null) {
            EnquireLinkResp resp = pduDecomposer.enquireLinkResp(pdu);
            pendingResp.done(resp);
        } else {
            logger.error("No request found for {}", pduHeader);
        }
    }

    @Override
    public void processGenericNack(Command pduHeader, byte[] pdu,
            BaseResponseHandler responseHandler) throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processUnbind(Command pduHeader, byte[] pdu,
            BaseResponseHandler sessionHandler) throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processUnbindResp(Command pduHeader, byte[] pdu,
            BaseResponseHandler sessionHandler) throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processUnknownCid(Command pduHeader, byte[] pdu,
            BaseResponseHandler sessionHandler) throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processDataSm(Command pduHeader, byte[] pdu,
            BaseResponseHandler responseHandler) throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processDataSmResp(Command pduHeader, byte[] pdu,
            BaseResponseHandler responseHandler) throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processCancelSm(Command pduHeader, byte[] pdu,
            ServerResponseHandler responseHandler) throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processReplaceSm(Command pduHeader, byte[] pdu,
            ServerResponseHandler responseHandler) throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processBroadcastSm(final Command pduHeader, final byte[] pdu,
                                   final ServerResponseHandler responseHandler)
        throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processCancelBroadcastSm(final Command pduHeader, final byte[] pdu,
                                         final ServerResponseHandler responseHandler)
        throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }

    @Override
    public void processQueryBroadcastSm(final Command pduHeader, final byte[] pdu,
                                        final ServerResponseHandler responseHandler)
        throws IOException {
        throw new IOException(INVALID_PROCESS_FOR_OPEN_SESSION);
    }
}


text:
using AutoMapper;
using SimpleTaskSystem.Tasks;
using SimpleTaskSystem.Tasks.Dtos;

namespace SimpleTaskSystem
{
    internal static class DtoMappings
    {
        public static void Map(IMapperConfigurationExpression mapper)
        {
            //I specified mapping for AssignedPersonId since NHibernate does not fill Task.AssignedPersonId
            //If you will just use EF, then you can remove ForMember definition.
            mapper.CreateMap<Task, TaskDto>().ForMember(t => t.AssignedPersonId, opts => opts.MapFrom(d => d.AssignedPerson.Id));
        }
    }
}


text:
package com.camunda.demo.webinar.cmmn.jsf;

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

import javax.inject.Inject;
import javax.inject.Named;

import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.engine.identity.Group;
import org.camunda.bpm.engine.repository.CaseDefinition;
import org.camunda.bpm.engine.runtime.CaseInstance;
import org.camunda.bpm.engine.task.Task;

import com.camunda.demo.webinar.cmmn.Constants;
import com.camunda.demo.webinar.cmmn.domain.Application;

@Named
public class TasklistController {

  @Inject
  private ProcessEngine processEngine;

  @Inject
  @Named
  private CaseController caseController;

  @Inject
  @Named
  private UserController userController;

  private List<TaskRow> taskRows;

  public List<TaskRow> getAllTasks() {
    // lazy load tasks if not yet done
    if (taskRows == null) {
      taskRows = new ArrayList<TaskRow>();
      // Todo: check that somebody is logged in

      List<Task> tasksForUser = processEngine.getTaskService().createTaskQuery() //
          .taskAssignee(userController.getUserId()) //
          .active() //
          .orderByTaskCreateTime().desc() //
          .initializeFormKeys() //
          .list();
      taskRows.addAll(createTaskRows(tasksForUser));

      List<Group> groups = processEngine.getIdentityService().createGroupQuery().groupMember(userController.getUserId()).list();
      List<String> groupIds = new ArrayList<String>();
      for (final Group group : groups) {
        groupIds.add(group.getId());
      }
      if (groupIds.size() > 0) {
        List<Task> tasksForGroups = processEngine.getTaskService().createTaskQuery() //
            .taskCandidateGroupIn(groupIds) //
            .active() //
            .orderByTaskCreateTime().desc() //
            .initializeFormKeys() //
            .list();
        taskRows.addAll(createTaskRows(tasksForGroups));
      }
    }
    return taskRows;
  }

  private List<TaskRow> createTaskRows(final List<Task> tasks) {
    List<TaskRow> taskRows = new ArrayList<TaskRow>();
    for (Task task : tasks) {
      CaseInstance caseInstance = null;
      Application application = null;
      CaseDefinition caseDefinition = null;

      if (task.getCaseInstanceId() != null) {
        caseInstance = processEngine.getCaseService().createCaseInstanceQuery().caseInstanceId(task.getCaseInstanceId()).singleResult();
        caseDefinition = processEngine.getRepositoryService().getCaseDefinition(caseInstance.getCaseDefinitionId());
      }

      application = (Application) processEngine.getTaskService().getVariable(task.getId(), Constants.VAR_NAME_APPLICATION);
      taskRows.add(new TaskRow(task, application, caseInstance, caseDefinition));
    }
    return taskRows;
  }
}


text:
{% extends "base.html" %}

{% block content %}

Change your password

Booksonas is a work-in-progress for better library management. Right now, we create a library from books in your Dropbox, which you can organize, search, and send to your various devices via email.

Booksonas is alpha software, currently comes with no warranty. Currently, you use it at your own risk. We do not write to your Dropbox or make edits there.

<form action="{{ action }}" method="POST">
    {% csrf_token %}
    {% if form.non_field_errors %}

        {% for error in form.non_field_errors %}

{{ error }}

        {% endfor %}

    {% endif %}

    {% for field in form %}

            {{ field.help_text }}

                {{ field.label_tag }} {{ field }}

                {{ field.errors }}

    {% endfor %}

    <input id="add_invite" type="submit" value="Save">
</form>
{% endblock %}


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

/**
 * @fileoverview A slider implementation that allows to select a value within a
 * range by dragging a thumb. The selected value is exposed through getValue().
 *
 * To decorate, the slider should be bound to an element with the class name
 * 'goog-slider' containing a child with the class name 'goog-slider-thumb',
 * whose position is set to relative.
 * Note that you won't be able to see these elements unless they are styled.
 *
 * Slider orientation is horizontal by default.
 * Use setOrientation(goog.ui.Slider.Orientation.VERTICAL) for a vertical
 * slider.
 *
 * Decorate Example:
 *

 *

 *

 *
 *
 *
 * @author arv@google.com (Erik Arvidsson)
 * @see ../demos/slider.html
 */

// Implementation note: We implement slider by inheriting from baseslider,
// which allows to select sub-ranges within a range using two thumbs. All we do
// is we co-locate the two thumbs into one.

goog.provide('goog.ui.Slider');
goog.provide('goog.ui.Slider.Orientation');

goog.require('goog.a11y.aria');
goog.require('goog.a11y.aria.Role');
goog.require('goog.dom');
goog.require('goog.ui.SliderBase');

/**
 * This creates a slider object.
 * @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper.
 * @param {(function(number):?string)=} opt_labelFn An optional function mapping
 *     slider values to a description of the value.
 * @constructor
 * @extends {goog.ui.SliderBase}
 */
goog.ui.Slider = function(opt_domHelper, opt_labelFn) {
  goog.ui.SliderBase.call(this, opt_domHelper, opt_labelFn);
  this.rangeModel.setExtent(0);
};
goog.inherits(goog.ui.Slider, goog.ui.SliderBase);
goog.tagUnsealableClass(goog.ui.Slider);

/**
 * Expose Enum of superclass (representing the orientation of the slider) within
 * Slider namespace.
 *
 * @enum {string}
 */
goog.ui.Slider.Orientation = goog.ui.SliderBase.Orientation;

/**
 * The prefix we use for the CSS class names for the slider and its elements.
 * @type {string}
 */
goog.ui.Slider.CSS_CLASS_PREFIX = goog.getCssName('goog-slider');

/**
 * CSS class name for the single thumb element.
 * @type {string}
 */
goog.ui.Slider.THUMB_CSS_CLASS =
    goog.getCssName(goog.ui.Slider.CSS_CLASS_PREFIX, 'thumb');

/**
 * Returns CSS class applied to the slider element.
 * @param {goog.ui.SliderBase.Orientation} orient Orientation of the slider.
 * @return {string} The CSS class applied to the slider element.
 * @protected
 * @override
 */
goog.ui.Slider.prototype.getCssClass = function(orient) {
  return orient == goog.ui.SliderBase.Orientation.VERTICAL ?
      goog.getCssName(goog.ui.Slider.CSS_CLASS_PREFIX, 'vertical') :
      goog.getCssName(goog.ui.Slider.CSS_CLASS_PREFIX, 'horizontal');
};

/** @override */
goog.ui.Slider.prototype.createThumbs = function() {
  // find thumb
  var element = this.getElement();
  var thumb = goog.dom.getElementsByTagNameAndClass(
      null, goog.ui.Slider.THUMB_CSS_CLASS, element)[0];
  if (!thumb) {
    thumb = this.createThumb_();
    element.appendChild(thumb);
  }
  this.valueThumb = this.extentThumb = thumb;
};

/**
 * Creates the thumb element.
 * @return {HTMLDivElement} The created thumb element.
 * @private
 */
goog.ui.Slider.prototype.createThumb_ = function() {
  var thumb =
      this.getDomHelper().createDom('div', goog.ui.Slider.THUMB_CSS_CLASS);
  goog.a11y.aria.setRole(thumb, goog.a11y.aria.Role.BUTTON);
  return /** @type {HTMLDivElement} */ (thumb);
};


text:
import urllib2
import sys
import time
from math import cos, sin
import cv2.cv as cv

CLOCKS_PER_SEC = 1.0
MHI_DURATION = 1
MAX_TIME_DELTA = 0.5
MIN_TIME_DELTA = 0.05
N = 4
buf = range(10)
last = 0
mhi = None # MHI
orient = None # orientation
mask = None # valid orientation mask
segmask = None # motion segmentation map
storage = None # temporary storage

def update_mhi(img, dst, diff_threshold):
    global last
    global mhi
    global storage
    global mask
    global orient
    global segmask
    timestamp = time.clock() / CLOCKS_PER_SEC # get current time in seconds
    size = cv.GetSize(img) # get current frame size
    idx1 = last
    if not mhi or cv.GetSize(mhi) != size:
        for i in range(N):
            buf[i] = cv.CreateImage(size, cv.IPL_DEPTH_8U, 1)
            cv.Zero(buf[i])
        mhi = cv.CreateImage(size,cv. IPL_DEPTH_32F, 1)
        cv.Zero(mhi) # clear MHI at the beginning
        orient = cv.CreateImage(size,cv. IPL_DEPTH_32F, 1)
        segmask = cv.CreateImage(size,cv. IPL_DEPTH_32F, 1)
        mask = cv.CreateImage(size,cv. IPL_DEPTH_8U, 1)

    cv.CvtColor(img, buf[last], cv.CV_BGR2GRAY) # convert frame to grayscale
    idx2 = (last + 1) % N # index of (last - (N-1))th frame
    last = idx2
    silh = buf[idx2]
    cv.AbsDiff(buf[idx1], buf[idx2], silh) # get difference between frames
    cv.Threshold(silh, silh, diff_threshold, 1, cv.CV_THRESH_BINARY) # and threshold it
    cv.UpdateMotionHistory(silh, mhi, timestamp, MHI_DURATION) # update MHI
    cv.CvtScale(mhi, mask, 255./MHI_DURATION,
                (MHI_DURATION - timestamp)*255./MHI_DURATION)
    cv.Zero(dst)
    cv.Merge(mask, None, None, None, dst)
    cv.CalcMotionGradient(mhi, mask, orient, MAX_TIME_DELTA, MIN_TIME_DELTA, 3)
    if not storage:
        storage = cv.CreateMemStorage(0)
    seq = cv.SegmentMotion(mhi, segmask, storage, timestamp, MAX_TIME_DELTA)
    for (area, value, comp_rect) in seq:
        if comp_rect[2] + comp_rect[3] > 100: # reject very small components
            color = cv.CV_RGB(255, 0,0)
            silh_roi = cv.GetSubRect(silh, comp_rect)
            mhi_roi = cv.GetSubRect(mhi, comp_rect)
            orient_roi = cv.GetSubRect(orient, comp_rect)
            mask_roi = cv.GetSubRect(mask, comp_rect)
            angle = 360 - cv.CalcGlobalOrientation(orient_roi, mask_roi, mhi_roi, timestamp, MHI_DURATION)

            count = cv.Norm(silh_roi, None, cv.CV_L1, None) # calculate number of points within silhouette ROI
            if count < (comp_rect[2] * comp_rect[3] * 0.05):
                continue

            magnitude = 30.
            center = ((comp_rect[0] + comp_rect[2] / 2), (comp_rect[1] + comp_rect[3] / 2))
            cv.Circle(dst, center, cv.Round(magnitude*1.2), color, 3, cv.CV_AA, 0)
            cv.Line(dst,
                    center,
                    (cv.Round(center[0] + magnitude * cos(angle * cv.CV_PI / 180)),
                     cv.Round(center[1] - magnitude * sin(angle * cv.CV_PI / 180))),
                    color,
                    3,
                    cv.CV_AA,
                    0)

if __name__ == "__main__":
    motion = 0
    capture = 0

    if len(sys.argv)==1:
        capture = cv.CreateCameraCapture(0)
    elif len(sys.argv)==2 and sys.argv[1].isdigit():
        capture = cv.CreateCameraCapture(int(sys.argv[1]))
    elif len(sys.argv)==2:
        capture = cv.CreateFileCapture(sys.argv[1])

    if not capture:
        print "Could not initialize capturing..."
        sys.exit(-1)

    cv.NamedWindow("Motion", 1)
    while True:
        image = cv.QueryFrame(capture)
        if(image):
            if(not motion):
                    motion = cv.CreateImage((image.width, image.height), 8, 3)
                    cv.Zero(motion)
                    #motion.origin = image.origin
            update_mhi(image, motion, 30)
            cv.ShowImage("Motion", motion)
            if(cv.WaitKey(10) != -1):
                break
        else:
            break
    cv.DestroyWindow("Motion")


text:
#include "config.h"
#include "core/animation/CompositorAnimations.h"

#include "core/animation/AnimationTranslationUtil.h"
#include "core/animation/CompositorAnimationsImpl.h"
#include "core/animation/animatable/AnimatableDouble.h"
#include "core/animation/animatable/AnimatableFilterOperations.h"
#include "core/animation/animatable/AnimatableTransform.h"
#include "core/animation/animatable/AnimatableValue.h"
#include "core/rendering/RenderBoxModelObject.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderObject.h"
#include "core/rendering/compositing/CompositedLayerMapping.h"
#include "platform/geometry/FloatBox.h"
#include "public/platform/Platform.h"
#include "public/platform/WebAnimation.h"
#include "public/platform/WebCompositorSupport.h"
#include "public/platform/WebFilterAnimationCurve.h"
#include "public/platform/WebFilterKeyframe.h"
#include "public/platform/WebFloatAnimationCurve.h"
#include "public/platform/WebFloatKeyframe.h"
#include "public/platform/WebTransformAnimationCurve.h"
#include "public/platform/WebTransformKeyframe.h"

#include <algorithm>
#include <cmath>

namespace blink {

namespace {

void getKeyframeValuesForProperty(const KeyframeEffectModelBase* effect, CSSPropertyID id, double scale, bool reverse, PropertySpecificKeyframeVector& values)
{
    ASSERT(values.isEmpty());
    const PropertySpecificKeyframeVector& group = effect->getPropertySpecificKeyframes(id);

    if (reverse) {
        for (size_t i = group.size(); i--;) {
            double offset = (1 - group[i]->offset()) * scale;
            values.append(group[i]->cloneWithOffset(offset));
        }
    } else {
        for (size_t i = 0; i < group.size(); ++i) {
            double offset = group[i]->offset() * scale;
            values.append(group[i]->cloneWithOffset(offset));
        }
    }
}

}

// -----------------------------------------------------------------------
// TimingFunctionReverser methods
// -----------------------------------------------------------------------

PassRefPtr<TimingFunction> CompositorAnimationsTimingFunctionReverser::reverse(const LinearTimingFunction* timefunc)
{
    return const_cast<LinearTimingFunction*>(timefunc);
}

PassRefPtr<TimingFunction> CompositorAnimationsTimingFunctionReverser::reverse(const CubicBezierTimingFunction* timefunc)
{
    switch (timefunc->subType()) {
    case CubicBezierTimingFunction::EaseIn:
        return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseOut);
    case CubicBezierTimingFunction::EaseOut:
        return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn);
    case CubicBezierTimingFunction::EaseInOut:
        return const_cast<CubicBezierTimingFunction*>(timefunc);
    case CubicBezierTimingFunction::Ease: // Ease is not symmetrical
    case CubicBezierTimingFunction::Custom:
        return CubicBezierTimingFunction::create(1 - timefunc->x2(), 1 - timefunc->y2(), 1 - timefunc->x1(), 1 - timefunc->y1());
    default:
        ASSERT_NOT_REACHED();
        return PassRefPtr<TimingFunction>();
    }
}

PassRefPtr<TimingFunction> CompositorAnimationsTimingFunctionReverser::reverse(const TimingFunction* timefunc)
{
    switch (timefunc->type()) {
    case TimingFunction::LinearFunction: {
        const LinearTimingFunction* linear = toLinearTimingFunction(timefunc);
        return reverse(linear);
    }
    case TimingFunction::CubicBezierFunction: {
        const CubicBezierTimingFunction* cubic = toCubicBezierTimingFunction(timefunc);
        return reverse(cubic);
    }

    // Steps function can not be reversed.
    case TimingFunction::StepsFunction:
    default:
        ASSERT_NOT_REACHED();
        return PassRefPtr<TimingFunction>();
    }
}

bool CompositorAnimations::getAnimatedBoundingBox(FloatBox& box, const AnimationEffect& effect, double minValue, double maxValue) const
{
    const KeyframeEffectModelBase& keyframeEffect = toKeyframeEffectModelBase(effect);

    PropertySet properties = keyframeEffect.properties();

    if (properties.isEmpty())
        return true;

    minValue = std::min(minValue, 0.0);
    maxValue = std::max(maxValue, 1.0);

    for (PropertySet::const_iterator it = properties.begin(); it != properties.end(); ++it) {
        // TODO: Add the ability to get expanded bounds for filters as well.
        if (*it != CSSPropertyTransform && *it != CSSPropertyWebkitTransform)
            continue;

        const PropertySpecificKeyframeVector& frames = keyframeEffect.getPropertySpecificKeyframes(*it);
        if (frames.isEmpty() || frames.size() < 2)
            continue;

        FloatBox originalBox(box);

        for (size_t j = 0; j < frames.size() - 1; ++j) {
            const AnimatableTransform* startTransform = toAnimatableTransform(frames[j]->getAnimatableValue().get());
            const AnimatableTransform* endTransform = toAnimatableTransform(frames[j+1]->getAnimatableValue().get());
            // TODO: Add support for inflating modes other than Replace.
            if (frames[j]->composite() != AnimationEffect::CompositeReplace)
                return false;

            const TimingFunction* timing = frames[j]->easing();
            double min = 0;
            double max = 1;
            if (j == 0) {
                float frameLength = frames[j+1]->offset();
                if (frameLength > 0) {
                    min = minValue / frameLength;
                }
            }

            if (j == frames.size() - 2) {
                float frameLength = frames[j+1]->offset() - frames[j]->offset();
                if (frameLength > 0) {
                    max = 1 + (maxValue - 1) / frameLength;
                }
            }

            FloatBox bounds;
            if (timing)
                timing->range(&min, &max);
            if (!endTransform->transformOperations().blendedBoundsForBox(originalBox, startTransform->transformOperations(), min, max, &bounds))
                return false;
            box.expandTo(bounds);
        }
    }
    return true;
}

// -----------------------------------------------------------------------
// CompositorAnimations public API
// -----------------------------------------------------------------------

bool CompositorAnimations::isCandidateForAnimationOnCompositor(const Timing& timing, const AnimationEffect& effect)
{
    const KeyframeEffectModelBase& keyframeEffect = toKeyframeEffectModelBase(effect);

    PropertySet properties = keyframeEffect.properties();

    if (properties.isEmpty())
        return false;

    for (PropertySet::const_iterator it = properties.begin(); it != properties.end(); ++it) {
        const PropertySpecificKeyframeVector& frames = keyframeEffect.getPropertySpecificKeyframes(*it);
        ASSERT(frames.size() >= 2);
        for (size_t i = 0; i < frames.size(); ++i) {
            const Keyframe::PropertySpecificKeyframe *frame = frames[i].get();
            // FIXME: Determine candidacy based on the CSSValue instead of a snapshot AnimatableValue.
            if (frame->composite() != AnimationEffect::CompositeReplace || !frame->getAnimatableValue())
                return false;

            switch (*it) {
            case CSSPropertyOpacity:
                break;
            case CSSPropertyTransform:
                if (toAnimatableTransform(frame->getAnimatableValue().get())->transformOperations().dependsOnBoxSize())
                    return false;
                break;
            case CSSPropertyWebkitFilter: {
                const FilterOperations& operations = toAnimatableFilterOperations(frame->getAnimatableValue().get())->operations();
                if (operations.hasFilterThatMovesPixels())
                    return false;
                break;
            }
            default:
                return false;
            }

            // FIXME: Remove this check when crbug.com/229405 is resolved
            if (i < frames.size() - 1 && frame->easing()->type() == TimingFunction::StepsFunction)
                return false;
        }
    }

    CompositorAnimationsImpl::CompositorTiming out;
    if (!CompositorAnimationsImpl::convertTimingForCompositor(timing, out))
        return false;

    // FIXME: We should support non-linear timing functions in the compositor
    // eventually.
    if (timing.timingFunction->type() != TimingFunction::LinearFunction)
        return false;

    return true;
}

bool CompositorAnimations::canStartAnimationOnCompositor(const Element& element)
{
    return element.renderer() && element.renderer()->compositingState() == PaintsIntoOwnBacking;
}

bool CompositorAnimations::startAnimationOnCompositor(const Element& element, double startTime, const Timing& timing, const AnimationEffect& effect, Vector<int>& startedAnimationIds)
{
    ASSERT(startedAnimationIds.isEmpty());
    ASSERT(isCandidateForAnimationOnCompositor(timing, effect));
    ASSERT(canStartAnimationOnCompositor(element));

    const KeyframeEffectModelBase& keyframeEffect = toKeyframeEffectModelBase(effect);

    RenderLayer* layer = toRenderBoxModelObject(element.renderer())->layer();
    ASSERT(layer);

    Vector<OwnPtr<blink::WebAnimation> > animations;
    CompositorAnimationsImpl::getAnimationOnCompositor(timing, startTime, keyframeEffect, animations);
    ASSERT(!animations.isEmpty());
    for (size_t i = 0; i < animations.size(); ++i) {
        int id = animations[i]->id();
        if (!layer->compositedLayerMapping()->mainGraphicsLayer()->addAnimation(animations[i].release())) {
            // FIXME: We should know ahead of time whether these animations can be started.
            for (size_t j = 0; j < startedAnimationIds.size(); ++j)
                cancelAnimationOnCompositor(element, startedAnimationIds[j]);
            startedAnimationIds.clear();
            return false;
        }
        startedAnimationIds.append(id);
    }
    ASSERT(!startedAnimationIds.isEmpty());
    return true;
}

void CompositorAnimations::cancelAnimationOnCompositor(const Element& element, int id)
{
    if (!canStartAnimationOnCompositor(element)) {
        // When an element is being detached, we cancel any associated
        // AnimationPlayers for CSS animations. But by the time we get
        // here the mapping will have been removed.
        // FIXME: Defer remove/pause operations until after the
        // compositing update.
        return;
    }
    toRenderBoxModelObject(element.renderer())->layer()->compositedLayerMapping()->mainGraphicsLayer()->removeAnimation(id);
}

void CompositorAnimations::pauseAnimationForTestingOnCompositor(const Element& element, int id, double pauseTime)
{
    // FIXME: canStartAnimationOnCompositor queries compositingState, which is not necessarily up to date.
    // https://code.google.com/p/chromium/issues/detail?id=339847
    DisableCompositingQueryAsserts disabler;

    if (!canStartAnimationOnCompositor(element)) {
        ASSERT_NOT_REACHED();
        return;
    }
    toRenderBoxModelObject(element.renderer())->layer()->compositedLayerMapping()->mainGraphicsLayer()->pauseAnimation(id, pauseTime);
}

// -----------------------------------------------------------------------
// CompositorAnimationsImpl
// -----------------------------------------------------------------------

bool CompositorAnimationsImpl::convertTimingForCompositor(const Timing& timing, CompositorTiming& out)
{
    timing.assertValid();

    // All fill modes are supported (the calling code handles them).

    // FIXME: Support non-zero iteration start.
    if (timing.iterationStart)
        return false;

    // FIXME: Compositor only supports positive, integer iteration counts.
    // Zero iterations could be converted, but silly.
    if ((std::floor(timing.iterationCount) != timing.iterationCount) || timing.iterationCount <= 0)
        return false;

    if (std::isnan(timing.iterationDuration) || !timing.iterationDuration)
        return false;

    // FIXME: Support other playback rates
    if (timing.playbackRate != 1)
        return false;

    // All directions are supported.

    // Now attempt an actual conversion
    out.scaledDuration = timing.iterationDuration;
    ASSERT(out.scaledDuration > 0);

    double scaledStartDelay = timing.startDelay;
    if (scaledStartDelay > 0 && scaledStartDelay > out.scaledDuration * timing.iterationCount)
        return false;

    out.reverse = (timing.direction == Timing::PlaybackDirectionReverse
        || timing.direction == Timing::PlaybackDirectionAlternateReverse);
    out.alternate = (timing.direction == Timing::PlaybackDirectionAlternate
        || timing.direction == Timing::PlaybackDirectionAlternateReverse);

    if (!std::isfinite(timing.iterationCount)) {
        out.adjustedIterationCount = -1;
    } else {
        out.adjustedIterationCount = std::floor(timing.iterationCount);
        ASSERT(out.adjustedIterationCount > 0);
    }

    // Compositor's time offset is positive for seeking into the animation.
    out.scaledTimeOffset = -scaledStartDelay;
    return true;
}

namespace {

template<typename PlatformAnimationCurveType, typename PlatformAnimationKeyframeType>
void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const PlatformAnimationKeyframeType& keyframe, const TimingFunction* timingFunction)
{
    if (!timingFunction) {
        curve.add(keyframe);
        return;
    }

    switch (timingFunction->type()) {
    case TimingFunction::LinearFunction:
        curve.add(keyframe, blink::WebAnimationCurve::TimingFunctionTypeLinear);
        return;

    case TimingFunction::CubicBezierFunction: {
        const CubicBezierTimingFunction* cubic = toCubicBezierTimingFunction(timingFunction);

        if (cubic->subType() == CubicBezierTimingFunction::Custom) {
            curve.add(keyframe, cubic->x1(), cubic->y1(), cubic->x2(), cubic->y2());
        } else {

            blink::WebAnimationCurve::TimingFunctionType easeType;
            switch (cubic->subType()) {
            case CubicBezierTimingFunction::Ease:
                easeType = blink::WebAnimationCurve::TimingFunctionTypeEase;
                break;
            case CubicBezierTimingFunction::EaseIn:
                easeType = blink::WebAnimationCurve::TimingFunctionTypeEaseIn;
                break;
            case CubicBezierTimingFunction::EaseOut:
                easeType = blink::WebAnimationCurve::TimingFunctionTypeEaseOut;
                break;
            case CubicBezierTimingFunction::EaseInOut:
                easeType = blink::WebAnimationCurve::TimingFunctionTypeEaseInOut;
                break;

            // Custom Bezier are handled seperately.
            case CubicBezierTimingFunction::Custom:
            default:
                ASSERT_NOT_REACHED();
                return;
            }

            curve.add(keyframe, easeType);
        }
        return;
    }

    case TimingFunction::StepsFunction:
    default:
        ASSERT_NOT_REACHED();
        return;
    }
}

} // namespace anoymous

void CompositorAnimationsImpl::addKeyframesToCurve(blink::WebAnimationCurve& curve, const PropertySpecificKeyframeVector& keyframes, bool reverse)
{
    for (size_t i = 0; i < keyframes.size(); i++) {
        RefPtr<TimingFunction> reversedTimingFunction;
        const TimingFunction* keyframeTimingFunction = 0;
        if (i < keyframes.size() - 1) { // Ignore timing function of last frame.
            if (reverse) {
                reversedTimingFunction = CompositorAnimationsTimingFunctionReverser::reverse(keyframes[i + 1]->easing());
                keyframeTimingFunction = reversedTimingFunction.get();
            } else {
                keyframeTimingFunction = keyframes[i]->easing();
            }
        }

        // FIXME: This relies on StringKeyframes being eagerly evaluated, which will
        // not happen eventually. Instead we should extract the CSSValue here
        // and convert using another set of toAnimatableXXXOperations functions.
        const AnimatableValue* value = keyframes[i]->getAnimatableValue().get();

        switch (curve.type()) {
        case blink::WebAnimationCurve::AnimationCurveTypeFilter: {
            OwnPtr<blink::WebFilterOperations> ops = adoptPtr(blink::Platform::current()->compositorSupport()->createFilterOperations());
            toWebFilterOperations(toAnimatableFilterOperations(value)->operations(), ops.get());

            blink::WebFilterKeyframe filterKeyframe(keyframes[i]->offset(), ops.release());
            blink::WebFilterAnimationCurve* filterCurve = static_cast<blink::WebFilterAnimationCurve*>(&curve);
            addKeyframeWithTimingFunction(*filterCurve, filterKeyframe, keyframeTimingFunction);
            break;
        }
        case blink::WebAnimationCurve::AnimationCurveTypeFloat: {
            blink::WebFloatKeyframe floatKeyframe(keyframes[i]->offset(), toAnimatableDouble(value)->toDouble());
            blink::WebFloatAnimationCurve* floatCurve = static_cast<blink::WebFloatAnimationCurve*>(&curve);
            addKeyframeWithTimingFunction(*floatCurve, floatKeyframe, keyframeTimingFunction);
            break;
        }
        case blink::WebAnimationCurve::AnimationCurveTypeTransform: {
            OwnPtr<blink::WebTransformOperations> ops = adoptPtr(blink::Platform::current()->compositorSupport()->createTransformOperations());
            toWebTransformOperations(toAnimatableTransform(value)->transformOperations(), ops.get());

            blink::WebTransformKeyframe transformKeyframe(keyframes[i]->offset(), ops.release());
            blink::WebTransformAnimationCurve* transformCurve = static_cast<blink::WebTransformAnimationCurve*>(&curve);
            addKeyframeWithTimingFunction(*transformCurve, transformKeyframe, keyframeTimingFunction);
            break;
        }
        default:
            ASSERT_NOT_REACHED();
        }
    }
}

void CompositorAnimationsImpl::getAnimationOnCompositor(const Timing& timing, double startTime, const KeyframeEffectModelBase& effect, Vector<OwnPtr<blink::WebAnimation> >& animations)
{
    ASSERT(animations.isEmpty());
    CompositorTiming compositorTiming;
    bool timingValid = convertTimingForCompositor(timing, compositorTiming);
    ASSERT_UNUSED(timingValid, timingValid);

    PropertySet properties = effect.properties();
    ASSERT(!properties.isEmpty());
    for (PropertySet::iterator it = properties.begin(); it != properties.end(); ++it) {

        PropertySpecificKeyframeVector values;
        getKeyframeValuesForProperty(&effect, *it, compositorTiming.scaledDuration, compositorTiming.reverse, values);

        blink::WebAnimation::TargetProperty targetProperty;
        OwnPtr<blink::WebAnimationCurve> curve;
        switch (*it) {
        case CSSPropertyOpacity: {
            targetProperty = blink::WebAnimation::TargetPropertyOpacity;

            blink::WebFloatAnimationCurve* floatCurve = blink::Platform::current()->compositorSupport()->createFloatAnimationCurve();
            addKeyframesToCurve(*floatCurve, values, compositorTiming.reverse);
            curve = adoptPtr(floatCurve);
            break;
        }
        case CSSPropertyWebkitFilter: {
            targetProperty = blink::WebAnimation::TargetPropertyFilter;
            blink::WebFilterAnimationCurve* filterCurve = blink::Platform::current()->compositorSupport()->createFilterAnimationCurve();
            addKeyframesToCurve(*filterCurve, values, compositorTiming.reverse);
            curve = adoptPtr(filterCurve);
            break;
        }
        case CSSPropertyTransform: {
            targetProperty = blink::WebAnimation::TargetPropertyTransform;
            blink::WebTransformAnimationCurve* transformCurve = blink::Platform::current()->compositorSupport()->createTransformAnimationCurve();
            addKeyframesToCurve(*transformCurve, values, compositorTiming.reverse);
            curve = adoptPtr(transformCurve);
            break;
        }
        default:
            ASSERT_NOT_REACHED();
            continue;
        }
        ASSERT(curve.get());

        OwnPtr<blink::WebAnimation> animation = adoptPtr(blink::Platform::current()->compositorSupport()->createAnimation(*curve, targetProperty));

        if (!std::isnan(startTime))
            animation->setStartTime(startTime);

        animation->setIterations(compositorTiming.adjustedIterationCount);
        animation->setTimeOffset(compositorTiming.scaledTimeOffset);
        animation->setAlternatesDirection(compositorTiming.alternate);

        animations.append(animation.release());
    }
    ASSERT(!animations.isEmpty());
}

} // namespace blink


text:
namespace TIKSN.Progress
{
    public interface IUserConfirmation
    {
        bool ShouldContinue(string query, string caption);

        bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll);

        bool ShouldProcess(string target);

        bool ShouldProcess(string target, string action);

        bool ShouldProcess(string verboseDescription, string verboseWarning, string caption);
    }
}


text:
<?php

declare(strict_types=1);

/*
 * This file is part of SolidInvoice project.
 *
 * (c) Pierre du Plessis <open-source@solidworx.co>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace SolidInvoice\ApiBundle\Security;

use Doctrine\Persistence\ManagerRegistry;
use SolidInvoice\ApiBundle\Security\Provider\ApiTokenUserProvider;
use SolidInvoice\UserBundle\Entity\ApiTokenHistory;
use SolidInvoice\UserBundle\Repository\ApiTokenHistoryRepository;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
use Symfony\Contracts\Translation\TranslatorInterface;

class ApiTokenAuthenticator extends AbstractGuardAuthenticator
{
    protected ApiTokenUserProvider $userProvider;

    private ManagerRegistry $registry;

    private TranslatorInterface $translator;

    public function __construct(
        ApiTokenUserProvider $userProvider,
        ManagerRegistry $registry,
        TranslatorInterface $translator
    ) {
        $this->userProvider = $userProvider;
        $this->registry = $registry;
        $this->translator = $translator;
    }

    public function supports(Request $request): bool
    {
        return $request->headers->has('X-API-TOKEN') || $request->query->has('token');
    }

    public function getCredentials(Request $request): string
    {
        return $request->headers->get('X-API-TOKEN', $request->query->get('token'));
    }

    /**
     * @param string $credentials
     */
    public function getUser($credentials, UserProviderInterface $userProvider): ?UserInterface
    {
        assert($userProvider instanceof ApiTokenUserProvider);

        $username = $userProvider->getUsernameForToken($credentials);

        if (! $username) {
            return null;
        }

        return $userProvider->loadUserByUsername($username);
    }

    public function checkCredentials($credentials, UserInterface $user): bool
    {
        // In case of an API token, no credential check is needed.
        // Return `true` to cause authentication success
        return true;
    }

    public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $providerKey): ?Response
    {
        $apiToken = $this->getCredentials($request);

        $history = new ApiTokenHistory();

        $history->setMethod($request->getMethod())
            ->setIp($request->getClientIp())
            ->setRequestData($request->request->all())
            ->setUserAgent($request->server->get('HTTP_USER_AGENT'))
            ->setResource($request->getPathInfo());

        /** @var ApiTokenHistoryRepository $repository */
        $repository = $this->registry->getRepository(ApiTokenHistory::class);

        $repository->addHistory($history, $apiToken);

        return null;
    }

    public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response
    {
        $data = [
            'message' => $this->translator->trans($exception->getMessageKey(), $exception->getMessageData())
        ];

        return new JsonResponse($data, Response::HTTP_UNAUTHORIZED);
    }

    public function start(Request $request, AuthenticationException $authException = null): Response
    {
        $data = [
            // @TODO: translate this message
            'message' => 'Authentication Required'
        ];

        return new JsonResponse($data, Response::HTTP_UNAUTHORIZED);
    }

    public function supportsRememberMe(): bool
    {
        return false;
    }
}


text:
/**
 * This is a layout that inherits the anchoring of {@link Ext.layout.container.Anchor} and adds the
 * ability for x/y positioning using the standard x and y component config options.
 *
 * This class is intended to be extended or created via the {@link Ext.container.Container#layout layout}
 * configuration property.  See {@link Ext.container.Container#layout} for additional details.
 *
 *     @example
 *     Ext.create('Ext.form.Panel', {
 *         title: 'Absolute Layout',
 *         width: 300,
 *         height: 275,
 *         layout: {
 *             type: 'absolute'
 *             // layout-specific configs go here
 *             //itemCls: 'x-abs-layout-item',
 *         },
 *         url:'save-form.php',
 *         defaultType: 'textfield',
 *         items: [{
 *             x: 10,
 *             y: 10,
 *             xtype:'label',
 *             text: 'Send To:'
 *         },{
 *             x: 80,
 *             y: 10,
 *             name: 'to',
 *             anchor:'90%'  // anchor width by percentage
 *         },{
 *             x: 10,
 *             y: 40,
 *             xtype:'label',
 *             text: 'Subject:'
 *         },{
 *             x: 80,
 *             y: 40,
 *             name: 'subject',
 *             anchor: '90%'  // anchor width by percentage
 *         },{
 *             x:0,
 *             y: 80,
 *             xtype: 'textareafield',
 *             name: 'msg',
 *             anchor: '100% 100%'  // anchor width and height
 *         }],
 *         renderTo: Ext.getBody()
 *     });
 */
Ext.define('Ext.layout.container.Absolute', {

    /* Begin Definitions */

    alias: 'layout.absolute',
    extend: 'Ext.layout.container.Anchor',
    alternateClassName: 'Ext.layout.AbsoluteLayout',

    /* End Definitions */

    targetCls: Ext.baseCSSPrefix + 'abs-layout-ct',
    itemCls: Ext.baseCSSPrefix + 'abs-layout-item',

    /**
     * @cfg {Boolean} ignoreOnContentChange
     * True indicates that changes to one item in this layout do not effect the layout in
     * general. This may need to be set to false if the component is
     * {@link Ext.Component#scrollable scrollable}.
     */
    ignoreOnContentChange: true,

    type: 'absolute',

    /**
     * @private
     */
    adjustWidthAnchor: function(value, childContext) {
        var padding = this.targetPadding,
            x = childContext.getStyle('left');

        return value - x + padding.left;
    },

    /**
     * @private
     */
    adjustHeightAnchor: function(value, childContext) {
        var padding = this.targetPadding,
            y = childContext.getStyle('top');

        return value - y + padding.top;
    },

    isItemLayoutRoot: function (item) {
        return this.ignoreOnContentChange || this.callParent(arguments);
    },

    isItemShrinkWrap: function (item) {
        return true;
    },

    beginLayout: function (ownerContext) {
        var me = this,
            target = me.getTarget();

        me.callParent(arguments);

        // Do not set position: relative; when the absolute layout target is the body
        if (target.dom !== document.body) {
            target.position();
        }

        me.targetPadding = ownerContext.targetContext.getPaddingInfo();
    },

    isItemBoxParent: function (itemContext) {
        return true;
    },

    onContentChange: function () {
        if (this.ignoreOnContentChange) {
            return false;
        }
        return this.callParent(arguments);
    },

    calculateContentSize: function (ownerContext, dimensions) {
        var me = this,
            containerDimensions = (dimensions || 0) | // jshint ignore:line
                   ((ownerContext.widthModel.shrinkWrap ? 1 : 0) | // jshint ignore:line
                    (ownerContext.heightModel.shrinkWrap ? 2 : 0)),
            calcWidth = (containerDimensions & 1) || undefined,// jshint ignore:line
            calcHeight = (containerDimensions & 2) || undefined,// jshint ignore:line
            childItems = ownerContext.childItems,
            length = childItems.length,
            contentHeight = 0,
            contentWidth = 0,
            needed = 0,
            props = ownerContext.props,
            targetPadding, child, childContext, height, i, margins, width;

        if (calcWidth) {
            if (isNaN(props.contentWidth)) {
                ++needed;
            } else {
                calcWidth = undefined;
            }
        }
        if (calcHeight) {
            if (isNaN(props.contentHeight)) {
                ++needed;
            } else {
                calcHeight = undefined;
            }
        }

        if (needed) {
            for (i = 0; i < length; ++i) {
                childContext = childItems[i];
                child = childContext.target;
                height = calcHeight && childContext.getProp('height');
                width = calcWidth && childContext.getProp('width');
                margins = childContext.getMarginInfo();

                height += margins.bottom;
                width  += margins.right;

                contentHeight = Math.max(contentHeight, (child.y || 0) + height);
                contentWidth = Math.max(contentWidth, (child.x || 0) + width);

                if (isNaN(contentHeight) && isNaN(contentWidth)) {
                    me.done = false;
                    return;
                }
            }

            if (calcWidth || calcHeight) {
                targetPadding = ownerContext.targetContext.getPaddingInfo();
            }
            if (calcWidth && !ownerContext.setContentWidth(contentWidth + targetPadding.width)) {
                me.done = false;
            }
            if (calcHeight && !ownerContext.setContentHeight(contentHeight + targetPadding.height)) {
                me.done = false;
            }

            /* add a '/' to turn on this log ('//* enables, '/*' disables)
            if (me.done) {
                var el = ownerContext.targetContext.el.dom;
                Ext.log(this.owner.id, '.contentSize: ', contentWidth, 'x', contentHeight,
                    ' => scrollSize: ', el.scrollWidth, 'x', el.scrollHeight);
            }/**/
        }
    }
});


text:
package main

import (
	"errors"
	"fmt"
	"net/http"
	"strings"

	"google.golang.org/appengine"
	"google.golang.org/appengine/log"
	"google.golang.org/appengine/user"

	"github.com/icco/xsrftoken"
	"github.com/pilu/traffic"
)

type TagData struct {
	Posts   *map[int64]Entry
	Tag     string
	Aliases []string
}

func TagHandler(w traffic.ResponseWriter, r *traffic.Request) {
	c := appengine.NewContext(r.Request)
	tag := r.Param("id")

	if tag == "" {
		http.Redirect(w, r.Request, "/tags", 301)
	}

	if tag != strings.ToLower(tag) {
		http.Redirect(w, r.Request, fmt.Sprintf("/tags/%s", strings.ToLower(tag)), 301)
	}

	isAlias, alias := GetAlias(c, tag)
	if isAlias {
		http.Redirect(w, r.Request, fmt.Sprintf("/tags/%s", alias), 301)
	}

	entries, err := PostsWithTag(c, tag)
	if err != nil {
		http.Error(w, err.Error(), 500)
		return
	}

	aliases := GetTagAliases(c, tag)
	data := &TagData{Posts: entries, Tag: tag, Aliases: *aliases}
	w.Render("tag", data)
}

type TagsData struct {
	Tags map[string]int
}

func TagsHandler(w traffic.ResponseWriter, r *traffic.Request) {
	c := appengine.NewContext(r.Request)
	w.Render("tags", &TagsData{Tags: AllTags(c)})
}

type AliasData struct {
	Aliases map[string]string
	Xsrf    string
	IsAdmin bool
}

func TagAliasGetHandler(w traffic.ResponseWriter, r *traffic.Request) {
	c := appengine.NewContext(r.Request)
	u := user.Current(c)
	if u == nil {
		url, _ := user.LoginURL(c, "/aliases")
		http.Redirect(w, r.Request, url, 302)
		return
	} else {
		log.Infof(c, "Logged in as: %s", u.String())
	}

	if u != nil && !user.IsAdmin(c) {
		http.Error(w, errors.New("Not a valid user.").Error(), 403)
		return
	} else {
		token := xsrftoken.Generate(GetFlagLogError(c, "SESSION_KEY"), u.String(), "/aliases")
		w.Render("aliases", &AliasData{
			Aliases: AliasMap(c),
			Xsrf:    token,
			IsAdmin: user.IsAdmin(c),
		})
		return
	}
}

func TagAliasPostHandler(w traffic.ResponseWriter, r *traffic.Request) {
	c := appengine.NewContext(r.Request)
	u := user.Current(c)
	if u == nil {
		url, _ := user.LoginURL(c, "/aliases")
		http.Redirect(w, r.Request, url, 302)
		return
	} else {
		log.Infof(c, "Logged in as: %s", u.String())
	}

	if u != nil && !user.IsAdmin(c) {
		http.Error(w, errors.New("Not a valid user.").Error(), 403)
		return
	} else {
		err := r.ParseForm()
		if err != nil {
			log.Warningf(c, "Couldn't parse form: %v", r)
		}
		xsrf := r.Request.FormValue("xsrf")
		from := r.Request.FormValue("name")
		to := r.Request.FormValue("tag")

		if xsrftoken.Valid(xsrf, GetFlagLogError(c, "SESSION_KEY"), u.String(), r.Request.URL.Path) {
			log.Infof(c, "Valid Token!")
			a := NewAlias(from, to)
			err = a.Save(c)
			if err != nil {
				http.Error(w, err.Error(), 500)
				return
			}
		} else {
			log.Infof(c, "Invalid Token...")
			http.Error(w, errors.New("Invalid Token").Error(), 403)
			return
		}

		http.Redirect(w, r.Request, "/aliases", 302)
		return
	}
}


text:
package com.hazelcast.spi.impl.eventservice.impl.operations;

import com.hazelcast.internal.cluster.ClusterService;
import com.hazelcast.spi.Operation;
import com.hazelcast.spi.impl.eventservice.impl.Registration;
import com.hazelcast.util.function.Supplier;

/**
 * Supplier that creates {@link RegistrationOperation}s for a listener registration.
 */
public class RegistrationOperationSupplier implements Supplier<Operation> {
    private final Registration reg;
    private final ClusterService clusterService;

    public RegistrationOperationSupplier(Registration reg, ClusterService clusterService) {
        this.reg = reg;
        this.clusterService = clusterService;
    }

    @Override
    public Operation get() {
        return new RegistrationOperation(reg, clusterService.getMemberListVersion());
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>LazyComponent</title>
<meta name="date" content="2015-10-25">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

haxe.at.dotpoint.core.lazy

Class LazyComponent

java.lang.Object

haxe.lang.HxObject

haxe.at.dotpoint.core.lazy.LazyComponent

All Implemented Interfaces:

haxe.lang.IHxObject

public class LazyComponent
extends haxe.lang.HxObject

Field Summary

Fields

Modifier and Type
Field and Description

boolean
allowDispatchUpdate

haxe.lang.Function
onUpdate

haxe.lang.Function
onValidate

LazyStatus
status

Constructor Summary

Constructors

Constructor and Description

LazyComponent(haxe.lang.EmptyObject empty)

LazyComponent(haxe.lang.Function onUpdate,
             haxe.lang.Function onValidate)

Method Summary

All Methods Static Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

static java.lang.Object
__hx_create(haxe.root.Array arr)

static java.lang.Object
__hx_createEmpty()

static void
__hx_ctor_haxe_at_dotpoint_core_lazy_LazyComponent(LazyComponent __temp_me34,
                                                  haxe.lang.Function onUpdate,
                                                  haxe.lang.Function onValidate)

java.lang.Object
__hx_getField(java.lang.String field,
             boolean throwErrors,
             boolean isCheck,
             boolean handleProperties)

void
__hx_getFields(haxe.root.Array<java.lang.String> baseArr)

java.lang.Object
__hx_invokeField(java.lang.String field,
                haxe.root.Array dynargs)

java.lang.Object
__hx_setField(java.lang.String field,
             java.lang.Object value,
             boolean handleProperties)

void
dispatchUpdate()

void
invalidate()

void
setDefaultOnUpdate()

void
setDefaultOnValidate()

void
validate()

Methods inherited from class haxe.lang.HxObject

__hx_ctor_haxe_lang_HxObject, __hx_deleteField, __hx_getField_f, __hx_lookupField_f, __hx_lookupField, __hx_lookupSetField_f, __hx_lookupSetField, __hx_setField_f

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

status

public LazyStatus status

onUpdate

public haxe.lang.Function onUpdate

onValidate

public haxe.lang.Function onValidate

allowDispatchUpdate

public boolean allowDispatchUpdate

Constructor Detail

LazyComponent

public LazyComponent(haxe.lang.EmptyObject empty)

LazyComponent

public LazyComponent(haxe.lang.Function onUpdate,
                     haxe.lang.Function onValidate)

Method Detail

__hx_ctor_haxe_at_dotpoint_core_lazy_LazyComponent

public static void __hx_ctor_haxe_at_dotpoint_core_lazy_LazyComponent(LazyComponent __temp_me34,
                                                                      haxe.lang.Function onUpdate,
                                                                      haxe.lang.Function onValidate)

__hx_createEmpty

public static java.lang.Object __hx_createEmpty()

__hx_create

public static java.lang.Object __hx_create(haxe.root.Array arr)

dispatchUpdate

public final void dispatchUpdate()

validate

public final void validate()

invalidate

public void invalidate()

setDefaultOnUpdate

public void setDefaultOnUpdate()

setDefaultOnValidate

public void setDefaultOnValidate()

__hx_setField

public java.lang.Object __hx_setField(java.lang.String field,
                                      java.lang.Object value,
                                      boolean handleProperties)

Specified by:

__hx_setField in interface haxe.lang.IHxObject

Overrides:

__hx_setField in class haxe.lang.HxObject

__hx_getField

public java.lang.Object __hx_getField(java.lang.String field,
                                      boolean throwErrors,
                                      boolean isCheck,
                                      boolean handleProperties)

Specified by:

__hx_getField in interface haxe.lang.IHxObject

Overrides:

__hx_getField in class haxe.lang.HxObject

__hx_invokeField

public java.lang.Object __hx_invokeField(java.lang.String field,
                                         haxe.root.Array dynargs)

Specified by:

__hx_invokeField in interface haxe.lang.IHxObject

Overrides:

__hx_invokeField in class haxe.lang.HxObject

__hx_getFields

public void __hx_getFields(haxe.root.Array<java.lang.String> baseArr)

Specified by:

__hx_getFields in interface haxe.lang.IHxObject

Overrides:

__hx_getFields in class haxe.lang.HxObject

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
class UpdateSpreeProductTranslations < SpreeExtension::Migration[4.2]
  def change
    if column_exists?(:spree_product_translations, :permalink)
      rename_column :spree_product_translations, :permalink, :slug
    end
  end
end


text:
import { IProxy } from '../IProxy';
import tracing from '../Tracing';
import { getMessageIngressUrl } from '../../common/RequestUtilities';
import performance from '../../common/PerformanceUtilities';

const UPDATE_INTERVAL = 1000;

/**
 * @property {string} name - The fully resolved URL of the resource
 * @property {number} startTime - The amount of time that has elapsed since the
 *      time origin of the browser, typically page load
 * @property {number} duration - The amount of time it took to fetch the resource
 * @property {string} initiatorType - The type of resource, e.g. 'css', 'img', etc.
 * @property {string} nextHopProtocol - The protocol used by the browser to fetch
 *      the resource, e.g. 'HTTP/1'
 * @property {number} redirectStart - The timestamp of the start of a redirect
 * @property {number} redirectEnd - The timestamp of the end of a redirect
 * @property {number} fetchStart - The timestamp of the start of a fetch request
 * @property {number} domainLookupStart - The timestamp of the start of a DNS lookup
 * @property {number} domainLookupEnd - The timestamp of the end of a DNS lookup
 * @property {number} connectStart - The timestamp of the start of a TCP connection
 *      being made
 * @property {number} connectEnd - The timestamp of the end of a TCP connection
 *      being made
 * @property {number} secureConnectionStart - The timestamp of the start of a
 *      secure TLS connection being made
 * @property {number} requestStart - The timestamp of the start the HTTP request
 * @property {number} responseStart - The timestamp of the start the HTTP response
 * @property {number} responseEnd - The timestamp of the end the HTTP response
 * @property {number} transferSize - The size of the entire response, including headers, body, etc.
 * @property {number} encodedBodySize - The size of the response body before decoding, e.g. gzipped size
 * @Property {number} decodedBodySize - The size of the response body after decoding
 */
export interface IResourceTimingCollectionEvent {
    name: string;
    startTime: number;
    duration: number;
    initiatorType: string;
    nextHopProtocol: string;
    redirectStart: number;
    redirectEnd: number;
    fetchStart: number;
    domainLookupStart: number;
    domainLookupEnd: number;
    connectStart: number;
    connectEnd: number;
    secureConnectionStart: number;
    requestStart: number;
    responseStart: number;
    responseEnd: number;
    transferSize: number;
    encodedBodySize: number;
    decodedBodySize: number;
}
export const EVENT_RESOURCE_TIMING_COLLECTED = 'notify|performance.resource-collected';

export class ResourceTimingProxy implements IProxy {
    public isSupported(): boolean {
        // Don't initialize if this browser doesn't support resource timing
        return !!(performance && performance.getEntriesByType);
    }

    public init() {
        function processEntry(entry): IResourceTimingCollectionEvent {
            // This sheds any extra properties that may be introduced to resource timing
            // or are browser specific, and ensures the data matches our interface for it.
            return {
                name: entry.name,
                startTime: entry.startTime,
                duration: entry.duration,
                initiatorType: entry.initiatorType,
                nextHopProtocol: entry.nextHopProtocol,
                redirectStart: entry.redirectStart,
                redirectEnd: entry.redirectEnd,
                fetchStart: entry.fetchStart,
                domainLookupStart: entry.domainLookupStart,
                domainLookupEnd: entry.domainLookupEnd,
                connectStart: entry.connectStart,
                connectEnd: entry.connectEnd,
                secureConnectionStart: entry.secureConnectionStart,
                requestStart: entry.requestStart,
                responseStart: entry.responseStart,
                responseEnd: entry.responseEnd,
                transferSize: entry.transferSize,
                encodedBodySize: entry.encodedBodySize,
                decodedBodySize: entry.decodedBodySize
            };
        }

        // Eventually we want to switch to using Performance Observers once browsers
        // start to implement, but currently none do, so we poll for entries instead
        // https://w3c.github.io/performance-timeline/#dom-performanceobserver
        const reportedEntries = {};
        function record() {
            const resources = performance.getEntriesByType('resource');
            const entriesToPublish = [];
            const ingressUrl = getMessageIngressUrl();
            for (const resource of resources) {
                // Create a unique id for the entry, a combination of the start time
                // and resolved URL
                const id = `${resource.startTime}#${resource.name}`;
                if (!reportedEntries[id] && resource.name.indexOf(ingressUrl) === -1) {
                    reportedEntries[id] = true;
                    entriesToPublish.push(processEntry(resource));
                }
            }
            if (entriesToPublish.length) {
                tracing.publish(EVENT_RESOURCE_TIMING_COLLECTED, entriesToPublish);
            }
            setTimeout(record, UPDATE_INTERVAL);
        };
        record();
    }
}

// WEBPACK FOOTER //
// ./src/tracing/proxies/ResourceTimingProxy.ts


text:
set -e

# This script's real path.
SCRIPT_FILE=$(readlink -f "$0")

# This script's source directory.
SOURCE_DIR=$(readlink -f `dirname "$SCRIPT_FILE"`/..)

# The target install directory.
INSTALL_DIR='/usr/local/argumenta'

# The deployment config directory.
CONFIG_DIR='/etc/argumenta'

# The upstart config file.
UPSTART_CONFIG_FILE='/etc/init/argumenta.conf'

# The Nginx upstart file.
NGINX_UPSTART_FILE='/etc/init/argumenta-nginx.conf'

# The daily backup cron.d file.
BACKUP_CRON_FILE='/etc/cron.d/argumenta-backup'

#
# Upstart config for the `argumenta` service.
#
UPSTART_CONFIG=$(cat <<-"END"

	description "Argumenta (Node.js)"
	author "Argumenta.io"

	start on (local-filesystems and net-device-up IFACE!=lo)
	stop on runlevel [016]

	respawn
	respawn limit 10 5  # Default respawns per second.

	script
	  if [ -f /usr/bin/node ]; then
	    NODE=/usr/bin/node
	  else
	    NODE=`which node`
	  fi

	  export HOME="/home/argumenta"
	  echo $$ > /var/run/argumenta.pid
	  exec sudo -u argumenta \
	    NODE_ENV='production' CONFIG_DIR='/etc/argumenta' \
	    "$NODE" /usr/local/argumenta/app \
	    1>> /var/log/argumenta.log \
	    2>> /var/log/argumenta.err
	end script

END
)

#
# Upstart config for `argumenta-nginx` reverse proxy.
#
NGINX_UPSTART=$(cat <<-"END"

	description "Nginx (Argumenta)"
	author "Argumenta.io"

	start on starting argumenta
	stop on stopping argumenta

	respawn
	respawn limit 10 5  # Default respawns per second.

	script
	  NGINX="/usr/sbin/nginx"
	  CONFIG="/etc/argumenta/nginx.conf"

	  echo $$ > /var/run/argumenta-nginx.pid
	  exec "$NGINX" -c "$CONFIG" -g "daemon off;" \
	    1>> /var/log/argumenta-nginx.log \
	    2>> /var/log/argumenta-nginx.err
	end script

END
)

#
# Cron.d file for daily backups.
#
BACKUP_CRON=$(cat <<-"END"

	# /etc/cron.d/argumenta-backup

	# Cron.d format:
	# m h d M D  user   command

	SHELL=/bin/bash

	# Creates rotated database backups.
	ARGUMENTA_BACKUP=/usr/bin/argumenta-backup

	# Log file.
	BACKUP_LOG=/var/log/argumenta-backup.log

	# Daily at 12:01 am, backup the production database.
	01 00 * * *  root    $ARGUMENTA_BACKUP >> $BACKUP_LOG 2>&1

END
)

#
# Adds an `argumenta` user account.
#
addUser() {
  echo "Adding 'argumenta' user account."
  adduser \
    --quiet \
    --system \
    --shell /bin/bash \
    --gecos 'Argumenta web app' \
    --group \
    --disabled-password \
    --home /home/argumenta \
    argumenta
}

#
# Adds an `argumenta-backup` user for database backups.
#
addBackupUser() {
  echo "Adding 'argumenta-backup' user account."
  adduser \
    --quiet \
    --system \
    --shell /bin/bash \
    --gecos 'Argumenta backups' \
    --group \
    --disabled-password \
    --home /home/argumenta-backup \
    argumenta-backup
}

#
# Installs the Argumenta app.
#
installApp() {
  echo "Installing app to '$INSTALL_DIR'."
  cp -a -L -T "$SOURCE_DIR" "$INSTALL_DIR"
  chown -R root:argumenta "$INSTALL_DIR"
  chmod -R 0640 "$INSTALL_DIR"
  chmod -R 0750 "${INSTALL_DIR}/bin"
  find "$INSTALL_DIR" -type d -print0 | xargs -0 chmod 0750

  # Allow Nginx to serve static files.
  chmod 0755 "$INSTALL_DIR"
  find "$INSTALL_DIR"/public -type f -print0 | xargs -0 chmod 0644
  find "$INSTALL_DIR"/public -type d -print0 | xargs -0 chmod 0755
}

#
# Generates app config files.
#
genAppConfig() {
  echo "Generating app config."
  "$INSTALL_DIR"/bin/setup-config.sh > /dev/null
}

#
# Creates deployment config files.
#
createDeployConfig() {
  echo "Creating deploy config in '$CONFIG_DIR'."
  cp -a --no-clobber -T "${INSTALL_DIR}/config/deploy" "$CONFIG_DIR"
  chown -R root:argumenta "$CONFIG_DIR"
  chmod -R 0740 "$CONFIG_DIR"
  find "$CONFIG_DIR" -type d -print0 | xargs -0 chmod -R 0750
}

#
# Creates an Upstart config file.
#
createUpstartConfig() {
  echo "Creating Upstart config '$UPSTART_CONFIG_FILE'."
  echo "$UPSTART_CONFIG" > $UPSTART_CONFIG_FILE
  chmod 0644 $UPSTART_CONFIG_FILE
}

#
# Creates SSL config directory.
#
createSSLConfig() {
  if [ ! -d "$CONFIG_DIR"/ssl ]; then
    echo "Creating SSL config directory '$CONFIG_DIR/ssl'."
    mkdir -p "$CONFIG_DIR"/ssl
    ln -s '/etc/ssl/certs/argumenta.crt' "$CONFIG_DIR"/ssl/argumenta.crt
    ln -s '/etc/ssl/private/argumenta.key' "$CONFIG_DIR"/ssl/argumenta.key
  fi
}

#
# Creates Nginx configuration files.
#
createNginxConfig() {
  echo "Creating Nginx config '/etc/argumenta/nginx.conf'."
  "$INSTALL_DIR"/bin/setup-nginx.sh > /dev/null
}

#
# Creates an Nginx Upstart service.
#
createNginxUpstart() {
  echo "Creating Nginx Upstart '$NGINX_UPSTART_FILE'"
  echo "$NGINX_UPSTART" > "$NGINX_UPSTART_FILE"
  sudo chmod 0644 "$NGINX_UPSTART_FILE"
}

#
# Creates a daily backup cron.d file.
#
createBackupCron() {
  echo "Creating Backup cron.d file: '$BACKUP_CRON_FILE'."
  echo "$BACKUP_CRON" > "$BACKUP_CRON_FILE"
  sudo chmod 0644 "$BACKUP_CRON_FILE"
}

#
# Prints usage information.
#
usage() {
  cat <<-End

  Usage: $0 [options]

  Options:
    -d, --debug : Show additional debug info.
    -h, --help  : Show this usage info.

End
}

#
# Gets command line options.
#
getOpts() {
  while [[ "$1" == -* ]]; do
    case "$1" in
      -d | --debug  ) DEBUG=1; shift ;;
      -h | --help   ) usage; exit 0 ;;
      *             ) shift ;;
    esac
  done

  if [[ $DEBUG -eq 1 ]]; then
    echo "Debug mode enabled."
    set -x
  fi
}

#
# Main script.
#
main() {
  getOpts "$@"
  addUser
  addBackupUser
  installApp
  genAppConfig
  createDeployConfig
  createUpstartConfig
  createSSLConfig
  createNginxConfig
  createNginxUpstart
  createBackupCron
  echo "Done!"
}

# Let's do this!
main "$@"


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Raven.Abstractions.Indexing;
using Raven.Client.Indexes;

namespace AspNetServiceStackRole.DataAccess {
    public class TvSeriesNameIndex : AbstractIndexCreationTask<TvSeriesDoc> {
        public TvSeriesNameIndex() {
            Map = series => from serie in series
                            select new {serie.Name};

            Indexes = new Dictionary<Expression<Func<TvSeriesDoc, object>>, FieldIndexing> {
                { serie => serie.Name, FieldIndexing.Analyzed },
            };
        }
    }

}


text:
(function () {
    'use strict';

    var app = angular.module('app');

    app.config(['$routeProvider', function ($routeProvider) {
        $routeProvider
            .when('/', {
                title: 'ASP.NET Brasil Conference',
                templateUrl: 'app/pages/static/home.html',
                controller: 'pageController'
            })
            .otherwise({ redirectTo: '/' });
    }]);

    //app.config(['$provide', function ($provide) {
    //    $provide.decorator('$exceptionHandler',
    //        ['$delegate', 'config', 'logger', function ($delegate, config, logger) {
    //            var appErrorPrefix = config.appErrorPrefix;
    //            var logError = logger.getLogFn('app', 'error');
    //            return function (exception, cause) {
    //                $delegate(exception, cause);
    //                if (appErrorPrefix && exception.message.indexOf(appErrorPrefix) === 0) { return; }

    //                var errorData = { exception: exception, cause: cause };
    //                var msg = appErrorPrefix + exception.message;
    //                logError(msg, errorData, true);
    //            };
    //        }]);
    //}]);

})();


text:
package ginalexa

import (
	"github.com/gin-gonic/gin"
	echoRequest "github.com/go-alexa/alexa/parser"
	echoResponse "github.com/go-alexa/alexa/response"
	"github.com/nicksnyder/go-i18n/i18n"
)

const (
	EventOnLaunch       = "OnLaunch"
	EventOnIntent       = "OnIntent"
	EventOnSessionEnded = "OnSessionEnded"
	EventOnAuthCheck    = "OnAuthCheck"
	AmazonCancelIntent  = "AMAZON.CancelIntent"
	AmazonHelpIntent    = "AMAZON.HelpIntent"
	AmazonNextIntent    = "AMAZON.NextIntent"
	AmazonStopIntent    = "AMAZON.StopIntent"
)

type (

	// EchoError can be used to transport dispatchable errors through your app
	EchoError struct {
		errorString       string
		errorCode         int
		responseString    string
		responseI18nToken string
	}

	// EchoMethod is a shortform for the actual callback for all methods
	EchoMethod func(*EchoContext, *echoRequest.Event, *echoResponse.Response)

	// EchoAction represents the actions which can be registered to the app
	EchoAction interface {
		GetType() string
		GetName() string
		GetCallback() EchoMethod
	}

	// EchoContext provides a unified set of information to each callup
	EchoContext struct {
		AppID      string
		GinContext *gin.Context
		EchoConfig Configurable
		T          i18n.TranslateFunc
		Session    Session
	}

	// EchoApplication is the actual application you define per endpoint
	EchoApplication struct {
		AppID          string
		config         Configurable
		Session        Session
		OnLaunch       EchoMethod
		OnSessionEnded EchoMethod
		OnAuthCheck    func(*EchoContext, *echoRequest.Event, *echoResponse.Response) error
		Context        *EchoContext

		intents map[string]EchoMethod
	}

	echoAct struct {
		eaName     string
		eaType     string
		eaCallback EchoMethod
	}

	echoAuthAct struct {
		eaType         string
		eaAuthCallback func(*EchoContext, *echoRequest.Event, *echoResponse.Response) error
	}
)

// New creates a new representation of EchoApplication
func New(appID string, config Configurable, c *gin.Context) *EchoApplication {

	_appid := appID
	if _appid == "" {
		_appid = config.GetString("AppID")
	}

	if _appid == "" {
		panic("no appID given")
		return nil
	}

	return &EchoApplication{
		AppID:   _appid,
		config:  config,
		intents: make(map[string]EchoMethod),
		Context: &EchoContext{
			AppID:      appID,
			GinContext: c,
			EchoConfig: config,
			Session:    nil,
		},
	}
}

// Set sets echo actions
func (ea *EchoApplication) Set(actions ...EchoAction) {

	for _, v := range actions {

		switch v.GetType() {

		case EventOnLaunch:
			ea.OnLaunch = v.GetCallback()

		case EventOnSessionEnded:
			ea.OnSessionEnded = v.GetCallback()

		case EventOnIntent:
			ea.intents[v.GetName()] = v.GetCallback()

		case EventOnAuthCheck:
			eac := v.(echoAuthAct)
			ea.OnAuthCheck = eac.GetAuthCallback()
		}
	}
}

// ######################### EchoMethod

// ######################### EchoAction

func (ac echoAct) GetType() string         { return ac.eaType }
func (ac echoAct) GetName() string         { return ac.eaName }
func (ac echoAct) GetCallback() EchoMethod { return ac.eaCallback }

func (ac echoAuthAct) GetType() string         { return ac.eaType }
func (ac echoAuthAct) GetName() string         { return "" }
func (ac echoAuthAct) GetCallback() EchoMethod { return nil }

func (ac echoAuthAct) GetAuthCallback() func(*EchoContext, *echoRequest.Event, *echoResponse.Response) error {
	return ac.eaAuthCallback
}

// ######################### HELPERS

func MkCustomIntent(theName, theType string, theCallback EchoMethod) EchoAction {

	return echoAct{
		eaName:     theName,
		eaType:     theType,
		eaCallback: theCallback,
	}
}

func MkEchoAuthAction(theCallback func(*EchoContext, *echoRequest.Event, *echoResponse.Response) error) EchoAction {

	return echoAuthAct{
		eaType:         EventOnAuthCheck,
		eaAuthCallback: theCallback,
	}
}

func MkCancelIntent(theCallback EchoMethod) EchoAction {

	return echoAct{
		eaName:     AmazonCancelIntent,
		eaType:     EventOnIntent,
		eaCallback: theCallback,
	}
}

func MkHelpIntent(theCallback EchoMethod) EchoAction {

	return echoAct{
		eaName:     AmazonHelpIntent,
		eaType:     EventOnIntent,
		eaCallback: theCallback,
	}
}

func MkNextIntent(theCallback EchoMethod) EchoAction {

	return echoAct{
		eaName:     AmazonNextIntent,
		eaType:     EventOnIntent,
		eaCallback: theCallback,
	}
}

func MkStopIntent(theCallback EchoMethod) EchoAction {

	return echoAct{
		eaName:     AmazonStopIntent,
		eaType:     EventOnIntent,
		eaCallback: theCallback,
	}
}

// ################### EchoError

func NewEchoError(msg string, code int, responseMessage, i18nToken string) error {

	return EchoError{
		errorString:       msg,
		errorCode:         code,
		responseString:    responseMessage,
		responseI18nToken: i18nToken,
	}
}

func EchoErrorFromError(err error, code int, responseMessage, i18nToken string) error {

	return NewEchoError(err.Error(), code, responseMessage, i18nToken)
}

func (ee EchoError) Error() string {

	return ee.errorString
}

func (ee EchoError) Code() int {
	return ee.errorCode
}

func (ee EchoError) ResponseMessage() string {
	return ee.responseString
}

func (ee EchoError) ResponseI18nToken() string {
	return ee.responseI18nToken
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\ProductSearch */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'idProduct') ?>

    <?= $form->field($model, 'idCategory') ?>

    <?= $form->field($model, 'idProduction') ?>

    <?= $form->field($model, 'ProductName') ?>

    <?= $form->field($model, 'Description') ?>

    <?php // echo $form->field($model, 'BasePrice') ?>

        <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>