text:
// stdlib includes

// barrelfish includes

// lwip includes
#include "lwip/init.h"
#include "lwip/netif.h"
#include "lwip/ip.h"
#include "lwip/dhcp.h"
#include "lwip/prot/ethernet.h"
#include "lwip/timeouts.h"

#include <barrelfish/barrelfish.h>
#include <barrelfish/deferred.h>
#include <barrelfish/waitset.h>
#include <barrelfish/waitset_chan.h>

#include <net/net_filter.h>
#include <net_sockets/net_sockets.h>
#include <net_interfaces/flags.h>
#include "networking_internal.h"
#include "net_queue_internal.h"

struct net_state state = {0};
struct waitset_chanstate net_loopback_poll_channel;
struct deferred_event net_lwip_timer;

#define NETWORKING_DEFAULT_QUEUE_ID 0
#define NETWORKING_BUFFER_COUNT (4096 * 3)
#define NETWORKING_BUFFER_RX_POPULATE (4096 - 10)
#define NETWORKING_BUFFER_SIZE  2048

static const char* default_name = "net_sockets_server";

#define NETDEBUG_SUBSYSTEM "net"

/**
 * @brief obtains the default setting for initializaion of the driver
 *
 * @param queue     returns the queue to be used
 * @param cardname  returns the card name to be used
 *
 * @return SYS_ERR_OK on success, SKB_ERR_* on failure
 */
errval_t networking_get_defaults(uint64_t *queue, const char **cardname, uint32_t *flags)
{
    /* TODO: get some reasonable values */

    *queue = NETWORKING_DEFAULT_QUEUE_ID;
    *cardname = default_name;
    *flags = NET_FLAGS_POLLING | NET_FLAGS_BLOCKING_INIT;

    return SYS_ERR_OK;
}

static void int_handler(void* args)
{
    NETDEBUG("Enter int_handler!\n");
    struct net_state *st = devq_get_state(args);

    if (st) {
        net_if_poll(&st->netif);
        net_lwip_timeout();
    }
}

static void net_loopback_poll(void *arg)
{
    netif_poll_all();
    net_lwip_timeout();
}

void net_if_trigger_loopback(void)
{
    errval_t err;

    err = waitset_chan_trigger(&net_loopback_poll_channel);
    assert(err_is_ok(err));
}

void net_lwip_timeout(void)
{
    errval_t err;

    sys_check_timeouts();
    deferred_event_cancel(&net_lwip_timer);
    uint32_t delay = sys_timeouts_sleeptime();
    if (delay != 0xffffffff) {
        err = deferred_event_register(&net_lwip_timer, get_default_waitset(),
            delay * 1000, MKCLOSURE((void (*)(void *))net_lwip_timeout, NULL));
        assert(err_is_ok(err));
    }
}

/**
 * @brief creates a queue to the given card and the queueid
 *
 * @param cardname  network card to create the queue for
 * @param ep        endpoint to networking card, possibly null
 * @param queueid   queueid of the network card
 * @param retqueue  returns endpoint to netfilter interface of this queue
 * @param retqueue  returns the pointer to the queue
 *
 * @return SYS_ERR_OK on success, errval on failure
 */
errval_t networking_create_queue(const char *cardname, struct capref* ep,
                                 uint64_t* queueid, struct capref* filter_ep,
                                 struct devq **retqueue)
{
    struct net_state *st = get_default_net_state();
    bool poll = st->flags & NET_FLAGS_POLLING;
    bool default_q = st->flags & NET_FLAGS_DEFAULT_QUEUE;
    return net_queue_internal_create(int_handler, cardname, ep, queueid, default_q,
                                     poll, filter_ep, retqueue);
}

static errval_t networking_poll_st(struct net_state *st)
{
    event_dispatch_non_block(get_default_waitset());
    if (st->flags & NET_FLAGS_POLLING) {
        return net_if_poll(&st->netif);
    } else {
        return event_dispatch(get_default_waitset());
    }
}

/**
 * @brief initializes the networking library with a given device queue
 *
 * @param st        the networking state to initialize
 * @param q         the device queue to initialize the networking on
 * @param flags     supplied initialization flags
 *
 * @return SYS_ERR_OK on success, errval on failure
 */
static errval_t networking_init_with_queue_st(struct net_state *st, struct devq *q,
                                              net_flags_t flags)
{
    errval_t err;

    NETDEBUG("initializing networking with devq=%p, flags=%" PRIx32 "...\n", q,
             flags);

    if (st->initialized) {
        debug_printf("WARNING. initialize called twice. Ignoring\n");
        return SYS_ERR_OK;
    }

    /* set the variables */
    st->flags = flags;
    st->queue = q;
    st->initialized = true;
    st->waitset = get_default_waitset();

    /* associate the net state with the device queue */
    devq_set_state(st->queue, st);

    /* create buffers and add them to the interface*/
    err = net_buf_pool_alloc(st->queue, NETWORKING_BUFFER_COUNT,
                             NETWORKING_BUFFER_SIZE, &st->pool);
    if (err_is_fail(err)) {
        //net_if_destroy(&st->netif);
        goto out_err1;
    }

    deferred_event_init(&net_lwip_timer);
    /* initialize the device queue */
    NETDEBUG("initializing LWIP...\n");
    lwip_init();

    /* create the LWIP network interface and initialize it */
    NETDEBUG("creating netif for LWIP...\n");
    err = net_if_init_devq(&st->netif, st->queue);
    if (err_is_fail(err)) {
        goto out_err1;
    }

    err = net_if_add(&st->netif, st);
    if (err_is_fail(err)) {
        goto out_err1;
    }

    if (!(flags & NET_FLAGS_NO_NET_FILTER) && st->hw_filter) {
        NETDEBUG("initializing hw filter...\n");

        if (!capref_is_null(st->filter_ep)) {
            debug_printf("Connecting to net filter interface using EP \n");
            err = net_filter_init_with_ep(&st->filter, st->filter_ep);
            if (err_is_fail(err)) {
                USER_PANIC("Init filter infrastructure failed: %s \n", err_getstring(err));
            }
        } else {
            debug_printf("Connecting to net filter interface using name \n");
            err = net_filter_init(&st->filter, st->cardname);
            if (err_is_fail(err)) {
                USER_PANIC("Init filter infrastructure failed: %s \n", err_getstring(err));
            }
        }
    }

    NETDEBUG("setting default netif...\n");
    netif_set_default(&st->netif);

    NETDEBUG("adding RX buffers\n");
    for (int i = 0; i < NETWORKING_BUFFER_RX_POPULATE; i++) {
        struct pbuf *p = net_buf_alloc(st->pool);
        if (p == NULL) {
            NETDEBUG("net: WARNING there was no buffer\n");
            break;
        }
        err = net_if_add_rx_buf(&st->netif, p);
        if (err_is_fail(err)) {
            break;
        }
    }

    if (flags & NET_FLAGS_DO_DHCP) {
        err = dhcpd_start(flags);
        if (err_is_fail(err)) {
            DEBUG_ERR(err, "failed to start DHCP.\n");
        }

        err = arp_service_start();
        if (err_is_fail(err)) {
            DEBUG_ERR(err,  "failed to start the ARP service\n");
        }
    } else {
        /* get static IP config */
        err = net_config_static_ip_query(flags);
        if (err_is_fail(err)) {
            DEBUG_ERR(err, "failed to set IP.\n");
        }

        err = arp_service_subscribe();
        if (err_is_fail(err)) {
            DEBUG_ERR(err, "failed to subscribte the ARP service\n");
        }
    }

    waitset_chanstate_init(&net_loopback_poll_channel, CHANTYPE_OTHER);
    net_loopback_poll_channel.persistent = true;
    err = waitset_chan_register(get_default_waitset(), &net_loopback_poll_channel,
                               MKCLOSURE(net_loopback_poll, NULL));

    NETDEBUG("initialization complete.\n");

    return SYS_ERR_OK;

    out_err1:
    st->initialized = false;

    return err;

}

/**
 * @brief initializes the networking library
 *
 * @param st        the networking state to be initalized
 * @param nic       the nic to use with the networking library
 * @param ep        endpoint to the nic, ignored if NULL
 * @param flags     flags to use to initialize the networking library
 *
 * @return SYS_ERR_OK on success, errval on failure
 */
static errval_t networking_init_st(struct net_state *st, const char *nic, net_flags_t flags)
{
    errval_t err;

    NETDEBUG("initializing networking with nic=%s, flags=%" PRIx32 "...\n", nic,
             flags);

    if(st->initialized) {
        NETDEBUG("WARNING. initialize called twice. Ignoring\n");
        return SYS_ERR_OK;
    }

    st->cardname = nic;
    st->flags = flags;

    // default no hw filters
    st->hw_filter = false;

    // if the NIC has a net_sockets_server prependend -> connect to net_socket server
    // ontop of a nic
    if (strncmp("net_sockets_server", nic, strlen("net_sockets_server")) == 0) {
        return net_sockets_init_with_card(nic);
    } else {
        /* create the queue wit the given nic and card name */
        err = networking_create_queue(nic, NULL, &st->queueid, &st->filter_ep, &st->queue);
        if (err_is_fail(err)) {
            return err;
        }

        assert(st->queue != NULL);

        err = networking_init_with_queue_st(st, st->queue, flags);
        if (err_is_fail(err)) {
           // devq_destroy(st->queue);
        }

        return err;
    }
}

/**
 * @brief initializes the networking with the defaults
 *
 * @param st    the networking state to be initialized
 *
 * @return SYS_ERR_OK on sucess, errval on failure
 */
static errval_t networking_init_default_st(struct net_state *st)
{
    errval_t err;

    NETDEBUG("initializing networking with default options...\n");

    if(st->initialized) {
        NETDEBUG("WARNING. initialize called twice. Ignoring\n");
        return SYS_ERR_OK;
    }

    // obtain the settings to create the queue
    err = networking_get_defaults(&st->queueid, &st->cardname, &st->flags);
    if (err_is_fail(err)) {
        return err;
    }

    return networking_init_st(st, st->cardname, st->flags);
}

/*
 * ===========================================================================
 * Public interface
 * ===========================================================================
 */

/**
 * @brief initializes the networking library with a given device queue
 *
 * @param q         the device queue to initialize the networking on
 * @param flags     supplied initialization flags
 *
 * @return SYS_ERR_OK on success, errval on failure
 */
errval_t networking_init_with_queue(struct devq *q, net_flags_t flags)
{
    struct net_state *st = get_default_net_state();
    return networking_init_with_queue_st(st, q, flags);
}

