text:
using System;
using System.Linq;
using UnityEngine;

public class FractalPlanetScript : MonoBehaviour
{
    public GameObject[] Blocks;

    private Direction[] directions;

    void Start()
    {
        var collider = GetComponent<CircleCollider2D>();
        directions = Enum.GetValues(typeof(Direction)).Cast<Direction>().ToArray();

        var blockSize = 1;

        do
        {
            blockSize *= 2;
        }
        while (blockSize < collider.radius);

        GenerateCore(blockSize);
    }

    void Update()
    {

    }

    private void GenerateCore(float blockSize)
    {
        var core = GenerateBlock(gameObject.transform.position, blockSize);

        blockSize /= 2;

        if (blockSize >= 1)
        {
            foreach (var direction in directions)
            {
                GenerateNodes(core, direction, blockSize);
            }
        }
    }

    private void GenerateNodes(GameObject parent, Direction direction, float blockSize)
    {
        var newLocation = GetNodeOffset(parent.transform.position, direction, blockSize);
        var block = GenerateBlock(newLocation, blockSize);

        var joint = block.AddComponent<FixedJoint2D>();
        joint.connectedBody = parent.GetComponent<Rigidbody2D>();
        // Add weld location

        blockSize /= 2;

        if (blockSize >= 1)
        {
            foreach (var option in directions)
            {
                if (!IsOppositeDirection(option, direction))
                {
                    GenerateNodes(block, option, blockSize);
                }
            }
        }
    }

    private Vector3 GetNodeOffset(Vector3 parentLocation, Direction direction, float blockSize)
    {
        var x = parentLocation.x;
        var y = parentLocation.y;

        switch (direction)
        {
            case Direction.N:
                y += blockSize * 1.5f;
                break;
            case Direction.S:
                y -= blockSize * 1.5f;
                break;
            case Direction.E:
                x += blockSize * 1.5f;
                break;
            case Direction.W:
                x -= blockSize * 1.5f;
                break;
        }

        return new Vector3(x, y);
    }

    private GameObject GetRandomBlock()
    {
        return Blocks[UnityEngine.Random.Range(0, this.Blocks.Length)];
    }

    private GameObject GenerateBlock(Vector3 position, float blockSize)
    {
        var block = Instantiate(GetRandomBlock(), position, Quaternion.identity);
        block.transform.localScale = new Vector3(blockSize, blockSize, blockSize);
        //Debug.Log(position);
        //Debug.Log(blockSize);
        // Set Mass
        // Attach Rigidbody

        return block;
    }

    private bool IsOppositeDirection(Direction d1, Direction d2)
    {
        switch (d1)
        {
            case Direction.N:
                return d2 == Direction.S;
            case Direction.S:
                return d2 == Direction.N;
            case Direction.E:
                return d2 == Direction.W;
            case Direction.W:
                return d2 == Direction.E;
        }

        throw new Exception("THIS IS NOT EVEN POSSIBLE! WHAT HAVE YOU DONE!?");
    }

    private enum Direction
    {
        N,
        S,
        E,
        W
    }
}


text:
namespace slack
{
  namespace api
  {
#define RtmStart_REQUIRED \
    API_FIELDS_DEF((std::string, token))
#define RtmStart_OPTIONAL \
    API_FIELDS_DEF( \
                   (bool, simple_latest), \
                   (bool, no_unreads), \
                   (bool, mpim_aware))
#define RtmStart_RESULT \
    API_FIELDS_DEF( \
                   (bool, ok), \
                   (std::string, url))

    API_NAMESPACE_BEGIN(Rtm)
      API_ENDPOINT(RtmStart, start, "api/rtm.start");
    API_NAMESPACE_END();
  }
}

redpajama_set_name: RedPajamaGithub


text:
package info_test

import (
	"net/http"
	"net/http/httptest"

	"github.com/cloudfoundry-incubator/notifications/v1/web/info"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("GetHandler", func() {
	Describe("ServeHTTP", func() {
		var handler info.GetHandler

		BeforeEach(func() {
			handler = info.NewGetHandler()
		})

		It("returns a 200 response code and an empty JSON body", func() {
			writer := httptest.NewRecorder()
			request, err := http.NewRequest("GET", "/info", nil)
			if err != nil {
				panic(err)
			}

			handler.ServeHTTP(writer, request, nil)

			Expect(writer.Code).To(Equal(http.StatusOK))
			Expect(writer.Body.String()).To(MatchJSON(`{
				"version": 1
			}`))
		})
	})
})


text:
package net.plommer.UltraWarp.More;

import net.plommer.UltraWarp.Configs.LoadConfig;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class UsefullItems {

	public static ItemStack WarpCompass() {
		ItemStack item = new ItemStack(Material.COMPASS, 1);
		ItemMeta im = item.getItemMeta();
		im.setDisplayName(LoadConfig.compass_name);
		item.setItemMeta(im);
		return item;
	}

	@SuppressWarnings("deprecation")
	public static void addWarpCompass(Player player, int pos) {
		if(!player.getInventory().contains(WarpCompass())) {
			if(player.getInventory().getItem(8) != null) {
				ItemStack a = player.getInventory().getItem(pos);
				player.getInventory().addItem(a);
				player.getInventory().remove(pos);
			}
			player.getInventory().setItem(pos, WarpCompass());
		}
	}

}


text:
<html>
<head>
<meta http-equiv="refresh" content="0; url=https://developers.liveperson.com/consumer-experience-javascript-chat-getexitsurvey.html" />
</head>
</html>


text:
'''
'''
#  Licensed to the Apache Software Foundation (ASF) under one
#  or more contributor license agreements.  See the NOTICE file
#  distributed with this work for additional information
#  regarding copyright ownership.  The ASF licenses this file
#  to you 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.

import os
Test.Summary = '''
Test tunneling based on SNI renaming
'''

# need Curl
Test.SkipUnless(
    Condition.HasProgram("curl", "Curl need to be installed on system for this test to work")
)

# Define default ATS
ts = Test.MakeATSProcess("ts", select_ports=False)
server_bar = Test.MakeOriginServer("server_bar", ssl=True)
server_random = Test.MakeOriginServer("server_random", ssl=True)

request_bar_header = {"headers": "GET / HTTP/1.1\r\nHost: bar.com\r\n\r\n", "timestamp": "1469733493.993", "body": ""}
request_random_header = {"headers": "GET / HTTP/1.1\r\nHost: random.com\r\n\r\n", "timestamp": "1469733493.993", "body": ""}
response_bar_header = {"headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n", "timestamp": "1469733493.993", "body": "ok bar"}
response_random_header = {"headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n", "timestamp": "1469733493.993", "body": "ok random"}
server_bar.addResponse("sessionlog_bar.json", request_bar_header, response_bar_header)
server_random.addResponse("sessionlog_random.json", request_random_header, response_random_header)

Test.PreparePlugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'ssl_sni_rename_test.cc'), ts)

# add ssl materials like key, certificates for the server
ts.addSSLfile("ssl/signed-foo.pem")
ts.addSSLfile("ssl/signed-foo.key")
ts.addSSLfile("ssl/signed-bar.pem")
ts.addSSLfile("ssl/signed-bar.key")
ts.addSSLfile("ssl/server.pem")
ts.addSSLfile("ssl/server.key")
ts.addSSLfile("ssl/signer.pem")
ts.addSSLfile("ssl/signer.key")

ts.Variables.ssl_port = 4443

# Need no remap rules.  Everything should be proccessed by ssl_server_name

# Make sure the TS server certs are different from the origin certs
ts.Disk.ssl_multicert_config.AddLine(
    'dest_ip=* ssl_cert_name=signed-foo.pem ssl_key_name=signed-foo.key'
)

# Case 1, global config policy=permissive properties=signature
#         override for foo.com policy=enforced properties=all
ts.Disk.records_config.update({
    'proxy.config.ssl.server.cert.path': '{0}'.format(ts.Variables.SSLDir),
    'proxy.config.ssl.server.private_key.path': '{0}'.format(ts.Variables.SSLDir),
    # enable ssl port
    'proxy.config.http.server_ports': '{0} {1}:proto=http2;http:ssl'.format(ts.Variables.port, ts.Variables.ssl_port),
    'proxy.config.http.connect_ports': '{0} {1} {2}'.format(ts.Variables.ssl_port,server_bar.Variables.SSL_Port,server_random.Variables.SSL_Port),
    'proxy.config.ssl.server.cipher_suite': 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:RC4-SHA:RC4-MD5:AES128-SHA:AES256-SHA:DES-CBC3-SHA!SRP:!DSS:!PSK:!aNULL:!eNULL:!SSLv2',
    'proxy.config.ssl.client.CA.cert.path': '{0}'.format(ts.Variables.SSLDir),
    'proxy.config.ssl.client.CA.cert.filename': 'signer.pem',
    'proxy.config.exec_thread.autoconfig.scale': 1.0,
    'proxy.config.url_remap.pristine_host_hdr': 1
})

