text:
from __future__ import absolute_import, division, print_function

import os
import sys

from setuptools import find_packages, setup

PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
_jax_version_constraints = ">=0.2.13"
_jaxlib_version_constraints = ">=0.1.65"

# Find version
for line in open(os.path.join(PROJECT_PATH, "numpyro", "version.py")):
    if line.startswith("__version__ = "):
        version = line.strip().split()[2][1:-1]

# READ README.md for long description on PyPi.
try:
    long_description = open("README.md", encoding="utf-8").read()
except Exception as e:
    sys.stderr.write("Failed to read README.md:\n  {}\n".format(e))
    sys.stderr.flush()
    long_description = ""

setup(
    name="numpyro",
    version=version,
    description="Pyro PPL on NumPy",
    packages=find_packages(include=["numpyro", "numpyro.*"]),
    url="https://github.com/pyro-ppl/numpyro",
    author="Uber AI Labs",
    install_requires=[
        f"jax{_jax_version_constraints}",
        f"jaxlib{_jaxlib_version_constraints}",
        "multipledispatch",
        "numpy",
        "tqdm",
    ],
    extras_require={
        "doc": [
            "ipython",  # sphinx needs this to render codes
            "nbsphinx>=0.8.5",
            "readthedocs-sphinx-search==0.1.0",
            "sphinx",
            "sphinx_rtd_theme",
            "sphinx-gallery",
        ],
        "test": [
            "importlib-metadata<5.0",
            "black[jupyter]>=21.8b0",
            "flake8",
            "importlib-metadata<5.0",
            "isort>=5.0",
            "pytest>=4.1",
            "pyro-api>=0.1.1",
            "scipy>=1.6,<1.7",
        ],
        "dev": [
            "dm-haiku",
            "flax",
            "funsor>=0.4.1",
            "graphviz",
            "jaxns==1.0.0",
            "optax>=0.0.6",
            "pyyaml",  # flax dependency
            "tensorflow_probability>=0.17.0",
        ],
        "examples": [
            "arviz",
            "jupyter",
            "matplotlib",
            "pandas",
            "seaborn",
            "scikit-learn",
            "wordcloud",
        ],
        "cpu": f"jax[cpu]{_jax_version_constraints}",
        # TPU and CUDA installations, currently require to add package repository URL, i.e.,
        # pip install numpyro[cuda] -f https://storage.googleapis.com/jax-releases/jax_releases.html
        "tpu": f"jax[tpu]{_jax_version_constraints}",
        "cuda": f"jax[cuda]{_jax_version_constraints}",
    },
    long_description=long_description,
    long_description_content_type="text/markdown",
    keywords="probabilistic machine learning bayesian statistics",
    license="Apache License 2.0",
    classifiers=[
        "Intended Audience :: Developers",
        "Intended Audience :: Education",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: POSIX :: Linux",
        "Operating System :: MacOS :: MacOS X",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
    ],
)


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using AspectCore.Configuration;
using AspectCore.DynamicProxy;
using Xunit;

namespace AspectCore.Tests.DynamicProxy
{
    public class NothingAttribute : AbstractInterceptorAttribute
    {
        public override Task Invoke(AspectContext context, AspectDelegate next)
        {
            return next(context);
        }
    }

    public class ThrowExceptionTester
    {
        [Nothing]
        public virtual int ThrowOfResult() => throw new ArgumentException();
        [Nothing]
        public virtual Task<int> ThrowAsyncOfTaskResult() => throw new ArgumentException();
        [Nothing]
        public virtual ValueTask<int> ThrowAsyncOfValueTask() => throw new ArgumentException();

        [Nothing]
        public virtual Task ThrowInMainTask()
        {
            return Task.Run(() => throw new ArgumentException())
                .ContinueWith(m =>
                {
                    if (m.IsFaulted)
                        throw m.Exception.InnerException;
                });
        }

        [Nothing]
        public virtual Task ThrowInUncontinuedTasks()
        {
            return Task.Run(() => throw new ArgumentException())
                .ContinueWith(m => Console.WriteLine(m.Status), TaskContinuationOptions.OnlyOnRanToCompletion);
        }

        [Nothing]
        public virtual Task ThrowInSubTask()
        {
            return Task.Run(() => Task.FromResult(1))
                .ContinueWith(m => throw new ArgumentException());
        }
    }

    public class ThrowExceptionTests : DynamicProxyTestBase
    {
        private static void AssertSameThrows(Func<object> action, Func<object> proxyAction)
        {
            try
            {
                action();
            }
            catch (Exception ex)
            {
                try
                {
                    proxyAction();
                }
                catch (Exception exOfProxy)
                {
                    Assert.Equal(typeof(AspectInvocationException), exOfProxy.GetType());
                    Assert.NotNull(exOfProxy.InnerException);
                    Assert.Equal(ex.GetType(), exOfProxy.InnerException.GetType());
                    return;
                }
                throw new InvalidOperationException("no exception in proxyAction");
            }
            throw new InvalidOperationException("no exception in action");
        }

        private static async Task AssertSameThrowsAsync(Func<Task> action, Func<Task> proxyAction)
        {
            try
            {
                await action();
            }
            catch (Exception ex)
            {
                try
                {
                    await proxyAction();
                }
                catch (Exception exOfProxy)
                {
                    Assert.Equal(typeof(AspectInvocationException), exOfProxy.GetType());
                    Assert.NotNull(exOfProxy.InnerException);
                    Assert.Equal(ex.GetType(), exOfProxy.InnerException.GetType());
                    return;
                }
                throw new InvalidOperationException("no exception in proxyAction");
            }
            throw new InvalidOperationException("no exception in action");
        }

        [Fact]
        public async Task TestThrowException()
        {
            var obj = new ThrowExceptionTester();
            var proxy = ProxyGenerator.CreateClassProxy<ThrowExceptionTester>();
            Assert.True(proxy.IsProxy());

            AssertSameThrows(
                () => obj.ThrowOfResult(),
                () => proxy.ThrowOfResult());

            await AssertSameThrowsAsync(
                async () => await obj.ThrowAsyncOfTaskResult(),
                async () => await proxy.ThrowAsyncOfTaskResult());

            await AssertSameThrowsAsync(
                async () => await obj.ThrowAsyncOfValueTask(),
                async () => await proxy.ThrowAsyncOfValueTask());
        }

        [Fact]
        public async Task TestThrowInMainTask()
        {
            var obj = new ThrowExceptionTester();
            var proxy = ProxyGenerator.CreateClassProxy<ThrowExceptionTester>();
            Assert.True(proxy.IsProxy());

            await AssertSameThrowsAsync(
                async () => await obj.ThrowInMainTask(),
                async () => await proxy.ThrowInMainTask());
        }

        [Fact]
        public async Task TestThrowInSubTask()
        {
            var obj = new ThrowExceptionTester();
            var proxy = ProxyGenerator.CreateClassProxy<ThrowExceptionTester>();
            Assert.True(proxy.IsProxy());

            await AssertSameThrowsAsync(
                async () => await obj.ThrowInSubTask(),
                async () => await proxy.ThrowInSubTask());
        }

        [Fact]
        public async Task TestThrowInUncontinuedTasks()
        {
            var obj = new ThrowExceptionTester();
            var proxy = ProxyGenerator.CreateClassProxy<ThrowExceptionTester>();
            Assert.True(proxy.IsProxy());

            // todo re-test
            // await AssertSameThrowsAsync(
            //     async () => await obj.ThrowInUncontinuedTasks(),
            //     async () => await proxy.ThrowInUncontinuedTasks());
        }