/**
 * @brief initializes the networking library
 *
 * @param nic       the nic to use with the networking library
 * @param flags     flags to use to initialize the networking library
 *
 * @return SYS_ERR_OK on success, errval on failure
 */
errval_t networking_init_with_nic(const char *nic, net_flags_t flags)
{
    struct net_state *st = get_default_net_state();
    return networking_init_st(st, nic, flags);
}

/**
 * @brief initializes the networking library
 *
 * @param nic       the nic to use with the networking library
 * @param ep        endpoint to the nic
 * @param flags     flags to use to initialize the networking library
 *
 * @return SYS_ERR_OK on success, errval on failure
 */
errval_t networking_init_with_ep(const char *nic, struct capref ep,
                                 net_flags_t flags)
{
    errval_t err;

    struct net_state *st = get_default_net_state();
    st->flags = flags;
    st->cardname = nic;

    /* create the queue wit the given nic and card name */
    err = networking_create_queue(nic, &ep, &st->queueid, &st->filter_ep,
                                  &st->queue);
    if (err_is_fail(err)) {
        return err;
    }

    return networking_init_with_queue_st(st, st->queue, flags);
}

/**
 * @brief initializes the networking with the defaults
 *
 * @return SYS_ERR_OK on success, errval on failure
 */
errval_t networking_init_default(void)
{
    struct net_state *st = get_default_net_state();
    if (!st->initialized) {
        return networking_init_default_st(st);
    }
    return SYS_ERR_OK;
}

/**
 * @brief polls the network for new packets
 *
 * @return SYS_ERR_OK on success, errval on failure
 */
errval_t networking_poll(void)
{
    //return net_if_poll_all();
    struct net_state *st = &state;
    return networking_poll_st(st);
}

/**
 * @brief Install L3/L4 filter
 *
 * @param tcp       should TCP packets be filtered or UPD
 * @param src_ip    source ip of the filter, 0 for wildcard
 * @param src_port  source port of the filter, 0 for wildcard
 * @param dst_port  destination port fo the filter
 *
 * @return SYS_ERR_OK on success, NET_FILTER_ERR_* on failure
 */
errval_t networking_install_ip_filter(bool tcp, struct in_addr *src,
                                      uint16_t src_port, uint16_t dst_port)
{
    errval_t err;
    if (!state.hw_filter) {
        debug_printf("Not adding filter as there are no HW filters");
        return SYS_ERR_OK;
    }

    if (state.filter == NULL) {
        return NET_FILTER_ERR_NOT_INITIALIZED;
    }

    struct net_filter_state *st = state.filter;

    // get current config
    struct in_addr dst_ip;
    err = netif_get_ipconfig(&dst_ip, NULL, NULL);
    if (err_is_fail(err)) {
        return err;
    }

    struct net_filter_ip ip = {
        .qid = state.queueid,
        .ip_src = (uint32_t) src->s_addr,
        .ip_dst = (uint32_t) dst_ip.s_addr,
        .port_dst = dst_port,
        .port_src = src_port,
    };

    if (tcp) {
        ip.type = NET_FILTER_TCP;
    } else {
        ip.type = NET_FILTER_UDP;
    }

    return net_filter_ip_install(st, &ip);
}

/**
 * @brief Remove L3/L4 filter
 *
 * @param tcp       should TCP packets be filtered or UPD
 * @param src_ip    source ip of the filter, 0 for wildcard
 * @param src_port  source port of the filter, 0 for wildcard
 * @param dst_port  destination port fo the filter
 *
 * @return SYS_ERR_OK on success, NET_FILTER_ERR_* on failure
 */
errval_t networking_remove_ip_filter(bool tcp, struct in_addr *src,
                                     uint16_t src_port, uint16_t dst_port)
{

    errval_t err;
    if (!state.hw_filter) {
        debug_printf("Not removing filter as there are no HW filters");
        return SYS_ERR_OK;
    }

    if (state.filter == NULL) {
        return NET_FILTER_ERR_NOT_INITIALIZED;
    }

    struct net_filter_state *st = state.filter;

    // get current config
    struct in_addr dst_ip;
    err = netif_get_ipconfig(&dst_ip, NULL, NULL);
    if (err_is_fail(err)) {
        return err;
    }

    struct net_filter_ip ip = {
        .qid = state.queueid,
        .ip_src = (uint32_t) src->s_addr,
        .ip_dst = (uint32_t) dst_ip.s_addr,
        .port_dst = dst_port,
        .port_src = src_port,
    };

    if (tcp) {
        ip.type = NET_FILTER_TCP;
    } else {
        ip.type = NET_FILTER_UDP;
    }

    return net_filter_ip_remove(st, &ip);
}


text:
namespace MassTransit.Middleware
{
    using System.Threading.Tasks;

    /// <summary>
    /// Simply ignores/discards the not-consumed message
    /// </summary>
    public class DiscardDeadLetterFilter :
        IFilter<ReceiveContext>
    {
        void IProbeSite.Probe(ProbeContext context)
        {
            context.CreateFilterScope("discard-dead-letter");
        }

        Task IFilter<ReceiveContext>.Send(ReceiveContext context, IPipe<ReceiveContext> next)
        {
            return next.Send(context);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
(function() {
	angular
		.module('app.board')
		.controller('Board', Board);

	Board.$inject = ['dataService', 'logger', '$q'];
	function Board(dataService, logger, $q) {
		var vm = this;

		activate();

		function activate() {
			$q
				.when(getBoard())
				.then(function() {
					logger.success('Board Activated!');
				});
		}

		function getBoard() {
			dataService
				.getBoard()
				.then(onGetBoardCompleted)
		}

		function onGetBoardCompleted(data) {
			vm.board = data;
		}
	}
}());


text:
#include <string.h>
#include <stdio.h>
#include <s2n.h>

#include "s2n_test.h"
#include "testlib/s2n_testlib.h"

#include "tls/extensions/s2n_extension_list.h"
#include "tls/s2n_cipher_suites.h"
#include "tls/s2n_tls.h"
#include "tls/s2n_tls13.h"

#include "error/s2n_errno.h"
#include "stuffer/s2n_stuffer.h"
#include "utils/s2n_safety.h"

s2n_cert_public_key public_key;
s2n_pkey_type actual_cert_pkey_type;

static int s2n_skip_cert_chain_size(struct s2n_stuffer *stuffer)
{
    uint32_t cert_chain_size;
    GUARD(s2n_stuffer_read_uint24(stuffer, &cert_chain_size));
    eq_check(cert_chain_size, s2n_stuffer_data_available(stuffer));
    return S2N_SUCCESS;
}

static int s2n_skip_cert(struct s2n_stuffer *stuffer)
{
    uint32_t cert_size;
    GUARD(s2n_stuffer_read_uint24(stuffer, &cert_size));
    GUARD(s2n_stuffer_skip_read(stuffer, cert_size));
    return S2N_SUCCESS;
}

static int s2n_x509_validator_validate_cert_chain_test(struct s2n_connection *conn, struct s2n_stuffer *stuffer)
{
    GUARD(s2n_skip_cert_chain_size(stuffer));
    uint32_t cert_chain_size = s2n_stuffer_data_available(stuffer);

    uint8_t *cert_chain_data;
    notnull_check(cert_chain_data = s2n_stuffer_raw_read(stuffer, cert_chain_size));

    GUARD(s2n_x509_validator_validate_cert_chain(&conn->x509_validator, conn,
            cert_chain_data, cert_chain_size, &actual_cert_pkey_type, &public_key));

    GUARD(s2n_pkey_free(&public_key));
    return S2N_SUCCESS;
}

static int s2n_write_test_cert(struct s2n_stuffer *stuffer, struct s2n_cert_chain_and_key *chain_and_key)
{
    struct s2n_blob *cert = &chain_and_key->cert_chain->head->raw;
    GUARD(s2n_stuffer_write_uint24(stuffer, cert->size));
    GUARD(s2n_stuffer_write_bytes(stuffer, cert->data, cert->size));
    return S2N_SUCCESS;
}

static int s2n_setup_connection_for_ocsp_validate_test(struct s2n_connection **conn, struct s2n_cert_chain_and_key *chain_and_key)
{
    struct s2n_connection *nconn;

    notnull_check(nconn = s2n_connection_new(S2N_SERVER));
    nconn->actual_protocol_version = S2N_TLS13;
    nconn->handshake_params.our_chain_and_key = chain_and_key;

    GUARD(s2n_connection_allow_all_response_extensions(nconn));
    nconn->status_type = S2N_STATUS_REQUEST_OCSP;

    *conn = nconn;
    return S2N_SUCCESS;
}

int main(int argc, char **argv)
{
    BEGIN_TEST();

    EXPECT_SUCCESS(s2n_enable_tls13());

    struct s2n_config *config;
    EXPECT_NOT_NULL(config = s2n_config_new());

    EXPECT_SUCCESS(s2n_pkey_zero_init(&public_key));

    /* Initialize cert chain */
    struct s2n_cert_chain_and_key *chain_and_key;
    EXPECT_SUCCESS(s2n_test_cert_chain_and_key_new(&chain_and_key,
            S2N_DEFAULT_TEST_CERT_CHAIN, S2N_DEFAULT_TEST_PRIVATE_KEY));
    EXPECT_SUCCESS(s2n_config_add_cert_chain_and_key_to_store(config, chain_and_key));

    /* Initialize cert extension data */
    uint8_t data[] = "extension data";
    EXPECT_SUCCESS(s2n_cert_chain_and_key_set_ocsp_data(chain_and_key, data, s2n_array_len(data)));
    EXPECT_SUCCESS(s2n_cert_chain_and_key_set_sct_list(chain_and_key, data, s2n_array_len(data)));

    /* Test: s2n_send_cert_chain sends extensions */
    {
        /* Test: extensions only sent for >= TLS1.3 */
        {
            struct s2n_connection *conn;
            EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER));
            conn->handshake_params.our_chain_and_key = chain_and_key;

            EXPECT_SUCCESS(s2n_connection_allow_all_response_extensions(conn));
            conn->status_type = S2N_STATUS_REQUEST_OCSP;

            /* TLS1.2 does NOT send extensions */
            {
                DEFER_CLEANUP(struct s2n_stuffer stuffer, s2n_stuffer_free);
                EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));

                conn->actual_protocol_version = S2N_TLS12;
                EXPECT_SUCCESS(s2n_send_cert_chain(conn, &stuffer, chain_and_key));

                s2n_parsed_extensions_list extensions;
                EXPECT_SUCCESS(s2n_skip_cert_chain_size(&stuffer));
                EXPECT_SUCCESS(s2n_skip_cert(&stuffer));

                EXPECT_FAILURE_WITH_ERRNO(s2n_extension_list_parse(&stuffer, &extensions),
                        S2N_ERR_BAD_MESSAGE);
            }

            /* TLS1.3 DOES send extensions */
            {
                DEFER_CLEANUP(struct s2n_stuffer stuffer, s2n_stuffer_free);
                EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));