# bar.com should terminate.
# empty should tunnel to server_random (should not happen)
# newname should tunnel to server_bar
ts.Disk.ssl_server_name_yaml.AddLines([
  "- fqdn: newname",
  "  tunnel_route: localhost:{0}".format(server_bar.Variables.SSL_Port),
  "- fqdn: ''",  #default case
  "  tunnel_route: localhost:{0}".format(server_random.Variables.SSL_Port),
  ])

# Plugin should add "newname" to the empty sni and go to _bar instead of random.com
tr = Test.AddTestRun("no-sni-tunnel-test")
tr.Processes.Default.Command = "curl --http1.1 -v -k https://127.0.0.1:{0}".format(ts.Variables.ssl_port)
tr.ReturnCode = 0
tr.Processes.Default.StartBefore(server_bar)
tr.Processes.Default.StartBefore(server_random)
tr.Processes.Default.StartBefore(Test.Processes.ts, ready=When.PortOpen(ts.Variables.ssl_port))
tr.StillRunningAfter = server_random
tr.StillRunningAfter = ts
tr.Processes.Default.Streams.All += Testers.ExcludesExpression("Could Not Connect", "Curl attempt should have succeeded")
tr.Processes.Default.Streams.All += Testers.ExcludesExpression("Not Found on Accelerato", "Should not try to remap on Traffic Server")
tr.Processes.Default.Streams.All += Testers.ContainsExpression("HTTP/1.1 200 OK", "Should get a successful response")
tr.Processes.Default.Streams.All += Testers.ContainsExpression("ok bar", "Body is expected")


text:
require 'rubygems'
require 'bundler/setup'
require 'plexify'

RSpec.configure do |config|
  config.color_enabled = true
  config.formatter     = 'documentation'
end


text:
namespace chromeos {

MockUserManager::MockUserManager() {}

MockUserManager::~MockUserManager() {}

}  // namespace chromeos


text:
// Visual Studio Shared Project
// Copyright(c) Microsoft Corporation
// 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
//
// THIS CODE IS PROVIDED ON AN  *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABILITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing
// permissions and limitations under the License.

using System;
using Microsoft.VisualStudio;
using TestUtilities;
using TestUtilities.SharedProject;

namespace Microsoft.VisualStudioTools.MockVsTests {
    public static class MockVsTestExtensions {
        public static IVisualStudioInstance ToMockVs(this SolutionFile self) {
            MockVs vs = new MockVs();
            vs.Invoke(() => {
                // HACK: The default targets files require a function that we don't provide
                // The tests are mostly still broken, but they get further now. We should probably
                // move them into UI tests, as we can't emulate the MSBuild environment well enough
                // to open projects from here.
                Microsoft.Build.Evaluation.ProjectCollection.GlobalProjectCollection.SetGlobalProperty("NugetRestoreTargets", "false");
                ErrorHandler.ThrowOnFailure(vs.Solution.OpenSolutionFile(0, self.Filename));
            });
            return vs;
        }

    }
}


text:
package org.kaaproject.kaa.client.exceptions;

public class KaaInvalidConfigurationException extends KaaRuntimeException {

    private static final long serialVersionUID = 3377204017776257012L;

    public KaaInvalidConfigurationException(Exception cause) {
        super(cause);
    }

}


text:
package com.hazelcast.config;

import com.hazelcast.internal.util.RuntimeAvailableProcessors;
import com.hazelcast.mapreduce.TopologyChangedStrategy;

/**
 * Contains the configuration for an {@link com.hazelcast.mapreduce.JobTracker}.
 */
public class JobTrackerConfig {

    /**
     * Default size of thread.
     */
    public static final int DEFAULT_MAX_THREAD_SIZE = RuntimeAvailableProcessors.get();
    /**
     * Default value of retry counter.
     */
    public static final int DEFAULT_RETRY_COUNT = 0;
    /**
     * Default value of chunk size.
     */
    public static final int DEFAULT_CHUNK_SIZE = 1000;
    /**
     * Default value of Queue size.
     */
    public static final int DEFAULT_QUEUE_SIZE = 0;
    /**
     * Default boolean value of communication statics.define how a map reduce job behaves
     */
    public static final boolean DEFAULT_COMMUNICATE_STATS = true;
    /**
     * Define how a map reduce job behaves.
     */
    public static final TopologyChangedStrategy DEFAULT_TOPOLOGY_CHANGED_STRATEGY
            = TopologyChangedStrategy.CANCEL_RUNNING_OPERATION;

    private String name;
    private int maxThreadSize = DEFAULT_MAX_THREAD_SIZE;
    private int retryCount = DEFAULT_RETRY_COUNT;
    private int chunkSize = DEFAULT_CHUNK_SIZE;
    private int queueSize = DEFAULT_QUEUE_SIZE;
    private boolean communicateStats = DEFAULT_COMMUNICATE_STATS;
    private TopologyChangedStrategy topologyChangedStrategy = DEFAULT_TOPOLOGY_CHANGED_STRATEGY;

    public JobTrackerConfig() {
    }

    public JobTrackerConfig(JobTrackerConfig source) {
        this.name = source.name;
        this.maxThreadSize = source.maxThreadSize;
        this.retryCount = source.retryCount;
        this.chunkSize = source.chunkSize;
        this.queueSize = source.queueSize;
        this.communicateStats = source.communicateStats;
        this.topologyChangedStrategy = source.topologyChangedStrategy;
    }

    /**
     * Sets the name of this {@link com.hazelcast.mapreduce.JobTracker}.
     *
     * @param name the name of the {@link com.hazelcast.mapreduce.JobTracker}
     * @return the current job tracker config instance
     */
    public JobTrackerConfig setName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Gets the name of this {@link com.hazelcast.mapreduce.JobTracker}.
     *
     * @return the name of the {@link com.hazelcast.mapreduce.JobTracker}
     */
    public String getName() {
        return name;
    }

    /**
     * Gets the maximum thread pool size of this {@link com.hazelcast.mapreduce.JobTracker}.
     *
     * @return the maximum thread pool size of the {@link com.hazelcast.mapreduce.JobTracker}
     */
    public int getMaxThreadSize() {
        return maxThreadSize;
    }

    /**
     * Sets the maximum thread pool size of this {@link com.hazelcast.mapreduce.JobTracker}.
     *
     * @param maxThreadSize the maximum thread pool size of the {@link com.hazelcast.mapreduce.JobTracker}
     */
    public void setMaxThreadSize(int maxThreadSize) {
        this.maxThreadSize = maxThreadSize;
    }

    /**
     * retry count is currently not used but reserved for later use where the framework will
     * automatically try to restart / retry operations from a available savepoint.
     */
    public int getRetryCount() {
        return retryCount;
    }

    /**
     * retry count is currently not used but reserved for later use where the framework will
     * automatically try to restart / retry operations from a available savepoint.
     */
    public void setRetryCount(int retryCount) {
        this.retryCount = retryCount;
    }

    /**
     * Gets the number of emitted values before a chunk is send to the reducers.
     * If your emitted values are big, you might want to change this to a lower value. If you want
     * to better balance your work, you might want to change this to a higher value.
     * A value of 0 means immediate transmission, but remember that low values mean higher traffic
     * costs.
     * A very high value might cause an OutOfMemoryError to occur if emitted values do not fit into
     * heap memory before being sent to reducers. To prevent this, you might want to use a combiner
     * to pre-reduce values on mapping nodes.
     *
     * @return the number of emitted values before a chunk is sent to the reducers
     */
    public int getChunkSize() {
        return chunkSize;
    }

    /**
     * Sets the number of emitted values before a chunk is send to the reducers.
     * If your emitted values are big, you might want to change this to a lower value. If you want
     * to better balance your work, you might want to change this to a higher value.
     * A value of 0 means immediate transmission, but remember that low values mean higher traffic
     * costs.
     * A very high value might cause an OutOfMemoryError to occur if emitted values do not fit into
     * heap memory before being sent to reducers. To prevent this, you might want to use a combiner
     * to pre-reduce values on mapping nodes.
     *
     * @param chunkSize the number of emitted values before a chunk is sent to the reducers
     */
    public void setChunkSize(int chunkSize) {
        this.chunkSize = chunkSize;
    }

    /**
     * Gets immutable version of this configuration.
     *
     * @return immutable version of this configuration
     * @deprecated this method will be removed in 4.0; it is meant for internal usage only
     */
    public JobTrackerConfig getAsReadOnly() {
        return new JobTrackerConfigReadOnly(this);
    }