        protected override void Configure(IAspectConfiguration configuration)
        {
            configuration.ThrowAspectException = true;
            base.Configure(configuration);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
class IRedoUndo
{
public:

    virtual ~IRedoUndo() {}

    virtual bool Redo() = 0;
    virtual void Undo() = 0;
};

#endif


text:
package nl.tno.idsa.framework.semantics_impl.variables;

import nl.tno.idsa.framework.semantics_base.SemanticLibrary;
import nl.tno.idsa.framework.semantics_impl.roles.Role;

/**
 * Created by jongsd on 13-8-15.
 */

// TODO Document code.

public class RoleVariable extends Variable<Class<? extends Role>> {

    public RoleVariable() {
    }

    public RoleVariable(Class<? extends Role> value) {
        setValue(value);
    }

    @Override
    public Variable<Class<? extends Role>> getConstraintIntersection(Variable<Class<? extends Role>> otherVariable) {
        if (SemanticLibrary.getInstance().isSemanticSubclass(getValue(), otherVariable.getValue())) {
            return otherVariable;
        } else if (SemanticLibrary.getInstance().isSemanticSuperclass(getValue(), otherVariable.getValue())) {
            return this;
        } else {
            return null;
        }
    }

    @Override
    protected boolean checkValidity(Class<? extends Role> value) {
        return true;
    }

    @Override
    public Variable<Class<? extends Role>> deepClone() {
        return new RoleVariable(getValue());
    }

    @Override
    public String toString() {
        if (getBinder() != null) {
            Variable<Class<? extends Role>> mostSpecificVariable = getBinder().getMostSpecificVariable(this);
            if (mostSpecificVariable != this) {
                return mostSpecificVariable.toString(false);
            }
        }
        return toString(false);
    }

    @Override
    public String toString(boolean mostSpecific) {
        if (mostSpecific) {
            return toString();
        }
        String simpleName = getValue() != null ? getValue().getSimpleName() : "?";
        return "R" + getIdString() + "[" + simpleName + "]";
    }
}


text:
.jcarousel-skin-tango .jcarousel-container {
    -moz-border-radius: 10px;
    border: 1px solid #ccc;
}

.jcarousel-skin-tango .jcarousel-direction-rtl {
	direction: rtl;
}

.jcarousel-skin-tango .jcarousel-container-horizontal {
    width: 245px;
    padding: 20px 40px;
}

.jcarousel-skin-tango .jcarousel-container-vertical {
    width: 75px;
    height: 245px;
    padding: 40px 20px;
}

.jcarousel-skin-tango .jcarousel-clip-horizontal {
    width:  245px;
    height: 75px;
}

.jcarousel-skin-tango .jcarousel-clip-vertical {
    width:  75px;
    height: 245px;
}

.jcarousel-skin-tango .jcarousel-item {
    width: 75px;
    height: 75px;
}

.jcarousel-skin-tango .jcarousel-item-horizontal {
	margin-left: 0;
    margin-right: 10px;
}

.jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-item-horizontal {
	margin-left: 10px;
    margin-right: 0;
}

.jcarousel-skin-tango .jcarousel-item-vertical {
    margin-bottom: 10px;
}

.jcarousel-skin-tango .jcarousel-item-placeholder {
    background: #fff;
    color: #000;
}

/**
 *  Horizontal Buttons
 */

.jcarousel-skin-tango .jcarousel-next-horizontal:hover {
    background-position: -32px 0;
}

.jcarousel-skin-tango .jcarousel-next-horizontal:active {
    background-position: -64px 0;
}

.jcarousel-skin-tango .jcarousel-next-disabled-horizontal,
.jcarousel-skin-tango .jcarousel-next-disabled-horizontal:hover,
.jcarousel-skin-tango .jcarousel-next-disabled-horizontal:active {
    cursor: default;
    background-position: -96px 0;
}

.jcarousel-skin-tango .jcarousel-prev-horizontal:hover {
    background-position: -32px 0;
}

.jcarousel-skin-tango .jcarousel-prev-horizontal:active {
    background-position: -64px 0;
}

.jcarousel-skin-tango .jcarousel-prev-disabled-horizontal,
.jcarousel-skin-tango .jcarousel-prev-disabled-horizontal:hover,
.jcarousel-skin-tango .jcarousel-prev-disabled-horizontal:active {
    cursor: default;
    background-position: -96px 0;
}

/**
 *  Vertical Buttons
 */

.jcarousel-skin-tango .jcarousel-next-vertical:hover {
    background-position: 0 -32px;
}

.jcarousel-skin-tango .jcarousel-next-vertical:active {
    background-position: 0 -64px;
}

.jcarousel-skin-tango .jcarousel-next-disabled-vertical,
.jcarousel-skin-tango .jcarousel-next-disabled-vertical:hover,
.jcarousel-skin-tango .jcarousel-next-disabled-vertical:active {
    cursor: default;
    background-position: 0 -96px;
}

.jcarousel-skin-tango .jcarousel-prev-vertical:hover {
    background-position: 0 -32px;
}

.jcarousel-skin-tango .jcarousel-prev-vertical:active {
    background-position: 0 -64px;
}

.jcarousel-skin-tango .jcarousel-prev-disabled-vertical,
.jcarousel-skin-tango .jcarousel-prev-disabled-vertical:hover,
.jcarousel-skin-tango .jcarousel-prev-disabled-vertical:active {
    cursor: default;
    background-position: 0 -96px;
}
.dialog {
    border:4px solid #09f;
    background:#fff;
    display:none;
}


text:
package life.http;

import life.Account;
import life.Block;
import life.LifeCoin;
import life.LifeException;
import life.db.DbIterator;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONStreamAware;

import javax.servlet.http.HttpServletRequest;

public final class GetAccountBlocks extends APIServlet.APIRequestHandler {

    static final GetAccountBlocks instance = new GetAccountBlocks();

    private GetAccountBlocks() {
        super(new APITag[] {APITag.ACCOUNTS}, "account", "timestamp", "firstIndex", "lastIndex", "includeTransactions");
    }

    @Override
    JSONStreamAware processRequest(HttpServletRequest req) throws LifeException {

        Account account = ParameterParser.getAccount(req);
        int timestamp = ParameterParser.getTimestamp(req);
        int firstIndex = ParameterParser.getFirstIndex(req);
        int lastIndex = ParameterParser.getLastIndex(req);

        boolean includeTransactions = "true".equalsIgnoreCase(req.getParameter("includeTransactions"));

        JSONArray blocks = new JSONArray();
        try (DbIterator<? extends Block> iterator = LifeCoin.getBlockchain().getBlocks(account, timestamp, firstIndex, lastIndex)) {
            while (iterator.hasNext()) {
                Block block = iterator.next();
                blocks.add(JSONData.block(block, includeTransactions));
            }
        }

        JSONObject response = new JSONObject();
        response.put("blocks", blocks);

        return response;
    }

}


text:
Title: System Design Primer: Asynchronism
Date: 2020-01-13
Status: draft
Summary: Asynchronism
CoverImage: http://i.imgur.com/6SbxQah.png
Thumbnail: http://i.imgur.com/oCWLuMC.png

## Asynchronism

  Source: Intro to architecting systems for scale

Asynchronous workflows help reduce request times for expensive operations that would otherwise be performed in-line.  They can also help by doing time-consuming work in advance, such as periodic aggregation of data.

### Message queues

Message queues receive, hold, and deliver messages.  If an operation is too slow to perform inline, you can use a message queue with the following workflow:

* An application publishes a job to the queue, then notifies the user of job status
* A worker picks up the job from the queue, processes it, then signals the job is complete

The user is not blocked and the job is processed in the background.  During this time, the client might optionally do a small amount of processing to make it seem like the task has completed.  For example, if posting a tweet, the tweet could be instantly posted to your timeline, but it could take some time before your tweet is actually delivered to all of your followers.

**[Redis](https://redis.io/)** is useful as a simple message broker but messages can be lost.

**[RabbitMQ](https://www.rabbitmq.com/)** is popular but requires you to adapt to the 'AMQP' protocol and manage your own nodes.

**[Amazon SQS](https://aws.amazon.com/sqs/)** is hosted but can have high latency and has the possibility of messages being delivered twice.

### Task queues

Tasks queues receive tasks and their related data, runs them, then delivers their results.  They can support scheduling and can be used to run computationally-intensive jobs in the background.

**Celery** has support for scheduling and primarily has python support.

### Back pressure

If queues start to grow significantly, the queue size can become larger than memory, resulting in cache misses, disk reads, and even slower performance.  [Back pressure](http://mechanical-sympathy.blogspot.com/2012/05/apply-back-pressure-when-overloaded.html) can help by limiting the queue size, thereby maintaining a high throughput rate and good response times for jobs already in the queue.  Once the queue fills up, clients get a server busy or HTTP 503 status code to try again later.  Clients can retry the request at a later time, perhaps with [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff).

### Disadvantage(s): asynchronism

* Use cases such as inexpensive calculations and realtime workflows might be better suited for synchronous operations, as introducing queues can add delays and complexity.

### Source(s) and further reading

* [It's all a numbers game](https://www.youtube.com/watch?v=1KRYH75wgy4)
* [Applying back pressure when overloaded](http://mechanical-sympathy.blogspot.com/2012/05/apply-back-pressure-when-overloaded.html)
* [Little's law](https://en.wikipedia.org/wiki/Little%27s_law)
* [What is the difference between a message queue and a task queue?](https://www.quora.com/What-is-the-difference-between-a-message-queue-and-a-task-queue-Why-would-a-task-queue-require-a-message-broker-like-RabbitMQ-Redis-Celery-or-IronMQ-to-function)


text:
"""Zwave workarounds."""
from . import const

# Manufacturers
FIBARO = 0x010f
PHILIO = 0x013c
WENZHOU = 0x0118
SOMFY = 0x47

# Product IDs
PHILIO_SLIM_SENSOR = 0x0002
PHILIO_3_IN_1_SENSOR_GEN_4 = 0x000d
PHILIO_PAN07 = 0x0005

# Product Types
FGFS101_FLOOD_SENSOR_TYPE = 0x0b00
FGRM222_SHUTTER2 = 0x0301
FGR222_SHUTTER2 = 0x0302
PHILIO_SWITCH = 0x0001
PHILIO_SENSOR = 0x0002
SOMFY_ZRTSI = 0x5a52

# Mapping devices
PHILIO_SLIM_SENSOR_MOTION_MTII = (PHILIO, PHILIO_SENSOR, PHILIO_SLIM_SENSOR, 0)
PHILIO_3_IN_1_SENSOR_GEN_4_MOTION_MTII = (
    PHILIO, PHILIO_SENSOR, PHILIO_3_IN_1_SENSOR_GEN_4, 0)
PHILIO_PAN07_MTII = (PHILIO, PHILIO_SWITCH, PHILIO_PAN07, 0)
WENZHOU_SLIM_SENSOR_MOTION_MTII = (
    WENZHOU, PHILIO_SENSOR, PHILIO_SLIM_SENSOR, 0)

# Workarounds
WORKAROUND_NO_OFF_EVENT = 'trigger_no_off_event'
WORKAROUND_NO_POSITION = 'workaround_no_position'
WORKAROUND_REFRESH_NODE_ON_UPDATE = 'refresh_node_on_update'
WORKAROUND_IGNORE = 'workaround_ignore'

# List of workarounds by (manufacturer_id, product_type, product_id, index)
DEVICE_MAPPINGS_MTII = {
    PHILIO_SLIM_SENSOR_MOTION_MTII: WORKAROUND_NO_OFF_EVENT,
    PHILIO_3_IN_1_SENSOR_GEN_4_MOTION_MTII: WORKAROUND_NO_OFF_EVENT,
    WENZHOU_SLIM_SENSOR_MOTION_MTII: WORKAROUND_NO_OFF_EVENT,
    PHILIO_PAN07_MTII: WORKAROUND_REFRESH_NODE_ON_UPDATE,
}

SOMFY_ZRTSI_CONTROLLER_MT = (SOMFY, SOMFY_ZRTSI)

# List of workarounds by (manufacturer_id, product_type)
DEVICE_MAPPINGS_MT = {
    SOMFY_ZRTSI_CONTROLLER_MT: WORKAROUND_NO_POSITION,
}

# Component mapping devices
FIBARO_FGFS101_SENSOR_ALARM = (
    FIBARO, FGFS101_FLOOD_SENSOR_TYPE, const.COMMAND_CLASS_SENSOR_ALARM)
FIBARO_FGRM222_BINARY = (
    FIBARO, FGRM222_SHUTTER2, const.COMMAND_CLASS_SWITCH_BINARY)
FIBARO_FGR222_BINARY = (
    FIBARO, FGR222_SHUTTER2, const.COMMAND_CLASS_SWITCH_BINARY)

# List of component workarounds by
# (manufacturer_id, product_type, command_class)
DEVICE_COMPONENT_MAPPING = {
    FIBARO_FGFS101_SENSOR_ALARM: 'binary_sensor',
    FIBARO_FGRM222_BINARY: WORKAROUND_IGNORE,
    FIBARO_FGR222_BINARY: WORKAROUND_IGNORE,
}

def get_device_component_mapping(value):
    """Get mapping of value to another component."""
    if (value.node.manufacturer_id.strip() and
            value.node.product_type.strip()):
        manufacturer_id = int(value.node.manufacturer_id, 16)
        product_type = int(value.node.product_type, 16)
        return DEVICE_COMPONENT_MAPPING.get(
            (manufacturer_id, product_type, value.command_class))

    return None

def get_device_mapping(value):
    """Get mapping of value to a workaround."""
    if (value.node.manufacturer_id.strip() and
            value.node.product_id.strip() and
            value.node.product_type.strip()):
        manufacturer_id = int(value.node.manufacturer_id, 16)
        product_type = int(value.node.product_type, 16)
        product_id = int(value.node.product_id, 16)
        result = DEVICE_MAPPINGS_MTII.get(
            (manufacturer_id, product_type, product_id, value.index))
        if result:
            return result
        return DEVICE_MAPPINGS_MT.get((manufacturer_id, product_type))

    return None


text:
/*
 * The HMAC-SHA1 has is defined as:
 *
 *     HMAC = SHA1(K XOR opad, SHA1(K XOR ipad, message))
 *
 * "opad" is 64 bytes filled with 0x5c
 * "ipad" is 64 bytes filled with 0x36
 * "K" is the key material
 *
 * If the key material "K" is longer than 64 bytes, then the key material
 * will first be digested (K = SHA1(K)) resulting in a 20-byte hash.
 * If the key material is shorter than 64 bytes, it is padded with zero
 * bytes.
 *
 * This code precomputes "K XOR ipad" and "K XOR opad" since that just makes
 * sense.
 *
 * This code was heavily influenced by Eric A. Young's in how the interface
 * was designed and how this file is formatted.
 */

#ifndef __HMAC_SHA1_H__
#define __HMAC_SHA1_H__

#include "hmac_sha.h"
#include <string.h>

#ifdef  __cplusplus
extern "C" {
#endif

/* Filler bytes: */
#define IPAD_BYTE	0x36
#define OPAD_BYTE	0x5c
#define ZERO_BYTE	0x00

void HMAC_SHA1_Init(HMAC_SHA1_CTX *ctx) {
	memset(&(ctx->key[0]), ZERO_BYTE, HMAC_SHA1_BLOCK_LENGTH);
	memset(&(ctx->ipad[0]), IPAD_BYTE, HMAC_SHA1_BLOCK_LENGTH);
	memset(&(ctx->opad[0]), OPAD_BYTE, HMAC_SHA1_BLOCK_LENGTH);
	ctx->keylen = 0;
	ctx->hashkey = 0;
}

void HMAC_SHA1_UpdateKey(HMAC_SHA1_CTX *ctx, unsigned char *key, unsigned int keylen) {

	/* Do we have anything to work with?  If not, return right away. */
	if (keylen < 1)
		return;

	/*
	 * Is the total key length (current data and any previous data)
	 * longer than the hash block length?
	 */
	if (ctx->hashkey !=0 || (keylen + ctx->keylen) > HMAC_SHA1_BLOCK_LENGTH) {
		/*
		 * Looks like the key data exceeds the hash block length,
		 * so that means we use a hash of the key as the key data
		 * instead.
		 */
		if (ctx->hashkey == 0) {
			/*
			 * Ah, we haven't started hashing the key
			 * data yet, so we must init. the hash
			 * monster to begin feeding it.
			 */

			/* Set the hash key flag to true (non-zero) */
			ctx->hashkey = 1;

			/* Init. the hash beastie... */
			SHA1_Init(&ctx->shactx);

			/* If there's any previous key data, use it */
			if (ctx->keylen > 0) {
				SHA1_Update(&ctx->shactx, &(ctx->key[0]), ctx->keylen);
			}

			/*
			 * Reset the key length to the future true
			 * key length, HMAC_SHA1_DIGEST_LENGTH
			 */
			ctx->keylen = HMAC_SHA1_DIGEST_LENGTH;
		}
		/* Now feed the latest key data to the has monster */
		SHA1_Update(&ctx->shactx, key, keylen);
	} else {
		/*
		 * Key data length hasn't yet exceeded the hash
		 * block length (HMAC_SHA1_BLOCK_LENGTH), so theres
		 * no need to hash the key data (yet).  Copy it
		 * into the key buffer.
		 */
		memcpy(&(ctx->key[ctx->keylen]), key, keylen);
		ctx->keylen += keylen;
	}
}

void HMAC_SHA1_EndKey(HMAC_SHA1_CTX *ctx) {
	unsigned char	*ipad, *opad, *key;
	int		i;

	/* Did we end up hashing the key? */
	if (ctx->hashkey) {
		memset(&(ctx->key[0]), ZERO_BYTE, HMAC_SHA1_BLOCK_LENGTH);
		/* Yes, so finish up and copy the key data */
		SHA1_Final(&(ctx->key[0]), &ctx->shactx);
		/* ctx->keylen was already set correctly */
	}
	/* Pad the key if necessary with zero bytes */
	if ((i = HMAC_SHA1_BLOCK_LENGTH - ctx->keylen) > 0) {
		memset(&(ctx->key[ctx->keylen]), ZERO_BYTE, i);
	}

	ipad = &(ctx->ipad[0]);
	opad = &(ctx->opad[0]);

	/* Precompute the respective pads XORed with the key */
	key = &(ctx->key[0]);
	for (i = 0; i < ctx->keylen; i++, key++) {
		/* XOR the key byte with the appropriate pad filler byte */
		*ipad++ ^= *key;
		*opad++ ^= *key;
	}
}

void HMAC_SHA1_StartMessage(HMAC_SHA1_CTX *ctx) {
	SHA1_Init(&ctx->shactx);
	SHA1_Update(&ctx->shactx, &(ctx->ipad[0]), HMAC_SHA1_BLOCK_LENGTH);
}

void HMAC_SHA1_UpdateMessage(HMAC_SHA1_CTX *ctx, unsigned char *data, unsigned int datalen) {
	SHA1_Update(&ctx->shactx, data, datalen);
}

void HMAC_SHA1_EndMessage(unsigned char *out, HMAC_SHA1_CTX *ctx) {
	unsigned char	buf[HMAC_SHA1_DIGEST_LENGTH];
	SHA_CTX		*c = &ctx->shactx;

	SHA1_Final(&(buf[0]), c);
	SHA1_Init(c);
	SHA1_Update(c, &(ctx->opad[0]), HMAC_SHA1_BLOCK_LENGTH);
	SHA1_Update(c, buf, HMAC_SHA1_DIGEST_LENGTH);
	SHA1_Final(out, c);
}

void HMAC_SHA1_Done(HMAC_SHA1_CTX *ctx) {
	/* Just to be safe, toast all context data */
	memset(&(ctx->ipad[0]), ZERO_BYTE, HMAC_SHA1_BLOCK_LENGTH);
	memset(&(ctx->ipad[0]), ZERO_BYTE, HMAC_SHA1_BLOCK_LENGTH);
	memset(&(ctx->key[0]), ZERO_BYTE, HMAC_SHA1_BLOCK_LENGTH);
	ctx->keylen = 0;
	ctx->hashkey = 0;
}

#ifdef  __cplusplus
}
#endif

#endif


text:
import pygame

import screens.pregame.pregame_instructions
import screens.sound as sound

import widget.button

class PreGameIntroductionScreen:
    def __init__(self, canvas):
        self.canvas = canvas
        self.image = pygame.image.load('resources/screens/' + canvas.language + '/pregame/pregame_introduction.jpg')
        self.button1 = widget.button.Button((17, 595), (91, 75), self.to_instructions)

    # Updates this 'pregame introduction' screen.
    def update(self):
        pass

    # Handles an event.
    def on_event(self, event):
        self.button1.on_event(event)

    # Switches to the pre-game instructions screen.
    def to_instructions(self, x, y, cursor):
        sound.Plopperdeplop.tune(self, 'click')
        self.canvas.set_screen(screens.pregame.pregame_instructions.PreGameInstructionsScreen(self.canvas))

    # Draws the components of this 'pregame introduction' screen.
    def draw(self, surface):
        surface.blit(self.image, (0, 0))


text:
<?php

namespace test\cdi;

class MyClasseCDI extends \core\interfaces\AbstractMappingCDI {

   public function mappingClass() {
      parent::add(\test\entity\IAlgumaCoisa::class, new \test\entity\AlgumaClasse(new \test\entity\Categoria()));
   }

}


text:
using System.Xml;

namespace FatturaElettronicaPA.FatturaElettronicaHeader.CedentePrestatore
{
    public class StabileOrganizzazione : Common.Località
    {
        public StabileOrganizzazione() { }
        public StabileOrganizzazione(XmlReader r) : base(r) { }
    }
}


text:
.class Landroid/telecom/ConnectionService$5;
.super Lcom/android/internal/telecom/RemoteServiceCallback$Stub;
.source "ConnectionService.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Landroid/telecom/ConnectionService;->onAdapterAttached()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Landroid/telecom/ConnectionService;

# direct methods
.method constructor <init>(Landroid/telecom/ConnectionService;)V
    .locals 0

    .prologue
    .line 739
    iput-object p1, p0, Landroid/telecom/ConnectionService$5;->this$0:Landroid/telecom/ConnectionService;

    invoke-direct {p0}, Lcom/android/internal/telecom/RemoteServiceCallback$Stub;-><init>()V

    return-void
.end method

# virtual methods
.method public onError()V
    .locals 2

    .prologue
    .line 760
    iget-object v0, p0, Landroid/telecom/ConnectionService$5;->this$0:Landroid/telecom/ConnectionService;

    # getter for: Landroid/telecom/ConnectionService;->mHandler:Landroid/os/Handler;
    invoke-static {v0}, Landroid/telecom/ConnectionService;->access$000(Landroid/telecom/ConnectionService;)Landroid/os/Handler;

    move-result-object v0

    new-instance v1, Landroid/telecom/ConnectionService$5$2;

    invoke-direct {v1, p0}, Landroid/telecom/ConnectionService$5$2;-><init>(Landroid/telecom/ConnectionService$5;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 766
    return-void
.end method

.method public onResult(Ljava/util/List;Ljava/util/List;)V
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Landroid/content/ComponentName;",
            ">;",
            "Ljava/util/List",
            "<",
            "Landroid/os/IBinder;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 744
    .local p1, "componentNames":Ljava/util/List;, "Ljava/util/List<Landroid/content/ComponentName;>;"
    .local p2, "services":Ljava/util/List;, "Ljava/util/List<Landroid/os/IBinder;>;"
    iget-object v0, p0, Landroid/telecom/ConnectionService$5;->this$0:Landroid/telecom/ConnectionService;

    # getter for: Landroid/telecom/ConnectionService;->mHandler:Landroid/os/Handler;
    invoke-static {v0}, Landroid/telecom/ConnectionService;->access$000(Landroid/telecom/ConnectionService;)Landroid/os/Handler;

    move-result-object v0

    new-instance v1, Landroid/telecom/ConnectionService$5$1;

    invoke-direct {v1, p0, p1, p2}, Landroid/telecom/ConnectionService$5$1;-><init>(Landroid/telecom/ConnectionService$5;Ljava/util/List;Ljava/util/List;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 756
    return-void
.end method


text:
package org.lxp.model;

public class Tag {
    private Integer id;

    private String name;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}


text:
"""
    Server API

    Reference for Server API (REST/Json)

    OpenAPI spec version: 2.0.21

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from pprint import pformat
from six import iteritems
import re

class IPCoordinates(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, latitude=None, longitude=None):
        """
        IPCoordinates - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'latitude': 'float',
            'longitude': 'float'
        }

        self.attribute_map = {
            'latitude': 'latitude',
            'longitude': 'longitude'
        }

        self._latitude = latitude
        self._longitude = longitude

    @property
    def latitude(self):
        """
        Gets the latitude of this IPCoordinates.

        :return: The latitude of this IPCoordinates.
        :rtype: float
        """
        return self._latitude

    @latitude.setter
    def latitude(self, latitude):
        """
        Sets the latitude of this IPCoordinates.

        :param latitude: The latitude of this IPCoordinates.
        :type: float
        """

        self._latitude = latitude

    @property
    def longitude(self):
        """
        Gets the longitude of this IPCoordinates.

        :return: The longitude of this IPCoordinates.
        :rtype: float
        """
        return self._longitude

    @longitude.setter
    def longitude(self, longitude):
        """
        Sets the longitude of this IPCoordinates.

        :param longitude: The longitude of this IPCoordinates.
        :type: float
        """

        self._longitude = longitude

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return pformat(self.to_dict())

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other


text:
package org.knowm.xchange.binance;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import javax.ws.rs.DELETE;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import org.knowm.xchange.binance.dto.BinanceException;
import org.knowm.xchange.binance.dto.account.AssetDetail;
import org.knowm.xchange.binance.dto.account.AssetDividendResponse;
import org.knowm.xchange.binance.dto.account.BinanceAccountInformation;
import org.knowm.xchange.binance.dto.account.BinanceDeposit;
import org.knowm.xchange.binance.dto.account.BinanceWithdraw;
import org.knowm.xchange.binance.dto.account.DepositAddress;
import org.knowm.xchange.binance.dto.account.TransferHistory;
import org.knowm.xchange.binance.dto.account.TransferSubUserHistory;
import org.knowm.xchange.binance.dto.account.WithdrawResponse;
import org.knowm.xchange.binance.dto.trade.BinanceCancelledOrder;
import org.knowm.xchange.binance.dto.trade.BinanceDustLog;
import org.knowm.xchange.binance.dto.trade.BinanceListenKey;
import org.knowm.xchange.binance.dto.trade.BinanceNewOrder;
import org.knowm.xchange.binance.dto.trade.BinanceOrder;
import org.knowm.xchange.binance.dto.trade.BinanceTrade;
import org.knowm.xchange.binance.dto.trade.OrderSide;
import org.knowm.xchange.binance.dto.trade.OrderType;
import org.knowm.xchange.binance.dto.trade.TimeInForce;
import si.mazi.rescu.ParamsDigest;
import si.mazi.rescu.SynchronizedValueFactory;

@Path("")
@Produces(MediaType.APPLICATION_JSON)
public interface BinanceAuthenticated extends Binance {

  String SIGNATURE = "signature";
  String X_MBX_APIKEY = "X-MBX-APIKEY";

  /**
   * Send in a new order
   *
   * @param symbol
   * @param side
   * @param type
   * @param timeInForce
   * @param quantity
   * @param price optional, must be provided for limit orders only
   * @param newClientOrderId optional, a unique id for the order. Automatically generated if not
   *     sent.
   * @param stopPrice optional, used with stop orders
   * @param icebergQty optional, used with iceberg orders
   * @param newOrderRespType optional, MARKET and LIMIT order types default to FULL, all other
   *     orders default to ACK
   * @param recvWindow optional
   * @param timestamp
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @POST
  @Path("api/v3/order")
  BinanceNewOrder newOrder(
      @FormParam("symbol") String symbol,
      @FormParam("side") OrderSide side,
      @FormParam("type") OrderType type,
      @FormParam("timeInForce") TimeInForce timeInForce,
      @FormParam("quantity") BigDecimal quantity,
      @FormParam("price") BigDecimal price,
      @FormParam("newClientOrderId") String newClientOrderId,
      @FormParam("stopPrice") BigDecimal stopPrice,
      @FormParam("icebergQty") BigDecimal icebergQty,
      @FormParam("newOrderRespType") BinanceNewOrder.NewOrderResponseType newOrderRespType,
      @FormParam("recvWindow") Long recvWindow,
      @FormParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Test new order creation and signature/recvWindow long. Creates and validates a new order but
   * does not send it into the matching engine.
   *
   * @param symbol
   * @param side
   * @param type
   * @param timeInForce
   * @param quantity
   * @param price
   * @param newClientOrderId optional, a unique id for the order. Automatically generated by
   *     default.
   * @param stopPrice optional, used with STOP orders
   * @param icebergQty optional used with icebergOrders
   * @param recvWindow optional
   * @param timestamp
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @POST
  @Path("api/v3/order/test")
  Object testNewOrder(
      @FormParam("symbol") String symbol,
      @FormParam("side") OrderSide side,
      @FormParam("type") OrderType type,
      @FormParam("timeInForce") TimeInForce timeInForce,
      @FormParam("quantity") BigDecimal quantity,
      @FormParam("price") BigDecimal price,
      @FormParam("newClientOrderId") String newClientOrderId,
      @FormParam("stopPrice") BigDecimal stopPrice,
      @FormParam("icebergQty") BigDecimal icebergQty,
      @FormParam("recvWindow") Long recvWindow,
      @FormParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Check an order's status.

   * Either orderId or origClientOrderId must be sent.
   *
   * @param symbol
   * @param orderId optional
   * @param origClientOrderId optional
   * @param recvWindow optional
   * @param timestamp
   * @param apiKey
   * @param signature
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @GET
  @Path("api/v3/order")
  BinanceOrder orderStatus(
      @QueryParam("symbol") String symbol,
      @QueryParam("orderId") long orderId,
      @QueryParam("origClientOrderId") String origClientOrderId,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Cancel an active order.
   *
   * @param symbol
   * @param orderId optional
   * @param origClientOrderId optional
   * @param newClientOrderId optional, used to uniquely identify this cancel. Automatically
   *     generated by default.
   * @param recvWindow optional
   * @param timestamp
   * @param apiKey
   * @param signature
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @DELETE
  @Path("api/v3/order")
  BinanceCancelledOrder cancelOrder(
      @QueryParam("symbol") String symbol,
      @QueryParam("orderId") long orderId,
      @QueryParam("origClientOrderId") String origClientOrderId,
      @QueryParam("newClientOrderId") String newClientOrderId,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Cancels all active orders on a symbol. This includes OCO orders.
   *
   * @param symbol
   * @param recvWindow optional
   * @param timestamp
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @DELETE
  @Path("api/v3/openOrders")
  List<BinanceCancelledOrder> cancelAllOpenOrders(
      @QueryParam("symbol") String symbol,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Get open orders on a symbol.
   *
   * @param symbol optional
   * @param recvWindow optional
   * @param timestamp
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @GET
  @Path("api/v3/openOrders")
  List<BinanceOrder> openOrders(
      @QueryParam("symbol") String symbol,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Get all account orders; active, canceled, or filled.

   * If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are
   * returned.
   *
   * @param symbol
   * @param orderId optional
   * @param limit optional
   * @param recvWindow optional
   * @param timestamp
   * @param apiKey
   * @param signature
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @GET
  @Path("api/v3/allOrders")
  List<BinanceOrder> allOrders(
      @QueryParam("symbol") String symbol,
      @QueryParam("orderId") Long orderId,
      @QueryParam("limit") Integer limit,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Get current account information.
   *
   * @param recvWindow optional
   * @param timestamp
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @GET
  @Path("api/v3/account")
  BinanceAccountInformation account(
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Get trades for a specific account and symbol.
   *
   * @param symbol
   * @param orderId optional
   * @param startTime optional
   * @param endTime optional
   * @param fromId optional, tradeId to fetch from. Default gets most recent trades.
   * @param limit optional, default 500; max 1000.
   * @param recvWindow optional
   * @param timestamp
   * @param apiKey
   * @param signature
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @GET
  @Path("api/v3/myTrades")
  List<BinanceTrade> myTrades(
      @QueryParam("symbol") String symbol,
      @QueryParam("orderId") Long orderId,
      @QueryParam("startTime") Long startTime,
      @QueryParam("endTime") Long endTime,
      @QueryParam("fromId") Long fromId,
      @QueryParam("limit") Integer limit,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Retrieves the dust log from Binance. If you have many currencies with low amount (=dust) that
   * cannot be traded, because their amount is less than the minimum amount required for trading
   * them, you can convert all these currencies at once into BNB with the button "Convert Small
   * Balance to BNB".
   *
   * @param startTime optional. If set, also the endTime must be set. If neither time is set, the
   *     100 most recent dust logs are returned.
   * @param endTime optional. If set, also the startTime must be set. If neither time is set, the
   *     100 most recent dust logs are returned.
   * @param recvWindow optional
   * @param timestamp mandatory
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @GET
  @Path("/sapi/v1/asset/dribblet")
  BinanceDustLog getDustLog(
      @QueryParam("startTime") Long startTime,
      @QueryParam("endTime") Long endTime,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Submit a withdraw request.
   *
   * @param coin
   * @param address
   * @param addressTag optional for Ripple
   * @param amount
   * @param name optional, description of the address
   * @param recvWindow optional
   * @param timestamp
   * @param apiKey
   * @param signature
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @POST
  @Path("/sapi/v1/capital/withdraw/apply")
  WithdrawResponse withdraw(
      @FormParam("coin") String coin,
      @FormParam("address") String address,
      @FormParam("addressTag") String addressTag,
      @FormParam("amount") BigDecimal amount,
      @FormParam("name") String name,
      @FormParam("recvWindow") Long recvWindow,
      @FormParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Fetch deposit history.
   *
   * @param coin optional
   * @param startTime optional
   * @param endTime optional
   * @param recvWindow optional
   * @param timestamp
   * @param apiKey
   * @param signature
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @GET
  @Path("/sapi/v1/capital/deposit/hisrec")
  List<BinanceDeposit> depositHistory(
      @QueryParam("coin") String coin,
      @QueryParam("startTime") Long startTime,
      @QueryParam("endTime") Long endTime,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Fetch withdraw history.
   *
   * @param coin optional
   * @param startTime optional
   * @param endTime optional
   * @param recvWindow optional
   * @param timestamp
   * @param apiKey
   * @param signature
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @GET
  @Path("/sapi/v1/capital/withdraw/history")
  List<BinanceWithdraw> withdrawHistory(
      @QueryParam("coin") String coin,
      @QueryParam("startTime") Long startTime,
      @QueryParam("endTime") Long endTime,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Fetch small amounts of assets exchanged BNB records.
   *
   * @param asset optional
   * @param startTime optional
   * @param endTime optional
   * @param recvWindow optional
   * @param timestamp
   * @param apiKey
   * @param signature
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @GET
  @Path("/sapi/v1/asset/assetDividend")
  AssetDividendResponse assetDividend(
      @QueryParam("asset") String asset,
      @QueryParam("startTime") Long startTime,
      @QueryParam("endTime") Long endTime,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  @GET
  @Path("/sapi/v1/sub-account/sub/transfer/history")
  List<TransferHistory> transferHistory(
      @QueryParam("fromEmail") String fromEmail,
      @QueryParam("startTime") Long startTime,
      @QueryParam("endTime") Long endTime,
      @QueryParam("page") Integer page,
      @QueryParam("limit") Integer limit,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  @GET
  @Path("/sapi/v1/sub-account/transfer/subUserHistory")
  List<TransferSubUserHistory> transferSubUserHistory(
      @QueryParam("asset") String asset,
      @QueryParam("type") Integer type,
      @QueryParam("startTime") Long startTime,
      @QueryParam("endTime") Long endTime,
      @QueryParam("limit") Integer limit,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Fetch deposit address.
   *
   * @param coin
   * @param recvWindow
   * @param timestamp
   * @param apiKey
   * @param signature
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @GET
  @Path("/sapi/v1/capital/deposit/address")
  DepositAddress depositAddress(
      @QueryParam("coin") String coin,
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Fetch asset details.
   *
   * @param recvWindow
   * @param timestamp
   * @param apiKey
   * @param signature
   * @return
   * @throws IOException
   * @throws BinanceException
   */
  @GET
  @Path("/sapi/v1/asset/assetDetail")
  Map<String, AssetDetail> assetDetail(
      @QueryParam("recvWindow") Long recvWindow,
      @QueryParam("timestamp") SynchronizedValueFactory<Long> timestamp,
      @HeaderParam(X_MBX_APIKEY) String apiKey,
      @QueryParam(SIGNATURE) ParamsDigest signature)
      throws IOException, BinanceException;

  /**
   * Returns a listen key for websocket login.
   *
   * @param apiKey the api key
   * @return
   * @throws BinanceException
   * @throws IOException
   */
  @POST
  @Path("/api/v3/userDataStream")
  BinanceListenKey startUserDataStream(@HeaderParam(X_MBX_APIKEY) String apiKey)
      throws IOException, BinanceException;

  /**
   * Keeps the authenticated websocket session alive.
   *
   * @param apiKey the api key
   * @param listenKey the api secret
   * @return
   * @throws BinanceException
   * @throws IOException
   */
  @PUT
  @Path("/api/v3/userDataStream?listenKey={listenKey}")
  Map<?, ?> keepAliveUserDataStream(
      @HeaderParam(X_MBX_APIKEY) String apiKey, @PathParam("listenKey") String listenKey)
      throws IOException, BinanceException;

  /**
   * Closes the websocket authenticated connection.
   *
   * @param apiKey the api key
   * @param listenKey the api secret
   * @return
   * @throws BinanceException
   * @throws IOException
   */
  @DELETE
  @Path("/api/v3/userDataStream?listenKey={listenKey}")
  Map<?, ?> closeUserDataStream(
      @HeaderParam(X_MBX_APIKEY) String apiKey, @PathParam("listenKey") String listenKey)
      throws IOException, BinanceException;
}


text:
// Copyright (c) 2003-present, Jodd Team (http://jodd.org)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

package jodd.util.collection;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.NoSuchElementException;

/**
  * Enumeration that combines multiple enumerations.
  */
public class CompositeEnumeration<T> implements Enumeration<T> {

	protected final List<Enumeration<T>> allEnumerations = new ArrayList<>();

	/**
	 * Creates new composite enumeration.
	 * Enumerations may be added using the {@link #add(Enumeration)} method.
	 */
	public CompositeEnumeration() {
	}

	/**
	 * Creates new composite enumeration with provided enumerations.
	 */
	public CompositeEnumeration(final Enumeration<T>... enumerations) {
		for (final Enumeration<T> enumeration : enumerations) {
			add(enumeration);
		}
	}

	/**
	 * Adds an enumeration to this composite.
	 */
	public void add(final Enumeration<T> enumeration) {
		if (allEnumerations.contains(enumeration)) {
			throw new IllegalArgumentException("Duplicate enumeration");
		}
		allEnumerations.add(enumeration);
	}

	// ---------------------------------------------------------------- interface

	protected int currentEnumeration = -1;

	/**
	 * Returns true if composite has more elements.
	 */
	public boolean hasMoreElements() {
		if (currentEnumeration == -1) {
			currentEnumeration = 0;
		}
		for (int i = currentEnumeration; i < allEnumerations.size(); i++) {
			final Enumeration<T> enumeration = allEnumerations.get(i);
			if (enumeration.hasMoreElements()) {
				currentEnumeration = i;
				return true;
			}
		}
		return false;
	}

	/**
	 * {@inheritDoc}
	 */
	public T nextElement() {
		if (!hasMoreElements()) {
			throw new NoSuchElementException();
		}

		return allEnumerations.get(currentEnumeration).nextElement();
	}

}


text:
require 'congress_v3/version'
require 'congress_v3/config'
require 'congress_v3/request'
require 'congress_v3/response'
require 'congress_v3/legislator'
require 'congress_v3/bill'
require 'congress_v3/vote'

module CongressV3
end


text:
module ResourceEvents
  class ChangeMilestoneService < BaseChangeTimeboxService
    attr_reader :milestone, :old_milestone

    def initialize(resource, user, created_at: Time.current, old_milestone:)
      super(resource, user, created_at: created_at)

      @milestone = resource&.milestone
      @old_milestone = old_milestone
    end

    private

    def create_event
      ResourceMilestoneEvent.create(build_resource_args)
    end

    def build_resource_args
      action = milestone.blank? ? :remove : :add

      super.merge({
        state: ResourceMilestoneEvent.states[resource.state],
        action: ResourceTimeboxEvent.actions[action],
        milestone_id: milestone.blank? ? old_milestone&.id : milestone&.id
      })
    end
  end
end


text:
package com.mit.dstore.entity;

import java.util.List;

import org.litepal.crud.DataSupport;

public class SellerInfoItem extends DataSupport{
	private List<SellerTypesItem> SellerType ;
	private List<SellerAreaItem> SellerArea ;
	public List<SellerTypesItem> getSellerType() {
		return SellerType;
	}
	public void setSellerType(List<SellerTypesItem> sellerType) {
		SellerType = sellerType;
	}
	public List<SellerAreaItem> getSellerArea() {
		return SellerArea;
	}
	public void setSellerArea(List<SellerAreaItem> sellerArea) {
		SellerArea = sellerArea;
	}

}


text:
lazyobject 0.0.1
================

A thread-safe LazyObject class for Python.

The LazyObject class is a wrapper for another
class that can be used to delay instantiation
of the wrapped class.

This was copied from Django and modified to add
thread safety.
https://github.com/django/django/blob/master/django/utils/functional.py

Why
---

This lets you create module-level objects
that will not initialize until first accessed.
This library simply adds thread-safety to Django's
version, to ensure that only 1 thread will initialize
the object.

Installation
------------

    pip install lazyobject

Usage
-----

    from lazyobject import ThreadSafeLazyObject

    class MyLazyClass(ThreadSafeLazyObject):
      def _setup(self):
        my_real_object = create_my_object()
        self._wrapped = my_real_object

    my_lazy_object = MyLazyClass()


text:
ActionController::Base.session = {
  :key         => '_oo_session',
  :secret      => '66e06b6c192f1d2310aa173d85b673c8cc9bdbb085eea31ba8b562749250b797084e83ef92c2b852aff3ae537c71f420fe349939108c97664c8243aefdc5cee6'
}

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
# ActionController::Base.session_store = :active_record_store


text:
//
//  SNFScreenshotManager.m
//  ScreenshotShare
//
//  Created by Seth Friedman on 5/22/14.
//  Copyright (c) 2014 Seth Friedman. All rights reserved.
//

#import "SNFScreenshotManager.h"

@import AssetsLibrary;

@interface SNFScreenshotManager () <UIAlertViewDelegate, UIActionSheetDelegate>

@property (weak, nonatomic) UIViewController *visibleViewController;

@end

@implementation SNFScreenshotManager

#pragma mark - Designated Initializer

- (id)init {
    self = [super init];

    if (self) {
        _enabled = NO;
    }

    return self;
}

- (void)dealloc {
    if (self.enabled) {
        [[NSNotificationCenter defaultCenter] removeObserver:self];
    }
}

#pragma mark - Singleton

+ (instancetype)sharedManager {
    static SNFScreenshotManager *_sharedManager;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _sharedManager = [[SNFScreenshotManager alloc] init];
    });

    return _sharedManager;
}

#pragma mark - Custom Getter

- (NSString *)photosPermissionMessage {
    if (!_photosPermissionMessage) {
        NSString *appName = [[NSBundle mainBundle] infoDictionary][@"CFBundleName"];

        _photosPermissionMessage = [NSString stringWithFormat:@"%@ allows you to quickly do things with your screenshots, like message them to a friend. To allow this, please give the app permission to access your photos when the next alert pops up.", appName];
    }

    return _photosPermissionMessage;
}

- (NSArray *)excludedActivityTypes {
    if (!_excludedActivityTypes) {
        _excludedActivityTypes = @[UIActivityTypeSaveToCameraRoll];
    }

    return _excludedActivityTypes;
}

#pragma mark - Custom Setter

- (void)setEnabled:(BOOL)enabled {
    if (_enabled != enabled) {
        _enabled = enabled;

        if (_enabled) {
            [[NSNotificationCenter defaultCenter] addObserver:self
                                                     selector:@selector(displayActionSheet)
                                                         name:UIApplicationUserDidTakeScreenshotNotification
                                                       object:nil];
        } else {
            [[NSNotificationCenter defaultCenter] removeObserver:self];
        }
    }
}

#pragma mark - Instance Methods

/**
 *  Displays a `UIActionSheet` in the `visibleViewController` that gives the user
 *  the option to share the screenshot that they just took.
 */
- (void)displayActionSheet {
    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Screenshot"
                                                             delegate:self
                                                    cancelButtonTitle:@"Cancel"
                                               destructiveButtonTitle:nil
                                                    otherButtonTitles:@"Share", nil];

    UIWindow *currentWindow = [UIApplication sharedApplication].keyWindow;
    UIViewController *rootViewController = currentWindow.rootViewController;

    if ([rootViewController isKindOfClass:[UINavigationController class]]) {
        self.visibleViewController = ((UINavigationController *)rootViewController).visibleViewController;
    } else if ([rootViewController isKindOfClass:[UITabBarController class]]) {
        self.visibleViewController = ((UITabBarController *)rootViewController).selectedViewController;
    } else {
        self.visibleViewController = rootViewController;
    }

    [actionSheet showInView:self.visibleViewController.view];
}

/**
 *  Calls `shareScreenshot` if the user has given permission to access the
 *  Camera Roll. If the user has not yet been asked for permission, the user is
 *  prompted for permission using Cluster's method. The method is a no-op if the
 *  user has denied or restricted permission.
 */
- (void)shareScreenshotIfPermitted {
    ALAuthorizationStatus authorizationStatus = [ALAssetsLibrary authorizationStatus];

    if (authorizationStatus != ALAuthorizationStatusDenied && authorizationStatus != ALAuthorizationStatusRestricted) {
        // Check if the user has been asked for permission yet
        if (authorizationStatus == ALAuthorizationStatusNotDetermined) {
            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Permission Needed"
                                                                message:self.photosPermissionMessage
                                                               delegate:nil
                                                      cancelButtonTitle:@"OK"
                                                      otherButtonTitles:nil];

            alertView.delegate = self;

            [alertView show];
        } else {
            [self shareScreenshot];
        }
    }
}

/**
 *  Fetches the screenshot just taken and displays a `UIActivityViewController`
 *  for the user to do something with that screenshot.
 */
- (void)shareScreenshot {
    [self latestPhotoWithCompletionBlock:^(UIImage *photo, NSError *error) {
        if (photo) {
            [self displayActivityViewControllerInViewController:self.visibleViewController
                                              withActivityItems:@[photo]];
        } else {
            NSLog(@"Photo Error: %@", [error description]);
        }
    }];
}

/**
 *  Fetches, at full resolution, the latest photo taken on the device.
 *
 *  @param completionBlock The block to be executed upon fetching the `UIImage`
 *                         object, with an `NSError` if necessary. Called on
 *                         the main thread.
 */
- (void)latestPhotoWithCompletionBlock:(void (^)(UIImage *photo, NSError *error))completionBlock {
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
        UIImage * __block latestPhoto;

        ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];

        [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos
                               usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
                                   [group setAssetsFilter:[ALAssetsFilter allPhotos]];

                                   [group enumerateAssetsWithOptions:NSEnumerationReverse
                                                          usingBlock:^(ALAsset *result, NSUInteger index, BOOL *innerStop) {
                                                              if (result) {
                                                                  CGImageRef fullResolutionImageRef = [[result defaultRepresentation] fullResolutionImage];
                                                                  latestPhoto = [UIImage imageWithCGImage:fullResolutionImageRef];

                                                                  *innerStop = YES;
                                                                  *stop = YES;

                                                                  dispatch_async(dispatch_get_main_queue(), ^{
                                                                      completionBlock(latestPhoto, nil);
                                                                  });
                                                              }
                                                          }];
                               } failureBlock:^(NSError *error) {
                                   dispatch_async(dispatch_get_main_queue(), ^{
                                       completionBlock(nil, error);
                                   });
                               }];
    });
}

/**
 *  Creates and presents a simple `UIActivityViewController` using
 *  `applicationActivities` and `excludedActivityTypes`.
 *
 *  @param viewController The view controller that should present the
 *                        `UIAcitivityViewController`.
 *  @param activityItems  The array of data objects on which to perform the
 *                        activity. See the `UIActivityViewController`
 *                        documentation for more information.
 */
- (void)displayActivityViewControllerInViewController:(UIViewController *)viewController withActivityItems:(NSArray *)activityItems {
    UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems
                                                                                applicationActivities:self.applicationActivities];
    activityViewController.excludedActivityTypes = self.excludedActivityTypes;

    [viewController presentViewController:activityViewController
                                 animated:YES
                               completion:nil];
}

#pragma mark - Alert View Delegate

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
    [self shareScreenshot];
}

#pragma mark - Action Sheet Delegate

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
    switch (buttonIndex) {
        case 0: // Share
            [self shareScreenshotIfPermitted];
            break;

        default: // Cancel
            break;
    }
}

@end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
La Cellule 33: 265 (1923)

#### Original name
Penicillium rubens Biourge

### Remarks
null


text:
package org.almiso.pattern.patterns.observer.example2;

import org.almiso.pattern.utils.Logger;

/**
 * Created by Alexandr on 05.07.16.
 */
public class SilentClient implements TwitterListener {