                conn->actual_protocol_version = S2N_TLS13;
                EXPECT_SUCCESS(s2n_send_cert_chain(conn, &stuffer, chain_and_key));

                s2n_parsed_extensions_list extensions;
                EXPECT_SUCCESS(s2n_skip_cert_chain_size(&stuffer));
                EXPECT_SUCCESS(s2n_skip_cert(&stuffer));

                EXPECT_SUCCESS(s2n_extension_list_parse(&stuffer, &extensions));
                EXPECT_PARSED_EXTENSION_LIST_NOT_EMPTY(extensions);
            }

            EXPECT_SUCCESS(s2n_connection_free(conn));
        }

        /* Test: extensions only sent on first certificate */
        {
            struct s2n_connection *conn;
            EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER));
            conn->handshake_params.our_chain_and_key = chain_and_key;

            DEFER_CLEANUP(struct s2n_stuffer stuffer, s2n_stuffer_free);
            EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));

            EXPECT_SUCCESS(s2n_connection_allow_all_response_extensions(conn));
            conn->status_type = S2N_STATUS_REQUEST_OCSP;

            conn->actual_protocol_version = S2N_TLS13;
            EXPECT_SUCCESS(s2n_send_cert_chain(conn, &stuffer, chain_and_key));

            s2n_parsed_extensions_list extensions;
            EXPECT_SUCCESS(s2n_skip_cert_chain_size(&stuffer));

            /* First cert includes extensions */
            EXPECT_SUCCESS(s2n_skip_cert(&stuffer));
            EXPECT_SUCCESS(s2n_extension_list_parse(&stuffer, &extensions));
            EXPECT_PARSED_EXTENSION_LIST_NOT_EMPTY(extensions);

            /* Other certs do not include extensions */
            do {
                EXPECT_SUCCESS(s2n_skip_cert(&stuffer));
                EXPECT_SUCCESS(s2n_extension_list_parse(&stuffer, &extensions));
                EXPECT_PARSED_EXTENSION_LIST_EMPTY(extensions);
            } while(s2n_stuffer_data_available(&stuffer));

            EXPECT_SUCCESS(s2n_connection_free(conn));
        }
    }

    /* Test: s2n_x509_validator_validate_cert_chain handles the output of s2n_send_cert_chain */
    {
        /* Test: with no extensions */
        {
            struct s2n_connection *conn;
            EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER));
            conn->actual_protocol_version = S2N_TLS13;
            conn->handshake_params.our_chain_and_key = chain_and_key;

            DEFER_CLEANUP(struct s2n_stuffer stuffer, s2n_stuffer_free);
            EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));

            EXPECT_SUCCESS(s2n_send_cert_chain(conn, &stuffer, chain_and_key));
            EXPECT_SUCCESS(s2n_x509_validator_validate_cert_chain_test(conn, &stuffer));

            EXPECT_SUCCESS(s2n_connection_free(conn));
        }

        /* Test: with extensions */
        {
            struct s2n_connection *conn;
            EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER));
            conn->actual_protocol_version = S2N_TLS13;
            conn->handshake_params.our_chain_and_key = chain_and_key;

            DEFER_CLEANUP(struct s2n_stuffer stuffer, s2n_stuffer_free);
            EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));

            EXPECT_SUCCESS(s2n_connection_allow_all_response_extensions(conn));
            conn->status_type = S2N_STATUS_REQUEST_OCSP;
            conn->ct_level_requested = S2N_CT_SUPPORT_REQUEST;

            EXPECT_SUCCESS(s2n_send_cert_chain(conn, &stuffer, chain_and_key));
            EXPECT_SUCCESS(s2n_x509_validator_validate_cert_chain_test(conn, &stuffer));

            /* OCSP extension processed */
            EXPECT_EQUAL(conn->status_response.size, s2n_array_len(data));
            EXPECT_BYTEARRAY_EQUAL(conn->status_response.data, data, s2n_array_len(data));

            /* SCT extension processed */
            EXPECT_EQUAL(conn->ct_response.size, s2n_array_len(data));
            EXPECT_BYTEARRAY_EQUAL(conn->ct_response.data, data, s2n_array_len(data));

            EXPECT_SUCCESS(s2n_connection_free(conn));
        }
    }

    /* Test: s2n_x509_validator_validate_cert_chain receives extensions */
    {
        /* Test: extensions only processed for >= TLS1.3 */
        {
            struct s2n_connection *setup_conn;
            GUARD(s2n_setup_connection_for_ocsp_validate_test(&setup_conn, chain_and_key));

            DEFER_CLEANUP(struct s2n_stuffer stuffer, s2n_stuffer_free);
            EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));

            struct s2n_stuffer_reservation size = {0};
            EXPECT_SUCCESS(s2n_stuffer_reserve_uint24(&stuffer, &size));
            EXPECT_SUCCESS(s2n_write_test_cert(&stuffer, chain_and_key));
            EXPECT_SUCCESS(s2n_extension_list_send(S2N_EXTENSION_LIST_CERTIFICATE, setup_conn, &stuffer));
            EXPECT_SUCCESS(s2n_stuffer_write_vector_size(&size));

            /* TLS1.2 does NOT process extensions */
            {
                struct s2n_connection *conn;
                GUARD(s2n_setup_connection_for_ocsp_validate_test(&conn, chain_and_key));

                EXPECT_SUCCESS(s2n_stuffer_reread(&stuffer));
                conn->actual_protocol_version = S2N_TLS12;

                EXPECT_FAILURE(s2n_x509_validator_validate_cert_chain_test(conn, &stuffer));

                EXPECT_EQUAL(conn->status_response.size, 0);
                EXPECT_EQUAL(conn->status_response.data, NULL);

                EXPECT_SUCCESS(s2n_connection_free(conn));
            }

            /* TLS1.3 DOES process extensions */
            {
                struct s2n_connection *conn;
                GUARD(s2n_setup_connection_for_ocsp_validate_test(&conn, chain_and_key));

                EXPECT_SUCCESS(s2n_stuffer_reread(&stuffer));
                conn->actual_protocol_version = S2N_TLS13;

                EXPECT_SUCCESS(s2n_x509_validator_validate_cert_chain_test(conn, &stuffer));

                EXPECT_EQUAL(conn->status_response.size, s2n_array_len(data));
                EXPECT_BYTEARRAY_EQUAL(conn->status_response.data, data, s2n_array_len(data));

                EXPECT_SUCCESS(s2n_connection_free(conn));
            }

            EXPECT_SUCCESS(s2n_connection_free(setup_conn));
        }

        /* Test: extensions only processed on first certificate */
        {
            struct s2n_stuffer_reservation size = {0};

            /* Extensions on second cert ignored */
            {
                struct s2n_connection *conn;
                GUARD(s2n_setup_connection_for_ocsp_validate_test(&conn, chain_and_key));

                DEFER_CLEANUP(struct s2n_stuffer stuffer, s2n_stuffer_free);
                EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));

                EXPECT_SUCCESS(s2n_stuffer_reserve_uint24(&stuffer, &size));
                EXPECT_SUCCESS(s2n_write_test_cert(&stuffer, chain_and_key));
                EXPECT_SUCCESS(s2n_extension_list_send(S2N_EXTENSION_LIST_EMPTY, conn, &stuffer));
                EXPECT_SUCCESS(s2n_write_test_cert(&stuffer, chain_and_key));
                EXPECT_SUCCESS(s2n_extension_list_send(S2N_EXTENSION_LIST_CERTIFICATE, conn, &stuffer));
                EXPECT_SUCCESS(s2n_stuffer_write_vector_size(&size));

                EXPECT_SUCCESS(s2n_x509_validator_validate_cert_chain_test(conn, &stuffer));

                EXPECT_EQUAL(conn->status_response.size, 0);
                EXPECT_EQUAL(conn->status_response.data, NULL);

                EXPECT_SUCCESS(s2n_connection_free(conn));
            }

            /* Extensions on first cert processed */
            {
                struct s2n_connection *conn;
                GUARD(s2n_setup_connection_for_ocsp_validate_test(&conn, chain_and_key));

                DEFER_CLEANUP(struct s2n_stuffer stuffer, s2n_stuffer_free);
                EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));

                EXPECT_SUCCESS(s2n_stuffer_reserve_uint24(&stuffer, &size));
                EXPECT_SUCCESS(s2n_write_test_cert(&stuffer, chain_and_key));
                EXPECT_SUCCESS(s2n_extension_list_send(S2N_EXTENSION_LIST_CERTIFICATE, conn, &stuffer));
                EXPECT_SUCCESS(s2n_write_test_cert(&stuffer, chain_and_key));
                EXPECT_SUCCESS(s2n_extension_list_send(S2N_EXTENSION_LIST_EMPTY, conn, &stuffer));
                EXPECT_SUCCESS(s2n_stuffer_write_vector_size(&size));

                EXPECT_SUCCESS(s2n_x509_validator_validate_cert_chain_test(conn, &stuffer));

                EXPECT_EQUAL(conn->status_response.size, s2n_array_len(data));
                EXPECT_BYTEARRAY_EQUAL(conn->status_response.data, data, s2n_array_len(data));

                EXPECT_SUCCESS(s2n_connection_free(conn));
            }
        }
    }

    EXPECT_SUCCESS(s2n_cert_chain_and_key_free(chain_and_key));
    EXPECT_SUCCESS(s2n_config_free(config));

    END_TEST();

    return 0;
}


text:
import time
import random

from zope.interface import implements
from twisted.python import usage, log
from twisted.application.internet import TCPClient
from twisted.internet.protocol import ReconnectingClientFactory
from twisted.protocols.basic import LineReceiver
from twisted.internet.task import LoopingCall
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker

class Options(usage.Options):
    optParameters = [
        ['host', 'h', 'localhost', "Carbon's host", str],
        ['port', 'p', 2003, "Carbon's port", int],
        ['interval', 'i', 30, "Interval (seconds) between metric sends", int]]