    /**
     * Gets the maximum size of the queue; the maximum number of tasks that can wait to be processed. A
     * value of 0 means an unbounded queue.
     *
     * @return the maximum size of the queue
     */
    public int getQueueSize() {
        return queueSize;
    }

    /**
     * Sets the maximum size of the queue; the maximum number of tasks that can wait to be processed. A
     * value of 0 means an unbounded queue.
     *
     * @param queueSize the maximum size of the queue
     */
    public void setQueueSize(int queueSize) {
        this.queueSize = queueSize;
    }

    /**
     * True if statistics (for example, about processed entries)
     * are transmitted to the job emitter, false otherwise. This might be used to show any kind of progress to
     * users inside of UI systems, but this produces additional traffic. If statistics are not needed, you might
     * want to deactivate this.
     *
     * @return {@code true} if statistics (for example, about processed entries) are transmitted to the job emitter,
     * {@code false} otherwise.
     */
    public boolean isCommunicateStats() {
        return communicateStats;
    }

    /**
     * Set to true if statistics (for example, about processed entries)
     * should be transmitted to the job emitter, false otherwise. This might be used to show any kind of progress to
     * users inside of UI systems, but this produces additional traffic. If statistics are not needed, you might
     * want to deactivate this.
     *
     * @param communicateStats {@code true} if statistics (for example, about processed entries) are transmitted to the job
     *                         emitter, {@code false} otherwise.
     */
    public void setCommunicateStats(boolean communicateStats) {
        this.communicateStats = communicateStats;
    }

    /**
     * Gets how the map reduce framework will react on topology
     * changes while executing a job.
     * Currently only CANCEL_RUNNING_OPERATION is fully supported; it throws an exception to
     * the job emitter (throws com.hazelcast.mapreduce.TopologyChangedException).
     *
     * @return How the map reduce framework will react on topology
     * changes while executing a job.
     */
    public TopologyChangedStrategy getTopologyChangedStrategy() {
        return topologyChangedStrategy;
    }

    /**
     * Sets how the map reduce framework will react on topology
     * changes while executing a job.
     * Currently only CANCEL_RUNNING_OPERATION is fully supported; it throws an exception to
     * the job emitter (throws com.hazelcast.mapreduce.TopologyChangedException).
     *
     * @param topologyChangedStrategy How the map reduce framework will react on topology
     *                                changes while executing a job.
     */
    public void setTopologyChangedStrategy(TopologyChangedStrategy topologyChangedStrategy) {
        this.topologyChangedStrategy = topologyChangedStrategy;
    }
}


text:
package org.codehaus.jremoting.requests;

import org.codehaus.jremoting.requests.Request;
import org.codehaus.jremoting.requests.RequestConstants;

/**
 * Class ListServices
 *
 * @author Vinay Chandrasekharan
 *
 */
public final class ListServices extends Request {
    private static final long serialVersionUID = 8447620862650263282L;

    /**
     * Gets number that represents type for this class.
     * This is quicker than instanceof for type checking.
     *
     * @return the representative code
     * @see org.codehaus.jremoting.requests.RequestConstants
     */
    public int getRequestCode() {
        return RequestConstants.LISTSERVICESREQUEST;
    }
}


text:
'''Author: Raytone-D
    Date: 2020-10-21
'''

from . import Account
from .util import find_all

class Manager:
    '''管理多个木偶实例的类'''
    def __init__(self, accno: int =None, to_dict=True, keyboard=False):
        self.acc_list = [Account(title=root, to_dict=to_dict, keyboard=keyboard) for root in find_all()]
        self.accno_list = [int(acc.id) for acc in self.acc_list]
        self.take(accno or self.accno_list[0])

    def take(self, accno: int):
        '''指定交易账号'''
        if accno in self.accno_list:
            self.acc = self.acc_list[self.accno_list.index(accno)]
            return self.acc

    def __getattr__(self, name: str):
        return getattr(self.acc, name)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GTInterfacesLibrary;

namespace CheckersGame.Logic
{
    using TaskReturnType = GTGameSpaceInterface<Element, Position>;
    public class CorrectAi : GTArtificialIntelligenceInterface<Element, Position>, IGTArtificialIntelligenceInterface
    {

        async public Task<GTGameSpaceInterface<Element, Position>>
            calculateNextStep(TaskReturnType gameSpace,
                              GTGameStateGeneratorInterface<Element, Position> generator,
                              GTGameStateHashInterface<Element, Position> hash)
        {

            TaskReturnType best = null;
            int bestValue = int.MinValue;
            GTPlayerInterface<Element, Position> actualPlayer = gameSpace.getNextPlayer();

            Task<List<TaskReturnType>> listTask = generator.availableStatesFrom(gameSpace, gameSpace.getNextPlayer());

            //await listTask;

            List<GTGameSpaceInterface<Element, Position>> states = listTask.Result;

            if (states.Count == 0)
            {
                throw new Exception("There is no more state");
            }
            foreach (TaskReturnType item in states)
            {
                int current = hash.evaluateState(item, actualPlayer);
                if (current > bestValue)
                {
                    best = item;
                    bestValue = current;
                }
            }

            return best;
        }

        public string Name
        {
            get { return "CorrectAi"; }
        }

        public string Description
        {
            get { return "A decent AI without any foresight"; }
        }

        public Difficulty Difficulty
        {
            get { return Difficulty.Normal; }
        }
    }
}


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Package com.hazelcast.management.request (Hazelcast Root 3.3.3 API)</title>
<meta name="date" content="2014-11-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
com.hazelcast.management.request

Packages that use com.hazelcast.management.request

Package
Description

com.hazelcast.management.request

Contains requests that made from Management Center.

Classes in com.hazelcast.management.request used by com.hazelcast.management.request

Class and Description

ConsoleRequest

Represents request sent from Management Center.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.


text:
using Microsoft.AspNetCore.Mvc.ModelBinding;
using System.Linq;

namespace AlgoRun.Server.Filters
{

    public class ApiError
    {
        public string message { get; set; }
        public bool isError { get; set; }
        public string detail { get; set; }
        public ValidationErrorCollection errors { get; set; }

        public ApiError(string message)
        {
            this.message = message;
            isError = true;
        }

        public ApiError(ModelStateDictionary modelState)
        {
            this.isError = true;
            if (modelState != null && modelState.Any(m => m.Value.Errors.Count > 0))
            {
                message = "Please correct the specified errors and try again.";
                //errors = modelState.SelectMany(m => m.Value.Errors).ToDictionary(m => m.Key, m=> m.ErrorMessage);
                //errors = modelState.SelectMany(m => m.Value.Errors.Select( me => new KeyValuePair<string,string>( m.Key,me.ErrorMessage) ));
                //errors = modelState.SelectMany(m => m.Value.Errors.Select(me => new ModelError { FieldName = m.Key, ErrorMessage = me.ErrorMessage }));
            }
        }
    }
}


text:
package com.alfredayibonte.questionnaireviewlib;

import android.content.Context;
import android.support.v7.widget.AppCompatRadioButton;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import com.alfredayibonte.questionnaireviewlib.adapters.RadioListAdapter;
import com.alfredayibonte.questionnaireviewlib.models.Answer;

/**
 *
 *  Created by Alfredayibonte on 5/3/17.
 */
public class RadioListItemView extends LinearLayout{
    private AppCompatRadioButton radioButton;
    private AppCompatTextView textView;
    private Answer answer;
    private Context context;
    private RadioListAdapter adapter;
    private boolean isChecked = false;
    public Answer getAnswer() {
        return answer;
    }

    public void setAnswer(Answer answer) {
        this.answer = answer;
        textView.setText(answer.getAnswer());
        this.context = getContext();
    }
    public void setRadioItem(Answer answer, RadioListAdapter adapter) {
        this.setAnswer(answer);
        this.adapter = adapter;
    }

    public RadioListItemView(Context context, AttributeSet attrs) {
        super(context, attrs);

    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        radioButton = (AppCompatRadioButton) findViewById(R.id.radio);
        textView = (AppCompatTextView)findViewById(R.id.tv1);

    }

}


text:
set -ex

# We don't want to build libgit2 on the next branch, as we carry a
# submodule with the exact version we support
if [ "x$TRAVIS_BRANCH" = "xnext" ]; then
    exit 0
fi

cd "${HOME}"
wget -O libgit2-0.23.1.tar.gz https://github.com/libgit2/libgit2/archive/v0.23.1.tar.gz
tar -xzvf libgit2-0.23.1.tar.gz
cd libgit2-0.23.1 && mkdir build && cd build
cmake -DTHREADSAFE=ON -DBUILD_CLAR=OFF -DCMAKE_BUILD_TYPE="RelWithDebInfo" .. && make && sudo make install
sudo ldconfig
cd "${TRAVIS_BUILD_DIR}"