    private static final String TAG = SilentClient.class.getSimpleName();
    private Server server;

    public SilentClient(Server server) {
        this.server = server;
    }

    @Override
    public void onNewTweets() {
        Logger.d(TAG, "I do not care about new tweets!");
    }
}


text:
Module('App.Filter', function (Filter) {
  Filter.fn.initialize = function () {
    this.$filterToggle  = $('.js-filter-toggle');
    this.$filterWrapper = $('.js-filter-wrapper');

    this.$filterToggle.on('click', $.proxy(this.toggleFilter, this));
  };

  Filter.fn.toggleFilter = function (event) {
    event.preventDefault();
    this.$filterWrapper.slideToggle();
  };
});


text:
Address Type
------------

Address type is the entity that is used to specify type of address. Address can have several address types.
Be default there are two address types - billing and shipping. Address type entity called AddressType
and stored in Oro/Bundle/AddressBundle/Entity/AddressType.php. It has two properties:
"name" that defined symbolic name of type and "label" that is used at frontend.
Address types are translatable entities - their label should be defined for each supported locale.
Loading and translation of address types performed in data fixture
Oro/Bundle/AddressBundle/Data/ORM/LoadAddressTypeData.php.

There is abstract address entity that support types - AbstractTypedAddress.
It has property "types" and methods to work with it, but DB relation between address and address type
must be defined in specific class:

``` php
/**
 * @var Collection
 *
 * @ORM\ManyToMany(targetEntity="Oro\Bundle\AddressBundle\Entity\AddressType")
 * @ORM\JoinTable(
 *     name="orocrm_contact_address_to_address_type",
 *     joinColumns={@ORM\JoinColumn(name="contact_address_id", referencedColumnName="id")},
 *     inverseJoinColumns={@ORM\JoinColumn(name="type_name", referencedColumnName="name")}
 * )
 **/
protected $types;
```


text:
As of Sprint 13, Brackets has a new [CEF3-based application shell](https://github.com/adobe/brackets-shell). Please use the new shell for all development.

For general information on Brackets, see the [brackets repo](https://github.com/adobe/brackets) or [brackets.io](http://brackets.io).

Please don't file bugs in this repo--instead, file them in the brackets repo:
https://github.com/adobe/brackets/issues


text:
package com.example.greatbook.local.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.example.greatbook.R;
import com.example.greatbook.databinding.ActivityAllLocalRecordBinding;
import com.example.greatbook.local.fragment.LocalRecordBigFragment;
import com.example.greatbook.local.fragment.LocalRecordSmallFragment;
import com.example.greatbook.widght.DefaultNavigationBar;

/**
 * Created by MDove on 2017/8/13.
 */

public class AllLocalRecordActivity extends AppCompatActivity {
    private LocalRecordBigFragment mBigFragment;
    private LocalRecordSmallFragment mSmallFragment;
    private ActivityAllLocalRecordBinding mBinding;

    private String[] fragTitles = {"段子详情", "段子简介"};

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_all_local_record);
        init();
    }

    public void init() {
        new DefaultNavigationBar.Builder(this,null)
                .setLeftResId(R.drawable.btn_back_)
                .setOnLeftClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        finish();
                    }
                })
                .setTitleText("我的全部短句")
                .builder();

        mSmallFragment = LocalRecordSmallFragment.newInstance();
        mBigFragment = LocalRecordBigFragment.newInstance();

        mBinding.viewPager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
            @Override
            public Fragment getItem(int position) {
                if (position == 0) {
                    return mBigFragment;
                }
                return mSmallFragment;
            }

            @Override
            public int getCount() {
                return fragTitles.length;
            }

            @Override
            public CharSequence getPageTitle(int position) {
                return fragTitles[position];
            }
        });
        mBinding.tabLayout.setupWithViewPager(mBinding.viewPager);
    }
}