class MetricSendingClient(LineReceiver):
    def __init__(self, interval, metric_maker=None):
        self.metric_maker = metric_maker or self.maker
        self.interval = interval
        self.periodic_send = LoopingCall(self.send_metrics)

    def connectionMade(self):
        self.start_sending()

    def start_sending(self):
        self.periodic_send.start(self.interval)

    def send_metrics(self):
        log.msg(' * starting sends')

        now = int(time.time())
        metrics = self.metric_maker()

        for name, value in metrics.iteritems():
            line = "%s %s %d" % (name, value, now)
            log.msg('   - sending metric data: "%s"' % line)
            self.sendLine(line)

        log.msg(' * finished sends\n')

    @staticmethod
    def maker():
        return {
            'diamondash.test.small.a.last': random.randint(5, 10),
            'diamondash.test.small.b.last': random.randint(10, 20),
            'diamondash.test.small.c.last': random.randint(0, 20),
            'diamondash.test.small.d.last': random.randint(10, 30),
            'diamondash.test.small.e.last': random.randint(5, 15),

            'diamondash.test.big.a.last': 1000000 * random.randint(5, 10),
            'diamondash.test.big.b.last': 1000000 * random.randint(10, 20),
            'diamondash.test.big.c.last': 1000000 * random.randint(0, 20),
            'diamondash.test.big.d.last': 1000000 * random.randint(10, 30),
            'diamondash.test.big.e.last': 1000000 * random.randint(5, 15),
        }

class MetricSendingClientFactory(ReconnectingClientFactory):
    protocol = MetricSendingClient

    def __init__(self, *client_args):
        self.client_args = client_args

    def buildProtocol(self, addr):
        client = self.protocol(*self.client_args)
        client.factory = self
        self.client = client
        return client

class MetricSendingClientServiceMaker(object):
    implements(IServiceMaker, IPlugin)
    tapname = "gen-graphite-metrics"
    description = 'Generate graphite metrics'
    options = Options

    def makeService(self, options):
        host, port = options['host'], options['port']
        factory = MetricSendingClientFactory(options['interval'])
        return TCPClient(host, port, factory)


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
JcrReference (JCROM 2.1.1 API)
</TITLE>

<META NAME="date" CONTENT="2014-12-29">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: REQUIRED | OPTIONAL

DETAIL: ELEMENT

org.jcrom.annotations

Annotation Type JcrReference

@Retention(value=RUNTIME)
@Target(value={FIELD,ANNOTATION_TYPE})
public @interface JcrReference

This annotation is used to mark fields that are to be mapped as JCR reference properties.

Author:

Olafur Gauti Gudmundsson, Nicolas Dos Santos

Optional Element Summary

 boolean
byPath

          Setting this to true will store the reference as the path to the referenced entity in a normal String property,
 rather than a reference property.

 boolean
lazy

          Setting this to true will turn on lazy loading for this field.

 String
name

          The name of the JCR reference property.

 boolean
weak

          Setting this to true will force a weak reference for this field.

name

public abstract String name

The name of the JCR reference property. Defaults to the name of the field being annotated.

Returns:
the name of the JCR reference property

Default:
"fieldName"

lazy

public abstract boolean lazy

Setting this to true will turn on lazy loading for this field. The default is false.

Returns:
whether to apply lazy loading to this field

Default:
false

byPath

public abstract boolean byPath

Setting this to true will store the reference as the path to the referenced entity in a normal String property,
 rather than a reference property.

Returns:
whether to use path-based references

Default:
false

weak

public abstract boolean weak

Setting this to true will force a weak reference for this field. The default is false.

Returns:
whether to force this field to use a weak reference

Default:
false

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: REQUIRED | OPTIONAL

DETAIL: ELEMENT

Copyright © 2008-2014. All Rights Reserved.


text:
import { applyDetailsToggle, classTrigger, classDetails, classBody, classExpandedState } from 'app/modules/details-toggle'

const strTemplate = `

    Show further guidance

    Vestibulum id ligula porta felis euismod semper. Curabitur blandit tempus porttitor. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Donec sed odio dui. Aenean lacinia bibendum nulla sed consectetur.

`

let elDetails, elTrigger, elBody

describe('Details Toggle', () => {
  before('Add template to DOM', () => {
    let wrapper = document.createElement('div')
    wrapper.innerHTML = strTemplate
    elDetails = wrapper.firstChild
    document.body.appendChild(elDetails)
    let el = applyDetailsToggle(elDetails)
    ;({elTrigger, elBody} = el)
  })

  it('DOM should contain the template', () => {
    expect(document.body.contains(elDetails)).to.equal(true)
  })

  it(`Should toggle class '.${classExpandedState}' when clicked`, () => {
    elTrigger.click()
    expect(elDetails.classList.contains(classExpandedState)).to.equal(true)
    elTrigger.click()
    expect(elDetails.classList.contains(classExpandedState)).to.equal(false)
  })
})


text:
{% extends "base.html" %}
{% block title %}Bloggato{% endblock %}

{% block content %}

Andrea Grandi's Django Blog

{% if posts %}
    {% for post in posts %}

            {{ post.title }}

{{ post.text }}

 Posted on {{ post.date }}

    {% endfor %}
{% else %}

No Blog posts are available.

{% endif %}

        {% if posts.object_list and posts.paginator.num_pages > 1 %}

                {% if posts.has_previous %}
                    newer entries <<
                {% endif %}

                     Page {{ posts.number }} of {{ posts.paginator.num_pages }}

                {% if posts.has_next %}
                     >> older entries
                {% endif %}

        {% endif %}

{% endblock %}


text:
<?php

class Trimart extends CI_Model
{
	public function __construct()
	{
		$this->load->database('test3');
	}

	public function get_login_credentials($user,$password)
	{
		$result = $this->db->query("select F1142 from STORESQL.dbo.CLK_TAB where F1143='$user' and F1141='$password'")->row_array();

		return $result;
	}

	public function get_addresses()
	{
		$result = $this->db->query("select F1155,F1573 from STORESQL.dbo.CLT_TAB where F1573 != 'NULL' and F1573 != '' ORDER BY F1155 ASC")->result_array();

		return $result;
	}

	public function get_subscribers()
	{
		$result = $this->db->query()->result_array();
	}

	public function get_real_name($user)
	{
		$row = $this->db->query("select F1155 from STORESQL.dbo.CLK_TAB where F1573 = '$user'")->row_array();
		return $row['F1155'];
	}

}

//select F1127,F1141 from dbo.CLK_TAB where F1142 >= 5; //used to select login credentials
//SELECT F1142 FROM dbo.CLK_TAB WHERE F1143 ='$user' AND F1141 ='$password'

?>


text:
package elastic

import (
	"encoding/json"
	"testing"
)

func TestTypeFilter(t *testing.T) {
	f := NewTypeFilter("my_type")
	data, err := json.Marshal(f.Source())
	if err != nil {
		t.Fatalf("marshaling to JSON failed: %v", err)
	}
	got := string(data)
	expected := `{"type":{"value":"my_type"}}`
	if got != expected {
		t.Errorf("expected\n%s\n,got:\n%s", expected, got)
	}
}


text:
#ifndef DALE_COMMONDECL
#define DALE_COMMONDECL

#include "../Unit/Unit.h"

namespace dale
{
/*! CommonDecl

    Provides functions for adding the common declarations/definitions
    to a unit.
*/
namespace CommonDecl
{
/*! Add the intrinsic va_start and va_end functions to the unit.
 *  @param unit The unit.
 */
void addVarargsFunctions(Unit *unit);
/*! Add the basic type functions to the unit.
 *  @param unit The unit.
 *  @param is_x86_64 Whether the current platform is x86-64.
 *
 *  See BasicTypes.
 */
void addBasicTypes(Unit *unit, bool is_x86_64);
/*! Add the va-list type to the unit.
 *  @param unit The unit.
 *  @param is_x86_64 Whether the current platform is x86-64.
 */
void addVarargsTypes(Unit *unit, bool is_x86_64);
/*! Add the standard variables to the unit.
 *  @param unit The unit.
 *
 *  These are the global variables provided by the standard C library.
 *  The variables added here are documented in 'Form reference'.
 */
void addStandardVariables(Unit *unit);
}
}

#endif


text:
co = coroutine.wrap(function()
  co()
end)

local ok, msg = pcall(function()
  co()
end)
assert(not ok and string.find(msg, "can not resume a running thread"))

co = coroutine.wrap(function()
  return 1
end)
assert(co() == 1)
local ok, msg = pcall(function()
  co()
end)
assert(not ok and string.find(msg, "can not resume a dead thread"))


text:
var through     = require('through2');
var trim        = require('trim');

var PLUGIN_NAME = 'gulp-strip-sourcemapurl';

