text:
alter table ACT_RE_PROCDEF drop constraint ACT_UNIQ_PROCDEF;

alter table ACT_RE_PROCDEF alter column KEY_ nvarchar(255) not null;

alter table ACT_RE_PROCDEF alter column VERSION_ int not null;

alter table ACT_RE_PROCDEF
    add constraint ACT_UNIQ_PROCDEF
    unique (KEY_,VERSION_);

alter table ACT_RE_DEPLOYMENT add CATEGORY_ nvarchar(255);

alter table ACT_RE_PROCDEF
    add DESCRIPTION_ nvarchar(4000);

alter table ACT_RU_TASK
    add SUSPENSION_STATE_ int;

update ACT_RU_TASK set SUSPENSION_STATE_ = 1;

alter table ACT_RU_EXECUTION
    add constraint ACT_FK_EXE_PROCDEF
    foreign key (PROC_DEF_ID_)
    references ACT_RE_PROCDEF (ID_);

create table ACT_RE_MODEL (
    ID_ nvarchar(64) not null,
    REV_ int,
    NAME_ nvarchar(255),
    KEY_ nvarchar(255),
    CATEGORY_ nvarchar(255),
    CREATE_TIME_ datetime,
    LAST_UPDATE_TIME_ datetime,
    VERSION_ int,
    META_INFO_ nvarchar(4000),
    DEPLOYMENT_ID_ nvarchar(64),
    EDITOR_SOURCE_VALUE_ID_ nvarchar(64),
    EDITOR_SOURCE_EXTRA_VALUE_ID_ nvarchar(64),
    primary key (ID_)
);

alter table ACT_RE_MODEL
    add constraint ACT_FK_MODEL_SOURCE
    foreign key (EDITOR_SOURCE_VALUE_ID_)
    references ACT_GE_BYTEARRAY (ID_);

alter table ACT_RE_MODEL
    add constraint ACT_FK_MODEL_SOURCE_EXTRA
    foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
    references ACT_GE_BYTEARRAY (ID_);

alter table ACT_RE_MODEL
    add constraint ACT_FK_MODEL_DEPLOYMENT
    foreign key (DEPLOYMENT_ID_)
    references ACT_RE_DEPLOYMENT (ID_);

delete from ACT_GE_PROPERTY where NAME_ = 'historyLevel';

alter table ACT_RU_JOB
    add PROC_DEF_ID_ nvarchar(64);

update ACT_GE_PROPERTY set VALUE_ = '5.11' where NAME_ = 'schema.version';

redpajama_set_name: RedPajamaGithub


text:
(function() {
    Ext.define('HatimeriaBank.invoices.InvoicesPanel', {
        extend: 'Hatimeria.core.grid.BaseGrid',
        actionColumn: false,
        initComponent: function()
        {
            var store = Ext.create('HatimeriaBank.invoices.store.AllStore');

            var config = {
                id: 'invoices-panel',
                title: 'Faktury',
                store: store,
                columns: [
                    {header: "Nr", dataIndex: 'fullNumber', sortable: false},
                    {header: "Kwota", dataIndex: 'amount'},
                    {header: "Data", dataIndex: 'createdAt'},
                    {header: "Tytuł", dataIndex: 'title', flex: 1}
                ],
                viewConfig: {
                    forceFit: true
                }
            };

            this.listeners = {
                itemclick: {
                    fn: function(view, record){
                        window.location = Routing.generate("invoice_download", {id: record.get('id')});
                    }
            }};

            Ext.apply(this, Ext.apply(config, this.initialConfig));
            this.callParent();
        }

    });

})();


text:
using Ninject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Talks.Model;
using Talks.Model.Searcher;
using Talks.Service;

namespace Talks.Admin.Controllers
{
    [Authorize]
    public class HomeController : Controller
    {

        [Inject]
        public IProductService productService { get; set; }

        public ActionResult Index(ProductSearcher searcher)
        {
            searcher.PageSize = 10;
            productService.BindList(ViewBag, searcher);
            return View();
        }
        public ActionResult Index2()
        {
            var product = new Product()
            {
                ProductID = Guid.NewGuid().ToString(),
                Name = "Name_" + Guid.NewGuid().ToString(),
                Category = "category",
                Company = "vancl",
                Description = "hahaha",
                Price = 100.01M,
                AddTime=DateTime.Now,

            };
            var id = productService.InserProduct(product);
            return Content(id);
        }

        public ActionResult About()
        {
            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        public ActionResult Ueditor() {

            return View();
        }
    }
}


text:
using System.Threading.Tasks;

namespace Lombiq.HelpfulExtensions.Extensions.Emails.Services;

/// <summary>
/// Service for managing email templates.
/// </summary>
public interface IEmailTemplateService
{
    /// <summary>
    /// Renders an email template content identified by its ID.
    /// </summary>
    /// <param name="emailTemplateId">ID of the email template.</param>
    /// <param name="model">Optional model used as replacements in the email template.</param>
    /// <returns>Rendered email template.</returns>
    Task<string> RenderEmailTemplateAsync(string emailTemplateId, object model = null);
}


text:
package minerCFinderAdapter;

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

import ru.ispras.modis.NetBlox.scenario.GraphMiningParametersSet;
import ru.ispras.modis.NetBlox.scenario.RangeOfValues;
import ru.ispras.modis.NetBlox.scenario.ValueFromRange;
import ru.ispras.modis.NetBlox.utils.MiningJobBase;
import ru.ispras.modis.NetBlox.utils.Pair;

public class ParametersSetCFinder extends GraphMiningParametersSet {
	private ValueFromRange<Float> minWeightThreshold = null;
	private ValueFromRange<Float> maxWeightThreshold = null;
	private ValueFromRange<Float> maxCliquesSearchTime = null;
	private ValueFromRange<Float> weightIntensityThreshold = null;
	private ValueFromRange<Integer> kCliqueSize = null;

	private static final Integer DEFAULT_K_CLIQUE_SIZE = 3;

	public ParametersSetCFinder(String algorithmNameInScenario, String algorithmDescriptionID,
			ValueFromRange<Float> minWeightThreshold, ValueFromRange<Float> maxWeightThreshold,
			ValueFromRange<Float> maxCliquesSearchTime, ValueFromRange<Float> weightIntensityThreshold,
			ValueFromRange<Integer> kCliqueSize) {
		super(MiningJobBase.JobBase.GRAPH, algorithmNameInScenario, algorithmDescriptionID);

		this.minWeightThreshold = minWeightThreshold;
		this.maxWeightThreshold = maxWeightThreshold;
		this.maxCliquesSearchTime = maxCliquesSearchTime;
		this.weightIntensityThreshold = weightIntensityThreshold;
		this.kCliqueSize = kCliqueSize;
	}

	public ParametersSetCFinder(ParametersSetCFinder toClone)	{
		super(toClone.getJobBase(), toClone.getAlgorithmName(), toClone.getAlgorithmDescriptionId());

		this.minWeightThreshold = clone(toClone.minWeightThreshold);
		this.maxWeightThreshold = clone(toClone.maxWeightThreshold);
		this.maxCliquesSearchTime = clone(toClone.maxCliquesSearchTime);
		this.weightIntensityThreshold = clone(toClone.weightIntensityThreshold);
		this.kCliqueSize = clone(toClone.kCliqueSize);

		this.launchNumber = clone(toClone.launchNumber);
	}

	public Float getMinWeightThreshold()	{
		return (minWeightThreshold==null) ? null : minWeightThreshold.getValue();
	}

	public Float getMaxWeightThreshold()	{
		return (maxWeightThreshold==null) ? null : maxWeightThreshold.getValue();
	}

	public Float getMaxSearchTimeForCliques()	{
		return (maxCliquesSearchTime==null) ? null : maxCliquesSearchTime.getValue();
	}

	public Float getWeightIntensityThreshold()	{
		return (weightIntensityThreshold==null) ? null : weightIntensityThreshold.getValue();
	}

	public Integer getCliqueSize()	{
		return (kCliqueSize==null) ? DEFAULT_K_CLIQUE_SIZE : kCliqueSize.getValue();
	}

	public void setCliquesSize(Integer cliquesSize)	{
		if (kCliqueSize == null)	{
			kCliqueSize = new ValueFromRange<Integer>(RangeOfValues.NO_RANGE_ID, cliquesSize);
		}
		else	{
			kCliqueSize.setValue(cliquesSize);
		}
	}

	@Override
	public boolean hasParametersFromSomeRange() {
		return (minWeightThreshold != null)  &&  (!minWeightThreshold.getRangeId().equals(RangeOfValues.NO_RANGE_ID))   ||
				(maxWeightThreshold != null)  &&  (!maxWeightThreshold.getRangeId().equals(RangeOfValues.NO_RANGE_ID))   ||
				(maxCliquesSearchTime != null)  &&  (!maxCliquesSearchTime.getRangeId().equals(RangeOfValues.NO_RANGE_ID))   ||
				(weightIntensityThreshold != null)  &&  (!weightIntensityThreshold.getRangeId().equals(RangeOfValues.NO_RANGE_ID))   ||
				(kCliqueSize != null)  &&  (!kCliqueSize.getRangeId().equals(RangeOfValues.NO_RANGE_ID))   ||
				super.hasParametersFromSomeRange();
	}

	@Override
	public Object getValueForVariationId(String id) {
		Object result = null;

		if ((minWeightThreshold != null)  &&  (id.equals(minWeightThreshold.getRangeId())))	{
			result = minWeightThreshold.getValue();
		}
		else if ((maxWeightThreshold != null)  &&  (id.equals(maxWeightThreshold.getRangeId())))	{
			result = maxWeightThreshold.getValue();
		}
		else if ((maxCliquesSearchTime != null)  &&  (id.equals(maxCliquesSearchTime.getRangeId())))	{
			result = maxCliquesSearchTime.getValue();
		}
		else if ((weightIntensityThreshold != null)  &&  (id.equals(weightIntensityThreshold.getRangeId())))	{
			result = weightIntensityThreshold.getValue();
		}
		else if ((kCliqueSize != null)  &&  (id.equals(kCliqueSize.getRangeId())))	{
			result = kCliqueSize.getValue();
		}
		else	{
			result = super.getValueForVariationId(id);
		}

		return result;
	}