text:
using System.Collections.Generic;
using Azure.Core;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.SecurityCenter.Models;

namespace Azure.ResourceManager.SecurityCenter
{
    /// <summary> A class representing the IotSecurityAggregatedRecommendation data model. </summary>
    public partial class IotSecurityAggregatedRecommendationData : ResourceData
    {
        /// <summary> Initializes a new instance of IotSecurityAggregatedRecommendationData. </summary>
        public IotSecurityAggregatedRecommendationData()
        {
            Tags = new ChangeTrackingDictionary<string, string>();
        }

        /// <summary> Initializes a new instance of IotSecurityAggregatedRecommendationData. </summary>
        /// <param name="id"> The id. </param>
        /// <param name="name"> The name. </param>
        /// <param name="resourceType"> The resourceType. </param>
        /// <param name="systemData"> The systemData. </param>
        /// <param name="recommendationName"> Name of the recommendation. </param>
        /// <param name="recommendationDisplayName"> Display name of the recommendation type. </param>
        /// <param name="description"> Description of the suspected vulnerability and meaning. </param>
        /// <param name="recommendationTypeId"> Recommendation-type GUID. </param>
        /// <param name="detectedBy"> Name of the organization that made the recommendation. </param>
        /// <param name="remediationSteps"> Recommended steps for remediation. </param>
        /// <param name="reportedSeverity"> Assessed recommendation severity. </param>
        /// <param name="healthyDevices"> Number of healthy devices within the IoT Security solution. </param>
        /// <param name="unhealthyDeviceCount"> Number of unhealthy devices within the IoT Security solution. </param>
        /// <param name="logAnalyticsQuery"> Log analytics query for getting the list of affected devices/alerts. </param>
        /// <param name="tags"> Resource tags. </param>
        internal IotSecurityAggregatedRecommendationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string recommendationName, string recommendationDisplayName, string description, string recommendationTypeId, string detectedBy, string remediationSteps, ReportedSeverity? reportedSeverity, long? healthyDevices, long? unhealthyDeviceCount, string logAnalyticsQuery, IDictionary<string, string> tags) : base(id, name, resourceType, systemData)
        {
            RecommendationName = recommendationName;
            RecommendationDisplayName = recommendationDisplayName;
            Description = description;
            RecommendationTypeId = recommendationTypeId;
            DetectedBy = detectedBy;
            RemediationSteps = remediationSteps;
            ReportedSeverity = reportedSeverity;
            HealthyDevices = healthyDevices;
            UnhealthyDeviceCount = unhealthyDeviceCount;
            LogAnalyticsQuery = logAnalyticsQuery;
            Tags = tags;
        }