function stripSourceMappingURL(opts) {
	if (!opts) opts = {};

	return through.obj(function (file, enc, cb) {
		if (!file.isNull()) {
			var src = file.contents.toString('utf8');
			var re = /(^\/\/# sourceMappingURL=.*)/m;
			src = src.replace(re,"");
			file.contents = new Buffer(trim(src));
		}

		this.push(file);
		cb();
	});
}

module.exports = stripSourceMappingURL;


text:
package com.microsoft.azure.management.logic.v2018_07_01_preview.implementation;

import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.management.logic.v2018_07_01_preview.IntegrationAccountBatchConfigurations;
import rx.Completable;
import rx.Observable;
import rx.functions.Func1;
import java.util.List;
import com.microsoft.azure.management.logic.v2018_07_01_preview.BatchConfiguration;

class IntegrationAccountBatchConfigurationsImpl extends WrapperImpl<IntegrationAccountBatchConfigurationsInner> implements IntegrationAccountBatchConfigurations {
    private final LogicManager manager;

    IntegrationAccountBatchConfigurationsImpl(LogicManager manager) {
        super(manager.inner().integrationAccountBatchConfigurations());
        this.manager = manager;
    }

    public LogicManager manager() {
        return this.manager;
    }

    @Override
    public BatchConfigurationImpl define(String name) {
        return wrapModel(name);
    }

    private BatchConfigurationImpl wrapModel(BatchConfigurationInner inner) {
        return  new BatchConfigurationImpl(inner, manager());
    }

    private BatchConfigurationImpl wrapModel(String name) {
        return new BatchConfigurationImpl(name, this.manager());
    }

    @Override
    public Observable<BatchConfiguration> listAsync(String resourceGroupName, String integrationAccountName) {
        IntegrationAccountBatchConfigurationsInner client = this.inner();
        return client.listAsync(resourceGroupName, integrationAccountName)
        .flatMap(new Func1<List<BatchConfigurationInner>, Observable<BatchConfigurationInner>>() {
            @Override
            public Observable<BatchConfigurationInner> call(List<BatchConfigurationInner> innerList) {
                return Observable.from(innerList);
            }
        })
        .map(new Func1<BatchConfigurationInner, BatchConfiguration>() {
            @Override
            public BatchConfiguration call(BatchConfigurationInner inner) {
                return wrapModel(inner);
            }
        });
    }

    @Override
    public Observable<BatchConfiguration> getAsync(String resourceGroupName, String integrationAccountName, String batchConfigurationName) {
        IntegrationAccountBatchConfigurationsInner client = this.inner();
        return client.getAsync(resourceGroupName, integrationAccountName, batchConfigurationName)
        .map(new Func1<BatchConfigurationInner, BatchConfiguration>() {
            @Override
            public BatchConfiguration call(BatchConfigurationInner inner) {
                return wrapModel(inner);
            }
       });
    }

    @Override
    public Completable deleteAsync(String resourceGroupName, String integrationAccountName, String batchConfigurationName) {
        IntegrationAccountBatchConfigurationsInner client = this.inner();
        return client.deleteAsync(resourceGroupName, integrationAccountName, batchConfigurationName).toCompletable();
    }

}


text:
titel: Analyse & Recherche
kuerzel: pa
verantwortlich: cn
typ: projektarbeit
pflicht: false
termin: 2017-05-15 13:00
published: true
dauer: 240
info: Erarbeitung der notwendigen Methoden und Techniken und Anwendung auf den Projektgegenstand.
---


text:
<?php

namespace LightSaml\Tests\Store\Id;

use LightSaml\Store\Id\IdArrayStore;
use LightSaml\Tests\BaseTestCase;

class IdArrayStoreTest extends BaseTestCase
{
    public function test_works()
    {
        $store = new IdArrayStore();
        $store->set('aaa', '111', new \DateTime('+1 day'));
        $store->set('aaa', '222', new \DateTime('+1 day'));
        $store->set('bbb', '333', new \DateTime('+1 day'));

        $this->assertTrue($store->has('aaa', '111'));
        $this->assertTrue($store->has('aaa', '222'));
        $this->assertTrue($store->has('bbb', '333'));

        $this->assertFalse($store->has('xxx', '888'));
    }
}


text:
try:
    import builtins
except ImportError:
    import __builtin__ as builtins

import datetime

try:
    from cdecimal import Decimal
except:
    from decimal import Decimal

try:
    unicode_type = builtins.unicode
except AttributeError:
    unicode_type = builtins.str

str_type = builtins.str

try:
    long_type = builtins.long
    int_type = builtins.int
except AttributeError:
    int_type = builtins.int
    long_type = builtins.int

float_type = builtins.float
bool_type = builtins.bool
bytes_type = builtins.bytes
bytearray_type = builtins.bytearray
date_type = datetime.date
time_type = datetime.time
datetime_type = datetime.datetime
decimal_type = Decimal
none_type = type(None)


text:
"""
Contains possible interactions with the Apollo Organisms Module
"""
import json

from apollo.client import Client
from apollo.decorators import raise_error_decorator

class OrganismsClient(Client):
    CLIENT_BASE = '/organism/'

    @raise_error_decorator
    def add_organism(self, common_name, directory, blatdb=None, genus=None,
                     species=None, public=False, metadata=None):
        """
        Add an organism

        :type common_name: str
        :param common_name: Organism common name

        :type directory: str
        :param directory: Server-side directory

        :type blatdb: str
        :param blatdb: Server-side path to 2bit index of the genome for Blat

        :type genus: str
        :param genus: Genus

        :type species: str
        :param species: Species

        :type public: bool
        :param public: Should the organism be public or not

        :type metadata: str
        :param metadata: JSON formatted arbitrary metadata

        :rtype: dict
        :return: a dictionary with information about the new organism
        """
        data = {
            'commonName': common_name,
            'directory': directory,
            'publicMode': public,
        }

        if blatdb is not None:
            data['blatdb'] = blatdb
        if genus is not None:
            data['genus'] = genus
        if species is not None:
            data['species'] = species
        if metadata is not None:
            if isinstance(metadata, dict):
                # Apollo wants a string
                metadata = json.dumps(metadata)
            data['metadata'] = metadata

        response = self.post('addOrganism', data)
        # Apollo decides here that it would be nice to return information about
        # EVERY organism. LMAO.
        if type(response) is not list:
            return response
        return [x for x in response if x['commonName'] == common_name][0]

    def update_organism(self, organism_id, common_name, directory, blatdb=None, species=None, genus=None, public=False,
                        no_reload_sequences=False):
        """
        Update an organism

        :type organism_id: str
        :param organism_id: Organism ID Number

        :type common_name: str
        :param common_name: Organism common name

        :type directory: str
        :param directory: Server-side directory

        :type blatdb: str
        :param blatdb: Server-side Blat directory for the organism

        :type genus: str
        :param genus: Genus

        :type species: str
        :param species: Species

        :type public: bool
        :param public: User's email

        :type no_reload_sequences: bool
        :param no_reload_sequences: Set this if you don't want Apollo to reload genome sequences (no change in genome sequence)

        :rtype: dict
        :return: a dictionary with information about the updated organism
        """
        data = {
            'id': organism_id,
            'name': common_name,
            'directory': directory,
            'publicMode': public,
            'noReloadSequences': no_reload_sequences,
        }

        if blatdb is not None:
            data['blatdb'] = blatdb
        if genus is not None:
            data['genus'] = genus
        if species is not None:
            data['species'] = species

        response = self.post('updateOrganismInfo', data)[0]

        if len(response.keys()) == 0:
            return self.show_organism(organism_id)
        return response

    def get_organisms(self, common_name=None):
        """
        Get all organisms

        :type common_name: str
        :param common_name: Optionally filter on common name

        :rtype: list
        :return: Organism information
        """
        if common_name is None:
            orgs = self.post('findAllOrganisms', data={})
        else:
            orgs = self.post('findAllOrganisms', {'organism': common_name})
        return orgs

    def show_organism(self, common_name):
        """
        Get information about a specific organism.

        :type common_name: str
        :param common_name: Organism Common Name

        :rtype: dict
        :return: a dictionary containing the organism's information
        """
        orgs = self.get_organisms(common_name=common_name)
        if isinstance(orgs, list) and len(orgs) > 0:
            orgs = orgs[0]
        return orgs

    def delete_organism(self, organism_id):
        """
        Delete an organim

        :type organism_id: str
        :param organism_id: Organism ID Number

        :rtype: list
        :return: A list of all remaining organisms
        """
        return self.post('deleteOrganism', {'id': organism_id})

    def delete_features(self, organism_id):
        """
        Remove features of an organism

        :type organism_id: str
        :param organism_id: Organism ID Number

        :rtype: dict
        :return: an empty dictionary
        """
        return self.post('deleteOrganismFeatures', {'organism': organism_id})

    def get_sequences(self, organism_id):
        """
        Get the sequences for an organism

        :type organism_id: str
        :param organism_id: Organism ID Number

        :rtype: list of dict
        :return: The set of sequences associated with an organism
        """
        return self.post('getSequencesForOrganism', {'organism': organism_id})

    def get_organism_creator(self, organism_id):
        """
        Get the creator of an organism

        :type organism_id: str
        :param organism_id: Organism ID Number

        :rtype: dict
        :return: a dictionary containing user information
        """
        return self.post('getOrganismCreator', {'organism': organism_id})

    def update_metadata(self, organism_id, metadata):
        """
        Update the metadata for an existing organism.

        :type metadata: str
        :param metadata: Organism metadata. (Recommendation: use a structured format like JSON)

        :rtype: dict
        :return: An empty, useless dictionary
        """
        return self.post('updateOrganismMetadata', {'id': organism_id, 'metadata': metadata})


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Niemelä, Kinnunen, Larsson, Schigel & Larsson, Karstenia 45(2): 76 (2005)

#### Original name
Polyporus salmonicolor Berk. & M.A. Curtis, 1849

### Remarks
null


text:
package com.welshare.web.util;

import java.io.IOException;
import java.util.Locale;
import java.util.Map;
import java.util.logging.LogManager;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.SessionCookieConfig;
import javax.servlet.annotation.WebListener;

import org.joda.time.DateTimeZone;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.google.code.linkedinapi.client.constant.ApplicationConstants;
import com.google.common.collect.Maps;
import com.welshare.service.UrlShorteningService;
import com.welshare.service.social.helper.ExtendedLinkedInApiClient;
import com.welshare.service.social.helper.FacebookHelper;
import com.welshare.service.social.helper.GooglePlusHelper;
import com.welshare.service.social.helper.LinkedInHelper;
import com.welshare.service.social.helper.TwitterHelper;
import com.welshare.service.social.pictures.PictureProvider;
import com.welshare.service.social.video.VideoExtractor;
import com.welshare.util.WebUtils;

@WebListener
public class StartupListener implements ServletContextListener {

    private static final Logger logger = LoggerFactory.getLogger(StartupListener.class);

    @Override
    public void contextDestroyed(ServletContextEvent e) {
        // do nothing on destroy
    }

    @Override
    public void contextInitialized(ServletContextEvent e) {
        System.setProperty(ApplicationConstants.CLIENT_DEFAULT_IMPL, ExtendedLinkedInApiClient.class.getName());

        DateTimeZone.setDefault(DateTimeZone.UTC);
        Locale.setDefault(Locale.ENGLISH);
        SessionCookieConfig sessionCookieConfig = e.getServletContext().getSessionCookieConfig();
        sessionCookieConfig.setHttpOnly(true);
        try {
            LogManager.getLogManager().readConfiguration(e.getServletContext().getResourceAsStream("/WEB-INF/classes/logging.properties"));
        } catch (IOException ex) {
            throw new IllegalStateException("Failed to initialize java.util.logging", ex);
        }
        ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(e.getServletContext());
        Map<String, VideoExtractor> videoExtractors = ctx.getBeansOfType(VideoExtractor.class);
        WebUtils.videoExtractors.addAll(videoExtractors.values());

        Map<String, PictureProvider> pictureProviders = ctx.getBeansOfType(PictureProvider.class);
        WebUtils.pictureProviders.addAll(pictureProviders.values());

        Map<String, UrlShorteningService> urlShorteners = ctx.getBeansOfType(UrlShorteningService.class);
        WebUtils.urlShorteners.addAll(urlShorteners.values());

        initializeSocialNetworks(e.getServletContext());

        logger.info("Welshare startup successful");
    }

    private void initializeSocialNetworks(ServletContext ctx) {
        Map<String, SocialNetwork> networks = Maps.newLinkedHashMap();
        Map<String, SocialNetwork> networksByPrefix = Maps.newLinkedHashMap();

        SocialNetwork twitter = new SocialNetwork();
        twitter.setPrefix(TwitterHelper.PUBLIC_ID_PREFIX);
        twitter.setName("Twitter");
        twitter.setSiteName("twitter");
        twitter.setIcon("twitter_connect.png");
        twitter.setIndicatorIcon("twitter_indicator.png");
        twitter.setSharingEnabled(true);
        twitter.setLikeAndReshare(false);
        twitter.setFollowersUrl("http://twitter.com/followers");
        twitter.setFollowingUrl("http://twitter.com/following");
        networks.put(twitter.getSiteName(), twitter);
        networksByPrefix.put(twitter.getPrefix(), twitter);

        SocialNetwork facebook = new SocialNetwork();
        facebook.setPrefix(FacebookHelper.PUBLIC_ID_PREFIX);
        facebook.setName("Facebook");
        facebook.setSiteName("facebook");
        facebook.setIcon("facebook_connect.png");
        facebook.setIndicatorIcon("facebook_connect.png");
        facebook.setSharingEnabled(true);
        facebook.setLikeAndReshare(true);
        facebook.setFollowersUrl("http://facebook.com/friends");
        facebook.setFollowingUrl("http://facebook.com/friends");
        networks.put(facebook.getSiteName(), facebook);
        networksByPrefix.put(facebook.getPrefix(), facebook);

        SocialNetwork googlePlus = new SocialNetwork();
        googlePlus.setPrefix(GooglePlusHelper.PUBLIC_ID_PREFIX);
        googlePlus.setName("Google+");
        googlePlus.setSiteName("googlePlus");
        googlePlus.setIcon("googleplus_connect.png");
        googlePlus.setIndicatorIcon("googleplus_connect.png");
        googlePlus.setSharingEnabled(true);
        googlePlus.setLikeAndReshare(false);
        googlePlus.setFollowersUrl("https://plus.google.com/circles/addedyou");
        googlePlus.setFollowingUrl("https://plus.google.com/circles");
        networks.put(googlePlus.getSiteName(), googlePlus);
        networksByPrefix.put(googlePlus.getPrefix(), googlePlus);

        SocialNetwork linkedIn = new SocialNetwork();
        linkedIn.setPrefix(LinkedInHelper.PUBLIC_ID_PREFIX);
        linkedIn.setName("LinkedIn");
        linkedIn.setSiteName("linkedIn");
        linkedIn.setIcon("linkedin_connect.png");
        linkedIn.setIndicatorIcon("linkedin_connect.png");
        linkedIn.setSharingEnabled(true);
        linkedIn.setLikeAndReshare(true);
        linkedIn.setFollowersUrl("http://www.linkedin.com/connections");
        linkedIn.setFollowingUrl("http://www.linkedin.com/connections");
        networks.put(linkedIn.getSiteName(), linkedIn);
        networksByPrefix.put(linkedIn.getPrefix(), linkedIn);
        ctx.setAttribute("socialNetworks", networks);
        ctx.setAttribute("socialNetworksByPrefix", networksByPrefix);
    }

    public static class SocialNetwork {
        private String prefix;
        private String icon; //relative to /static/images/social
        private String indicatorIcon; //relative to /static/images/social
        private String name; //used for displaying to users
        private String siteName; //used internally
        private boolean sharingEnabled;
        private String followersUrl;
        private String followingUrl;
        private boolean likeAndReshare; // whether the network supports both actions, or just a single one

        public String getPrefix() {
            return prefix;
        }
        public void setPrefix(String prefix) {
            this.prefix = prefix;
        }
        public String getIcon() {
            return icon;
        }
        public void setIcon(String icon) {
            this.icon = icon;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getSiteName() {
            return siteName;
        }
        public void setSiteName(String siteName) {
            this.siteName = siteName;
        }
        public boolean isSharingEnabled() {
            return sharingEnabled;
        }
        public void setSharingEnabled(boolean sharingEnabled) {
            this.sharingEnabled = sharingEnabled;
        }
        public String getFollowersUrl() {
            return followersUrl;
        }
        public void setFollowersUrl(String followersUrl) {
            this.followersUrl = followersUrl;
        }
        public String getFollowingUrl() {
            return followingUrl;
        }
        public void setFollowingUrl(String followingUrl) {
            this.followingUrl = followingUrl;
        }
        public String getIndicatorIcon() {
            return indicatorIcon;
        }
        public void setIndicatorIcon(String indicatorIcon) {
            this.indicatorIcon = indicatorIcon;
        }
        public boolean isLikeAndReshare() {
            return likeAndReshare;
        }
        public void setLikeAndReshare(boolean likeAndReshare) {
            this.likeAndReshare = likeAndReshare;
        }
    }
}


text:
START TRANSACTION;
  UPDATE eng_schema_version SET version_value='45' WHERE version_key='schema_patch';
COMMIT;


text:
class Y1099 < ActiveRecord::Base
    self.table_name = 'y1099'
    self.primary_key = :Y_SEQ

end


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>colour.colorimetry.luminance Module — Colour 0.3.1 documentation</title>

    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="_static/bootswatch-3.1.0/colour/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="_static/styles.css" type="text/css" />

    <link rel="top" title="Colour 0.3.1 documentation" href="index.html" />
    <link rel="up" title="colour.colorimetry Package" href="colour.colorimetry.html" />
    <link rel="next" title="colour.colorimetry.spectrum Module" href="colour.colorimetry.spectrum.html" />
    <link rel="prev" title="colour.colorimetry.lightness Module" href="colour.colorimetry.lightness.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">

        </button>

          Colour 0.3

colour-science.org

                   Documentation

                           API Reference

                           IPython Notebooks

                           Features

                           Contributing

    « colour.colorimet...

    colour.colorimet... »

<form class="navbar-form navbar-right" action="search.html" method="get">

  <input type="text" name="q" class="form-control" placeholder="Search" />

  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>

colour.colorimetry.luminance Module¶

Luminance \(Y\)¶

Defines luminance \(Y\) computation objects.

The following methods are available:

<tt class="xref py py-func docutils literal">luminance_newhall1943()</tt>: luminance \(Y\) computation of given
Munsell value \(V\) using Newhall, Nickerson, and Judd (1943)
method.

<tt class="xref py py-func docutils literal">luminance_1976()</tt>: luminance \(Y\) computation of given
Lightness \(L^*\) as per CIE Lab implementation.

<tt class="xref py py-func docutils literal">luminance_ASTM_D1535_08()</tt>: luminance \(Y\) computation of given
Munsell value \(V\) using ASTM D1535-08e1 (2008) method.

See also

Luminance IPython Notebook

<tt class="descclassname">colour.colorimetry.luminance.</tt><tt class="descname">luminance_newhall1943</tt><big>(</big>V, **kwargs<big>)</big>[source]¶

Returns the luminance \(Y\) of given Munsell value \(V\) using
Newhall, Nickerson, and Judd (1943) method.

<col class="field-name" />
<col class="field-body" />

Parameters:

V (numeric) – Munsell value \(V\).

**kwargs (**, optional) – Unused parameter provided for signature compatibility with other
luminance computation objects.

Returns:
luminance \(Y\).

Return type:
numeric

Notes

Input Munsell value \(V\) is in domain [0, 10].

Output luminance \(Y\) is in domain [0, 100].

References

<colgroup><col class="label" /><col /></colgroup>

[1]	http://en.wikipedia.org/wiki/Lightness
(Last accessed 13 April 2014)

Examples

>>> luminance_newhall1943(3.74629715382)
10.4089874...

<tt class="descclassname">colour.colorimetry.luminance.</tt><tt class="descname">luminance_1976</tt><big>(</big>L, Yn=100<big>)</big>[source]¶

Returns the luminance \(Y\) of given Lightness \(L^*\) with
given reference white luminance \(Y_n\).

<col class="field-name" />
<col class="field-body" />

Parameters:

L (numeric) – Lightness \(L^*\)

Yn (numeric) – White reference luminance \(Y_n\).

Returns:
luminance \(Y\).

Return type:
numeric

Notes

Input Lightness \(L^*\) is in domain [0, 100].

Output luminance \(Y\) is in domain [0, 100].

References

<colgroup><col class="label" /><col /></colgroup>

[2]	http://www.poynton.com/PDFs/GammaFAQ.pdf
(Last accessed 12 April 2014)

Examples

>>> luminance_1976(37.9856290977)
10.0800000...

<tt class="descclassname">colour.colorimetry.luminance.</tt><tt class="descname">luminance_ASTM_D1535_08</tt><big>(</big>V, **kwargs<big>)</big>[source]¶

Returns the luminance \(Y\) of given Munsell value \(V\) using
ASTM D1535-08e1 (2008) method.

<col class="field-name" />
<col class="field-body" />

Parameters:

V (numeric) – Munsell value \(V\).

**kwargs (**, optional) – Unused parameter provided for signature compatibility with other
luminance computation objects.

Returns:
luminance \(Y\).

Return type:
numeric

Notes

Input Munsell value \(V\) is in domain [0, 10].

Output luminance \(Y\) is in domain [0, 100].

References

http://www.scribd.com/doc/89648322/ASTM-D1535-08e1-Standard-Practice-for-Specifying-Color-by-the-Munsell-System

Examples

>>> luminance_ASTM_D1535_08(3.74629715382)
10.1488096...

<tt class="descclassname">colour.colorimetry.luminance.</tt><tt class="descname">LUMINANCE_METHODS</tt> = CaseInsensitiveMapping({u'astm2008': <function luminance_ASTM_D1535_08 at 0x102e0f668>, u'Newhall 1943': <function luminance_newhall1943 at 0x102e0f578>, u'ASTM D1535-08': <function luminance_ASTM_D1535_08 at 0x102e0f668>, u'CIE 1976': <function luminance_1976 at 0x102e0f5f0>, u'cie1976': <function luminance_1976 at 0x102e0f5f0>})¶

Supported luminance computations methods.

LUMINANCE_METHODS : dict

(‘Newhall 1943’, ‘CIE 1976’, ‘ASTM D1535-08’)

Aliases:

‘cie1976’: ‘CIE 1976’

‘astm2008’: ‘ASTM D1535-08’

<tt class="descclassname">colour.colorimetry.luminance.</tt><tt class="descname">luminance</tt><big>(</big>LV, method=u'CIE 1976', **kwargs<big>)</big>[source]¶

Returns the luminance \(Y\) of given Lightness \(L^*\) or given
Munsell value \(V\).

<col class="field-name" />
<col class="field-body" />

Parameters:

LV (numeric) – Lightness \(L^*\) or Munsell value \(V\).

method (unicode, optional) – (‘Newhall 1943’, ‘CIE 1976’, ‘ASTM D1535-08’)
Computation method.

**kwargs (**) – Keywords arguments.

Returns:
luminance \(Y\).

Return type:
numeric

Notes

Input LV is in domain [0, 100] or [0, 10] and optional luminance
\(Y_n\) is in domain [0, 100].

Output luminance \(Y\) is in domain [0, 100].

Examples

>>> luminance(37.9856290977)
10.0800000...
>>> luminance(37.9856290977, Yn=100)
10.0800000...
>>> luminance(37.9856290977, Yn=95)
9.5760000...
>>> luminance(3.74629715382, method='Newhall 1943')
10.4089874...
>>> luminance(3.74629715382, method='ASTM D1535-08')
10.1488096...

      Back to top

        © Copyright 2013 - 2014, Colour Developers.

      Created using Sphinx 1.2.2.


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

<title>Using as: SH64-Chars</title>

<meta name="description" content="Using as: SH64-Chars">
<meta name="keywords" content="Using as: SH64-Chars">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="SH64-Syntax.html#SH64-Syntax" rel="up" title="SH64 Syntax">
<link href="SH64_002dRegs.html#SH64_002dRegs" rel="next" title="SH64-Regs">
<link href="SH64-Syntax.html#SH64-Syntax" rel="prev" title="SH64 Syntax">

Next: SH64-Regs, Up: SH64 Syntax   [Contents][Index]

9.40.2.1 Special Characters

‘<samp>!</samp>’ is the line comment character.

If a ‘<samp>#</samp>’ appears as the first character of a line then the whole
line is treated as a comment, but in this case the line could also be
a logical line number directive (see Comments) or a preprocessor
control command (see Preprocessing).

You can use ‘<samp>;</samp>’ instead of a newline to separate statements.

Since ‘<samp>$</samp>’ has no special meaning, you may use it in symbol names.


text:
package org.jets3t.service.acl.gs;

import com.jamesmurty.utils.XMLBuilder;

import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;

import org.jets3t.service.acl.GroupGrantee;

/**
 * Represents an Group By Domain Grantee, that is a group identified by their domain address.
 *
 * @author Google Developers
 *
 */
public class GroupByDomainGrantee extends GroupGrantee {
    public GroupByDomainGrantee() {
      super();
    }

    /**
     * Constructs a group grantee object using the given domain address as an identifier.
     *
     * @param domain
     */
    public GroupByDomainGrantee(String domain) {
      super(domain);
    }

    @Override
    public XMLBuilder toXMLBuilder() throws TransformerException,
        ParserConfigurationException, FactoryConfigurationError
    {
        return (XMLBuilder.create("Scope")
            .attr("type", "GroupByDomain")
            .element("Domain").text(id)
            );
    }

    @Override
    public boolean equals(Object obj) {
        return (obj instanceof GroupByDomainGrantee
                && ((GroupByDomainGrantee)obj).getIdentifier() == this.getIdentifier());
    }

    @Override
    public String toString() {
        return "GroupByDomain [" + id + "]";
    }
}


text:
class MtkSlideMenu extends HTMLElement {
    constructor() {
        super();
        this._root = this.attachShadow({ mode: "open" });
        this._$frame = null;
        this._open = true;
    }

    set open(value) {
        const result = (value === true);

        if (this._open === result) {
            return;
        }

        this._open = result;

        this._render();
    }
    get open() {
        return this._open;
    }

    connectedCallback() {
        this._root.innerHTML = `

                            <slot name="title">Menu</slot>

                        ✖

                        <slot class="content-slot"></slot>

        `;

        // get click handler on the frame
        this._$frame = this._root.querySelector(".frame");

        // add one single event listener for open close
        this._$frame.addEventListener("click", (event) => {
            // if clicked element has close prperty then closse
            // the clse button and thr backdrop have close data item
            if (event.target.dataset.close === "true") {
                this.open = false;
            }
        });
    }

    _render() {
        // if got the $frame ie connected t the dom
        if (this._$frame !== null) {
            // on render, if element is open raise event menu-opened
            if (this._open === true) {
                // add open class to custom element
                this._$frame.classList.add("open");
                this.dispatchEvent(new CustomEvent("menu-opened"));
            } else {
                // remove open class from custom element
                // on render, if element is open raise event menu-closed
                this._$frame.classList.remove("open");
                this.dispatchEvent(new CustomEvent("menu-closed"));
            }
        }
    }
}

window.customElements.define("mtk-slide-menu", MtkSlideMenu);


text:
//
//  ZBUtil.h
//  Books
//
//  Created by Balasankar J on 27/02/14.
//  Copyright (c) 2014 Balasankar J. All rights reserved.
//

/**
 \addtogroup Util
 *@{
 */

#import <Foundation/Foundation.h>
#import "ZBException.h"

/**
 ZBUtil interface has common utility methods.
 */
@interface ZBUtil : NSObject

/**
 Create a new instance of ZBException from the given error response.
 @param errorResponse - It contains code and message in the form of key, value.
 @returns ZBException
 */
+(ZBException *)exception:(NSMutableDictionary *) errorResponse;

@end

/** @}*/


text:
package org.bubblecloud.zigbee.util;

/**
 * @author Stefano "Kismet" Lenzi
 * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $)
 * @since 0.4.0 - Revision 62
 */
public class CircularBufferInt {

    private final int[] buffer;
    private int head;
    private int tail;
    private int used;

    private final boolean overwrite;

    public CircularBufferInt(final int size, final boolean cyclic) {
        buffer = new int[size];
        overwrite = cyclic;
        tail = 0;
        head = 0;
        used = 0;
    }

    public CircularBufferInt(final int[] data, final int size, final boolean cyclic) {
        buffer = new int[size];
        overwrite = cyclic;
        if (!cyclic && data.length > size) {
            throw new IndexOutOfBoundsException(
                    "Trying to copy " + data.length + " to non-cyclic buffer of " + size + "." +
                            "You should either increase the size of the buffer or set it as cyclic"
            );
        } else if (cyclic && data.length > size) {
            for (tail = 0; tail < buffer.length; tail++) {
                buffer[tail] = data[data.length - buffer.length + tail];
            }
        } else {
            for (tail = 0; tail < data.length; tail++) {
                buffer[tail] = data[tail];
            }
        }
        head = 0;
        used = tail;
    }

    public int slots() {
        return buffer.length;
    }

    public int size() {
        return used;
    }

    public boolean isFull() {
        return used == buffer.length;
    }

    public boolean isEmpty() {
        return used == 0;
    }

    public void add(int value) {
        if (isFull()) {
            if (overwrite) {
                remove();
            } else {
                throw new IndexOutOfBoundsException(
                        "Trying to add data to a full circular buffer, if you need it to " +
                                "overwrite its own data please create it with cyclic=true"
                );
            }
        }
        buffer[tail] = value;
        tail = (tail + 1) % buffer.length;
        used += 1;
    }

    public int get(int idx) {
        if (idx >= size() || idx < 0) {
            throw new IndexOutOfBoundsException(
                    "Trying to get data from " + idx + " but size is " + size()
            );
        }
        return buffer[(head + idx) % buffer.length];
    }

    public int remove() {
        if (isEmpty()) {
            throw new IndexOutOfBoundsException(
                    "Trying to remove data from an empty circular buffer"
            );
        }
        final int val = buffer[head];
        head = (head + 1) % buffer.length;
        used -= 1;
        return val;
    }

    public int[] toArray() {
        int[] values = new int[size()];
        int i = 0;
        for (int j = head; j < buffer.length; j++) {
            values[i] = buffer[j];
            i += 1;
        }
        for (int j = 0; j < tail; j++) {
            values[i] = buffer[j];
            i += 1;
        }
        return values;
    }
}


text:
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi" xmlns:shibmd="urn:mace:shibboleth:metadata:1.0" xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" entityID="https://cerbere2.mines-douai.fr/idp/shibboleth">
    <md:Extensions>
      <mdrpi:RegistrationInfo registrationAuthority="https://federation.renater.fr/" registrationInstant="2013-10-03T09:42:09Z">
        <mdrpi:RegistrationPolicy xml:lang="en">https://services.renater.fr/federation/en/metadata_registration_practice_statement</mdrpi:RegistrationPolicy>
      </mdrpi:RegistrationInfo>
    </md:Extensions>
    <md:IDPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:1.1:protocol urn:mace:shibboleth:1.0 urn:oasis:names:tc:SAML:2.0:protocol">
      <md:Extensions>
        <shibmd:Scope regexp="false">mines-douai.fr</shibmd:Scope>
        <mdui:UIInfo>
          <mdui:DisplayName xml:lang="fr">Mines Douai</mdui:DisplayName>
        </mdui:UIInfo>
      </md:Extensions>
      <md:KeyDescriptor use="signing">
        <ds:KeyInfo>
          <ds:X509Data>
            <ds:X509Certificate>
					      MIIDSDCCAjCgAwIBAgIVAPf+z/Alo2UGcIQMpD8+yoRE9DjEMA0GCSqGSIb3DQEB
BQUAMCIxIDAeBgNVBAMTF2NlcmJlcmUyLm1pbmVzLWRvdWFpLmZyMB4XDTEzMDkz
MDEyMTA0N1oXDTMzMDkzMDEyMTA0N1owIjEgMB4GA1UEAxMXY2VyYmVyZTIubWlu
ZXMtZG91YWkuZnIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsehUd
QZAcFM8YQRAuQ4MSbuE5yrEu7ZpH8ICDmKMlVudlEWSLSkCZqrbtNYOev8gdHQTh
OvKd5IzIph5TaRjY1qQI5v2ud/ov+Xk0JLWkYWnh2wMIQ07LoQ66zQqHxVbfq6lR
lNtaHXhcPNPp/61j4OOoHNbztglqpAeVnkgUqMksnDofsjVsVMYG+9naGfwHKJlH
I9HW7aUEvYYl/mUKrHbu9+QWpLsJukiJEF6hyRgijs/kr2pm0pBB4djy1NTgrqfz
qjYmCzxtkbogHsOs0KGdoMg6R5PmHojtQ00beeKC8/hfHP+sU3wnNO+Hb14B/NLB
veexLjO3AQpMtMY5AgMBAAGjdTBzMFIGA1UdEQRLMEmCF2NlcmJlcmUyLm1pbmVz
LWRvdWFpLmZyhi5odHRwczovL2NlcmJlcmUyLm1pbmVzLWRvdWFpLmZyL2lkcC9z
aGliYm9sZXRoMB0GA1UdDgQWBBTHtKE6G3SkaEo+yuSQU4KTB9wxkDANBgkqhkiG
9w0BAQUFAAOCAQEAqXrF4OYsvzcJ6djLo7hq52yqhYJtEdSGJkJ4n7CKX4WrHs5M
YwWM3B6qbIjni0+cel8TJTCPG94ZZZOKZIPRv6eS2j77sRgnsht+mYpl9o4+zjrE
CPVr99SlBCSuArEnnqDe26EJyV5M0fALwgHaBTPUlHhObgUuPuzlQQGEZKpoSlGT
Hx5ewqQ+m/jii2h1IOzex/1uFA3euE8trn5LMmNZpvQ24yRBCVQ1LyTmmdTkNeHk
GiluYTYk7G0sXbJWur7gK8jpHdojNfR2SUay9Z2lAllZ2V/cwxVOgOMgaFkaHAq1
1Zj4drFJWcGthEvZ8uVYsc6wJoIy1fbrkBcMng==
					    </ds:X509Certificate>
          </ds:X509Data>
        </ds:KeyInfo>
      </md:KeyDescriptor>
      <md:NameIDFormat>urn:mace:shibboleth:1.0:nameIdentifier</md:NameIDFormat>
      <md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</md:NameIDFormat>
      <md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://cerbere2.mines-douai.fr/idp/profile/SAML2/POST/SSO"/>
      <md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://cerbere2.mines-douai.fr/idp/profile/SAML2/Redirect/SSO"/>
      <md:SingleSignOnService Binding="urn:mace:shibboleth:1.0:profiles:AuthnRequest" Location="https://cerbere2.mines-douai.fr/idp/profile/Shibboleth/SSO"/>
    </md:IDPSSODescriptor>
    <md:Organization>
      <md:OrganizationName xml:lang="en">Mines Douai</md:OrganizationName>
      <md:OrganizationDisplayName xml:lang="en">Mines Douai</md:OrganizationDisplayName>
      <md:OrganizationURL xml:lang="en">http://unknown.site.com</md:OrganizationURL>
    </md:Organization>
    <md:ContactPerson contactType="technical">
      <md:EmailAddress>net.supervision@mines-douai.fr</md:EmailAddress>
    </md:ContactPerson>
  </md:EntityDescriptor>


text:
/*****************************************************************************/
/*                                                                           */
/*            Copyright (C)           1997-1999         M. Held              */
/*                                                                           */
/* This code is not in the public domain. All rights reserved! Please make   */
/* sure to read the full copyright statement contained in "README" or in the */
/* "main" file of this code, such as "main.c".                               */
/*                                                                           */
/*****************************************************************************/
/*                                                                           */
/* Written by:  Martin Held                                                  */
/* Date:        March 16, 1997                                               */
/* Modified:                                                                 */
/*                                                                           */
/* E-Mail:      held@ams.sunysb.edu                                          */
/* Fax Mail:    (+516) 632-8490                                              */
/* Voice Mail:  (+516) 632-8362                                              */
/* Snail Mail:  Martin Held                                                  */
/*              Department of Applied Mathematics                            */
/*              State University of New York at Stony Brook                  */
/*              Stony Brook, NY 11794-3600, USA                              */
/*                                                                           */
/*****************************************************************************/

/* graphics.c */

#ifdef GRAPHICS

void SetBB(machine_double *xl, machine_double *yl, machine_double *xr, machine_double *yr,
           machine_double xl_bb, machine_double yl_bb, machine_double xr_bb, machine_double yr_bb);

void InitializeMapping(machine_double xl, machine_double yl, machine_double xr, machine_double yr,
                       int imax, int jmax, machine_double *scale,
                       machine_double *xm, machine_double *ym, int *im, int *jm);

void DrawLine(Display *mydisplay, Window  mywindow, GC mygc,
              int im, int jm, machine_double scale, machine_double xm, machine_double ym,
              machine_double xc1, machine_double yc1, machine_double xc2, machine_double yc2);

void DrawTriangle(Display *mydisplay, Window  mywindow, GC mygc,
                  int im, int jm, machine_double scale, machine_double xm, machine_double ym,
                  machine_double xc1, machine_double yc1, machine_double xc2, machine_double yc2,
                  machine_double xc3, machine_double yc3);

void DrawFilledTriangle(Display *mydisplay, Window  mywindow, GC mygc,
                        int im, int jm, machine_double scale, machine_double xm, machine_double ym,
                        machine_double xc1, machine_double yc1, machine_double xc2, machine_double yc2,
                        machine_double xc3, machine_double yc3);

void DrawFilledCircle(Display *mydisplay, Window  mywindow, GC mygc,
                      int im, int jm, machine_double scale, machine_double xm, machine_double ym,
                      machine_double xc1, machine_double yc1, unsigned int radius);

void MapWorldCoordinates(machine_double scale, machine_double xm, machine_double ym, int im, int jm,
                         machine_double x, machine_double y, int *i, int *j);

void MapWindowCoordinates(machine_double scale, machine_double xm, machine_double ym, int im, int jm,
                          int i,int j, machine_double *x, machine_double *y);

void ConsumeTime(void);

void ChooseCursor(int cursor_shape);

void ChooseSprayCanCursor(void);

void SelectInputEvents(void);

void InitGraphicsContext(void);

void CreateWindow(int argc, char *argv[]);

void SetWindowPositionSize(void);

void SetPixelValues(boolean color_graphics);

void GraphicsStartUp(void);

void FreeGraphics(void);

void QuickDisplay();

void ProcessMouseClick(int curr_loop);

void ClosePolygon(int curr_loop, boolean *new_input);

#endif


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Pleospora pachyasca Auersw.

### Remarks
null


text:
@interface ContainerViewSegueManager ()

@end

@implementation ContainerViewSegueManager

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)viewWillAppear:(BOOL)animated {
    [self setUpDataManagerClass:_containerDataClass];
}

-(void)setUpDataManagerClass:(id)class {
    if ([class conformsToProtocol:@protocol(ContainerViewManagerDelegate)]){
        class = [[class alloc] initWithParent:self.parentViewController andContainer:self];
    }
}

#pragma mark - Segue handle methods
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([self.childViewControllers count] > 0) {
        [self swapFromViewController:[self.childViewControllers objectAtIndex:0] toViewController:segue.destinationViewController];
    }
    else {
        [self addChildViewController:segue.destinationViewController];
        segue.destinationViewController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
        [self.view addSubview:segue.destinationViewController.view];
        [segue.destinationViewController didMoveToParentViewController:self];
    }
}