text:
namespace ThomasEngine
{
	[DataContractAttribute]
	public ref class AudioClip : public Resource
	{
	public:
		AudioClip(String^ path) : Resource(path, new thomas::resource::AudioClip(Utility::ConvertString(path))) {};

		[OnDeserializedAttribute]
		void OnDeserialized(StreamingContext c)
		{
			m_nativePtr = new thomas::resource::AudioClip(Utility::ConvertString(m_path));
		}
	};
}


text:
from peyotl.nexson_validation.helper import _NEXEL, errorReturn
from peyotl.nexson_validation.err_generator import (gen_InvalidKeyWarning,
                                                    gen_MissingCrucialContentWarning,
                                                    gen_MissingMandatoryKeyWarning,
                                                    gen_MultipleRootsWarning,
                                                    gen_NodeWithMultipleParents,
                                                    gen_NoRootWarning,
                                                    gen_ReferencedIDNotFoundWarning,
                                                    gen_RepeatedOTUWarning,
                                                    gen_TreeCycleWarning,
                                                    gen_WrongValueTypeWarning)
from peyotl.nexson_syntax.helper import add_literal_meta, \
    BADGER_FISH_NEXSON_VERSION, \
    delete_first_literal_meta, \
    find_val_for_first_bf_l_meta
from peyotl.nexson_validation._validation_base import NexsonValidationAdaptor
from peyotl.utility import get_logger

_LOG = get_logger(__name__)