        /// <summary> Name of the recommendation. </summary>
        public string RecommendationName { get; set; }
        /// <summary> Display name of the recommendation type. </summary>
        public string RecommendationDisplayName { get; }
        /// <summary> Description of the suspected vulnerability and meaning. </summary>
        public string Description { get; }
        /// <summary> Recommendation-type GUID. </summary>
        public string RecommendationTypeId { get; }
        /// <summary> Name of the organization that made the recommendation. </summary>
        public string DetectedBy { get; }
        /// <summary> Recommended steps for remediation. </summary>
        public string RemediationSteps { get; }
        /// <summary> Assessed recommendation severity. </summary>
        public ReportedSeverity? ReportedSeverity { get; }
        /// <summary> Number of healthy devices within the IoT Security solution. </summary>
        public long? HealthyDevices { get; }
        /// <summary> Number of unhealthy devices within the IoT Security solution. </summary>
        public long? UnhealthyDeviceCount { get; }
        /// <summary> Log analytics query for getting the list of affected devices/alerts. </summary>
        public string LogAnalyticsQuery { get; }
        /// <summary> Resource tags. </summary>
        public IDictionary<string, string> Tags { get; }
    }
}


text:
package org.apache.cassandra.gms;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;

import org.junit.BeforeClass;
import org.junit.Test;