	/**
	 * See the description in interface.
	 * Use as keys the CFinder CLI keys.
	 */
	@Override
	public List<Pair<String, String>> getSpecifiedParametersAsPairsOfUniqueKeysAndValues() {
		List<Pair<String, String>> list = appendNonNullParameter(null, minWeightThreshold, "w");
		list = appendNonNullParameter(list, maxWeightThreshold, "W");

		list = appendNonNullParameter(list, maxCliquesSearchTime, "t");
		list = appendNonNullParameter(list, weightIntensityThreshold, "I");

		if (list == null)	{
			list = new ArrayList<Pair<String, String>>(1);
		}
		list.add(new Pair<String, String>("r", getCliqueSize().toString()));

		return list;
	}

	@Override
	public ParametersSetCFinder clone()	{
		return new ParametersSetCFinder(this);
	}
}


text:
package merkletree

import (
	"bytes"
	"crypto/sha256"
	"errors"
	"fmt"
	"testing"
)

const (
	sha256EmptyTreeHash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
)

func verifierCheck(v *MerkleVerifier, leafIndex, treeSize int64, proof [][]byte, root []byte, leaf []byte) error {
	// Verify original inclusion proof
	got, err := v.RootFromInclusionProof(leafIndex, treeSize, proof, leaf)
	if err != nil {
		return err
	}
	if want := root; !bytes.Equal(got, want) {
		return fmt.Errorf("got root:\n%v\nexpected:\n%v", got, want)
	}
	if err := v.VerifyInclusionProof(leafIndex, treeSize, proof, root, leaf); err != nil {
		return err
	}

	// Wrong leaf index
	if err := v.VerifyInclusionProof(leafIndex-1, treeSize, proof, root, leaf); err == nil {
		return errors.New("incorrectly verified against leafIndex - 1")
	}
	if err := v.VerifyInclusionProof(leafIndex+1, treeSize, proof, root, leaf); err == nil {
		return errors.New("incorrectly verified against leafIndex + 1")
	}
	if err := v.VerifyInclusionProof(leafIndex^2, treeSize, proof, root, leaf); err == nil {
		return errors.New("incorrectly verified against leafIndex ^ 2")
	}

	// Wrong tree height
	if err := v.VerifyInclusionProof(leafIndex, treeSize*2, proof, root, leaf); err == nil {
		return errors.New("incorrectly verified against treeSize * 2")
	}
	if err := v.VerifyInclusionProof(leafIndex, treeSize/2, proof, root, leaf); err == nil {
		return errors.New("incorrectly verified against treeSize / 2")
	}

	// Wrong leaf
	if err := v.VerifyInclusionProof(leafIndex, treeSize, proof, root, []byte("WrongLeaf")); err == nil {
		return errors.New("incorrectly verified against WrongLeaf")
	}

	// Wrong root
	if err := v.VerifyInclusionProof(leafIndex, treeSize, proof, dh(sha256EmptyTreeHash), leaf); err == nil {
		return errors.New("incorrectly verified against empty root hash")
	}

	// Wrong inclusion proofs

	// Modify single element of the proof
	for i := 0; i < len(proof); i++ {
		tmp := proof[i]
		proof[i] = dh(sha256EmptyTreeHash)
		if err := v.VerifyInclusionProof(leafIndex, treeSize, proof, root, leaf); err == nil {
			return errors.New("incorrectly verified against incorrect inclusion proof")
		}
		proof[i] = tmp
	}

	// Add garbage at the end
	wrongProof := append(proof, []byte(""))
	if err := v.VerifyInclusionProof(leafIndex, treeSize, wrongProof, root, leaf); err == nil {
		return errors.New("incorrectly verified against proof with trailing garbage")
	}

	wrongProof = append(proof, root)
	if err := v.VerifyInclusionProof(leafIndex, treeSize, wrongProof, root, leaf); err == nil {
		return errors.New("incorrectly verified against proof with trailing root")
	}

	if len(proof) > 0 {
		// Remove a node from the end
		wrongProof = proof[:len(proof)-1]
		if err := v.VerifyInclusionProof(leafIndex, treeSize, wrongProof, root, leaf); err == nil {
			return errors.New("incorrectly verified against truncated proof")
		}
	}

	// Add garbage at the front
	wrongProof = append([][]byte{{}}, proof...)
	if err := v.VerifyInclusionProof(leafIndex, treeSize, wrongProof, root, leaf); err == nil {
		return errors.New("incorrectly verified against proof with preceding garbage")
	}

	wrongProof = append([][]byte{root}, proof...)
	if err := v.VerifyInclusionProof(leafIndex, treeSize, wrongProof, root, leaf); err == nil {
		return errors.New("incorrectly verified against proof with preceding garbage")
	}

	return nil
}

func verifierConsistencyCheck(v *MerkleVerifier, snapshot1, snapshot2 int64, root1, root2 []byte, proof [][]byte) error {
	// Verify original consistency proof
	err := v.VerifyConsistencyProof(snapshot1, snapshot2, root1, root2, proof)
	if err != nil {
		return err
	}

	if len(proof) == 0 {
		// For simplicity test only non-trivial proofs that have root1 != root2
		// snapshot1 != 0 and snapshot1 != snapshot2.
		return nil
	}

	// Wrong snapshot index
	if err := v.VerifyConsistencyProof(snapshot1-1, snapshot2, root1, root2, proof); err == nil {
		return errors.New("incorrectly verified against snapshot1-1")
	}
	if err := v.VerifyConsistencyProof(snapshot1+1, snapshot2, root1, root2, proof); err == nil {
		return errors.New("incorrectly verified against snapshot1+1")
	}
	if err := v.VerifyConsistencyProof(snapshot1^2, snapshot2, root1, root2, proof); err == nil {
		return errors.New("incorrectly verified against snapshot1^2")
	}

	// Wrong tree height
	if err := v.VerifyConsistencyProof(snapshot1, snapshot2*2, root1, root2, proof); err == nil {
		return errors.New("incorrectly verified against snapshot2*2")
	}
	if err := v.VerifyConsistencyProof(snapshot1, snapshot2/2, root1, root2, proof); err == nil {
		return errors.New("incorrectly verified against snapshot2/2")
	}

	// Wrong root
	if err := v.VerifyConsistencyProof(snapshot1, snapshot2, []byte("WrongRoot"), root2, proof); err == nil {
		return errors.New("incorrectly verified against wrong root1")
	}
	if err := v.VerifyConsistencyProof(snapshot1, snapshot2, root1, []byte("WrongRoot"), proof); err == nil {
		return errors.New("incorrectly verified against wrong root2")
	}
	// Swap roots
	if err := v.VerifyConsistencyProof(snapshot1, snapshot2*2, root2, root1, proof); err == nil {
		return errors.New("incorrectly verified against swapped roots")
	}

	// Wrong consistency proofs
	// Empty proof
	if err := v.VerifyConsistencyProof(snapshot1, snapshot2, root2, root1, [][]byte{}); err == nil {
		return errors.New("incorrectly verified against empty proof")
	}

	// Modify single element of the proof
	for i := 0; i < len(proof); i++ {
		tmp := proof[i]
		proof[i] = dh(sha256EmptyTreeHash)
		if err := v.VerifyConsistencyProof(snapshot1, snapshot2, root2, root1, proof); err == nil {
			return errors.New("incorrectly verified against incorrect consistency proof")
		}
		proof[i] = tmp
	}

	// Add garbage at the end
	wrongProof := append(proof, []byte(""))
	if err := v.VerifyConsistencyProof(snapshot1, snapshot2, root2, root1, wrongProof); err == nil {
		return errors.New("incorrectly verified against proof with trailing garbage")
	}

	wrongProof = append(proof, root1)
	if err := v.VerifyConsistencyProof(snapshot1, snapshot2, root2, root1, wrongProof); err == nil {
		return errors.New("incorrectly verified against proof with trailing root")
	}

	// Remove a node from the end
	wrongProof = proof[:len(proof)-1]
	if err := v.VerifyConsistencyProof(snapshot1, snapshot2, root2, root1, wrongProof); err == nil {
		return errors.New("incorrectly verified against truncated proof")
	}

	// Add garbage at the front
	wrongProof = append([][]byte{{}}, proof...)
	if err := v.VerifyConsistencyProof(snapshot1, snapshot2, root2, root1, wrongProof); err == nil {
		return errors.New("incorrectly verified against proof with preceding garbage")
	}

	wrongProof = append([][]byte{proof[0]}, proof...)
	if err := v.VerifyConsistencyProof(snapshot1, snapshot2, root2, root1, wrongProof); err == nil {
		return errors.New("incorrectly verified against proof with preceding garbage")
	}

	return nil
}

func getVerifier() MerkleVerifier {
	return NewMerkleVerifier(func(b []byte) []byte {
		h := sha256.Sum256(b)
		return h[:]
	})
}

type proofTestVector struct {
	h []byte
	l int
}

type inclusionProofTestVector struct {
	leaf, snapshot, proofLength int64
	proof                       []proofTestVector
}

func getInputs() []proofTestVector {
	return []proofTestVector{
		{dh(""), 0},
		{dh("00"), 1},
		{dh("10"), 1},
		{dh("2021"), 2},
		{dh("3031"), 2},
		{dh("40414243"), 4},
		{dh("5051525354555657"), 8},
		{dh("606162636465666768696a6b6c6d6e6f"), 16},
	}
}

func getInclusionTestVector() []inclusionProofTestVector {
	return []inclusionProofTestVector{
		{0, 0, 0, []proofTestVector{{dh(""), 0}, {dh(""), 0}, {dh(""), 0}}},
		{1, 1, 0, []proofTestVector{{dh(""), 0}, {dh(""), 0}, {dh(""), 0}}},
		{1,
			8,
			3,
			[]proofTestVector{
				{dh("96a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7"), 32},
				{dh("5f083f0a1a33ca076a95279832580db3e0ef4584bdff1f54c8a360f50de3031e"), 32},
				{dh("6b47aaf29ee3c2af9af889bc1fb9254dabd31177f16232dd6aab035ca39bf6e4"), 32}}},
		{6,
			8,
			3,
			[]proofTestVector{
				{dh("bc1a0643b12e4d2d7c77918f44e0f4f79a838b6cf9ec5b5c283e1f4d88599e6b"), 32},
				{dh("ca854ea128ed050b41b35ffc1b87b8eb2bde461e9e3b5596ece6b9d5975a0ae0"), 32},
				{dh("d37ee418976dd95753c1c73862b9398fa2a2cf9b4ff0fdfe8b30cd95209614b7"), 32}}},
		{3,
			3,
			1,
			[]proofTestVector{
				{dh("fac54203e7cc696cf0dfcb42c92a1d9dbaf70ad9e621f4bd8d98662f00e3c125"), 32},
				{dh(""), 0},
				{dh(""), 0}}},
		{2,
			5,
			3,
			[]proofTestVector{
				{dh("6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d"), 32},
				{dh("5f083f0a1a33ca076a95279832580db3e0ef4584bdff1f54c8a360f50de3031e"), 32},
				{dh("bc1a0643b12e4d2d7c77918f44e0f4f79a838b6cf9ec5b5c283e1f4d88599e6b"), 32}},
		}}
}

func getRoots() []proofTestVector {
	return []proofTestVector{
		{dh("6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d"), 32},
		{dh("fac54203e7cc696cf0dfcb42c92a1d9dbaf70ad9e621f4bd8d98662f00e3c125"), 32},
		{dh("aeb6bcfe274b70a14fb067a5e5578264db0fa9b51af5e0ba159158f329e06e77"), 32},
		{dh("d37ee418976dd95753c1c73862b9398fa2a2cf9b4ff0fdfe8b30cd95209614b7"), 32},
		{dh("4e3bbb1f7b478dcfe71fb631631519a3bca12c9aefca1612bfce4c13a86264d4"), 32},
		{dh("76e67dadbcdf1e10e1b74ddc608abd2f98dfb16fbce75277b5232a127f2087ef"), 32},
		{dh("ddb89be403809e325750d3d263cd78929c2942b7942a34b77e122c9594a74c8c"), 32},
		{dh("5dc9da79a70659a9ad559cb701ded9a2ab9d823aad2f4960cfe370eff4604328"), 32}}
}

type consistencyTestVector struct {
	snapshot1, snapshot2, proofLen int64
	proof                          [3]proofTestVector
}

func getConsistencyProofs() []consistencyTestVector {
	return []consistencyTestVector{
		{1, 1, 0, [3]proofTestVector{{dh(""), 0}, {dh(""), 0}, {dh(""), 0}}},
		{1,
			8,
			3,
			[3]proofTestVector{
				{dh("96a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7"), 32},
				{dh("5f083f0a1a33ca076a95279832580db3e0ef4584bdff1f54c8a360f50de3031e"), 32},
				{dh("6b47aaf29ee3c2af9af889bc1fb9254dabd31177f16232dd6aab035ca39bf6e4"), 32}}},
		{6,
			8,
			3,
			[3]proofTestVector{
				{dh("0ebc5d3437fbe2db158b9f126a1d118e308181031d0a949f8dededebc558ef6a"), 32},
				{dh("ca854ea128ed050b41b35ffc1b87b8eb2bde461e9e3b5596ece6b9d5975a0ae0"), 32},
				{dh("d37ee418976dd95753c1c73862b9398fa2a2cf9b4ff0fdfe8b30cd95209614b7"), 32}}},
		{2,
			5,
			2,
			[3]proofTestVector{
				{dh("5f083f0a1a33ca076a95279832580db3e0ef4584bdff1f54c8a360f50de3031e"), 32},
				{dh("bc1a0643b12e4d2d7c77918f44e0f4f79a838b6cf9ec5b5c283e1f4d88599e6b"), 32},
				{dh(""), 0}}},
	}
}

func TestVerifyInclusionProof(t *testing.T) {
	v := getVerifier()

	path := [][]byte{}
	// Various invalid paths
	if err := v.VerifyInclusionProof(0, 0, path, []byte{}, []byte{}); err == nil {
		t.Fatal("Incorrectly verified invalid path 1")
	}
	if err := v.VerifyInclusionProof(0, 1, path, []byte{}, []byte{}); err == nil {
		t.Fatal("Incorrectly verified invalid path 2")
	}
	if err := v.VerifyInclusionProof(1, 0, path, []byte{}, []byte{}); err == nil {
		t.Fatal("Incorrectly verified invalid path 3")
	}
	if err := v.VerifyInclusionProof(2, 1, path, []byte{}, []byte{}); err == nil {
		t.Fatal("Incorrectly verified invalid path 4")
	}

	if err := v.VerifyInclusionProof(0, 0, path, dh(sha256EmptyTreeHash), []byte{}); err == nil {
		t.Fatal("Incorrectly verified invalid root 1")
	}
	if err := v.VerifyInclusionProof(0, 1, path, dh(sha256EmptyTreeHash), []byte{}); err == nil {
		t.Fatal("Incorrectly verified invalid root 2")
	}
	if err := v.VerifyInclusionProof(1, 0, path, dh(sha256EmptyTreeHash), []byte{}); err == nil {
		t.Fatal("Incorrectly verified invalid root 3")
	}
	if err := v.VerifyInclusionProof(2, 1, path, dh(sha256EmptyTreeHash), []byte{}); err == nil {
		t.Fatal("Incorrectly verified invalid root 4")
	}

	// Known good paths.

	inclusionProofs := getInclusionTestVector()
	inputs := getInputs()
	roots := getRoots()
	// i = 0 is an invalid path.
	for i := 1; i < 6; i++ {
		// Construct the path.
		proof := [][]byte{}
		for j := int64(0); j < inclusionProofs[i].proofLength; j++ {
			proof = append(proof, inclusionProofs[i].proof[j].h)
		}
		err := verifierCheck(&v, inclusionProofs[i].leaf, inclusionProofs[i].snapshot, proof,
			roots[inclusionProofs[i].snapshot-1].h,
			inputs[inclusionProofs[i].leaf-1].h)
		if err != nil {
			t.Fatalf("i=%d: %s", i, err)
		}
	}

}

func TestVerifyConsistencyProof(t *testing.T) {
	v := getVerifier()

	proof := [][]byte{}
	root1 := []byte("don't care")
	root2 := []byte("don't care")

	// Snapshots that are always consistent
	if err := verifierConsistencyCheck(&v, 0, 0, root1, root2, proof); err != nil {
		t.Fatalf("Failed to verify proof: %s", err)
	}
	if err := verifierConsistencyCheck(&v, 0, 1, root1, root2, proof); err != nil {
		t.Fatalf("Failed to verify proof: %s", err)
	}
	if err := verifierConsistencyCheck(&v, 1, 1, root1, root2, proof); err != nil {
		t.Fatalf("Failed to verify proof: %s", err)
	}

	// Invalid consistency proofs.
	// Time travel to the past.
	if err := verifierConsistencyCheck(&v, 1, 0, root1, root2, proof); err == nil {
		t.Fatal("Incorrectly verified timetravelling proof")
	}
	if err := verifierConsistencyCheck(&v, 2, 1, root1, root2, proof); err == nil {
		t.Fatal("Incorrectly verified timetravelling proof")
	}

	// Empty proof
	if err := verifierConsistencyCheck(&v, 1, 2, root1, root2, proof); err == nil {
		t.Fatal("Incorrectly verified timetravelling proof")
	}

	root1 = dh(sha256EmptyTreeHash)
	// Roots don't match.
	if err := verifierConsistencyCheck(&v, 0, 0, root1, root2, proof); err == nil {
		t.Fatal("Incorrectly verified mismatched root")
	}
	if err := verifierConsistencyCheck(&v, 1, 1, root1, root2, proof); err == nil {
		t.Fatal("Incorrectly verified mismatched root")
	}

	// Roots match but the proof is not empty.
	root2 = dh(sha256EmptyTreeHash)
	proof = [][]byte{dh(sha256EmptyTreeHash)}

	if err := verifierConsistencyCheck(&v, 0, 0, root1, root2, proof); err == nil {
		t.Fatal("Incorrectly verified non-empty proof")
	}
	if err := verifierConsistencyCheck(&v, 0, 1, root1, root2, proof); err == nil {
		t.Fatal("Incorrectly verified non-empty proof")
	}
	if err := verifierConsistencyCheck(&v, 1, 1, root1, root2, proof); err == nil {
		t.Fatal("Incorrectly verified non-empty proof")
	}

	// Known good proofs.
	roots := getRoots()
	proofs := getConsistencyProofs()
	for i := 0; i < 4; i++ {
		proof := [][]byte{}
		for j := int64(0); j < proofs[i].proofLen; j++ {
			proof = append(proof, proofs[i].proof[j].h)
		}
		snapshot1 := proofs[i].snapshot1
		snapshot2 := proofs[i].snapshot2
		err := verifierConsistencyCheck(&v, snapshot1, snapshot2,
			roots[snapshot1-1].h,
			roots[snapshot2-1].h, proof)
		if err != nil {
			t.Fatalf("Failed to verify known good proof for i=%d: %s", i, err)
		}
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?><concept xmlns="http://www.w3.org/2004/02/skos/core#">
      <prefLabel>ADMINISTRATOR</prefLabel>
      <definition>The Administrator of the Centers for Medicare and Medicaid Services.</definition>
   </concept>


text:
(function() {
  define(['./baseFactory'], function($q, $location, $injector) {
    'use strict';
    return angular.module('compass.factories').factory('errorhandlingInterceptor', [
      '$q', '$location', '$injector', function($q, $location, $injector) {
        return {
          response: function(response) {
            return response;
          },
          responseError: function(rejection) {
            var $modal, wizardService;
            if (rejection.status === 401) {
              console.log("Response Error 401", rejection);
              $location.path('/login');
            } else {
              if (rejection.config.url && rejection.config.url !== "/api/users/login") {
                wizardService = $injector.get('wizardService');
                $modal = $injector.get('$modal');
                wizardService.showErrorMessage($modal, "ERROR " + rejection.status, rejection.data);
              }
            }
            return $q.reject(rejection);
          }
        };
      }
    ]);
  });

}).call(this);


text:
def max_nonoverlapping_segments(a, b)

end


text:
define(
    function (require) {
        var etpl = require( 'etpl' );
        var readText = require( 'readTextSync' );
        var text = readText( 'spec/var.text.html' );

        describe('Var', function() {
            it('can declare user variable', function() {
                var renderer = etpl.compile( text['tpl-simple'] );
                expect(renderer()).toEqual(text['expect-simple']);
            });

            it('has higher priority than data variable', function() {
                var data = {
                    name: 'etpl'
                };
                etpl.compile( text['tpl-prior'] );
                expect(etpl.render('varPriorNoVarTarget', data))
                    .toEqual(text['expect-prior-novar']);
                expect(etpl.render('varPriorVarTarget', data))
                    .toEqual(text['expect-prior-var']);
            });

            it('effective on declare position', function() {
                var data = {
                    name: 'etpl'
                };
                etpl.compile( text['tpl-ba'] );
                expect(etpl.render('varBATarget', data))
                    .toEqual(text['expect-ba']);
            });

            it('effective around the target', function() {
                etpl.compile( text['tpl-around'] );
                expect(etpl.render('varAroundTarget'))
                    .toEqual(text['expect-around']);
            });
        });
    }
);


text:
package com.battlelancer.seriesguide.ui;

import android.app.ActionBar;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.view.MenuItem;
import com.battlelancer.seriesguide.R;
import com.battlelancer.seriesguide.settings.TraktCredentials;

/**
 * Shows a {@link ConnectTraktFragment} or if already connected to trakt a
 * {@link ConnectTraktCredentialsFragment}.
 */
public class ConnectTraktActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setupActionBar();

        if (savedInstanceState == null) {
            if (TraktCredentials.get(this).hasCredentials()) {
                // immediately show credentials to allow disconnecting
                ConnectTraktCredentialsFragment f = ConnectTraktCredentialsFragment.newInstance();
                FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
                ft.add(android.R.id.content, f);
                ft.commit();
            } else {
                // display trakt introduction
                ConnectTraktFragment f = new ConnectTraktFragment();
                FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
                ft.add(android.R.id.content, f);
                ft.commit();
            }
        }
    }

    private void setupActionBar() {
        final ActionBar actionBar = getActionBar();
        actionBar.setTitle(R.string.connect_trakt);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            super.onBackPressed();
            return true;
        }
        return false;
    }
}