class BadgerFishValidationAdaptor(NexsonValidationAdaptor):
    def __init__(self, obj, logger, **kwargs):
        if not hasattr(self, '_syntax_version'):
            self._syntax_version = BADGER_FISH_NEXSON_VERSION
            self._find_first_literal_meta = find_val_for_first_bf_l_meta
        NexsonValidationAdaptor.__init__(self, obj, logger, **kwargs)

    def _post_key_check_validate_otus_obj(self, og_nex_id, otus_group, vc):
        otu_dict = {}
        otu_list = otus_group.get('otu', [])
        if isinstance(otu_list, dict):
            otu_list = [otu_list]
        if not otu_list:
            return
        vc.push_context(_NEXEL.OTU, (otus_group, og_nex_id))
        try:
            without_id = []
            otu_tuple_list = []
            for otu in otu_list:
                oid = otu.get('@id')
                if oid is None:
                    without_id.append(otu)
                else:
                    otu_tuple_list.append((oid, otu))
                otu_dict[oid] = otu
            if without_id:
                self._error_event(_NEXEL.NEXML,
                                  obj=without_id,
                                  err_type=gen_MissingCrucialContentWarning,
                                  anc=vc.anc_list,
                                  obj_nex_id=None,
                                  key_list=['@id'])
                return errorReturn('lack of "@id" in "otu"')
            r = self._validate_otu_list(otu_tuple_list, vc)
            if r:
                self._otu_by_otug[og_nex_id] = otu_dict
            return r
        except:
            vc.pop_context()

    def _post_key_check_validate_tree_group(self, tg_nex_id, trees_group, vc):
        otus_el = trees_group.get('@otus')
        if otus_el not in self._otu_group_by_id:
            kl = ['@otus="{oe}"'.format(oe=otus_el)]
            self._error_event(_NEXEL.TREES,
                              obj=trees_group,
                              err_type=gen_ReferencedIDNotFoundWarning,
                              anc=vc.anc_list,
                              obj_nex_id=tg_nex_id,
                              key_list=kl)
            return errorReturn('bad "@otus" in trees group')
        tree_list = trees_group.get('tree', [])
        if isinstance(tree_list, dict):
            tree_list = [tree_list]
        elif not isinstance(tree_list, list):
            self._error_event(_NEXEL.TREES,
                              obj=trees_group,
                              err_type=gen_WrongValueTypeWarning,
                              anc=vc.anc_list,
                              obj_nex_id=tg_nex_id,
                              key_list=['tree'])
            return errorReturn('lack of "tree" in trees group')
        for tree_obj in tree_list:
            t_nex_id = tree_obj.get('@id')
            vc.push_context(_NEXEL.TREE, (trees_group, tg_nex_id))
            try:
                if t_nex_id is None:
                    self._error_event(_NEXEL.TREE,
                                      obj=tree_obj,
                                      err_type=gen_MissingCrucialContentWarning,
                                      anc=vc.anc_list,
                                      obj_nex_id=tg_nex_id,
                                      key_list=['@id'])
                    return errorReturn('no "@id" in tree')
                if not self._validate_tree(t_nex_id,
                                           tree_obj,
                                           vc,
                                           otus_group_id=otus_el):
                    return False
            finally:
                vc.pop_context()
        return True

    # pylint: disable=R0915
    def _post_key_check_validate_tree(self,
                                      tree_nex_id,
                                      tree_obj,
                                      vc,
                                      otus_group_id=None):
        node_list = tree_obj.get('node')
        if isinstance(node_list, dict):
            node_list = [node_list]
        elif (not node_list) or (not isinstance(node_list, list)):
            self._error_event(_NEXEL.TREE,
                              obj=tree_obj,
                              err_type=gen_MissingCrucialContentWarning,
                              anc=vc.anc_list,
                              obj_nex_id=tree_nex_id,
                              key_list=['node', ])
            return errorReturn('no "node" in "trees"')
        edge_list = tree_obj.get('edge')
        if isinstance(edge_list, dict):
            edge_list = [edge_list]
        elif (not edge_list) or (not isinstance(edge_list, list)):
            self._error_event(_NEXEL.TREE,
                              obj=tree_obj,
                              err_type=gen_MissingCrucialContentWarning,
                              anc=vc.anc_list,
                              obj_nex_id=tree_nex_id,
                              key_list=['edge', ])
            return errorReturn('no "edge" in tree')
        edge_id_list = [(i.get('@id'), i) for i in edge_list]
        vc.push_context(_NEXEL.EDGE, (tree_obj, tree_nex_id))
        try:
            valid = self._validate_edge_list(edge_id_list, vc)
            if not valid:
                return False
        finally:
            vc.pop_context()
        node_id_obj_list = [(i.get('@id'), i) for i in node_list]
        vc.push_context(_NEXEL.NODE, (tree_obj, tree_nex_id))
        try:
            valid = self._validate_node_list(node_id_obj_list, vc)
            if not valid:
                return False
        finally:
            vc.pop_context()
        node_dict = {}
        for i in node_id_obj_list:
            nid, nd = i
            node_dict[nid] = nd
        missing_src = []
        missing_target = []
        for el in edge_id_list:
            e = el[1]
            sid = e.get('@source')
            tid = e.get('@target')
            if sid not in node_dict:
                missing_src.append(sid)
            if tid not in node_dict:
                missing_target.append(tid)
        if missing_src:
            self._error_event(_NEXEL.TREE,
                              obj=tree_obj,
                              err_type=gen_ReferencedIDNotFoundWarning,
                              anc=vc.anc_list,
                              obj_nex_id=tree_nex_id,
                              key_list=missing_src)
            return errorReturn('no "@source" in edge')
        if missing_target:
            self._error_event(_NEXEL.TREE,
                              obj=tree_obj,
                              err_type=gen_ReferencedIDNotFoundWarning,
                              anc=vc.anc_list,
                              obj_nex_id=tree_nex_id,
                              key_list=missing_target)
            return errorReturn('no "@target" in edge')
        if otus_group_id is None:
            tree_group = vc.anc_list[-1][1]
            otus_group_id = tree_group.get('@otus')

        lowest_nodeid_set = set()
        encountered_nodes = set()
        edge_by_target = {}
        edge_by_source = {}
        multi_parent_node = []
        for e in edge_list:
            t = e.get('@target')
            if t in edge_by_target:
                multi_parent_node.append(t)
            else:
                edge_by_target[t] = e
            # _LOG.debug('e=' + str(e))
            sid = e['@source']
            edge_by_source.setdefault(sid, []).append(e)
        if multi_parent_node:
            self._error_event(_NEXEL.TREE,
                              obj=tree_obj,
                              err_type=gen_NodeWithMultipleParents,
                              anc=vc.anc_list,
                              obj_nex_id=tree_nex_id,
                              node_id_list=multi_parent_node)
        otuid2leaf = {}
        unflagged_leaves = []
        nonleaves_with_leaf_flags = []
        with_at_root_prop = {}
        first_lowest_node = None
        for nd in node_list:
            nid = nd.get('@id')
            cycle_node, path_to_root = construct_path_to_root(nd, encountered_nodes, edge_by_target)
            if cycle_node:
                self._error_event(_NEXEL.TREE,
                                  obj=tree_obj,
                                  err_type=gen_TreeCycleWarning,
                                  anc=vc.anc_list,
                                  obj_nex_id=tree_nex_id,
                                  cycle_node=cycle_node)
                return errorReturn('"@id" in node')
            if path_to_root:
                lowest_nodeid_set.add(path_to_root[-1])
                if first_lowest_node is None:
                    first_lowest_node = path_to_root[-1]
            is_flagged_as_leaf = self._find_first_literal_meta(nd, 'ot:isLeaf')
            ch_list = edge_by_source.get(nid)
            if ch_list is None:
                otu_id = nd.get('@otu')
                if otu_id is None:
                    vc.push_context(_NEXEL.NODE, (tree_obj, tree_nex_id))
                    try:
                        self._error_event(_NEXEL.NODE,
                                          obj=nd,
                                          err_type=gen_MissingCrucialContentWarning,
                                          anc=vc.anc_list,
                                          obj_nex_id=nid,
                                          key_list=['@otu', ])
                        return errorReturn('"@otu" in leaf')
                    finally:
                        vc.pop_context()
                else:
                    if otu_id in otuid2leaf:
                        vc.push_context(_NEXEL.NODE, (tree_obj, tree_nex_id))
                        try:
                            self._error_event(_NEXEL.NODE,
                                              obj=nd,
                                              err_type=gen_RepeatedOTUWarning,
                                              anc=vc.anc_list,
                                              obj_nex_id=nid,
                                              key_list=[otu_id])
                            return errorReturn('repeated "@otu" in leaves')
                        finally:
                            vc.pop_context()
                    otuid2leaf[otu_id] = nd
                if not is_flagged_as_leaf:
                    if not self._logger.retain_deprecated:
                        add_literal_meta(nd, 'ot:isLeaf', True, self._syntax_version)
                    else:
                        unflagged_leaves.append(nid)
            elif is_flagged_as_leaf:
                if not self._logger.retain_deprecated:
                    delete_first_literal_meta(nd, 'ot:isLeaf', self._syntax_version)
                else:
                    nonleaves_with_leaf_flags.append(nid)
            if nd.get('@root'):
                with_at_root_prop[nid] = nd
        if unflagged_leaves:
            vc.push_context(_NEXEL.NODE, (tree_obj, tree_nex_id))
            try:
                # _LOG.debug('unflagged_leaves="{f}"'.format(f=unflagged_leaves))
                self._error_event(_NEXEL.NODE,
                                  obj=tree_obj,
                                  err_type=gen_MissingMandatoryKeyWarning,
                                  anc=vc.anc_list,
                                  obj_nex_id=unflagged_leaves,
                                  key_list=['ot:isLeaf'])
            finally:
                vc.pop_context()
        if nonleaves_with_leaf_flags:
            vc.push_context(_NEXEL.NODE, (tree_obj, tree_nex_id))
            try:
                self._error_event(_NEXEL.NODE,
                                  obj=tree_obj,
                                  err_type=gen_InvalidKeyWarning,
                                  anc=vc.anc_list,
                                  obj_nex_id=nonleaves_with_leaf_flags,
                                  key_list=['ot:isLeaf'])
                return errorReturn('"ot:isLeaf" for internal')
            finally:
                vc.pop_context()
        self._detect_multilabelled_tree(otus_group_id,
                                        tree_nex_id,
                                        otuid2leaf)
        if len(lowest_nodeid_set) > 1:
            lowest_nodeid_set = list(lowest_nodeid_set)
            lowest_nodeid_set.sort()
            self._error_event(_NEXEL.TREE,
                              obj=tree_obj,
                              err_type=gen_MultipleRootsWarning,
                              anc=vc.anc_list,
                              obj_nex_id=tree_nex_id,
                              node_id_list=lowest_nodeid_set)
            return errorReturn('multiple roots in a tree')

        root_node_id = first_lowest_node

        if root_node_id not in with_at_root_prop:
            self._error_event(_NEXEL.TREE,
                              obj=tree_obj,
                              err_type=gen_MultipleRootsWarning,
                              anc=vc.anc_list,
                              obj_nex_id=tree_nex_id,
                              node_id_list=list(with_at_root_prop.keys()) + [root_node_id])
            return errorReturn('root without "@root"')
        elif len(with_at_root_prop) > 1:
            self._error_event(_NEXEL.TREE,
                              obj=tree_obj,
                              err_type=gen_MultipleRootsWarning,
                              anc=vc.anc_list,
                              obj_nex_id=tree_nex_id,
                              node_id_list=list(with_at_root_prop.keys()))
            return errorReturn('Multiple nodes with "@root"')
        elif len(with_at_root_prop) == 0:
            self._error_event(_NEXEL.TREE,
                              obj=tree_obj,
                              err_type=gen_NoRootWarning,
                              anc=vc.anc_list,
                              obj_nex_id=tree_nex_id)
            return errorReturn('no node with "@root"')
        og = set([i['@id'] for i in self._otu_group_by_id[otus_group_id]['otu']])
        nli = [(i['@id'], i) for i in node_list]
        return self._validate_otu_key_if_present(nli, og, vc)

    def _post_key_check_validate_nexml_obj(self, nex_obj, obj_nex_id, vc):
        otus_group_list = nex_obj.get('otus', [])
        if otus_group_list and isinstance(otus_group_list, dict):
            otus_group_list = [otus_group_list]
        if not isinstance(otus_group_list, list):
            self._error_event(_NEXEL.NEXML,
                              obj=nex_obj,
                              err_type=gen_MissingCrucialContentWarning,
                              anc=vc.anc_list,
                              obj_nex_id=obj_nex_id,
                              key_list=['otus'])
            return errorReturn('no "otus" in nexml')
        vc.push_context(_NEXEL.OTUS, (nex_obj, obj_nex_id))
        try:
            without_id = []
            og_tuple_list = []
            for og in otus_group_list:
                ogid = og.get('@id')
                if ogid is None:
                    without_id.append(None)
                else:
                    og_tuple_list.append((ogid, og))
            if without_id:
                self._error_event(_NEXEL.OTUS,
                                  obj=nex_obj,
                                  err_type=gen_MissingCrucialContentWarning,
                                  anc=vc.anc_list,
                                  obj_nex_id=None,
                                  key_list=['otus[*]/@id'])
                return errorReturn('otu without "@id"')
            if not self._validate_otus_group_list(og_tuple_list, vc):
                return False
        finally:
            vc.pop_context()
        # and now the trees...
        trees_group_list = nex_obj.get('trees', [])
        if trees_group_list and isinstance(trees_group_list, dict):
            trees_group_list = [trees_group_list]
        if not isinstance(trees_group_list, list):
            self._error_event(_NEXEL.NEXML,
                              obj=nex_obj,
                              err_type=gen_WrongValueTypeWarning,
                              anc=vc.anc_list,
                              obj_nex_id=obj_nex_id,
                              key_list=['trees'])
            return errorReturn('No "trees" in nexml')
        vc.push_context(_NEXEL.TREES, (nex_obj, obj_nex_id))
        try:
            without_id = []
            tg_tuple_list = []
            for tg in trees_group_list:
                tgid = tg.get('@id')
                if tgid is None:
                    without_id.append(tg)
                else:
                    tg_tuple_list.append((tgid, tg))
            if without_id:
                self._error_event(_NEXEL.TREES,
                                  obj=without_id,
                                  err_type=gen_MissingCrucialContentWarning,
                                  anc=vc.anc_list,
                                  obj_nex_id=None,
                                  key_list=['@id'])
                return errorReturn('No "@id" in trees group"')
            if not self._validate_trees_group_list(tg_tuple_list, vc):
                return False
        finally:
            vc.pop_context()
        ogid2og = {}
        for og in otus_group_list:
            ogid = og.get('@id')
            ogid2og[ogid] = og
        if not self._find_first_literal_meta(nex_obj, 'ot:notIntendedForSynthesis'):
            cs = self._find_first_literal_meta(nex_obj, 'ot:candidateTreeForSynthesis')
            if cs:
                if not isinstance(cs, list):
                    tree_list = [cs]
                else:
                    tree_list = cs
            else:
                tree_list = []
                for tg in trees_group_list:
                    stree_list = tg.get('tree')
                    if not isinstance(stree_list, list):
                        stree_list = [stree_list]
                    tree_list.extend([i.get('@id') for i in stree_list])
            self._generate_ott_warnings(ogid2og, tree_list, (nex_obj, obj_nex_id), vc)
        return True