import org.apache.cassandra.Util;
import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.dht.IPartitioner;
import org.apache.cassandra.dht.RandomPartitioner;
import org.apache.cassandra.dht.Token;
import org.apache.cassandra.locator.TokenMetadata;
import org.apache.cassandra.service.StorageService;

import static org.junit.Assert.assertFalse;

public class FailureDetectorTest
{
    @BeforeClass
    public static void setup()
    {
        // slow unit tests can cause problems with FailureDetector's GC pause handling
        System.setProperty("cassandra.max_local_pause_in_ms", "20000");
        DatabaseDescriptor.daemonInitialization();
        DatabaseDescriptor.createAllDirectories();
    }

    @Test
    public void testConvictAfterLeft() throws UnknownHostException
    {
        StorageService ss = StorageService.instance;
        TokenMetadata tmd = ss.getTokenMetadata();
        tmd.clearUnsafe();
        IPartitioner partitioner = new RandomPartitioner();
        VersionedValue.VersionedValueFactory valueFactory = new VersionedValue.VersionedValueFactory(partitioner);

        ArrayList<Token> endpointTokens = new ArrayList<>();
        ArrayList<Token> keyTokens = new ArrayList<>();
        List<InetAddress> hosts = new ArrayList<>();
        List<UUID> hostIds = new ArrayList<>();

        // we want to convict if there is any heartbeat data present in the FD
        DatabaseDescriptor.setPhiConvictThreshold(0);

        // create a ring of 2 nodes
        Util.createInitialRing(ss, partitioner, endpointTokens, keyTokens, hosts, hostIds, 3);

        InetAddress leftHost = hosts.get(1);

        FailureDetector.instance.report(leftHost);

        // trigger handleStateLeft in StorageService
        ss.onChange(leftHost, ApplicationState.STATUS,
                    valueFactory.left(Collections.singleton(endpointTokens.get(1)), Gossiper.computeExpireTime()));

        // confirm that handleStateLeft was called and leftEndpoint was removed from TokenMetadata
        assertFalse("Left endpoint not removed from TokenMetadata", tmd.isMember(leftHost));

        // confirm the FD's history for leftHost didn't get wiped by status jump to LEFT
        FailureDetector.instance.interpret(leftHost);
        assertFalse("Left endpoint not convicted", FailureDetector.instance.isAlive(leftHost));
    }
}