-(void)swapFromViewController:(UIViewController *)fromViewController toViewController:(UIViewController *)toViewController {
    toViewController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);

    [fromViewController willMoveToParentViewController:nil];
    [self addChildViewController:toViewController];
    [self transitionFromViewController:fromViewController toViewController:toViewController duration:0.2 options:UIViewAnimationOptionTransitionCrossDissolve animations:nil completion:^(BOOL finished) {
        [fromViewController removeFromParentViewController];
        [toViewController didMoveToParentViewController:self];
    }];
}

@end


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.fax4j.spi.comm (fax4j 0.45.0 API)</title>
<meta name="date" content="2020-05-15">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

org.fax4j.spi.comm

Interfaces

CommPortAdapter

CommPortConnectionFactory

FaxModemAdapter

Classes

AbstractCommPortAdapter

AbstractCommPortConnectionFactory

AbstractFax4JFaxModemAdapter

AbstractFaxModemAdapter

CommFaxClientSpi

RXTXCommPortAdapter

RXTXCommPortConnectionFactory

Enums

CommFaxClientSpi.FaxClientSpiConfigurationConstants


text:
package org.oscm.app.vmware.ui.pages.clusterconfig;

import org.apache.commons.configuration.HierarchicalConfiguration;

/**
 * Reflects the host balancer configuration.
 *
 * @author soehnges
 */