text:
/* Scan results */
.family-list, .family-list ul {
	padding-left: 0px;
}

.family-list li {
	list-style-type: none;
}

.family {
	margin-bottom: 1em;
	background-color: #f9f9f9;
}

.family h3 {
	padding: 3px;
	background-color: #d7e9a1;
	margin-bottom: 3px;
}

.weak_hits .family h3 {
	background-color: #dadada;
}

.family h3 .description {
	font-weight: normal;
	padding-left: 15px;
}

.hit-list {
	padding-top: 1em;
}

div.domain-graphic {
	display: inline-block;
	vertical-align: middle;
	margin-bottom: 4px;
}

/* Domain graphics */
div.domain-graphic div.domain.member {
	background-color: #5f950c;
}

div.domain-graphic div.domain {
	background-color: #b63d2f;
	color: white;
	text-align: center;
	font-size: smaller;
	overflow: hidden;
}


text:
@interface SYHomeController : UIViewController

@end


text:
include ../../Makefile.common  # $(TABCAT_HOST) and $(PUSHED)

# generated/symlinked files for scoring
SCORING_COFFEE_SRC = ./scoring/app.coffee ./scoring/scoring.coffee
SCORING_SYMLINKS = scoring/app.coffee scoring/kanso.json

# CoffeeScript to compile into JavaScript
COFFEE_SRC = $(sort $(shell find . -name '*.coffee' -not -name '.*') $(SCORING_COFFEE_SRC))
COFFEE_JS = $(patsubst %.coffee, %.js, $(COFFEE_SRC))