def construct_path_to_root(node, encountered_nodes, edge_by_target):
    nid = node.get('@id')
    p = []
    s = set()
    while nid:
        # _LOG.debug('node = "{node}"   n="{n}"'.format(node=str(node), n=str(n)))
        if nid in s:
            return nid, p
        if nid in encountered_nodes:
            return None, []
        p.append(nid)
        s.add(nid)
        encountered_nodes.add(nid)
        e = edge_by_target.get(nid)
        src = None
        if e:
            src = e.get('@source')
        if src:
            nid = src
        else:
            break
    return None, p


text:
package smoketest.batch;

import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.job.builder.JobBuilder;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.step.builder.StepBuilder;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.PlatformTransactionManager;

@SpringBootApplication
public class SampleBatchApplication {

	@Bean
	Tasklet tasklet() {
		return (contribution, context) -> RepeatStatus.FINISHED;
	}

	@Bean
	Job job(JobRepository jobRepository, Step step) {
		return new JobBuilder("job", jobRepository).start(step).build();
	}

	@Bean
	Step step1(JobRepository jobRepository, Tasklet tasklet, PlatformTransactionManager transactionManager) {
		return new StepBuilder("step1", jobRepository).tasklet(tasklet, transactionManager).build();
	}

	public static void main(String[] args) {
		// System.exit is common for Batch applications since the exit code can be used to
		// drive a workflow
		System.exit(SpringApplication.exit(SpringApplication.run(SampleBatchApplication.class, args)));
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project>
  <property name="jnlp.title"    value="JST SelectableToolTip" />
  <property name="jnlp.Name"     value="SelectableToolTip" />
  <property name="jnlp.name"     value="selectabletooltip" />
  <property name="jnlp.codebase" value="https://ateraimemo.com/swing/selectabletooltip/" />
  <property name="jnlp.homepage" value="https://ateraimemo.com/Swing/SelectableToolTip.html" />
</project>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>probhash: Not compatible</title>
    <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
    <link href="../../../../../bootstrap.min.css" rel="stylesheet">
    <link href="../../../../../bootstrap-custom.css" rel="stylesheet">
    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

             Coq bench

clean / released

8.7.1+1 / probhash - 0.0.1

            « Up

              probhash

                0.0.1
                Not compatible

 (2020-01-15 19:27:58 UTC)

Context

# Packages matching: installed
# Name              # Installed # Synopsis
base-bigarray       base
base-threads        base
base-unix           base
camlp5              7.10        Preprocessor-pretty-printer of OCaml
conf-findutils      1           Virtual package relying on findutils
conf-m4             1           Virtual package relying on m4
coq                 8.7.1+1     Formal proof management system.
num                 1.3         The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml               4.06.1      The OCaml compiler (virtual package)
ocaml-base-compiler 4.06.1      Official 4.06.1 release
ocaml-config        1           OCaml Switch Configuration
ocamlfind           1.8.1       A library manager for OCaml
# opam file:
opam-version: "2.0"
synopsis: "Coq library for reasoning about probabilistic algorithms"
description: """
  ProbHash extends coq-infotheo to support reasoning about probabilistic algorithms,
  and includes a collection of lemmas on random oracle based hash functions.
  Provides an example implementation of a bloom filter and uses the library to prove
  the probability of a false positive.
""" # Longer description, can span several lines
homepage: "https://github.com/certichain/bloom-filter"
dev-repo: "git+https://github.com/certichain/bloom-filter.git"
bug-reports: "https://github.com/certichain/bloom-filter/issues"
maintainer: "kirang@comp.nus.edu.sg"
authors: [
  "Kiran Gopinathan"
  "Ilya Sergey"
]
license: "GPLv3" # Make sure this is reflected by a LICENSE file in your sources
depends: [
  "coq" {>= "8.9" & < "8.10~"}
  "coq-mathcomp-ssreflect" {>= "1.9" & < "1.10~"}
  "coq-mathcomp-analysis" { >= "0.2.0" & < "0.3~" }
  "coq-infotheo" { >= "0.0.4" & < "0.0.5~" }
]
build: [
  [make "-j%{jobs}%"]
]
install: [
  [make "install"]
]
url {
  src: "https://github.com/certichain/probhash/archive/0.0.1.tar.gz"
  checksum: "sha256=06365f9779104cc43e4f8fb069549c2eafe815512d1f49ef8fc865582510ce66"
}
tags: [
  "category:Computer Science/Data Types and Data Structures"
  "keyword: bloomfilter"
  "keyword: probability"
  "date:2019-10-12"
]

Lint

Command

true

Return code

0

Dry install

Dry install with the current Coq version:

Command

opam install -y --show-action coq-probhash.0.0.1 coq.8.7.1+1

Return code

5120

Output

[NOTE] Package coq is already installed (current version is 8.7.1+1).
The following dependencies couldn't be met:
  - coq-probhash -> coq >= 8.9
Your request can't be satisfied:
  - No available version of coq satisfies the constraints
No solution found, exiting

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

Command

opam remove -y coq; opam install -y --show-action --unlock-base coq-probhash.0.0.1

Return code

0

Install dependencies

Command

true

Return code

0

Duration

0 s

Install

Command

true

Return code

0

Duration

0 s

Installation size

No files were installed.

Uninstall

Command

true

Return code

0

Missing removes

                none

Wrong removes

                none

          Sources are on GitHub. © Guillaume Claret.


text:
module Tilia
  module CalDav
    module Subscriptions
      # This plugin adds calendar-subscription support to your CalDAV server.
      #
      # Some clients support 'managed subscriptions' server-side. This is basically
      # a list of subscription urls a user is using.
      class Plugin < Dav::ServerPlugin
        # This initializes the plugin.
        #
        # This function is called by Sabre\DAV\Server, after
        # addPlugin is called.
        #
        # This method should set up the required event subscriptions.
        #
        # @param Server server
        # @return void
        def setup(server)
          server.resource_type_mapping[ISubscription] = '{http://calendarserver.org/ns/}subscribed'
          server.xml.element_map['{http://calendarserver.org/ns/}source'] = Dav::Xml::Property::Href

          server.on('propFind', method(:prop_find), 150)
        end

        # This method should return a list of server-features.
        #
        # This is for example 'versioning' and is added to the DAV: header
        # in an OPTIONS response.
        #
        # @return array
        def features
          ['calendarserver-subscribed']
        end

        # Triggered after properties have been fetched.
        #
        # @param PropFind prop_find
        # @param INode node
        # @return void
        def prop_find(prop_find, _node)
          # There's a bunch of properties that must appear as a self-closing
          # xml-element. This event handler ensures that this will be the case.
          props = [
            '{http://calendarserver.org/ns/}subscribed-strip-alarms',
            '{http://calendarserver.org/ns/}subscribed-strip-attachments',
            '{http://calendarserver.org/ns/}subscribed-strip-todos'
          ]

          props.each do |prop|
            prop_find.set(prop, '', 200) if prop_find.status(prop) == 200
          end
        end

        # Returns a plugin name.
        #
        # Using this name other plugins will be able to access other plugins
        # using \Sabre\DAV\Server::getPlugin
        #
        # @return string
        def plugin_name
          'subscriptions'
        end

        # Returns a bunch of meta-data about the plugin.
        #
        # Providing this information is optional, and is mainly displayed by the
        # Browser plugin.
        #
        # The description key in the returned array may contain html and will not
        # be sanitized.
        #
        # @return array
        def plugin_info
          {
            'name'        => plugin_name,
            'description' => 'This plugin allows users to store iCalendar subscriptions in their calendar-home.',
            'link'        => nil
          }
        end
      end
    end
  end
end


text:
package org.ohdsi.webapi.pathway.dto.internal;

import java.util.Map;
import java.util.Objects;

public class CohortPathways {

    private Integer cohortId;
    private Integer targetCohortCount;
    private Integer totalPathwaysCount;
    private Map<String, Integer> pathwaysCounts;

    public Integer getCohortId() {

        return cohortId;
    }

    public void setCohortId(Integer cohortId) {

        this.cohortId = cohortId;
    }

    public Integer getTargetCohortCount() {

        return targetCohortCount;
    }

    public void setTargetCohortCount(Integer targetCohortCount) {

        this.targetCohortCount = targetCohortCount;
    }

    public Integer getTotalPathwaysCount() {

        return totalPathwaysCount;
    }

    public void setTotalPathwaysCount(Integer totalPathwaysCount) {

        this.totalPathwaysCount = totalPathwaysCount;
    }

    public Map<String, Integer> getPathwaysCounts() {

        return pathwaysCounts;
    }

    public void setPathwaysCounts(Map<String, Integer> pathwaysCounts) {

        this.pathwaysCounts = pathwaysCounts;
    }

    @Override
    public int hashCode() {
        return Objects.hash(getCohortId(), getTargetCohortCount(), getTotalPathwaysCount(), getPathwaysCounts());
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof CohortPathways)) return false;
        CohortPathways that = (CohortPathways) o;
        return Objects.equals(getCohortId(), that.getCohortId()) &&
                Objects.equals(getTargetCohortCount(), that.getTargetCohortCount()) &&
                Objects.equals(getTotalPathwaysCount(), that.getTotalPathwaysCount()) &&
                Objects.equals(getPathwaysCounts(), that.getPathwaysCounts());
    }
}