public class HostBalancerConfig {

    private HierarchicalConfiguration xmlConfig;

    public HostBalancerConfig(HierarchicalConfiguration xmlConfig) {
        this.xmlConfig = xmlConfig;
    }

    public String getBalancer() {
        return xmlConfig.getString("[@class]");
    }

    public void setBalancer(String value) {
        xmlConfig.setProperty("[@class]", value);
    }

    public String getMemoryWeight() {
        return xmlConfig.getString("[@memoryWeight]");
    }

    public void setMemoryWeight(String value) {
        xmlConfig.setProperty("[@memoryWeight]", value);
    }

    public String getCpuWeight() {
        return xmlConfig.getString("[@cpuWeight]");
    }

    public void setCpuWeight(String value) {
        xmlConfig.setProperty("[@cpuWeight]", value);
    }

    public String getVmWeight() {
        return xmlConfig.getString("[@vmWeight]");
    }

    public void setVmWeight(String value) {
        xmlConfig.setProperty("[@vmWeight]", value);
    }

}


text:
<?php

namespace App\Http\Controllers\Api;

use Auth;
use DB;
use Image;
use Log;
use Validator;
use App\Type;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;

class ClassController extends Controller
{
    protected $request;

    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    public function index()
    {
        $types = Type::all();

        return new JsonResponse(compact('types'), 200);
    }

    public function store()
    {
        $this->validate($this->request, [
            'type' => 'required'
        ]);

        $data = $this->request->all();
        $type = new Type();

        if( isset($data["id"]) && Type::find($data["id"]) ){
            $type = Type::find($data["id"]);
        }

        $type->class = $data["type"];

        $type->save();
    }
}


text:
namespace caffe2 {

REGISTER_CPU_OPERATOR(
    RecurrentNetworkBlobFetcher,
    RecurrentNetworkBlobFetcherOp<CPUContext>);

OPERATOR_SCHEMA(RecurrentNetworkBlobFetcher)
    .NumInputs(1)
    .NumOutputs(1)
    .SetDoc(R"DOC(
Retrieves blobs from scratch workspaces (which contain intermediate recurrent
network computation for each timestep) and puts them in the global
workspace under CPUContext.
)DOC")
    .Arg("prefix", "Prefix string to prepend extracted blobs.")
    .Input(
        0,
        "ScratchWorkspaceBlob",
        "Name of scratch workspace blob returned by recurrent network.")
    .Output(
        0,
        "blob_names",
        "1D tensor of strings containing extracted blob names.");

SHOULD_NOT_DO_GRADIENT(RecurrentNetworkBlobFetcher);
} // namespace caffe2