# files kanso expects to push
KANSO_DEPS = $(shell $(SCRIPTS)/json-ls /attachments+/modules kanso.json)
DDOC_NAME = $(shell $(SCRIPTS)/json-ls name kanso.json)

.PHONY: all
all: $(PUSHED_DBS)
	@: # suppress "nothing to be done for "all" message

.PHONY: clean
clean:
	rm -f $(COFFEE_JS)
	rm -f .pushed-*
	rm -f design.json
	rm -rf packages
	rm -f scoring/design.json
	rm -rf scoring/packages
	find . -type l -and -not -path ./Makefile -delete
	find . -name '*~' -delete

# compiling COFFEE_JS
$(COFFEE_JS): %.js: %.coffee
	coffee -c $<
	if which coffeelint; then coffeelint -q $<; fi

# task, for "tabcat" DB
$(PUSHED)_tabcat: design.json
	$(SCRIPTS)/force-put $< $(TABCAT_HOST)/tabcat/_design/$(DDOC_NAME)
	touch $@

design.json: packages kanso.json $(KANSO_DEPS)
	kanso install
	kanso show > $@

packages:
	mkdir -p ../../kanso-packages
	ln -sfn ../../kanso-packages $@

# scoring code, for "tabcat-data*" DBs
$(PUSHED_DATA_DBS): %: scoring/design.json
	$(SCRIPTS)/force-put $< $(patsubst $(PUSHED)_%,$(TABCAT_HOST)/%, $@)/_design/$(DDOC_NAME)
	touch $@

scoring/design.json: scoring/kanso.json scoring/app.js scoring/scoring.js scoring/js ../../core/js/tabcat/scoring.js scoring/packages
	mkdir -p $(@D)
	cd $(@D); kanso install
	cd $(@D); kanso show > $(@F)

$(SCORING_SYMLINKS): %:
	mkdir -p $(@D)
	ln -sf ../../../task-defaults/$@ $@

# scoring.coffee can be an empty file
scoring/scoring.coffee:
	mkdir -p $(@D)
	touch $@

scoring/js:
	mkdir -p $(@D)
	ln -sfn ../../../core/js $@

scoring/packages:
	mkdir -p $(@D)
	ln -sfn ../packages $@

# optionally, pack all the JS code into a single file, js/task.js.
# (include js/task.js in kanso.json to activate this)
#
# You will still have to include ../core/js/tabcat.js separately because
# it's big enough (currently, 290K) that we don't want to duplicate it.

ifeq (,$(wildcard js/task.coffee))  # handle js/task.coffee normally'
TASK_JS = scoring/scoring.js $(filter ./js/%,$(COFFEE_JS))
ifeq ($(TABCAT_DEBUG), 1)
# force rebuild of js/tabcat.js
.PHONY: js/task.js
js/task.js: $(TASK_JS)
	cat $^ > $@
else
js/task.js: $(TASK_JS)
	uglifyjs $^ -c warnings=false -o $@
endif
endif


text:
@include('adm.templates.htmlhead')

Fixed Header!

    Login here

@include('adm.templates.htmlbottom')


text:
import { KEYMAP, VALMAP } from "./constants";
import transform from "lodash.transform";
import set from "lodash.set";
import isNull from "lodash.isnull";
import isPlainObject from "lodash.isplainobject";
import get from "lodash.get";
import isString from "lodash.isstring";
import isFunction from "lodash.isfunction";

const returnValue = props => props.value;

const parseContext = contextDefinition => {
  return transform(
    contextDefinition,
    (context, value, key) => {
      const setKey = val => set(context, [KEYMAP, key], val);
      const setVal = val => set(context, [VALMAP, key], val);

      if (isNull(value)) {
        setKey(value);
        return context;
      }
      if (isString(value)) {
        setKey(value);
        return context;
      }
      if (isFunction(value)) {
        setKey(key);
        setVal(value);
        return context;
      }
      // advanced context definition syntax
      if (isPlainObject(value)) {
        setKey(get(value, "key", key));
        setVal(get(value, "val", returnValue));

        if (value.context) {
          // this hack will break if the subContext overwrites a key
          // in the parent context.
          // todo: implement subContext at JSON node level to avoid conflicts
          let subContext = parseContext(value.context);
          Object.assign(context[KEYMAP], subContext[KEYMAP]);
          Object.assign(context[VALMAP], subContext[VALMAP]);
        }
        return context;
      }
      // bad format
      throw new Error("parseContext error");
    },
    {}
  );
};

export default parseContext;