text:
CREATE TABLE data (
    id integer NOT NULL,
    number integer
);
INSERT INTO data VALUES (0, 0);
INSERT INTO data VALUES (1, 1);
INSERT INTO data VALUES (2, 2);


text:
typedef struct {
    int planet;
    int epoch;
    double time;
} CalcTransit;

CalcTransit* ttvfaster (
    // Inputs:
    int n_planets,
    double* params,
    double t0,
    double tf,
    int m_max,

    // Outputs:
    int* n_events_out
);

#endif


text:
"""transformer (attention seq-seq model) with mixtures of experts.

"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensor2tensor.layers import common_attention
from tensor2tensor.layers import common_hparams
from tensor2tensor.layers import common_layers
from tensor2tensor.models import transformer
from tensor2tensor.utils import expert_utils
from tensor2tensor.utils import registry
from tensor2tensor.utils import t2t_model

import tensorflow as tf

# The transformer architecture can be defined using the layer_types hparams.
# If not defined, the default types and num_hidden_layers are used as fallback
# values.
#
# Examples of usage:
# "a/a/a/a/a/a": Original base transformer (6 encoder and decoder layers of
# multihead full attention)
# "a/a/a-moe/a": 4 layers with 1 moe at layer 3
# "loc/red/loc/red": Alternate between local and memory compressed attention
# "a/a/a#": Encoder only model (3 layers)
# "#a/a/a": Decoder only model (3 layers)
# "a/a-moe#a/a/a": Encoder (2 layers with 1 moe), decoder (3 layers)
# Note that all combinations are not necessarily possibles (some attention
# types are not necessarily compatible with the encoder, or can't accept certain
# types of masking)

SEP_ENCODEC = "#"
SEP_LAYER = "/"
SEP_FF = "-"

@registry.register_model
class TransformerMoe(t2t_model.T2TModel):
  """Attention net.  See file docstring."""

  @staticmethod
  def use_body_sharded():
    return True

  def body_sharded(self, sharded_features):
    # ========= Prepare the input and target =========

    hparams = self._hparams
    dp = self._data_parallelism

    # Process input
    inputs = sharded_features["inputs"]
    target_space = sharded_features["target_space_id"]
    (
        encoder_input,
        encoder_self_attention_bias,
        encoder_decoder_attention_bias,
    ) = dp(self._prepare_encoder, inputs, target_space)

    # Process output
    targets = sharded_features["targets"]
    decoder_input, decoder_self_attention_bias = dp(
        self._prepare_decoder, targets
    )

    def dp_preprocess(x):
      return dp(common_layers.layer_preprocess, x, hparams)

    def dp_postprocess(x, y):
      return dp(common_layers.layer_postprocess, x, y, hparams)

    cache = dict(extra_loss=0.0)

    def prepostprocess(fct):
      """Apply processing and capture the extra loss."""
      @expert_utils.add_var_scope()
      def decorated(x, *args, **kwargs):
        x_preprocessed = dp_preprocess(x)
        y, loss = fct(x_preprocessed, *args, **kwargs)
        cache["extra_loss"] += loss
        return dp_postprocess(x, y)
      return decorated

    # ========= Compute the transformer architecture =========

    encoder_layers, decoder_layers = self._extract_layer_types()

    layers = common_attention.get_standardized_layers(
        hparams=hparams,
        dp=dp,
    )

    if hparams.mode == tf.estimator.ModeKeys.TRAIN:

      # Display the encoder-decoder architecture
      def print_layer(name, layers):
        tf.logging.info("{} architecture:".format(name))
        for i, l in enumerate(layers):
          tf.logging.info(" * Layer {}: {}".format(i, " - ".join(l)))
      print_layer("Encoder", encoder_layers)
      print_layer("Decoder", decoder_layers)

    # ========= Construct the transformer encoder and decoder =========

    encoder_outputs = []

    x = encoder_input
    with tf.variable_scope("encoder"):
      for layer_num, block_types in enumerate(encoder_layers):
        # Each encoder layers is composed of two blocks:
        # * self-attention block
        # * feed-forward block
        att_type, ff_type = block_types
        with tf.variable_scope("layer_{}".format(layer_num)):
          x = prepostprocess(layers[att_type])(
              x,
              bias=encoder_self_attention_bias,
              name="att_{}".format(att_type),
          )
          x = prepostprocess(layers[ff_type])(
              x,
              name="ff_{}".format(ff_type)
          )
        encoder_outputs.append(x)
      if encoder_outputs:
        encoder_outputs[-1] = dp_preprocess(x)

    x = decoder_input
    with tf.variable_scope("decoder"):
      for layer_num, block_types in enumerate(decoder_layers):
        # Each decoder layers is composed of three blocks:
        # * self-attention block
        # * enco-deco attention block (optional)
        # * feed-forward block
        self_att_type, att_ende_type, ff_type = block_types
        with tf.variable_scope("layer_{}".format(layer_num)):
          x = prepostprocess(layers[self_att_type])(
              x,
              bias=decoder_self_attention_bias,
              name="self_att_{}".format(self_att_type),
          )
          # Only add the enco-deco attention layer if there is an encoder
          if encoder_outputs:
            x = prepostprocess(layers[att_ende_type])(
                x,
                memory_antecedent=encoder_outputs[-1],
                bias=encoder_decoder_attention_bias,
                name="att_ende_{}".format(att_ende_type),
            )
          x = prepostprocess(layers[ff_type])(
              x,
              name="ff_{}".format(ff_type)
          )
      # If normalization is done in layer_preprocess, then it should also be
      # done on the output, since the output can grow very large, being the sum
      # of a whole stack of unnormalized layer outputs.
      x = dp_preprocess(x)

    decoder_output = dp(tf.expand_dims, x, 2)
    return decoder_output, cache["extra_loss"]

  @expert_utils.add_name_scope()
  def _prepare_encoder(self, inputs, target_space):
    """Process the transformer encoder inputs."""
    inputs = common_layers.flatten4d3d(inputs)

    output = transformer.transformer_prepare_encoder(
        inputs,
        target_space,
        self._hparams,
        features=None,
    )
    enco_input, enco_self_att_bias, enco_deco_att_bias = output

    enco_input = tf.nn.dropout(
        enco_input, 1.0 - self._hparams.layer_prepostprocess_dropout)

    return enco_input, enco_self_att_bias, enco_deco_att_bias

  @expert_utils.add_name_scope()
  def _prepare_decoder(self, targets):
    """Process the transformer decoder input."""
    targets = common_layers.flatten4d3d(targets)

    output = transformer.transformer_prepare_decoder(
        targets, self._hparams, features=None,
    )
    deco_input, deco_self_attention_bias = output

    deco_input = tf.nn.dropout(
        deco_input, 1.0 - self._hparams.layer_prepostprocess_dropout
    )
    return deco_input, deco_self_attention_bias

  def _extract_layer_types(self):
    """Parse the layer string.

    Returns:
      list[tuple[str, str]]: Encoder layers: list of (attention, feed-forward)
      list[tuple[str, str, str]]: Decoder layers: list of (self-attention,
        enc-dec attention, feed-forward)
    """
    hparams = self._hparams
    layer_types = hparams.layer_types

    # If the architecture has not explicitly been set, we just construct a
    # standard transformer with the fallback values
    if not layer_types:
      layer_types = SEP_LAYER.join(
          [hparams.default_att] * hparams.num_hidden_layers)

    # If encoder not explicitly defined, the encoder will have the same
    # structure as the decoder
    layer_types = layer_types.split(SEP_ENCODEC)
    if len(layer_types) == 1:
      layer_types *= 2

    # Some models don't need the encoder (ex: language modeling)
    # TODO(epot): What are the other conditions (has_input ?)
    if hparams.prepend_mode != "none":
      layer_types[0] = ""

    # Extend the blocks and fill them with the default values if not specified
    final_layers = ([], [])
    for i, blocks_str_joined in enumerate(layer_types):
      for blocks_str in blocks_str_joined.split(SEP_LAYER):
        if not blocks_str:
          continue
        blocks_list = blocks_str.split(SEP_FF)
        # Eventually use the fallback values for the layer_types. If the
        # encoder is empty, do not use the enco-deco attention.
        self_att = blocks_list[0] or hparams.default_att
        ende_att = hparams.default_att if layer_types[0] else "_"
        ff = hparams.default_ff
        if len(blocks_list) > 1:
          ff = blocks_list[-1]
        if len(blocks_list) == 3:
          ende_att = blocks_list[1]
        if i == 0:  # Encoder
          blocks_tuple = (self_att, ff)
        elif i == 1:  # Decoder
          blocks_tuple = (self_att, ende_att, ff)
        final_layers[i].append(blocks_tuple)

    return final_layers

@registry.register_hparams
def transformer_moe_base():
  """Set of hyperparameters."""
  hparams = common_hparams.basic_params1()
  hparams.norm_type = "layer"
  hparams.hidden_size = 512
  hparams.batch_size = 4096
  hparams.max_length = 2001
  hparams.max_input_seq_length = 2000
  hparams.max_target_seq_length = 2000
  hparams.dropout = 0.0
  hparams.clip_grad_norm = 0.  # i.e. no gradient clipping
  hparams.optimizer_adam_epsilon = 1e-9
  hparams.learning_rate_decay_scheme = "noam"
  hparams.learning_rate = 0.1
  hparams.learning_rate_warmup_steps = 2000
  hparams.initializer_gain = 1.0
  hparams.num_hidden_layers = 5
  hparams.initializer = "uniform_unit_scaling"
  hparams.weight_decay = 0.0
  hparams.optimizer_adam_beta1 = 0.9
  hparams.optimizer_adam_beta2 = 0.98
  hparams.num_sampled_classes = 0
  hparams.label_smoothing = 0.0
  hparams.shared_embedding_and_softmax_weights = True
  # According to noam, ("n", "da") seems better for harder-to-learn models
  hparams.layer_preprocess_sequence = "n"
  hparams.layer_postprocess_sequence = "da"

  # Hparams used by transformer_prepare_decoder() function
  hparams.add_hparam("pos", "timing")  # timing, none
  hparams.add_hparam("proximity_bias", False)
  hparams.add_hparam("causal_decoder_self_attention", True)

  hparams = common_attention.add_standard_attention_hparams(hparams)

  # Decoder layers type. If set, num_decoder_layers parameter will be ignored
  # and the number of decoder layer will be deduced from the string
  # See top file comment for example of usage
  hparams.add_hparam("layer_types", "")
  # Default attention type (ex: a, loc, red,...) and feed-forward type (ex: fc,
  # sep, moe,...)
  hparams.add_hparam("default_att", "a")
  hparams.add_hparam("default_ff", "fc")

  return hparams

@registry.register_hparams
def transformer_moe_8k():
  """Hyper parameters specifics for long sequence generation."""
  hparams = transformer_moe_base()

  hparams.batch_size = 8192
  hparams.max_length = 0  # max_length == batch_size
  hparams.eval_drop_long_sequences = True
  hparams.min_length_bucket = 256  # Avoid cyclic problems for big batches

  hparams.default_ff = "sep"
  hparams.hidden_size = 1024

  return hparams

@registry.register_hparams
def transformer_moe_8k_lm():
  """Language modeling params.

  Will have the following architecture by default:
  * No encoder.
  * Decoder architecture:
    * Layer 0: a - sepm  (masked self-attention/masked separable convolutions)
    * Layer 1: a - sepm
    * Layer 2: a - moe  (mixture of expert layers in the middle)
    * Layer 3: a - sepm
    * Layer 4: a - sepm

  Returns:
    hparams
  """
  hparams = transformer_moe_8k()

  # Use masked versions of local attention and separable convolution
  hparams.default_ff = "sepm"

  # hparams.layer_types contains the network architecture:
  # Start with '#' for decoder only architecture
  hparams.layer_types = "#a/a/a-moe/a/a"  # 5 full attention layers with 1 moe
  # For long sequences, if running out of memory, it's possible to use the
  # one of those two optimized versions instead:
  #  * Memory efficient multihead attention (slow):
  # hparams.layer_types = "#mem/mem/mem-moe/mem/mem"
  #  * Alternate between local/compressed attention layers (faster):
  # hparams.layer_types = "#locm/redm/locm-moe/redm/locm"

  return hparams

@registry.register_hparams
def transformer_moe_2k():
  """Base transformers model with moe.

  Will have the following architecture:
  * No encoder.
    * Layer 0: a - sep  (self-attention - unmasked separable convolutions)
    * Layer 1: a - sep
    * Layer 2: a - sep
    * Layer 3: a - sep
    * Layer 4: a - sep
  * Decoder architecture:
    * Layer 0: a - a - sepm  (self-attention - enco/deco-attention - masked sep)
    * Layer 1: a - a - sepm
    * Layer 2: a - a - moe  (mixture of expert layers in the middle)
    * Layer 3: a - a - sepm
    * Layer 4: a - a - sepm

  Returns:
    hparams
  """
  hparams = transformer_moe_8k()
  hparams.batch_size = 2048

  hparams.default_ff = "sep"

  # hparams.layer_types contains the network architecture:
  encoder_archi = "a/a/a/a/a"
  decoder_archi = "a-sepm/a-sepm/a-moe/a-sepm/a-sepm"
  hparams.layer_types = "{}#{}".format(encoder_archi, decoder_archi)

  return hparams

@registry.register_hparams
def transformer_moe_12k():
  """Hyper parameters specifics for long sequence generation."""
  hparams = transformer_moe_8k()
  hparams.batch_size = 12000
  # At 12k, the softmax become the memory bottleneck
  hparams.factored_logit = True
  return hparams

@registry.register_hparams
def transformer_moe_prepend_8k():
  """Model which formulate a seq2seq problem as language modeling."""
  hparams = transformer_moe_8k()
  hparams.prepend_mode = "prepend_inputs_masked_attention"
  hparams.eval_drop_long_sequences = False
  hparams.max_input_seq_length = 7500
  hparams.default_ff = "sepm"
  hparams.layer_types = "locm/redm/locm-moe/redm/locm"
  hparams.moe_num_experts = 256
  return hparams


text:
package proxy

import (
	"fmt"
	thrift "github.com/wfxiang08/go_thrift/thrift"
	"github.com/stretchr/testify/assert"
	"testing"
)

func fakeData(name string, typeId thrift.TMessageType, seqId int32, buf []byte) int {
	transport := NewTMemoryBufferWithBuf(buf)
	protocol := thrift.NewTBinaryProtocolTransport(transport)

	// 切换回原始的SeqId
	protocol.WriteMessageBegin(name, typeId, seqId)
	return transport.Buffer.Len()

}

//
// go test proxy -v -run "TestRequest"
//
func TestRequest(t *testing.T) {

	a := make([]byte, 1000)
	c := a
	d := a
	var e []byte
	fmt.Println("E: ", getSliceId(e), "A: ", getSliceId(c))
	assert.True(t, getSliceId(c) == getSliceId(d))

	data := make([]byte, 1000, 1000)
	size := fakeData("demo:hello", thrift.CALL, 0, data[0:0])
	data = data[0:size]

	r, _ := NewRequest(data, true)

	assert.Equal(t, "demo", r.Service)
	assert.Equal(t, "hello", r.Request.Name)

	//	fmt.Printf("Name: %s, SeqId: %d, TypeId: %d\n", r.Request.Name,
	//		r.Request.SeqId, r.Request.TypeId)

	var newSeqId int32 = 10
	r.ReplaceSeqId(newSeqId)

	_, _, seqId1, _ := DecodeThriftTypIdSeqId(r.Request.Data)
	assert.Equal(t, newSeqId, seqId1) // r.Request.Data中的id被替换成功

	r.Response.Data = r.Request.Data
	r.RestoreSeqId()

	// 恢复正常
	_, _, seqId2, _ := DecodeThriftTypIdSeqId(r.Response.Data)

	//	fmt.Printf("Reqeust SeqId: %d, %d\n", r.Request.SeqId, seqId2)
	assert.Equal(t, 0, int(seqId2))

}


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

<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>
=====TITLE=====
 - ScriptTiger</title>

=====HEADER=====

=====CONTENT=====


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.nativescript.widgets"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="17"
        android:targetSdkVersion="23" />

    <application android:allowBackup="true" >
    </application>

</manifest>


text:
from pyspark import SparkContext

sc = SparkContext(appName="PythonWordCount")
#lines = sc.textFile("file:///home/code/climatology-gaussianInterp/README.md", 8)
lines = sc.textFile("file:///usr/share/dict/words", 128)
counts = lines.flatMap(lambda x: x.split(' ')) \
              .map(lambda x: (x, 1)) \
              .reduceByKey(lambda x,y: x + y)

output = counts.collect()
#for (word, count) in output:
#    print("%s: %i" % (word, count))