text:
This is for learning how to use NSURLConnection to upload a image file to backend serve.

# Third Party Repos
- JSImagePickerViewController
- TCBlobDownload

# Credit
If you have any idea or request, please suggest it!


text:
package me.anchore.snippet.pattern.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.List;

/**
 * @author anchore
 * @date 2018/7/15
 */
public class JdkProxy {
    /**
     * jdk代理增强对象接口行为
     */
    private static void proxy() {
        @SuppressWarnings("unchecked")
        List<Object> objects = (List<Object>) Proxy.newProxyInstance(
                Thread.currentThread().getContextClassLoader(),
                new Class[]{List.class}, new InvocationHandler() {
                    List<Object> proxyee = new ArrayList<>();

                    @Override
                    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                        Object returned = method.invoke(proxyee, args);
                        if (method.equals(List.class.getDeclaredMethod("add", Object.class))) {
                            System.out.println("current size: " + proxyee.size());
                            return returned;
                        }
                        return returned;
                    }
                });

        objects.add(new Object());
        objects.add(new Object());
        objects.clear();
        objects.add(new Object());
    }

    public static void main(String[] args) {
        proxy();
    }
}


text:
<?php
/**
 * Created by gitkv.
 * E-mail: gitkv@ya.ru
 * GitHub: gitkv
 */

namespace Tmconsulting\Uniteller\Signature;

/**
 * Class Signature
 *
 * @package Tmconsulting\Client
 */
final class SignaturePayment extends AbstractSignature
{

    /**
     * @var string
     */
    protected $shopIdp;

    /**
     * @var string
     */
    protected $orderIdp;

    /**
     * @var string
     */
    protected $subtotalP;

    /**
     * @var string
     */
    protected $meanType;

    /**
     * @var string
     */
    protected $eMoneyType;

    /**
     * @var string
     */
    protected $lifeTime;

    /**
     * @var string
     */
    protected $customerIdp;

    /**
     * @var string
     */
    protected $cardIdp;

    /**
     * @var string
     */
    protected $iData;

    /**
     * @var string
     */
    protected $ptCode;

    /**
     * @var string
     */
    protected $password;

    /**
     * @param string $shopIdp
     * @return SignaturePayment
     */
    public function setShopIdp($shopIdp)
    {
        $this->shopIdp = $shopIdp;

        return $this;
    }

    /**
     * @param string $orderIdp
     * @return SignaturePayment
     */
    public function setOrderIdp($orderIdp)
    {
        $this->orderIdp = $orderIdp;

        return $this;
    }

    /**
     * @param string $subtotalP
     * @return SignaturePayment
     */
    public function setSubtotalP($subtotalP)
    {
        $this->subtotalP = $subtotalP;

        return $this;
    }

    /**
     * @param string $meanType
     * @return SignaturePayment
     */
    public function setMeanType($meanType)
    {
        $this->meanType = $meanType;

        return $this;
    }

    /**
     * @param string $eMoneyType
     * @return SignaturePayment
     */
    public function setEMoneyType($eMoneyType)
    {
        $this->eMoneyType = $eMoneyType;

        return $this;
    }

    /**
     * @param string $lifeTime
     * @return SignaturePayment
     */
    public function setLifeTime($lifeTime)
    {
        $this->lifeTime = $lifeTime;

        return $this;
    }

    /**
     * @param string $customerIdp
     * @return SignaturePayment
     */
    public function setCustomerIdp($customerIdp)
    {
        $this->customerIdp = $customerIdp;

        return $this;
    }

    /**
     * @param string $cardIdp
     * @return SignaturePayment
     */
    public function setCardIdp($cardIdp)
    {
        $this->cardIdp = $cardIdp;

        return $this;
    }

    /**
     * @param string $iData
     * @return SignaturePayment
     */
    public function setIData($iData)
    {
        $this->iData = $iData;

        return $this;
    }

    /**
     * @param string $ptCode
     * @return SignaturePayment
     */
    public function setPtCode($ptCode)
    {
        $this->ptCode = $ptCode;

        return $this;
    }

    /**
     * @param string $password
     * @return SignaturePayment
     */
    public function setPassword($password)
    {
        $this->password = $password;

        return $this;
    }

    /**
     * @return string
     */
    public function getShopIdp()
    {
        return $this->shopIdp;
    }

    /**
     * @return string
     */
    public function getOrderIdp()
    {
        return $this->orderIdp;
    }

    /**
     * @return string
     */
    public function getSubtotalP()
    {
        return $this->subtotalP;
    }

    /**
     * @return string
     */
    public function getMeanType()
    {
        return $this->meanType;
    }

    /**
     * @return string
     */
    public function getEMoneyType()
    {
        return $this->eMoneyType;
    }

    /**
     * @return string
     */
    public function getLifeTime()
    {
        return $this->lifeTime;
    }

    /**
     * @return string
     */
    public function getCustomerIdp()
    {
        return $this->customerIdp;
    }

    /**
     * @return string
     */
    public function getCardIdp()
    {
        return $this->cardIdp;
    }

    /**
     * @return string
     */
    public function getIData()
    {
        return $this->iData;
    }

    /**
     * @return string
     */
    public function getPtCode()
    {
        return $this->ptCode;
    }

    /**
     * @return string
     */
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * @return array
     */
    public function toArray()
    {
        $array = [];
        $array['Shop_IDP'] = $this->getShopIdp();
        $array['Order_IDP'] = $this->getOrderIdp();
        $array['Subtotal_P'] = $this->getSubtotalP();
        $array['MeanType'] = $this->getMeanType();
        $array['EMoneyType'] = $this->getEMoneyType();
        $array['Lifetime'] = $this->getLifeTime();
        $array['Customer_IDP'] = $this->getCustomerIdp();
        $array['Card_IDP'] = $this->getCardIdp();
        $array['IData'] = $this->getIData();
        $array['PT_Code'] = $this->getPtCode();
        $array['Password'] = $this->getPassword();

        return $array;
    }
}


text:
using UnityEditor;
using UnityEngine;

namespace RichJoslin
{
	namespace Pooling
	{
		[CustomPropertyDrawer(typeof(Poolable))]
		public class PoolableDrawer  : PropertyDrawer
		{
			public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
			{
				return label != GUIContent.none && Screen.width < 333 ? (16f + 18f) : 16f;
			}