text:
[![Build Status](https://travis-ci.org/rwjblue/broccoli-jshint.svg?branch=master)](https://travis-ci.org/rwjblue/broccoli-jshint)

Run JSHint on the provided node.

## Usage

```javascript
var JSHinter = require('broccoli-jshint');

// Assuming someNode contains .js files
var node = new JSHinter(someNode);
```

## Documentation

### `new JSHinter(inputNode, options)`

---

`options.jshintrcRoot` *{String}*

Will look in the root of the provided node for a `.jshintrc`. If you would prefer to use another specific root
for looking up your JSHint config, supply this option.

Default: **input node root**

---

`options.jshintrcPath` *{String}*

Specify the path to the `.jshintrc` that you would like to use. Use this option if you would like to use a `.jshintrc`
file from a path that is not in the same hierarchy as your input node (if it is use the `.jshintrcRoot`).

Default: **undefined**

---

`options.log` *{true|false}*

Should we log errors to the console?

Default: **true**

---

`options.disableTestGenerator` *{true|false}*

If `true` tests will not be generated.

Default: **false**

---

`options.testGenerator` *{Function}*

The function used to generate test modules. You can provide a custom function for your client side testing framework of choice.

The function receives the following arguments:

* `relativePath` - The relative path to the file being tested.
* `errors` - A generated string of errors found.

Default generates QUnit style tests:

```javascript
var path = require('path');

function(relativePath, errors) {
  return "module('" + path.dirname(relativePath) + "');";
         "test('" + relativePath + "' should pass jshint', function() { " +
         "  ok(passed, moduleName+" should pass jshint."+(errors ? "\n"+errors : '')); " +
         "});"
};
```
---

`options.console` *{Object}*

Allows you to provide a custom `console` object. This is useful if you have to supress console output in CI for example.

Default: **`console`**

---

`options.annotation` *{String}*

A human-readable description for this plugin instance.

Default: **undefined**

## ZOMG!!! TESTS?!?!!?

I know, right?

Running the tests:

```javascript
npm install
npm test
```

## License

This project is distributed under the MIT license.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<title>Alternet Libs 1.0 Reference Package ml.alternet.util.gen</title>
		<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="style" />

        	ml.alternet.util.gen

Classes

            	ByteCodeFactoryGenerator

            	ByteCodeSpec


text:
A [Concourse CI](http://concourse.ci) resource to send emails.

## Source Configuration

* `from`: *Required*. The email address of the sender as a string.

* `host`: *Optional*. The smtp host to send from.

### Example

Adding the resource to your project:

``` yaml
resource_types:
- name: email
  type: docker-image
  source:
    repository: mdomke/concourse-email-resource
```

Resource configuration:

``` yaml
resources:
- name: send-email
  type: email
  source:
    from: ci@example.com
    host: smtp.example.com
```

Sending an email message:

``` yaml
- put: send-email
  params:
    to: [recipient@example.com]
    subject: subject.txt
    body: body.txt
```

## Behavior

`check` and `in` operations are a noop.

### `out`: Send an email message

#### Parameters

* `to|to_file`: _(mandatory)_ Use `to` to specify a list of recipients as strings or use `to_file` to specify file with addresses, each address should be in a new line.
* `subject|subject_text`: _(mandatory)_ Use `subject` to specify a path to the file holding the email subject or use `subject_text` to specify a plain text subject.
* `body|body_text`: _(mandatory)_ Use `body ` to specify a path to the file holding the email body or use `body_text` to specify a plain text email body.
* `vars`: _(optional)_ A path to a JSON-file holding template vars.
* `type`: _(optional)_ The MIME subtype (defaults to `"html"`)
* `inline_css`: _(optional)_ Inline CSS to style attributes in HTML.
* `attachments`: A list of file names that will be attached to the email. Attachments only work if `type` is `"html"`, wildcards (`*`) are supported, ex: `your-attachment-*.zip`.

`subject|subject_text` and `body|body_text` can both either be plain text, html or a [jinja](http://jinja.pocoo.org/docs/dev/)-template.
In the latter case you can specify an additional file (`vars`) for holding template variables that should
be rendered into the template. Additionally to the variables from the `vars`-file, all environment variables can
be used in the template (e.g.: ``BUILD_ID``). By default (if the MIME subtype is "html"), the CSS styles will be
inlined to the HTML. If you don't want that, you can set the `inline_css` parameter to `False`.
If you want to use jinja-template in `subject_text` or `body_text` you need to define the content as a multiline text, otherwise a syntax error will be reported for malformed yaml.

``` yaml
- put: send-email
  params:
    to: [recipient@example.com]
    subject_text: |
      {% block BUILD_PIPELINE_NAME %}{% endblock %}:{% block BUILD_JOB_NAME %}{% endblock %} failed
    body_text: |
      {% block BUILD_PIPELINE_NAME %}{% endblock %}:{% block BUILD_JOB_NAME %}{% endblock %} failed
```

A more elaborate usage example would look like this:

```yaml
- put: send-email
  params:
    to: [recipient@example.com]
    subject: subject
    body: body.html
    vars: vars.json
```

or for a plain text example:

```yaml
- put: send-email
  params:
    to: [recipient@example.com]
    subject: subject.txt
    body: body.txt
    type: plain
```


text:
package me.ehlxr.test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import me.ehlxr.redis.JedisUtil;
import net.sf.json.JSONObject;

public class TestJdbc {
	private static Connection getConn() {
		String driver = "com.mysql.jdbc.Driver";
		String url = "jdbc:mysql://192.168.3.11:3306/wins-dsp-new?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&connectTimeout=60000&socketTimeout=60000";
		String username = "root";
		String password = "pxene";
		Connection conn = null;
		try {
			Class.forName(driver); // classLoader,加载对应驱动
			conn = (Connection) DriverManager.getConnection(url, username, password);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return conn;
	}

	private static Integer getAll() {
		Connection conn = getConn();
		String sql = "SELECT v.* FROM dsp_v_app_motionclick_day_count v WHERE  v.time BETWEEN 1433088000000 AND 1453046400000 ";
		// String sql = "SELECT * FROM dsp_t_ad_group_adx_creative WHERE groupid
		// = 'd092c630-abfd-45a1-92f3-d0530c1caee8' LIMIT 1,3;";
		PreparedStatement pstmt;
		try {
			pstmt = (PreparedStatement) conn.prepareStatement(sql);
			ResultSet rs = pstmt.executeQuery();
			ResultSetMetaData metaData = rs.getMetaData();
			while (rs.next()) {
				JSONObject jsonObject = new JSONObject();
				String time = "";
				String mapid = "";
				String appid = "";
				String adxtype = "";
				for (int i = 1; i <= metaData.getColumnCount(); i++) {
					String columnName = metaData.getColumnName(i);
					if ("time".equals(columnName)) {
						time = rs.getString(i);
					}
					if ("mapid".equals(columnName)) {
						mapid = rs.getString(i);
					}
					if ("appid".equals(columnName)) {
						appid = rs.getString(i);
					}
					if ("adxtype".equals(columnName)) {
						adxtype = rs.getString(i);
					}

					jsonObject.put(columnName, rs.getString(i));
				}
				Map<String, String> map = new HashMap<>();
				map.put(time + "_" + appid + "_" + adxtype, jsonObject.toString());
				JedisUtil.hset("HistoryAPPData_" + mapid, map);

				// JedisUtil.lpush("HistoryAPPData_"+mapid+"_"+time,
				// jsonObject.toString());
				System.out.println("HistoryAPPData_" + mapid);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}

	public static void main(String[] args) {

		insertData();

		// getAll();
//		 JedisUtil.deleteByPattern("HistoryAPPData_*");
		/*
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date start = new Date();

		List<String> mapids = getMapid();
		// String[] keys = JedisUtil.getKeys("HistoryAPPData_*");
		List<String> alldata = new ArrayList<String>();
		for (String mapid : mapids) {
			String key = "HistoryAPPData_" + mapid;
			String[] hkeys = JedisUtil.hkeys(key);
//			for (String hkey : hkeys) {
//				System.out.println(JedisUtil.hget(key, hkey));
//			}
			if(hkeys.length>0){
				List<String> hmget = JedisUtil.hmget(key, hkeys);
				alldata.addAll(hmget);
			}
		}
		System.out.println(alldata.size());
		Date end = new Date();
		System.out.println(sdf.format(start));
		System.out.println(sdf.format(end));
		*/
	}

	private static List<String> getMapid() {
		List<String> mapids = new ArrayList<String>();
		Connection conn = getConn();
		String sql = "SELECT t2.id AS mapid FROM dsp_t_ad_group_creative t2 LEFT JOIN dsp_t_ad_group t3 ON t2.groupid = t3.id LEFT JOIN dsp_t_campaign t4 ON t3.campaignid = t4.id LEFT JOIN dsp_t_advertiser_account t5 ON t4.accountid = t5.id LEFT JOIN dsp_t_advertiser t6 ON t5.advertiserid = t6.id WHERE ( t4.accountid IN ( SELECT id FROM dsp_t_advertiser_account t6 WHERE t6.advertiserid IN ( SELECT id FROM dsp_t_advertiser t7 WHERE t7.parentid = 'dfecbd8a-2d7e-4941-bd89-e39c576c5ee5' ) ) OR t4.accountid = 'dfecbd8a-2d7e-4941-bd89-e39c576c5ee5' )";
		// String sql = "SELECT * FROM dsp_t_ad_group_adx_creative WHERE groupid
		// = 'd092c630-abfd-45a1-92f3-d0530c1caee8' LIMIT 1,3;";
		PreparedStatement pstmt;
		try {
			pstmt = (PreparedStatement) conn.prepareStatement(sql);
			ResultSet rs = pstmt.executeQuery();
			ResultSetMetaData metaData = rs.getMetaData();
			while (rs.next()) {
				for (int i = 1; i <= metaData.getColumnCount(); i++) {
					mapids.add(rs.getString(i));
				}
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return mapids;
	}

	private static void insertData(){
		Connection conn = getConn();
		System.out.println(new Date());
		for (int i = 0; i > -1; i++) {
			String cid = UUID.randomUUID().toString();
			String sql = "INSERT INTO `dsp_t_statis_by_day` (`time`, `creativeid`, `category`, `imprs`, `clks`, `cost`, `downloads`, `regists`, `flag`, `createtime`) VALUES ('2014-12-06 00:00:00', '"+cid+"', '2', '961', '9', '201860.7000', '0', '0', '0', '2015-09-14 15:07:42');";
			PreparedStatement pstmt;
			try {
				pstmt = (PreparedStatement) conn.prepareStatement(sql);
				pstmt.executeUpdate();
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		System.out.println(new Date());
	}
}


text:
/*
242 Valid Anagram

Given two strings s and t, write a function to determine if t is an anagram of s.

For example,
s = "anagram", t = "nagaram", return true.
s = "rat", t = "car", return false.

Note:
 You may assume the string contains only lowercase alphabets.

Follow up:
 What if the inputs contain unicode characters? How would you adapt your solution to such case?

*/

/*****
1. 	Anagram 字母重排词.
2.	两表费空间, 一遍加,一边减,检查是否全零.
3.	Unicode用map
*****/

public class Solution {
	public boolean isAnagram(String s, String t) {
		int[] alphabet = new int[26];
		for (int i = 0; i < s.length(); i++) alphabet[s.charAt(i) - 'a']++;
		for (int i = 0; i < t.length(); i++) alphabet[t.charAt(i) - 'a']--;
		for (int i : alphabet) if (i != 0) return false;
		return true;
	}
}


text:
#include <sys/stat.h>
#include <android/log.h>
#include <jni.h>
#include <string>
#include <android/native_window.h>
#include <android/native_window_jni.h>
#include <android/log.h>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/imgproc/imgproc_c.h>
#include <opencv2/core/matx.hpp>
#include <opencv2/core/mat.hpp>

extern "C" {
#define  LOG_TAG    "videoplay"
#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
jstring
Java_com_example_lyc_vrexplayer_MainActivity_stringFromJNI(
        JNIEnv *env,
        jobject /* this */) {
    std::string hello = "Hello from C++";
    return env->NewStringUTF(hello.c_str());
}

JNIEXPORT jlong JNICALL
Java_com_example_lyc_vrexplayer_activity_MediaFile_getCreateTile(JNIEnv *env, jclass type,
                                                                 jstring path_) {
    const char *path = env->GetStringUTFChars(path_, 0);
    struct stat buf;
    int result;

    //获得文件状态信息

    result = stat(path, &buf);

    //显示文件状态信息

    if (result != 0)
        LOGD("显示文件状态信息出错");//

    else {

        LOGD("文件大小: %d", buf.st_size);
        LOGD("文件创建时间: %ld", buf.st_ctime);
        //       printf("文件创建时间: %s", ctime(&buf.st_ctime));
//        printf("访问日期: %s", ctime(&buf.st_atime));
//        printf("最后修改日期: %s", ctime(&buf.st_mtime));

    }
    env->ReleaseStringUTFChars(path_, path);
    return buf.st_mtime;

}

JNIEXPORT void JNICALL
Java_com_example_lyc_vrexplayer_activity_DetailPicAcitvity_setPathAndSurfaceView(JNIEnv *env,
                                                                                jobject instance,
                                                                                jstring path_,
                                                                                jobject surface,
                                                                                jint width,
                                                                                jint height,
                                                                                jint type) {
    const char *path = env->GetStringUTFChars(path_, 0);
    jbyteArray arr = env->NewByteArray(width * height * 4);
    jbyte *rgba = env->GetByteArrayElements(arr, NULL);
    LOGD("jinru C++");

    cv::Mat src = cv::imread(path);
    cv::Mat dst;
    LOGD("jinru C++1");

    switch (type) {
        case cv::INTER_NEAREST :
            cv::resize(src, dst, cv::Size(width, height), 0, 0, cv::INTER_NEAREST);
            break;
        case cv::INTER_LINEAR :
            cv::resize(src, dst, cv::Size(width, height), 0, 0, cv::INTER_LINEAR);
            break;
        case cv::INTER_CUBIC :
            cv::resize(src, dst, cv::Size(width, height), 0, 0, cv::INTER_CUBIC);
            break;
        case cv::INTER_AREA :
            cv::resize(src, dst, cv::Size(width, height), 0, 0, cv::INTER_AREA);
            break;
        case cv::INTER_LANCZOS4 :
            cv::resize(src, dst, cv::Size(width, height), 0, 0, cv::INTER_LANCZOS4);
            break;
    }
    LOGD("jinru C++2");
    long index = 0;
    for (int i = 0; i < height; i++) {
        //获取第 i 行首像素指针
        cv::Vec3b *p = dst.ptr<cv::Vec3b>(i);
        //因为mat中只有3个通道的,  要是 Vec4b  就错了
        for (int j = 0; j < width; j++) {
            // 这里 为什么赋值是210   因为opencv中的顺序是BGR
            //                         而我们需要的顺序是RGBA,所以自己最后还加了个Alpha
            //  index = i *width *4 + j * 4;
//            rgba[index + 0 ]  =    p[j][2] ;
//            rgba[index + 1 ]  =    p[j][1] ;
//            rgba[index + 2 ]  =    p[j][0] ;
//            rgba[index + 3 ] = 255;
            rgba[index] = p[j][2];
            index++;
            rgba[index] = p[j][1];
            index++;
            rgba[index] = p[j][0];
            index++;
            rgba[index] = 255;
            index++;
        }
    }
    src.release();
    dst.release();
    ANativeWindow *nativeWindow = ANativeWindow_fromSurface(env, surface);
    ANativeWindow_release(nativeWindow);
    ANativeWindow_setBuffersGeometry(nativeWindow, width, height,
                                     WINDOW_FORMAT_RGBA_8888);
    ANativeWindow_Buffer windowBuffer;
    ANativeWindow_lock(nativeWindow, &windowBuffer, 0);
    uint8_t *dst_data = (uint8_t *) windowBuffer.bits;
    int dstStride = windowBuffer.stride * 4;
    uint8_t *src_data = (uint8_t *) rgba;
    int srcStride = width * 4;
    int h;
    for (h = 0; h < height; h++) {

        memcpy(dst_data + h * dstStride, src_data + h * srcStride, srcStride);
    }
    ANativeWindow_unlockAndPost(nativeWindow);
    env->ReleaseByteArrayElements(arr, rgba, 0);
    env->ReleaseStringUTFChars(path_, path);
}

JNIEXPORT void JNICALL
Java_com_example_lyc_vrexplayer_activity_DetailPicAcitvity_setSurfaceView(JNIEnv *env,
                                                                          jobject instance,
                                                                          jobject surface,
                                                                          jbyteArray rgba_,
                                                                          jint width, jint height) {
    jbyte *rgba = env->GetByteArrayElements(rgba_, NULL);
    ANativeWindow *nativeWindow = ANativeWindow_fromSurface(env, surface);
    ANativeWindow_release(nativeWindow);
    ANativeWindow_setBuffersGeometry(nativeWindow, 3840, 1700,
                                     WINDOW_FORMAT_RGBA_8888);

    ANativeWindow_Buffer windowBuffer;
    ANativeWindow_lock(nativeWindow, &windowBuffer, 0);
    uint8_t *dst = (uint8_t *) windowBuffer.bits;
    int dstStride = windowBuffer.stride * 4;
    uint8_t *src = (uint8_t *) rgba;
    int srcStride = width * 4;
    LOGD("dstStride = %d ----srcStride = %d ", dstStride, srcStride);

//    // 由于window的stride和帧的stride不同,因此需要逐行复制
    int h;
    for (h = 0; h < height; h++) {
        //  LOGD("进行了 == %d" , h);
        memcpy(dst + h * dstStride, src + h * srcStride, srcStride);
    }
    LOGD("h=%d", h);
//
    ANativeWindow_unlockAndPost(nativeWindow);
    env->ReleaseByteArrayElements(rgba_, rgba, 0);
}
JNIEXPORT jbyteArray JNICALL
Java_com_example_lyc_vrexplayer_activity_DetailPicAcitvity_getNewPixels(JNIEnv *env,
                                                                        jobject instance,
                                                                        jintArray pixels_,
                                                                        jint width, jint height) {
    jint *pixels = env->GetIntArrayElements(pixels_, NULL);
    int pixel_length = width * height;
    int lenght = width * height * 4;
    jbyteArray arr = env->NewByteArray(lenght);
    jbyte *rgba = env->GetByteArrayElements(arr, NULL);
    int i = 0;

    for (i = 0; i < pixel_length; i++) {
        rgba[i * 4] = (pixels[i] >> 16) & 0xFF;
        rgba[i * 4 + 1] = (pixels[i] >> 8) & 0xFF;
        rgba[i * 4 + 2] = pixels[i] & 0xFF;
        rgba[i * 4 + 3] = (pixels[i] >> 24) & 0xFF;
    }
    jbyteArray it = (*env).NewByteArray(lenght);
    (*env).SetByteArrayRegion(it, 0, lenght, rgba);
    env->ReleaseByteArrayElements(arr, rgba, 0);
    env->ReleaseIntArrayElements(pixels_, pixels, 0);
    return  it;
}
}


text:
namespace blink {

ScriptPromiseResolver::ScriptPromiseResolver(ScriptState* scriptState)
    : SuspendableObject(scriptState->getExecutionContext()),
      m_state(Pending),
      m_scriptState(scriptState),
      m_timer(TaskRunnerHelper::get(TaskType::Microtask, getExecutionContext()),
              this,
              &ScriptPromiseResolver::onTimerFired),
      m_resolver(scriptState)
{
  if (getExecutionContext()->isContextDestroyed()) {
    m_state = Detached;
    m_resolver.clear();
  }
  InspectorInstrumentation::asyncTaskScheduled(getExecutionContext(), "Promise",
                                               this);
}

void ScriptPromiseResolver::suspend() {
  m_timer.stop();
}

void ScriptPromiseResolver::resume() {
  if (m_state == Resolving || m_state == Rejecting)
    m_timer.startOneShot(0, BLINK_FROM_HERE);
}

void ScriptPromiseResolver::detach() {
  if (m_state == Detached)
    return;
  m_timer.stop();
  m_state = Detached;
  m_resolver.clear();
  m_value.clear();
  m_keepAlive.clear();
  InspectorInstrumentation::asyncTaskCanceled(getExecutionContext(), this);
}

void ScriptPromiseResolver::keepAliveWhilePending() {
  // keepAliveWhilePending() will be called twice if the resolver
  // is created in a suspended execution context and the resolver
  // is then resolved/rejected while in that suspended state.
  if (m_state == Detached || m_keepAlive)
    return;

  // Keep |this| around while the promise is Pending;
  // see detach() for the dual operation.
  m_keepAlive = this;
}

void ScriptPromiseResolver::onTimerFired(TimerBase*) {
  ASSERT(m_state == Resolving || m_state == Rejecting);
  if (!getScriptState()->contextIsValid()) {
    detach();
    return;
  }

  ScriptState::Scope scope(m_scriptState.get());
  resolveOrRejectImmediately();
}

void ScriptPromiseResolver::resolveOrRejectImmediately() {
  DCHECK(!getExecutionContext()->isContextDestroyed());
  DCHECK(!getExecutionContext()->isContextSuspended());
  {
    InspectorInstrumentation::AsyncTask asyncTask(getExecutionContext(), this);
    if (m_state == Resolving) {
      m_resolver.resolve(m_value.newLocal(m_scriptState->isolate()));
    } else {
      ASSERT(m_state == Rejecting);
      m_resolver.reject(m_value.newLocal(m_scriptState->isolate()));
    }
  }
  detach();
}

DEFINE_TRACE(ScriptPromiseResolver) {
  SuspendableObject::trace(visitor);
}

}  // namespace blink


text:
class DropLeas < ActiveRecord::Migration
  def up
    drop_table :leas
  end

  def down
    create_table :leas do |t|
      t.string :lea_name
      t.integer :lea_code
    end
  end
end


text:
/**
  * Tests for the Kiama-based swap implementation.
  */
class KiamaSwappingTests extends SwappingSpec {

  def testedImplementation = "Kiama-based `swap' implementation"
}


text:
Quick and brief reference for React development

## Content

00. [Introduction](https://github.com/Jam3/jam3-lessons-react/blob/master/00.Introduction.md)
01. [React.createElement](https://github.com/Jam3/jam3-lessons-react/blob/master/01.React.createElement.md)
02. [JSX](https://github.com/Jam3/jam3-lessons-react/blob/master/02.JSX.md)
03. [Rendering Elements](https://github.com/Jam3/jam3-lessons-react/blob/master/03.Rendering.md)
04. [Components](https://github.com/Jam3/jam3-lessons-react/blob/master/04.Components.md)
05. [Props](https://github.com/Jam3/jam3-lessons-react/blob/master/05.Props.md)
06. [State](https://github.com/Jam3/jam3-lessons-react/blob/master/06.State.md)
07. [Reconciliation](https://github.com/Jam3/jam3-lessons-react/blob/master/07.01.Reconciliation.md)
  01. [shouldComponentUpdate](https://github.com/Jam3/jam3-lessons-react/blob/master/07.02.shouldComponentUpdate.md)
  02. [Constants Elements](https://github.com/Jam3/jam3-lessons-react/blob/master/07.03.Constants-elements.md)
  03. [Anonymous references](https://github.com/Jam3/jam3-lessons-react/blob/master/07.04.Anonymous-references.md)
08. [Lifecycle](https://github.com/Jam3/jam3-lessons-react/blob/master/08.Lifecycle.md)
09. [PropTypes and DefaultProps](https://github.com/Jam3/jam3-lessons-react/blob/master/09.PropTypes%20and%20DefaultProps.md)
10. [PureComponent](https://github.com/Jam3/jam3-lessons-react/blob/master/10.PureComponent.md)
11. [Refs](https://github.com/Jam3/jam3-lessons-react/blob/master/11.Refs.md)
12. [Routing](https://github.com/Jam3/jam3-lessons-react/blob/master/12.Routing.md)


text:
<?php

/*
 * GENERATED CODE WARNING
 * Generated by gapic-generator-php from the file
 * https://github.com/googleapis/googleapis/blob/master/google/cloud/compute/v1/compute.proto
 * Updates to the above are reflected here through a refresh process.
 */

namespace Google\Cloud\Compute\V1\Enums\RouterStatusBgpPeerStatus;

/**
 * StatusReason contains string constants that represent the names of each value in
 * the google.cloud.compute.v1.RouterStatusBgpPeerStatus.StatusReason descriptor.
 */
class StatusReason
{
    const UNDEFINED_STATUS_REASON = 'UNDEFINED_STATUS_REASON';

    const MD5_AUTH_INTERNAL_PROBLEM = 'MD5_AUTH_INTERNAL_PROBLEM';

    const STATUS_REASON_UNSPECIFIED = 'STATUS_REASON_UNSPECIFIED';
}


text:
const assert = require('assert');
const shareUrl = require('../');

describe('Facebook', function() {
  it('Compose the share on facebook url string.', function() {
    const u = 'https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fgoogle.com';
    assert(shareUrl.facebook({
      u: 'http://google.com'
    }) === u);
  });
});

describe('Whatsapp', function() {
  it('Compose the share on whatsapp url string.', function() {
    const u = 'https://api.whatsapp.com/send?text=Check%20out%20https%3A%2F%2Fgoogle.com';
    assert(shareUrl.whatsapp({
      text: 'Check out https://google.com'
    }) === u);
  });
});

describe('Telegram', function() {
  it('Compose the share on telegram url string.', function() {
    const u = 'https://t.me/share/url?url=https%3A%2F%2Fgoogle.com&text=Check%20out';
    assert(shareUrl.telegram({
      url: 'https://google.com',
      text: 'Check out'
    }) === u);
  });
});

describe('Twitter', function() {
  it('Compose the share on twitter url string.', function() {
    const u = 'https://twitter.com/share?text=custom%20share%20text&in_reply_to=471716611724812288&url=https%3A%2F%2Fdev.twitter.com%2Fweb%2Ftweet-button&hashtags=example%2Cdemo&via=twitterdev&related=twitterapi%2Ctwitter';
    assert(shareUrl.twitter({
      text: 'custom share text',
      in_reply_to: '471716611724812288',
      url: 'https://dev.twitter.com/web/tweet-button',
      hashtags: 'example,demo',
      via: 'twitterdev',
      related: 'twitterapi,twitter'
    }) === u);
  });
});

describe('Pinterest', function() {
  it('Compose the share on pinterest url string.', function() {
    const u = 'https://pinterest.com/pin/create/button/?url=http%3A%2F%2Fwww.flickr.com%2Fphotos%2Fkentbrew%2F6851755809%2F&media=http%3A%2F%2Ffarm8.staticflickr.com%2F7027%2F6851755809_df5b2051c9_z.jpg&description=Next%20Stop%20Pinterest';
    assert(shareUrl.pinterest({
      url : 'http://www.flickr.com/photos/kentbrew/6851755809/',
      media : 'http://farm8.staticflickr.com/7027/6851755809_df5b2051c9_z.jpg',
      description : 'Next Stop Pinterest'
    }) === u);
  });
});

describe('Reddit', function() {
  it('Compose the submit to reddit url string.', function() {
    const u = 'http://www.reddit.com/submit?url=%2F%2Fwww.reddit.com%2Fbuttons&title=Buttons!';
    assert(shareUrl.reddit({
      url : '//www.reddit.com/buttons',
      title : 'Buttons!'
    }) === u);
  });
});

describe('Linkedin', function() {
  it('', function() {
    const u = 'https://linkedin.com/sharing/share-offsite/?url=http%3A%2F%2Fdeveloper.linkedin.com';
    assert(shareUrl.linkedin({
      url : 'http://developer.linkedin.com',
    }) === u);
  });
});

describe('Email', function() {
  it('Compose the send email url string.', function() {
    const u = 'mailto:nowhere@mozilla.org?cc=nobody%40mozilla.org&subject=This%20is%20the%20subject&body=This%20is%20the%20body%20-%20https%3A%2F%2Fdeveloper.mozilla.org%2F';
    assert(shareUrl.email({
      to : 'nowhere@mozilla.org',
      cc : 'nobody@mozilla.org',
      subject : 'This is the subject',
      body : 'This is the body - https://developer.mozilla.org/'
    }) === u);
  });
});


text:
package org.broadleafcommerce.core.inventory.service;

import org.broadleafcommerce.common.extension.AbstractExtensionHandler;
import org.broadleafcommerce.common.extension.ExtensionResultHolder;
import org.broadleafcommerce.common.extension.ExtensionResultStatusType;
import org.broadleafcommerce.core.catalog.domain.Sku;

import java.util.Collection;
import java.util.Map;

public abstract class AbstractInventoryServiceExtensionHandler extends AbstractExtensionHandler implements InventoryServiceExtensionHandler {

    @Override
    public ExtensionResultStatusType retrieveQuantitiesAvailable(Collection<Sku> skus, Map<String, Object> context, ExtensionResultHolder<Map<Sku, Integer>> result) {
        return ExtensionResultStatusType.NOT_HANDLED;
    }

    @Override
    public ExtensionResultStatusType decrementInventory(Map<Sku, Integer> skuQuantities, Map<String, Object> context) throws InventoryUnavailableException {
        return ExtensionResultStatusType.NOT_HANDLED;
    }

    @Override
    public ExtensionResultStatusType incrementInventory(Map<Sku, Integer> skuQuantities, Map<String, Object> context) {
        return ExtensionResultStatusType.NOT_HANDLED;
    }

}


text:
using System;
using System.Data;
using System.Data.OleDb;

namespace MyMeta.Firebird
{
#if ENTERPRISE
	using System.Runtime.InteropServices;
	[ComVisible(true), ClassInterface(ClassInterfaceType.AutoDual), ComDefaultInterface(typeof(IDomain))]
#endif
	public class FirebirdDomain : Domain
	{
		public FirebirdDomain()
		{

		}

		override public string DataTypeNameComplete
		{
			get
			{
				FirebirdDomains domains = Domains as FirebirdDomains;
				return this.GetString(domains.f_TypeNameComplete);
			}
		}

		override public System.Int32 CharacterMaxLength
		{
			get
			{
				switch(DataTypeName)
				{
					case "VARCHAR":
					case "CHAR":
						return (int)this._row["DOMAIN_SIZE"];

					default:
						return this.GetInt32(Domains.f_MaxLength);
				}
			}
		}

		public override Int32 NumericPrecision
		{
			get
			{
				switch(DataTypeName)
				{
					case "VARCHAR":
					case "CHAR":
						return 0;

					default:
						return base.NumericPrecision;
				}
			}
		}
	}
}


text:
`Account` and `Group` resources have predefined fields that are useful to many `Applications`, but you are likely to have your own custom data that you need to associate with an account or group as well.

For this reason, both the account and group resources support a linked `customData` resource that you can use for your own needs. The `customData` resource is a schema-less JSON object that allows you to specify whatever name/value pairs you wish.

Since `customData` is a linked resource, it can be obtained by `Account`'s  or `Group`'s  getCustomData function.

Custom data can also be expanded and retrieved by specifying the `expand` option in the query parameters

```javascript

application.getAccounts()
    .search({email: "some@email.com"})
    .expand({customData: true})
    .exec(function(err, accounts){
      // accounts with custom data
    });

```

**Since**: 0.1.2

---

### method get(callback)

Calling this method retrieves `CustomData` resource.

#### Usage

```javascript

//Account
account.customData.get(function(err, customData){
    // customData
});

//Group
group.customData.get(function(err, customData){
    // customData
});

```

#### Parameters

| Parameter   | Type            | Presence   | Description
|-------------|---------------- |----------- | -----------
| *`callback`* | function | *`required`* | The callback to execute upon
 resource update. Parameters are `Error` and `CustomData` objects.

#### Return

void; the callback function if specified will be called with an
`Error`(if an error occurred) and
`CustomData`(if request was successful) objects.

---

### method delete(callback)

This function is used to delete the contents of an account's or group's custom data resource.
 This will delete all of the respective account's or group's custom data fields, but it leaves
 the `customData` placeholder in the account or group resource. You cannot delete the `customData`
 resource entirely – it will be automatically permanently deleted when the account or group is
 deleted.

#### Usage

```javascript

//Account
account.customData.delete(function(err){
  if(err) throw err;
});

//Group
group.customData.delete(function(err){
  if(err) throw err;
});

```

#### Parameters

| Parameter   | Type            | Presence   | Description
|-------------|---------------- |----------- | -----------
| *`callback`* | function | *`required`* | The callback to execute upon resource deletion. The only parameter is an `Error` object.

#### Returns
void; the callback function if specified will return an `Error` object if an error occurred.  There is no body to return of a successful deletion call.

---

### method remove(fieldName)

Call to this methods queues removal of any `CustomData` field until next
 update of `Account`,`Group` or `CustomData` via `save()` method.

#### Usage

```javascript

//Account
account.customData.remove('address1');

//Group
group.customData.remove('old_image_url')
    .remove('old_profile_id');

```

#### Parameters

| Parameter   | Type            | Presence   | Description
|-------------|---------------- |----------- | -----------
| *`fieldName`* | string | *`required`* | The name of `CustomData` field to remove.

#### Return

Current custom data instance, so remove calls can be chained.

---

### method save(callback)

Calling this method updates `CustomData` resource directly.

#### Usage

```javascript

//Account
account.customData.save(function(err, customData){
    // customData
});

//Group
group.customData.save(function(err, customData){
    // customData
});

```

#### Parameters

| Parameter   | Type            | Presence   | Description
|-------------|---------------- |----------- | -----------
| *`callback`* | function | *`required`* | The callback to execute upon
 resource update. Parameters are `Error` and `CustomData` objects.

#### Return

void; the callback function if specified will be called with an
`Error`(if an error occurred) and
`CustomData`(if update was successful) objects.


text:
package org.scify.jedai.blockbuilding;

import org.apache.jena.atlas.json.JsonArray;
import org.apache.jena.atlas.json.JsonObject;
import org.scify.jedai.configuration.gridsearch.DblGridSearchConfiguration;
import org.scify.jedai.configuration.randomsearch.DblRandomSearchConfiguration;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 *
 * @author gap2
 */
public class ExtendedQGramsBlocking extends QGramsBlocking {
    private static final long serialVersionUID = 7312257613427982298L;

    private final static int MAX_Q_GRAMS = 15;

    private float threshold;

    private final DblGridSearchConfiguration gridThreshold;
    private final DblRandomSearchConfiguration randomThreshold;

    public ExtendedQGramsBlocking() {
        this(0.95f, 6);
    }
     public ExtendedQGramsBlocking(float t, int n) {
        super(n);
        threshold = t;

        randomThreshold = new DblRandomSearchConfiguration(0.99f, 0.8f);
        gridThreshold = new DblGridSearchConfiguration(0.95f, 0.8f, 0.05f);
    }

    public void setnGramSize(int nGramSize) {
        this.nGramSize = nGramSize;
    }

    @Override
    protected Set<String> getBlockingKeys(String attributeValue) {
        final Set<String> keys = new HashSet<>();
        for (String token : getTokens(attributeValue)) {
            List<String> nGrams = getNGrams(nGramSize, token);
            if (nGrams.size() == 1) {
                keys.add(nGrams.get(0));
            } else {
                if (MAX_Q_GRAMS < nGrams.size()) {
                    nGrams = nGrams.subList(0, MAX_Q_GRAMS);
                }

                int minimumLength = (int) Math.max(1, Math.floor(nGrams.size() * threshold));
                for (int i = minimumLength; i <= nGrams.size(); i++) {
                    keys.addAll(getCombinationsFor(nGrams, i));
                }
            }
        }
        return keys;
    }

    protected Set<String> getCombinationsFor(List<String> sublists, int sublistLength) {
        if (sublistLength == 0 || sublists.size() < sublistLength) {
            return new HashSet<>();
        }

        final List<String> remainingElements = new ArrayList<>(sublists);
        final String lastSublist = remainingElements.remove(sublists.size() - 1);

        final Set<String> combinationsExclusiveX = getCombinationsFor(remainingElements, sublistLength);
        final Set<String> combinationsInclusiveX = getCombinationsFor(remainingElements, sublistLength - 1);

        final Set<String> resultingCombinations = new HashSet<>(combinationsExclusiveX);
        if (combinationsInclusiveX.isEmpty()) {
            resultingCombinations.add(lastSublist);
        } else {
            combinationsInclusiveX.stream().forEach((combination) -> resultingCombinations.add(combination + lastSublist));
        }
        return resultingCombinations;
    }

    @Override
    public String getMethodConfiguration() {
        return getParameterName(0) + "=" + nGramSize + ",\t"
                + getParameterName(1) + "=" + threshold;
    }

    @Override
    public String getMethodInfo() {
        return getMethodName() + ": it creates one block for every combination of q-grams that represents at least two entities.\n"
                + "The q-grams are extracted from any token in the attribute values of any entity.";
    }

    @Override
    public String getMethodName() {
        return "Extended Q-Grams Blocking";
    }

    @Override
    public String getMethodParameters() {
        return getMethodName() + " involves two parameters:\n"
                + "1)" + getParameterDescription(0) + ".\n"
                + "2)" + getParameterDescription(1) + ".";
    }

    @Override
    public int getNumberOfGridConfigurations() {
        return gridNGSize.getNumberOfConfigurations() * gridThreshold.getNumberOfConfigurations();
    }

    @Override
    public JsonArray getParameterConfiguration() {
        final JsonObject obj1 = new JsonObject();
        obj1.put("class", "java.lang.Integer");
        obj1.put("name", getParameterName(0));
        obj1.put("defaultValue", "6");
        obj1.put("minValue", "2");
        obj1.put("maxValue", "6");
        obj1.put("stepValue", "1");
        obj1.put("description", getParameterDescription(0));

        final JsonObject obj2 = new JsonObject();
        obj2.put("class", "java.lang.Float");
        obj2.put("name", getParameterName(1));
        obj2.put("defaultValue", "0.95");
        obj2.put("minValue", "0.8");
        obj2.put("maxValue", "0.95");
        obj2.put("stepValue", "0.05");
        obj2.put("description", getParameterDescription(1));

        final JsonArray array = new JsonArray();
        array.add(obj1);
        array.add(obj2);
        return array;
    }

    @Override
    public String getParameterDescription(int parameterId) {
        switch (parameterId) {
            case 0:
                return "The " + getParameterName(0) + " defines the number of characters that comprise every q-gram.";
            case 1:
                return "The " + getParameterName(1) + " (t) defines the number N of q-grams that are combined to form an individual blocking key.\n"
                        + "In more detail, the minimum number l_{min} of q-grams per blocking key is defined as l_{min} = max (1, \\floor{k \\cdot t}),\n"
                        + "where k is the number of q-grams from the original blocking key (token).";
            default:
                return "invalid parameter id";
        }
    }

    @Override
    public String getParameterName(int parameterId) {
        switch (parameterId) {
            case 0:
                return "Q-gram Size";
            case 1:
                return "Combination Threshold";
            default:
                return "invalid parameter id";
        }
    }

    @Override
    public void setNextRandomConfiguration() {
        super.setNextRandomConfiguration();
        threshold = (Float) randomThreshold.getNextRandomValue();
    }

    @Override
    public void setNumberedGridConfiguration(int iterationNumber) {
        int ngSizeIteration = iterationNumber / gridThreshold.getNumberOfConfigurations();
        nGramSize = (Integer) gridNGSize.getNumberedValue(ngSizeIteration);

        int thrIteration = iterationNumber - ngSizeIteration * gridThreshold.getNumberOfConfigurations();
        threshold = (Float) gridThreshold.getNumberedValue(thrIteration);
    }

    @Override
    public void setNumberedRandomConfiguration(int iterationNumber) {
        super.setNumberedRandomConfiguration(iterationNumber);
        threshold = (Float) randomThreshold.getNumberedRandom(iterationNumber);
    }
}


text:
<!doctype html>

		<title>imgsjs javascript image slider</title>
	<link rel="stylesheet" type="text/css" href="css/style.css">

	<link rel="stylesheet" type="text/css" href="css/al.css" />

Javascript image slider

imgsjs uses jquery as a helping library, include inside head tag.

	<link rel="stylesheet" type="text/css" href="css/style.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
	<script type="text/javascript" src="js/imgsjs.js"></script>

	To initialise imgsjs, first create dom element to hold the slider.
	For example:

	<div id='image-slider'></div>

	image-slider div element will be used only as a hook to attach our slider.
	Next we hook the slider and initialise it.

	// sliderImgs will be names of the pictures we want to load, see imgsjs code
	// for more details.
	var sliderImgs = [
		{ url: 'img/i1.jpg' },
		{ url: 'img/i2.jpg' },
		{ url: 'img/i3.jpg' },
		{ url: 'img/i4.jpg' }
	];

	var slider = IMGS.createImageSlider(document.getElementById('image-slider'));
	slider.init(sliderImgs, true);
	//slider.startAutoPlay(5000);
	slider.setFadeDuration(1000);

	That's pretty much it, see setFadeDuration & startAutoPlay function in source for more info on what these functions do.

	Enjoy using imgsjs slider. Have fun! :)


text:
<?php

class VP_Security
{

	/**
	 * Singleton instance of the class
	 * @var VP_Security
	 */
	private static $_instance;

	private $_whitelist = array();

	public static function instance()
	{
		if (is_null(self::$_instance))
			self::$_instance = new self();

		return self::$_instance;
	}

	public function whitelist_function($name)
	{
		if( ! in_array($name, $this->_whitelist) )
		{
			$this->_whitelist[] = $name;
			return $name;
		}
		return false;
	}

	public function is_function_whitelisted($name)
	{
		if( in_array($name, $this->_whitelist) )
			return true;
		return false;
	}

}

/**
 * EOF
 */


text:
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this data, including any software or models in source or binary
# form, as well as any drawings, specifications, and documentation
# (collectively "the Data"), to deal in the Data without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Data, and to
# permit persons to whom the Data is furnished to do so, subject to the
# following conditions:

# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Data.

# THE DATA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS, SPONSORS, DEVELOPERS, CONTRIBUTORS, OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE DATA OR THE USE OR OTHER DEALINGS IN THE DATA.

# =======================
# This version of the META tools is a fork of an original version produced
# by Vanderbilt University's Institute for Software Integrated Systems (ISIS).
# Their license statement:

# Copyright (C) 2011-2014 Vanderbilt University

# Developed with the sponsorship of the Defense Advanced Research Projects
# Agency (DARPA) and delivered to the U.S. Government with Unlimited Rights
# as defined in DFARS 252.227-7013.

# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this data, including any software or models in source or binary
# form, as well as any drawings, specifications, and documentation
# (collectively "the Data"), to deal in the Data without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Data, and to
# permit persons to whom the Data is furnished to do so, subject to the
# following conditions:

# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Data.

# THE DATA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS, SPONSORS, DEVELOPERS, CONTRIBUTORS, OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE DATA OR THE USE OR OTHER DEALINGS IN THE DATA.

import os
import os.path
import sys
import update_meta_tools

if __name__ == '__main__':
    for dir in sys.argv:
        for root, dirs, files in os.walk(dir):
            for filename in (fn for fn in files if fn.endswith('.msi')):
                print os.path.join(root, filename),
                try:
                    print update_meta_tools.GetMsiProperty(os.path.join(root, filename), "ProductVersion")
                except:
                    print "[error]"


text:
Bitcurrency
===========

Bitcurrency - X11 based PoS crypto-currency.

Bitcointalk thread: https://bitcointalk.org/index.php?topic=867474.0

IRC channel: #bitcurrency

Twitter: https://twitter.com/BitcurrencyTeam

Reddit: https://www.reddit.com/r/BitCurrency/


text:
var g = newGlobal('new-compartment');
g.eval("var obj = {};");

var dbg = Debugger(g);
var obj;
dbg.onDebuggerStatement = function (frame) { obj = frame.eval("obj").return; };
g.eval("debugger;");

var nameobj = {toString: function () { return 'x'; }};
assertEq(obj.getOwnPropertyDescriptor(nameobj), undefined);
g.obj.x = 17;
var desc = obj.getOwnPropertyDescriptor(nameobj);
assertEq(desc.value, 17);


text:
@interface PodsDummy_Pods_AGViewModelDemo : NSObject
@end
@implementation PodsDummy_Pods_AGViewModelDemo
@end