			public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
			{
				label = EditorGUI.BeginProperty(position, label, property);

				Rect contentPosition = EditorGUI.PrefixLabel(position, label);

				if (Application.isPlaying)
				{
					GameObject prefab = property.FindPropertyRelative("prefab").objectReferenceValue as GameObject;

					if (prefab!=null && PoolManager.I != null && PoolManager.I.GetPooler(prefab) != null)
					{
						float totalWidth = contentPosition.width - 180f;
						float nameWidth = totalWidth * 0.4f;
						float prefabWidth = totalWidth * 0.4f;
						float spawnedWidth = totalWidth * 0.1f;
						float usedWidth = totalWidth * 0.1f;

						GUI.enabled = false;

						contentPosition.width = 26f;
						EditorGUI.LabelField(contentPosition, "Key");
						contentPosition.x += 26f;

						contentPosition.width = nameWidth;
						EditorGUI.PropertyField(contentPosition, property.FindPropertyRelative("key"), GUIContent.none);
						contentPosition.x += nameWidth + 15f;

						contentPosition.width = 40f;
						EditorGUI.LabelField(contentPosition, "Prefab");
						contentPosition.x += 40f;

						contentPosition.width = prefabWidth;
						EditorGUI.PropertyField(contentPosition, property.FindPropertyRelative("prefab"), GUIContent.none);
						contentPosition.x += prefabWidth + 15f;

						contentPosition.width = 55f;
						EditorGUI.LabelField(contentPosition, "Spawned");
						contentPosition.x += 55f;

						contentPosition.width = spawnedWidth;
						EditorGUI.IntField(contentPosition,  GUIContent.none, PoolManager.I.GetPooler(prefab).poolSize);
						contentPosition.x += spawnedWidth;

						contentPosition.width = 30f;
						EditorGUI.LabelField(contentPosition, "Used");
						contentPosition.x += 30f;

						contentPosition.width = usedWidth;
						EditorGUI.IntField(contentPosition, GUIContent.none, PoolManager.I.GetPooler(prefab).used);
						contentPosition.x += usedWidth;

						GUI.enabled = true;
					}
				}
				else
				{
					float totalWidth = contentPosition.width - 180f;
					float nameWidth = totalWidth * 0.45f;
					float prefabWidth = totalWidth * 0.45f;
					float amountWidth = totalWidth * 0.1f;

					contentPosition.width = 26f;
					EditorGUI.LabelField(contentPosition, "Key");
					contentPosition.x += 26f;

					contentPosition.width = nameWidth;
					EditorGUI.PropertyField(contentPosition, property.FindPropertyRelative("key"), GUIContent.none);
					contentPosition.x += nameWidth + 15f;

					contentPosition.width = 40f;
					EditorGUI.LabelField(contentPosition, "Prefab");
					contentPosition.x += 40f;

					contentPosition.width = prefabWidth;
					EditorGUI.PropertyField(contentPosition, property.FindPropertyRelative("prefab"), GUIContent.none);
					contentPosition.x += prefabWidth + 15f;

					contentPosition.width = 50f;
					EditorGUI.LabelField(contentPosition, "Amount");
					contentPosition.x += 50f;

					contentPosition.width = amountWidth;
					EditorGUI.PropertyField(contentPosition, property.FindPropertyRelative("amountToSpawn"), GUIContent.none);
					contentPosition.x += amountWidth;
				}

				EditorGUI.EndProperty();
			}
		}
	}
}


text:
Capture whatever your mac is playing to a .wav file on your Desktop—as simply as a screenshot.

![](screenshot.png)

(This is alpha software. It will cause your computer to catch fire. 🔥)

#### Installation

##### Sierra
It's alive! Takes a few additional steps but unsigned kexts can be run if you complete the following steps.

1. Restart computer in recovery mode ```⌘R```

2. In Terminal type

   ```csrutil disable```

3. Restart computer

4. Run Installer

##### El Capitan

**NB: WavTap is completely broken on El Capitan** due to Apple's [System Integrity Protection](https://en.wikipedia.org/wiki/System_Integrity_Protection). The next release of WavTap will fix this.

##### Yosemite

As of Yosemite, Apple bans drivers that haven't received explicit approval from Apple. The only workaround I'm aware of is to set a system flag to [globally allow **all** unsigned kernel extensions](http://apple.stackexchange.com/questions/163059/how-can-i-disable-kext-signing-in-mac-os-x-10-10-yosemite). This means WavTap *will not work* unless you've enabled `kext-dev-mode`, using something like this:

```shell
sudo nvram boot-args=kext-dev-mode=1
```

Yes, [this sucks](https://www.gnu.org/philosophy/can-you-trust.html).

Once that's done, run the [installer](https://github.com/pje/WavTap/releases/download/0.3.0/WavTap.0.3.0.pkg).

#### Uninstallation

`make uninstall` removes everything

##### Nerd Corner

WavTap began as a fork of [Soundflower](https://github.com/Cycling74/Soundflower). thanks to [Cycling '74](http://cycling74.com), [tap](http://github.com/tap), [ma++ ingalls](http://sfsound.org/matt.html), and everyone else who's contributed to it.


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="manhattan.porter.stemmer.listener.class">Manhattan\PorterStemmerBundle\EventListener\StemmerListener</parameter>
        <parameter key="manhattan.porter.stemmer.class">Manhattan\PorterStemmerBundle\Tools\PorterStemmer</parameter>
        <parameter key="manhattan.porter.adapter.class">Manhattan\PorterStemmerBundle\Adapter\ORM\DoctrineAdapter</parameter>
        <parameter key="manhattan.porter.component.annotation.class">Manhattan\PorterStemmerBundle\Component\AnnotationParser</parameter>
        <parameter key="porter.stemmer.class">Porter</parameter>
    </parameters>

    <services>
        <service id="porter.stemmer" class="%porter.stemmer.class%" />

        <service id="manhattan.porter.stemmer" class="%manhattan.porter.stemmer.class%">
            <argument type="service" id="porter.stemmer" />
        </service>

        <service id="porter.stemmer.adapter" class="%manhattan.porter.adapter.class%">
            <argument type="service" id="manhattan.porter.stemmer" />
        </service>

        <service id="porter.stemmer.annotation.component" class="%manhattan.porter.component.annotation.class%">
            <argument type="service" id="annotation_reader" />
        </service>

        <service id="manhattan.porter.stemmer.listener" class="%manhattan.porter.stemmer.listener.class%">
            <argument type="service" id="porter.stemmer.annotation.component" />
            <argument type="service" id="porter.stemmer.adapter" />
            <tag name="doctrine.event_subscriber" />
        </service>
    </services>

</container>


text:
package org.github.dtsopensource.core.rule.help;

import org.github.dtsopensource.core.dao.dataobject.DtsActivityRuleDO;
import org.github.dtsopensource.server.share.rule.entity.ActivityRuleEntity;

/**
 * @author ligaofeng 2016年12月17日 下午2:20:36
 */
public class ActivityRuleHelper {

    private ActivityRuleHelper() {
    }

    /**
     * @param activityRuleDO
     * @return
     */
    public static ActivityRuleEntity toActivityRuleEntity(DtsActivityRuleDO activityRuleDO) {
        return new ActivityRuleEntity.Builder(activityRuleDO.getBizType()).setApp(activityRuleDO.getApp())
                .setAppCname(activityRuleDO.getAppCname()).setBizTypeName(activityRuleDO.getBizTypeName()).build();
    }

}


text:
'use strict';
var requirejs = require("requirejs");
requirejs.config({
    baseUrl: './src',
    nodeRequire: require
});

describe('Load Modules', function () {
    it('should load the matrix module', function () {
        var mod;
        var done = function() {
            mod.should.not.equal(undefined);
        };
        requirejs(['algebra'], function(m) {
            mod = m;
            done();
        });
    });

    it('should load the ode module', function () {
        var mod;
        var done = function() {
            mod.should.not.equal(undefined);
        };
        requirejs(['ode'], function(m) {
            mod = m;
            done();
        });
    });

    it('should load the stochastics module', function () {
        var mod;
        var done = function() {
            mod.should.not.equal(undefined);
        };
        requirejs(['stochastics'], function(m) {
            mod = m;
            done();
        });
    });

});


text:
'use strict'

const cli = require('heroku-cli-util')

function dropboxURL (url) {
  // Force a dump file to download instead of rendering as HTML
  // file by specifying the dl=1 param for Dropbox URL
  if (url.match(/^https?:\/\/www\.dropbox\.com/) && !url.endsWith('dl=1')) {
    if (url.endsWith('dl=0')) url = url.replace('dl=0', 'dl=1')
    else if (url.includes('?')) url += '&dl=1'
    else url += '?dl=1'
  }
  return url
}

async function run(context, heroku) {
  const pgbackups = require('../../lib/pgbackups')(context, heroku)
  const fetcher = require('../../lib/fetcher')(heroku)
  const host = require('../../lib/host')
  const { sortBy } = require('lodash')

  const { app, args, flags } = context
  const interval = Math.max(3, parseInt(flags['wait-interval'])) || 3
  const db = await fetcher.addon(app, args.database)

  let backupURL
  let backupName = args.backup

  if (backupName && backupName.match(/^https?:\/\//)) {
    backupURL = dropboxURL(backupName)
  } else {
    let backupApp
    if (backupName && backupName.match(/::/)) {
      [backupApp, backupName] = backupName.split('::')
    } else {
      backupApp = app
    }
    let transfers = await heroku.get(`/client/v11/apps/${backupApp}/transfers`, { host: host() })
    let backups = transfers.filter(t => t.from_type === 'pg_dump' && t.to_type === 'gof3r')
    let backup
    if (backupName) {
      backup = backups.find(b => pgbackups.transfer.name(b) === backupName)
      if (!backup) throw new Error(`Backup ${cli.color.cyan(backupName)} not found for ${cli.color.app(backupApp)}`)
      if (!backup.succeeded) throw new Error(`Backup ${cli.color.cyan(backupName)} for ${cli.color.app(backupApp)} did not complete successfully`)
    } else {
      backup = sortBy(backups.filter(b => b.succeeded), 'finished_at').pop()
      if (!backup) throw new Error(`No backups for ${cli.color.app(backupApp)}. Capture one with ${cli.color.cmd('heroku pg:backups:capture')}`)
      backupName = pgbackups.transfer.name(backup)
    }
    backupURL = backup.to_url
  }

  await cli.confirmApp(app, flags.confirm)
  let restore
  await cli.action(`Starting restore of ${cli.color.cyan(backupName)} to ${cli.color.addon(db.name)}`, async function () {
    restore = await heroku.post(`/client/v11/databases/${db.id}/restores`, {
      body: { backup_url: backupURL },
      host: host(db)
    })
  }())
  cli.log(`
Use Ctrl-C at any time to stop monitoring progress; the backup will continue restoring.
Use ${cli.color.cmd('heroku pg:backups')} to check progress.
Stop a running restore with ${cli.color.cmd('heroku pg:backups:cancel')}.
`)

  await pgbackups.wait('Restoring', restore.uuid, interval, flags.verbose, db.app.name)
}

module.exports = {
  topic: 'pg',
  command: 'backups:restore',
  description: 'restore a backup (default latest) to a database',
  help: 'defaults to saving the latest database to DATABASE_URL',
  needsApp: true,
  needsAuth: true,
  args: [
    { name: 'backup', optional: true },
    { name: 'database', optional: true }
  ],
  flags: [
    { name: 'wait-interval', hasValue: true },
    { name: 'verbose', char: 'v' },
    { name: 'confirm', char: 'c', hasValue: true }
  ],
  run: cli.command({ preauth: true }, run)
}


text:
Utility library for go

Currently contains:
	-Modified json marshaler, to enable lowercase json fields