text:
/*
 * syslinux/idle.h
 */

#ifndef _SYSLINUX_IDLE_H
#define _SYSLINUX_IDLE_H

void syslinux_idle(void);
void syslinux_reset_idle(void);

#endif


text:
<?php

namespace Core\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Paises
 *
 * @ORM\Table(name="paises", indexes={@ORM\Index(name="continente_id_idx", columns={"continente_id"})})
 * @ORM\Entity
 */
class Paises
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="sigla", type="string", length=5, nullable=true)
     */
    private $sigla;

    /**
     * @var string
     *
     * @ORM\Column(name="apelido", type="string", length=200, nullable=true)
     */
    private $apelido;

    /**
     * @var \Core\Entity\Continentes
     *
     * @ORM\ManyToOne(targetEntity="Core\Entity\Continentes")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="continente_id", referencedColumnName="id")
     * })
     */
    private $continente;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set sigla
     *
     * @param string $sigla
     * @return Paises
     */
    public function setSigla($sigla)
    {
        $this->sigla = $sigla;

        return $this;
    }

    /**
     * Get sigla
     *
     * @return string
     */
    public function getSigla()
    {
        return $this->sigla;
    }

    /**
     * Set apelido
     *
     * @param string $apelido
     * @return Paises
     */
    public function setApelido($apelido)
    {
        $this->apelido = $apelido;

        return $this;
    }

    /**
     * Get apelido
     *
     * @return string
     */
    public function getApelido()
    {
        return $this->apelido;
    }

    /**
     * Set continente
     *
     * @param \Core\Entity\Continentes $continente
     * @return Paises
     */
    public function setContinente(\Core\Entity\Continentes $continente = null)
    {
        $this->continente = $continente;

        return $this;
    }

    /**
     * Get continente
     *
     * @return \Core\Entity\Continentes
     */
    public function getContinente()
    {
        return $this->continente;
    }
}

redpajama_set_name: RedPajamaGithub


text:
from __future__ import unicode_literals, division, absolute_import
from builtins import *  # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.request import urlopen
from future.moves.urllib.parse import urlparse

import time
import logging
from datetime import timedelta, datetime

import requests
# Allow some request objects to be imported from here instead of requests
import warnings
from requests import RequestException

from flexget import __version__ as version
from flexget.utils.tools import parse_timedelta, TimedDict, timedelta_total_seconds

# If we use just 'requests' here, we'll get the logger created by requests, rather than our own
log = logging.getLogger('utils.requests')

# Don't emit info level urllib3 log messages or below
logging.getLogger('requests.packages.urllib3').setLevel(logging.WARNING)
# same as above, but for systems where urllib3 isn't part of the requests pacakge (i.e., Ubuntu)
logging.getLogger('urllib3').setLevel(logging.WARNING)

# Time to wait before trying an unresponsive site again
WAIT_TIME = timedelta(seconds=60)
# Remembers sites that have timed out
unresponsive_hosts = TimedDict(WAIT_TIME)

def is_unresponsive(url):
    """
    Checks if host of given url has timed out within WAIT_TIME

    :param url: The url to check
    :return: True if the host has timed out within WAIT_TIME
    :rtype: bool
    """
    host = urlparse(url).hostname
    return host in unresponsive_hosts

def set_unresponsive(url):
    """
    Marks the host of a given url as unresponsive

    :param url: The url that timed out
    """
    host = urlparse(url).hostname
    if host in unresponsive_hosts:
        # If somehow this is called again before previous timer clears, don't refresh
        return
    unresponsive_hosts[host] = True

class DomainLimiter(object):
    def __init__(self, domain):
        self.domain = domain

    def __call__(self):
        """This method will be called once before every request to the domain."""
        raise NotImplementedError

class TokenBucketLimiter(DomainLimiter):
    """
    A token bucket rate limiter for domains.

    New instances for the same domain will restore previous values.
    """
    # This is just an in memory cache right now, it works for the daemon, and across tasks in a single execution
    # but not for multiple executions via cron. Do we need to store this to db?
    state_cache = {}

    def __init__(self, domain, tokens, rate, wait=True):
        """
        :param int tokens: Size of bucket
        :param rate: Amount of time to accrue 1 token. Either `timedelta` or interval string.
        :param bool wait: If true, will wait for a token to be available. If false, errors when token is not available.
        """
        super(TokenBucketLimiter, self).__init__(domain)
        self.max_tokens = tokens
        self.rate = parse_timedelta(rate)
        self.wait = wait
        # Restore previous state for this domain, or establish new state cache
        self.state = self.state_cache.setdefault(domain, {'tokens': self.max_tokens, 'last_update': datetime.now()})

    @property
    def tokens(self):
        return min(self.max_tokens, self.state['tokens'])

    @tokens.setter
    def tokens(self, value):
        self.state['tokens'] = value

    @property
    def last_update(self):
        return self.state['last_update']

    @last_update.setter
    def last_update(self, value):
        self.state['last_update'] = value

    def __call__(self):
        if self.tokens < self.max_tokens:
            regen = (timedelta_total_seconds(datetime.now() - self.last_update) /
                     timedelta_total_seconds(self.rate))
            self.tokens += regen
        self.last_update = datetime.now()
        if self.tokens < 1:
            if not self.wait:
                raise RequestException('Requests to %s have exceeded their limit.' % self.domain)
            wait = timedelta_total_seconds(self.rate) * (1 - self.tokens)
            # Don't spam console if wait is low
            if wait < 4:
                level = log.debug
            else:
                level = log.verbose
            level('Waiting %.2f seconds until next request to %s', wait, self.domain)
            # Sleep until it is time for the next request
            time.sleep(wait)
        self.tokens -= 1

class TimedLimiter(TokenBucketLimiter):
    """Enforces a minimum interval between requests to a given domain."""

    def __init__(self, domain, interval):
        super(TimedLimiter, self).__init__(domain, 1, interval)

def _wrap_urlopen(url, timeout=None):
    """
    Handles alternate schemes using urllib, wraps the response in a requests.Response

    This is not installed as an adapter in requests, since urls without network locations
    (e.g. file:///somewhere) will cause errors

    """
    try:
        raw = urlopen(url, timeout=timeout)
    except IOError as e:
        msg = 'Error getting %s: %s' % (url, e)
        log.error(msg)
        raise RequestException(msg)
    resp = requests.Response()
    resp.raw = raw
    # requests passes the `decode_content` kwarg to read
    orig_read = raw.read
    resp.raw.read = lambda size, **kwargs: orig_read(size)
    resp.status_code = raw.code or 200
    resp.headers = requests.structures.CaseInsensitiveDict(raw.headers)
    return resp

def limit_domains(url, limit_dict):
    """
    If this url matches a domain in `limit_dict`, run the limiter.

    This is separated in to its own function so that limits can be disabled during unit tests with VCR.
    """
    for domain, limiter in limit_dict.items():
        if domain in url:
            limiter()
            break

class Session(requests.Session):
    """
    Subclass of requests Session class which defines some of our own defaults, records unresponsive sites,
    and raises errors by default.

    """

    def __init__(self, timeout=30, max_retries=1, *args, **kwargs):
        """Set some defaults for our session if not explicitly defined."""
        super(Session, self).__init__(*args, **kwargs)
        self.timeout = timeout
        self.stream = True
        self.adapters['http://'].max_retries = max_retries
        # Stores min intervals between requests for certain sites
        self.domain_limiters = {}
        self.headers.update({'User-Agent': 'FlexGet/%s (www.flexget.com)' % version})

    def add_cookiejar(self, cookiejar):
        """
        Merges cookies from `cookiejar` into cookiejar for this session.

        :param cookiejar: CookieJar instance to add to the session.
        """
        for cookie in cookiejar:
            self.cookies.set_cookie(cookie)

    def set_domain_delay(self, domain, delay):
        """
        DEPRECATED, use `add_domain_limiter`
        Registers a minimum interval between requests to `domain`

        :param domain: The domain to set the interval on
        :param delay: The amount of time between requests, can be a timedelta or string like '3 seconds'
        """
        warnings.warn('set_domain_delay is deprecated, use add_domain_limiter', DeprecationWarning, stacklevel=2)
        self.domain_limiters[domain] = TimedLimiter(domain, delay)

    def add_domain_limiter(self, limiter):
        """
        Add a limiter to throttle requests to a specific domain.

        :param DomainLimiter limiter: The `DomainLimiter` to add to the session.
        """
        self.domain_limiters[limiter.domain] = limiter

    def request(self, method, url, *args, **kwargs):
        """
        Does a request, but raises Timeout immediately if site is known to timeout, and records sites that timeout.
        Also raises errors getting the content by default.

        :param bool raise_status: If True, non-success status code responses will be raised as errors (True by default)
        """

        # Raise Timeout right away if site is known to timeout
        if is_unresponsive(url):
            raise requests.Timeout('Requests to this site (%s) have timed out recently. Waiting before trying again.' %
                                   urlparse(url).hostname)

        # Run domain limiters for this url
        limit_domains(url, self.domain_limiters)

        kwargs.setdefault('timeout', self.timeout)
        raise_status = kwargs.pop('raise_status', True)

        # If we do not have an adapter for this url, pass it off to urllib
        if not any(url.startswith(adapter) for adapter in self.adapters):
            log.debug('No adaptor, passing off to urllib')
            return _wrap_urlopen(url, timeout=kwargs['timeout'])

        try:
            log.debug('Fetching URL %s with args %s and kwargs %s', url, args, kwargs)
            result = super(Session, self).request(method, url, *args, **kwargs)
        except requests.Timeout:
            # Mark this site in known unresponsive list
            set_unresponsive(url)
            raise

        if raise_status:
            result.raise_for_status()

        return result

# Define some module level functions that use our Session, so this module can be used like main requests module
def request(method, url, **kwargs):
    s = kwargs.pop('session', Session())
    return s.request(method=method, url=url, **kwargs)

def head(url, **kwargs):
    """Sends a HEAD request. Returns :class:`Response` object.

    :param url: URL for the new :class:`Request` object.
    :param kwargs: Optional arguments that ``request`` takes.
    """
    kwargs.setdefault('allow_redirects', True)
    return request('head', url, **kwargs)

def get(url, **kwargs):
    """Sends a GET request. Returns :class:`Response` object.

    :param url: URL for the new :class:`Request` object.
    :param kwargs: Optional arguments that ``request`` takes.
    """
    kwargs.setdefault('allow_redirects', True)
    return request('get', url, **kwargs)

def post(url, data=None, **kwargs):
    """Sends a POST request. Returns :class:`Response` object.

    :param url: URL for the new :class:`Request` object.
    :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.
    :param kwargs: Optional arguments that ``request`` takes.
    """
    return request('post', url, data=data, **kwargs)


text:
/*
 * Copyright (c) 2012 by Delphix. All rights reserved.
 */

/*
 * zhack is a debugging tool that can write changes to ZFS pool using libzpool
 * for testing purposes. Altering pools with zhack is unsupported and may
 * result in corrupted pools.
 */

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <sys/zfs_context.h>
#include <sys/spa.h>
#include <sys/spa_impl.h>
#include <sys/dmu.h>
#include <sys/zap.h>
#include <sys/zfs_znode.h>
#include <sys/dsl_synctask.h>
#include <sys/vdev.h>
#include <sys/fs/zfs.h>
#include <sys/dmu_objset.h>
#include <sys/dsl_pool.h>
#include <sys/zio_checksum.h>
#include <sys/zio_compress.h>
#include <sys/zfeature.h>
#undef ZFS_MAXNAMELEN
#include <libzfs.h>

extern boolean_t zfeature_checks_disable;

const char cmdname[] = "zhack";
libzfs_handle_t *g_zfs;
static importargs_t g_importargs;
static char *g_pool;
static boolean_t g_readonly;

static void
usage(void)
{
	(void) fprintf(stderr,
	    "Usage: %s [-c cachefile] [-d dir] <subcommand> <args> ...\n"
	    "where <subcommand> <args> is one of the following:\n"
	    "\n", cmdname);

	(void) fprintf(stderr,
	    "    feature stat <pool>\n"
	    "        print information about enabled features\n"
	    "    feature enable [-d desc] <pool> <feature>\n"
	    "        add a new enabled feature to the pool\n"
	    "        -d <desc> sets the feature's description\n"
	    "    feature ref [-md] <pool> <feature>\n"
	    "        change the refcount on the given feature\n"
	    "        -d decrease instead of increase the refcount\n"
	    "        -m add the feature to the label if increasing refcount\n"
	    "\n"
	    "    <feature> : should be a feature guid\n");
	exit(1);
}

static void
fatal(const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	(void) fprintf(stderr, "%s: ", cmdname);
	(void) vfprintf(stderr, fmt, ap);
	va_end(ap);
	(void) fprintf(stderr, "\n");

	exit(1);
}

/* ARGSUSED */
static int
space_delta_cb(dmu_object_type_t bonustype, void *data,
    uint64_t *userp, uint64_t *groupp)
{
	/*
	 * Is it a valid type of object to track?
	 */
	if (bonustype != DMU_OT_ZNODE && bonustype != DMU_OT_SA)
		return (ENOENT);
	(void) fprintf(stderr, "modifying object that needs user accounting");
	abort();
	/* NOTREACHED */
}

/*
 * Target is the dataset whose pool we want to open.
 */
static void
import_pool(const char *target, boolean_t readonly)
{
	nvlist_t *config;
	nvlist_t *pools;
	int error;
	char *sepp;
	spa_t *spa;
	nvpair_t *elem;
	nvlist_t *props;
	const char *name;

	kernel_init(readonly ? FREAD : (FREAD | FWRITE));
	g_zfs = libzfs_init();
	ASSERT(g_zfs != NULL);

	dmu_objset_register_type(DMU_OST_ZFS, space_delta_cb);

	g_readonly = readonly;

	/*
	 * If we only want readonly access, it's OK if we find
	 * a potentially-active (ie, imported into the kernel) pool from the
	 * default cachefile.
	 */
	if (readonly && spa_open(target, &spa, FTAG) == 0) {
		spa_close(spa, FTAG);
		return;
	}

	g_importargs.unique = B_TRUE;
	g_importargs.can_be_active = readonly;
	g_pool = strdup(target);
	if ((sepp = strpbrk(g_pool, "/@")) != NULL)
		*sepp = '\0';
	g_importargs.poolname = g_pool;
	pools = zpool_search_import(g_zfs, &g_importargs);

	if (pools == NULL || nvlist_next_nvpair(pools, NULL) == NULL) {
		if (!g_importargs.can_be_active) {
			g_importargs.can_be_active = B_TRUE;
			if (zpool_search_import(g_zfs, &g_importargs) != NULL ||
			    spa_open(target, &spa, FTAG) == 0) {
				fatal("cannot import '%s': pool is active; run "
				    "\"zpool export %s\" first\n",
				    g_pool, g_pool);
			}
		}

		fatal("cannot import '%s': no such pool available\n", g_pool);
	}

	elem = nvlist_next_nvpair(pools, NULL);
	name = nvpair_name(elem);
	VERIFY(nvpair_value_nvlist(elem, &config) == 0);

	props = NULL;
	if (readonly) {
		VERIFY(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);
		VERIFY(nvlist_add_uint64(props,
		    zpool_prop_to_name(ZPOOL_PROP_READONLY), 1) == 0);
	}

	zfeature_checks_disable = B_TRUE;
	error = spa_import(name, config, props, ZFS_IMPORT_NORMAL);
	zfeature_checks_disable = B_FALSE;
	if (error == EEXIST)
		error = 0;

	if (error)
		fatal("can't import '%s': %s", name, strerror(error));
}

static void
zhack_spa_open(const char *target, boolean_t readonly, void *tag, spa_t **spa)
{
	int err;

	import_pool(target, readonly);

	zfeature_checks_disable = B_TRUE;
	err = spa_open(target, spa, tag);
	zfeature_checks_disable = B_FALSE;

	if (err != 0)
		fatal("cannot open '%s': %s", target, strerror(err));
	if (spa_version(*spa) < SPA_VERSION_FEATURES) {
		fatal("'%s' has version %d, features not enabled", target,
		    (int)spa_version(*spa));
	}
}

static void
dump_obj(objset_t *os, uint64_t obj, const char *name)
{
	zap_cursor_t zc;
	zap_attribute_t za;

	(void) printf("%s_obj:\n", name);

	for (zap_cursor_init(&zc, os, obj);
	    zap_cursor_retrieve(&zc, &za) == 0;
	    zap_cursor_advance(&zc)) {
		if (za.za_integer_length == 8) {
			ASSERT(za.za_num_integers == 1);
			(void) printf("\t%s = %llu\n",
			    za.za_name, (u_longlong_t)za.za_first_integer);
		} else {
			ASSERT(za.za_integer_length == 1);
			char val[1024];
			VERIFY(zap_lookup(os, obj, za.za_name,
			    1, sizeof (val), val) == 0);
			(void) printf("\t%s = %s\n", za.za_name, val);
		}
	}
	zap_cursor_fini(&zc);
}

static void
dump_mos(spa_t *spa)
{
	nvlist_t *nv = spa->spa_label_features;
	nvpair_t *pair;

	(void) printf("label config:\n");
	for (pair = nvlist_next_nvpair(nv, NULL);
	    pair != NULL;
	    pair = nvlist_next_nvpair(nv, pair)) {
		(void) printf("\t%s\n", nvpair_name(pair));
	}
}

static void
zhack_do_feature_stat(int argc, char **argv)
{
	spa_t *spa;
	objset_t *os;
	char *target;

	argc--;
	argv++;

	if (argc < 1) {
		(void) fprintf(stderr, "error: missing pool name\n");
		usage();
	}
	target = argv[0];

	zhack_spa_open(target, B_TRUE, FTAG, &spa);
	os = spa->spa_meta_objset;

	dump_obj(os, spa->spa_feat_for_read_obj, "for_read");
	dump_obj(os, spa->spa_feat_for_write_obj, "for_write");
	dump_obj(os, spa->spa_feat_desc_obj, "descriptions");
	dump_mos(spa);

	spa_close(spa, FTAG);
}

static void
feature_enable_sync(void *arg1, void *arg2, dmu_tx_t *tx)
{
	spa_t *spa = arg1;
	zfeature_info_t *feature = arg2;

	spa_feature_enable(spa, feature, tx);
}

static void
zhack_do_feature_enable(int argc, char **argv)
{
	char c;
	char *desc, *target;
	spa_t *spa;
	objset_t *mos;
	zfeature_info_t feature;
	zfeature_info_t *nodeps[] = { NULL };

	/*
	 * Features are not added to the pool's label until their refcounts
	 * are incremented, so fi_mos can just be left as false for now.
	 */
	desc = NULL;
	feature.fi_uname = "zhack";
	feature.fi_mos = B_FALSE;
	feature.fi_can_readonly = B_FALSE;
	feature.fi_depends = nodeps;

	optind = 1;
	while ((c = getopt(argc, argv, "rmd:")) != -1) {
		switch (c) {
		case 'r':
			feature.fi_can_readonly = B_TRUE;
			break;
		case 'd':
			desc = strdup(optarg);
			break;
		default:
			usage();
			break;
		}
	}

	if (desc == NULL)
		desc = strdup("zhack injected");
	feature.fi_desc = desc;

	argc -= optind;
	argv += optind;

	if (argc < 2) {
		(void) fprintf(stderr, "error: missing feature or pool name\n");
		usage();
	}
	target = argv[0];
	feature.fi_guid = argv[1];

	if (!zfeature_is_valid_guid(feature.fi_guid))
		fatal("invalid feature guid: %s", feature.fi_guid);

	zhack_spa_open(target, B_FALSE, FTAG, &spa);
	mos = spa->spa_meta_objset;

	if (0 == zfeature_lookup_guid(feature.fi_guid, NULL))
		fatal("'%s' is a real feature, will not enable");
	if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
		fatal("feature already enabled: %s", feature.fi_guid);

	VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
	    feature_enable_sync, spa, &feature, 5));

	spa_close(spa, FTAG);

	free(desc);
}

static void
feature_incr_sync(void *arg1, void *arg2, dmu_tx_t *tx)
{
	spa_t *spa = arg1;
	zfeature_info_t *feature = arg2;

	spa_feature_incr(spa, feature, tx);
}

static void
feature_decr_sync(void *arg1, void *arg2, dmu_tx_t *tx)
{
	spa_t *spa = arg1;
	zfeature_info_t *feature = arg2;

	spa_feature_decr(spa, feature, tx);
}

static void
zhack_do_feature_ref(int argc, char **argv)
{
	char c;
	char *target;
	boolean_t decr = B_FALSE;
	spa_t *spa;
	objset_t *mos;
	zfeature_info_t feature;
	zfeature_info_t *nodeps[] = { NULL };

	/*
	 * fi_desc does not matter here because it was written to disk
	 * when the feature was enabled, but we need to properly set the
	 * feature for read or write based on the information we read off
	 * disk later.
	 */
	feature.fi_uname = "zhack";
	feature.fi_mos = B_FALSE;
	feature.fi_desc = NULL;
	feature.fi_depends = nodeps;

	optind = 1;
	while ((c = getopt(argc, argv, "md")) != -1) {
		switch (c) {
		case 'm':
			feature.fi_mos = B_TRUE;
			break;
		case 'd':
			decr = B_TRUE;
			break;
		default:
			usage();
			break;
		}
	}
	argc -= optind;
	argv += optind;

	if (argc < 2) {
		(void) fprintf(stderr, "error: missing feature or pool name\n");
		usage();
	}
	target = argv[0];
	feature.fi_guid = argv[1];

	if (!zfeature_is_valid_guid(feature.fi_guid))
		fatal("invalid feature guid: %s", feature.fi_guid);

	zhack_spa_open(target, B_FALSE, FTAG, &spa);
	mos = spa->spa_meta_objset;

	if (0 == zfeature_lookup_guid(feature.fi_guid, NULL))
		fatal("'%s' is a real feature, will not change refcount");

	if (0 == zap_contains(mos, spa->spa_feat_for_read_obj,
	    feature.fi_guid)) {
		feature.fi_can_readonly = B_FALSE;
	} else if (0 == zap_contains(mos, spa->spa_feat_for_write_obj,
	    feature.fi_guid)) {
		feature.fi_can_readonly = B_TRUE;
	} else {
		fatal("feature is not enabled: %s", feature.fi_guid);
	}

	if (decr && !spa_feature_is_active(spa, &feature))
		fatal("feature refcount already 0: %s", feature.fi_guid);

	VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
	    decr ? feature_decr_sync : feature_incr_sync, spa, &feature, 5));

	spa_close(spa, FTAG);
}

static int
zhack_do_feature(int argc, char **argv)
{
	char *subcommand;

	argc--;
	argv++;
	if (argc == 0) {
		(void) fprintf(stderr,
		    "error: no feature operation specified\n");
		usage();
	}

	subcommand = argv[0];
	if (strcmp(subcommand, "stat") == 0) {
		zhack_do_feature_stat(argc, argv);
	} else if (strcmp(subcommand, "enable") == 0) {
		zhack_do_feature_enable(argc, argv);
	} else if (strcmp(subcommand, "ref") == 0) {
		zhack_do_feature_ref(argc, argv);
	} else {
		(void) fprintf(stderr, "error: unknown subcommand: %s\n",
		    subcommand);
		usage();
	}

	return (0);
}

#define	MAX_NUM_PATHS 1024

int
main(int argc, char **argv)
{
	extern void zfs_prop_init(void);

	char *path[MAX_NUM_PATHS];
	const char *subcommand;
	int rv = 0;
	char c;

	g_importargs.path = path;

	dprintf_setup(&argc, argv);
	zfs_prop_init();

	while ((c = getopt(argc, argv, "c:d:")) != -1) {
		switch (c) {
		case 'c':
			g_importargs.cachefile = optarg;
			break;
		case 'd':
			assert(g_importargs.paths < MAX_NUM_PATHS);
			g_importargs.path[g_importargs.paths++] = optarg;
			break;
		default:
			usage();
			break;
		}
	}

	argc -= optind;
	argv += optind;
	optind = 1;

	if (argc == 0) {
		(void) fprintf(stderr, "error: no command specified\n");
		usage();
	}

	subcommand = argv[0];

	if (strcmp(subcommand, "feature") == 0) {
		rv = zhack_do_feature(argc, argv);
	} else {
		(void) fprintf(stderr, "error: unknown subcommand: %s\n",
		    subcommand);
		usage();
	}

	if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_TRUE) != 0) {
		fatal("pool export failed; "
		    "changes may not be committed to disk\n");
	}

	libzfs_fini(g_zfs);
	kernel_fini();

	return (rv);
}


text:
layout: post
title: Tweets
date: 2019-08-30
summary: These are the tweets for August 30, 2019.
categories:
---


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
using Azure.ResourceManager.ContainerRegistry;

namespace Azure.ResourceManager.ContainerRegistry.Models
{
    internal partial class ContainerRegistryTaskListResult
    {
        internal static ContainerRegistryTaskListResult DeserializeContainerRegistryTaskListResult(JsonElement element)
        {
            Optional<IReadOnlyList<ContainerRegistryTaskData>> value = default;
            Optional<string> nextLink = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<ContainerRegistryTaskData> array = new List<ContainerRegistryTaskData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ContainerRegistryTaskData.DeserializeContainerRegistryTaskData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return new ContainerRegistryTaskListResult(Optional.ToList(value), nextLink.Value);
        }
    }
}


text:
<!DOCTYPE html>

  {{.PageTitle}}
  <meta charset='utf-8' />
  <meta name="keywords" content="{{.MetaKeywords}}" />
  <meta name="description" content="{{.MetaDescription}}" />
  <meta name="apple-mobile-web-app-capable" content="no">
  <meta content='True' name='HandheldFriendly' />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />

  <link rel="alternate" type="application/rss+xml" title="订阅最新帖" href="<%= feed_topics_url %>" />
  <link rel="stylesheet" media="screen" href="https://ruby-china-files.b0.upaiyun.com/assets/front-fc9aedc9c3cb04667f469712ece27d93f90ca5eb1932a5c598c6243475e53043.css" data-turbolinks-track="true" />

<body data-controller-name="<%= controller_name %>">

          Beginner Mind

		{{.NavBar}}
		{{.UserNav}}

            <form class="navbar-form form-search" action="/search" method="GET">

                <input class="form-control" name="q" type="text" value="" placeholder="搜索本站内容" />

            </form>

	{{.Content}}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     Ce code a été généré par un outil.
//     Version du runtime :4.0.30319.34209
//
//     Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
//     le code est régénéré.
// </auto-generated>
//------------------------------------------------------------------------------

namespace LibrairieService.LobbyGameProxy {
    using System.Runtime.Serialization;
    using System;

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="RoomInfo", Namespace="http://schemas.datacontract.org/2004/07/LibrairieService.Models")]
    [System.SerializableAttribute()]
    public partial class RoomInfo : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {

        [System.NonSerializedAttribute()]
        private System.Runtime.Serialization.ExtensionDataObject extensionDataField;

        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string MasterNameField;

        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string NameField;

        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private System.Guid TokenField;

        [global::System.ComponentModel.BrowsableAttribute(false)]
        public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
            get {
                return this.extensionDataField;
            }
            set {
                this.extensionDataField = value;
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public string MasterName {
            get {
                return this.MasterNameField;
            }
            set {
                if ((object.ReferenceEquals(this.MasterNameField, value) != true)) {
                    this.MasterNameField = value;
                    this.RaisePropertyChanged("MasterName");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public string Name {
            get {
                return this.NameField;
            }
            set {
                if ((object.ReferenceEquals(this.NameField, value) != true)) {
                    this.NameField = value;
                    this.RaisePropertyChanged("Name");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public System.Guid Token {
            get {
                return this.TokenField;
            }
            set {
                if ((this.TokenField.Equals(value) != true)) {
                    this.TokenField = value;
                    this.RaisePropertyChanged("Token");
                }
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="UserMessage", Namespace="http://schemas.datacontract.org/2004/07/LibrairieService.Models")]
    [System.SerializableAttribute()]
    public partial class UserMessage : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {

        [System.NonSerializedAttribute()]
        private System.Runtime.Serialization.ExtensionDataObject extensionDataField;

        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string ContentField;

        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private System.DateTime DateField;

        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string UsernameField;

        [global::System.ComponentModel.BrowsableAttribute(false)]
        public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
            get {
                return this.extensionDataField;
            }
            set {
                this.extensionDataField = value;
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public string Content {
            get {
                return this.ContentField;
            }
            set {
                if ((object.ReferenceEquals(this.ContentField, value) != true)) {
                    this.ContentField = value;
                    this.RaisePropertyChanged("Content");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public System.DateTime Date {
            get {
                return this.DateField;
            }
            set {
                if ((this.DateField.Equals(value) != true)) {
                    this.DateField = value;
                    this.RaisePropertyChanged("Date");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public string Username {
            get {
                return this.UsernameField;
            }
            set {
                if ((object.ReferenceEquals(this.UsernameField, value) != true)) {
                    this.UsernameField = value;
                    this.RaisePropertyChanged("Username");
                }
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="PlayerConfigEntry", Namespace="http://schemas.datacontract.org/2004/07/LibrairieService.Models")]
    [System.SerializableAttribute()]
    public partial class PlayerConfigEntry : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {

        [System.NonSerializedAttribute()]
        private System.Runtime.Serialization.ExtensionDataObject extensionDataField;

        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private int OrderField;

        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private int TeamField;

        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private System.Guid UserTokenField;

        [global::System.ComponentModel.BrowsableAttribute(false)]
        public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
            get {
                return this.extensionDataField;
            }
            set {
                this.extensionDataField = value;
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public int Order {
            get {
                return this.OrderField;
            }
            set {
                if ((this.OrderField.Equals(value) != true)) {
                    this.OrderField = value;
                    this.RaisePropertyChanged("Order");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public int Team {
            get {
                return this.TeamField;
            }
            set {
                if ((this.TeamField.Equals(value) != true)) {
                    this.TeamField = value;
                    this.RaisePropertyChanged("Team");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public System.Guid UserToken {
            get {
                return this.UserTokenField;
            }
            set {
                if ((this.UserTokenField.Equals(value) != true)) {
                    this.UserTokenField = value;
                    this.RaisePropertyChanged("UserToken");
                }
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="LobbyGameProxy.ILobbyService")]
    public interface ILobbyService {

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/CreateRoom", ReplyAction="http://tempuri.org/ILobbyService/CreateRoomResponse")]
        System.Nullable<System.Guid> CreateRoom(string name, System.Guid roomMaster);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/CreateRoom", ReplyAction="http://tempuri.org/ILobbyService/CreateRoomResponse")]
        System.Threading.Tasks.Task<System.Nullable<System.Guid>> CreateRoomAsync(string name, System.Guid roomMaster);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/JoinRoom", ReplyAction="http://tempuri.org/ILobbyService/JoinRoomResponse")]
        bool JoinRoom(System.Guid player, System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/JoinRoom", ReplyAction="http://tempuri.org/ILobbyService/JoinRoomResponse")]
        System.Threading.Tasks.Task<bool> JoinRoomAsync(System.Guid player, System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/JoinRoomGameEnd", ReplyAction="http://tempuri.org/ILobbyService/JoinRoomGameEndResponse")]
        bool JoinRoomGameEnd(System.Guid player, System.Guid gameEndToken);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/JoinRoomGameEnd", ReplyAction="http://tempuri.org/ILobbyService/JoinRoomGameEndResponse")]
        System.Threading.Tasks.Task<bool> JoinRoomGameEndAsync(System.Guid player, System.Guid gameEndToken);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/LeaveRoom", ReplyAction="http://tempuri.org/ILobbyService/LeaveRoomResponse")]
        bool LeaveRoom(System.Guid player, System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/LeaveRoom", ReplyAction="http://tempuri.org/ILobbyService/LeaveRoomResponse")]
        System.Threading.Tasks.Task<bool> LeaveRoomAsync(System.Guid player, System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetReady", ReplyAction="http://tempuri.org/ILobbyService/SetReadyResponse")]
        bool SetReady(System.Guid player, bool ready);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetReady", ReplyAction="http://tempuri.org/ILobbyService/SetReadyResponse")]
        System.Threading.Tasks.Task<bool> SetReadyAsync(System.Guid player, bool ready);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SendRoomMessage", ReplyAction="http://tempuri.org/ILobbyService/SendRoomMessageResponse")]
        bool SendRoomMessage(System.Guid player, System.Guid room, string message);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SendRoomMessage", ReplyAction="http://tempuri.org/ILobbyService/SendRoomMessageResponse")]
        System.Threading.Tasks.Task<bool> SendRoomMessageAsync(System.Guid player, System.Guid room, string message);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetConfig", ReplyAction="http://tempuri.org/ILobbyService/SetConfigResponse")]
        bool SetConfig(System.Guid player, System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetConfig", ReplyAction="http://tempuri.org/ILobbyService/SetConfigResponse")]
        System.Threading.Tasks.Task<bool> SetConfigAsync(System.Guid player, System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetName", ReplyAction="http://tempuri.org/ILobbyService/SetNameResponse")]
        bool SetName(System.Guid player, System.Guid room, string newName);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetName", ReplyAction="http://tempuri.org/ILobbyService/SetNameResponse")]
        System.Threading.Tasks.Task<bool> SetNameAsync(System.Guid player, System.Guid room, string newName);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetMaster", ReplyAction="http://tempuri.org/ILobbyService/SetMasterResponse")]
        bool SetMaster(System.Guid player, System.Guid room, string newMaster);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetMaster", ReplyAction="http://tempuri.org/ILobbyService/SetMasterResponse")]
        System.Threading.Tasks.Task<bool> SetMasterAsync(System.Guid player, System.Guid room, string newMaster);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetOpenRoomsInfo", ReplyAction="http://tempuri.org/ILobbyService/GetOpenRoomsInfoResponse")]
        LibrairieService.LobbyGameProxy.RoomInfo[] GetOpenRoomsInfo();

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetOpenRoomsInfo", ReplyAction="http://tempuri.org/ILobbyService/GetOpenRoomsInfoResponse")]
        System.Threading.Tasks.Task<LibrairieService.LobbyGameProxy.RoomInfo[]> GetOpenRoomsInfoAsync();

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetLoggedUsers", ReplyAction="http://tempuri.org/ILobbyService/GetLoggedUsersResponse")]
        System.Collections.Generic.Dictionary<string, byte> GetLoggedUsers();

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetLoggedUsers", ReplyAction="http://tempuri.org/ILobbyService/GetLoggedUsersResponse")]
        System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string, byte>> GetLoggedUsersAsync();

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetRoomPlayers", ReplyAction="http://tempuri.org/ILobbyService/GetRoomPlayersResponse")]
        string[] GetRoomPlayers(System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetRoomPlayers", ReplyAction="http://tempuri.org/ILobbyService/GetRoomPlayersResponse")]
        System.Threading.Tasks.Task<string[]> GetRoomPlayersAsync(System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetRoomMessages", ReplyAction="http://tempuri.org/ILobbyService/GetRoomMessagesResponse")]
        LibrairieService.LobbyGameProxy.UserMessage[] GetRoomMessages(System.Guid room, int limit);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetRoomMessages", ReplyAction="http://tempuri.org/ILobbyService/GetRoomMessagesResponse")]
        System.Threading.Tasks.Task<LibrairieService.LobbyGameProxy.UserMessage[]> GetRoomMessagesAsync(System.Guid room, int limit);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetMasterName", ReplyAction="http://tempuri.org/ILobbyService/GetMasterNameResponse")]
        string GetMasterName(System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetMasterName", ReplyAction="http://tempuri.org/ILobbyService/GetMasterNameResponse")]
        System.Threading.Tasks.Task<string> GetMasterNameAsync(System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetTeam", ReplyAction="http://tempuri.org/ILobbyService/SetTeamResponse")]
        bool SetTeam(System.Guid player, System.Guid room, int team);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetTeam", ReplyAction="http://tempuri.org/ILobbyService/SetTeamResponse")]
        System.Threading.Tasks.Task<bool> SetTeamAsync(System.Guid player, System.Guid room, int team);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetCurrentTeamIndex", ReplyAction="http://tempuri.org/ILobbyService/GetCurrentTeamIndexResponse")]
        int GetCurrentTeamIndex(System.Guid player);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetCurrentTeamIndex", ReplyAction="http://tempuri.org/ILobbyService/GetCurrentTeamIndexResponse")]
        System.Threading.Tasks.Task<int> GetCurrentTeamIndexAsync(System.Guid player);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetRoomName", ReplyAction="http://tempuri.org/ILobbyService/SetRoomNameResponse")]
        bool SetRoomName(System.Guid room, string newName);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SetRoomName", ReplyAction="http://tempuri.org/ILobbyService/SetRoomNameResponse")]
        System.Threading.Tasks.Task<bool> SetRoomNameAsync(System.Guid room, string newName);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetCurrentGameToken", ReplyAction="http://tempuri.org/ILobbyService/GetCurrentGameTokenResponse")]
        System.Nullable<System.Guid> GetCurrentGameToken(System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetCurrentGameToken", ReplyAction="http://tempuri.org/ILobbyService/GetCurrentGameTokenResponse")]
        System.Threading.Tasks.Task<System.Nullable<System.Guid>> GetCurrentGameTokenAsync(System.Guid room);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetNewMessageFrom", ReplyAction="http://tempuri.org/ILobbyService/GetNewMessageFromResponse")]
        LibrairieService.LobbyGameProxy.UserMessage[] GetNewMessageFrom(System.Guid player, string name);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetNewMessageFrom", ReplyAction="http://tempuri.org/ILobbyService/GetNewMessageFromResponse")]
        System.Threading.Tasks.Task<LibrairieService.LobbyGameProxy.UserMessage[]> GetNewMessageFromAsync(System.Guid player, string name);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/DoTheBigBastardThatWaveHisFlagHasNewMessageFromS" +
            "omeoneIfSoTellMeLad", ReplyAction="http://tempuri.org/ILobbyService/DoTheBigBastardThatWaveHisFlagHasNewMessageFromS" +
            "omeoneIfSoTellMeLadResponse")]
        string[] DoTheBigBastardThatWaveHisFlagHasNewMessageFromSomeoneIfSoTellMeLad(System.Guid player);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/DoTheBigBastardThatWaveHisFlagHasNewMessageFromS" +
            "omeoneIfSoTellMeLad", ReplyAction="http://tempuri.org/ILobbyService/DoTheBigBastardThatWaveHisFlagHasNewMessageFromS" +
            "omeoneIfSoTellMeLadResponse")]
        System.Threading.Tasks.Task<string[]> DoTheBigBastardThatWaveHisFlagHasNewMessageFromSomeoneIfSoTellMeLadAsync(System.Guid player);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SendPrivateMessage", ReplyAction="http://tempuri.org/ILobbyService/SendPrivateMessageResponse")]
        bool SendPrivateMessage(System.Guid from, string to, string message);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/SendPrivateMessage", ReplyAction="http://tempuri.org/ILobbyService/SendPrivateMessageResponse")]
        System.Threading.Tasks.Task<bool> SendPrivateMessageAsync(System.Guid from, string to, string message);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetPlayerConfig", ReplyAction="http://tempuri.org/ILobbyService/GetPlayerConfigResponse")]
        LibrairieService.LobbyGameProxy.PlayerConfigEntry[] GetPlayerConfig(System.Guid roomToken);

        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ILobbyService/GetPlayerConfig", ReplyAction="http://tempuri.org/ILobbyService/GetPlayerConfigResponse")]
        System.Threading.Tasks.Task<LibrairieService.LobbyGameProxy.PlayerConfigEntry[]> GetPlayerConfigAsync(System.Guid roomToken);
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public interface ILobbyServiceChannel : LibrairieService.LobbyGameProxy.ILobbyService, System.ServiceModel.IClientChannel {
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class LobbyServiceClient : System.ServiceModel.ClientBase<LibrairieService.LobbyGameProxy.ILobbyService>, LibrairieService.LobbyGameProxy.ILobbyService {

        public LobbyServiceClient() {
        }

        public LobbyServiceClient(string endpointConfigurationName) :
                base(endpointConfigurationName) {
        }

        public LobbyServiceClient(string endpointConfigurationName, string remoteAddress) :
                base(endpointConfigurationName, remoteAddress) {
        }

        public LobbyServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
                base(endpointConfigurationName, remoteAddress) {
        }

        public LobbyServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
                base(binding, remoteAddress) {
        }

        public System.Nullable<System.Guid> CreateRoom(string name, System.Guid roomMaster) {
            return base.Channel.CreateRoom(name, roomMaster);
        }

        public System.Threading.Tasks.Task<System.Nullable<System.Guid>> CreateRoomAsync(string name, System.Guid roomMaster) {
            return base.Channel.CreateRoomAsync(name, roomMaster);
        }

        public bool JoinRoom(System.Guid player, System.Guid room) {
            return base.Channel.JoinRoom(player, room);
        }

        public System.Threading.Tasks.Task<bool> JoinRoomAsync(System.Guid player, System.Guid room) {
            return base.Channel.JoinRoomAsync(player, room);
        }

        public bool JoinRoomGameEnd(System.Guid player, System.Guid gameEndToken) {
            return base.Channel.JoinRoomGameEnd(player, gameEndToken);
        }

        public System.Threading.Tasks.Task<bool> JoinRoomGameEndAsync(System.Guid player, System.Guid gameEndToken) {
            return base.Channel.JoinRoomGameEndAsync(player, gameEndToken);
        }

        public bool LeaveRoom(System.Guid player, System.Guid room) {
            return base.Channel.LeaveRoom(player, room);
        }

        public System.Threading.Tasks.Task<bool> LeaveRoomAsync(System.Guid player, System.Guid room) {
            return base.Channel.LeaveRoomAsync(player, room);
        }

        public bool SetReady(System.Guid player, bool ready) {
            return base.Channel.SetReady(player, ready);
        }

        public System.Threading.Tasks.Task<bool> SetReadyAsync(System.Guid player, bool ready) {
            return base.Channel.SetReadyAsync(player, ready);
        }

        public bool SendRoomMessage(System.Guid player, System.Guid room, string message) {
            return base.Channel.SendRoomMessage(player, room, message);
        }

        public System.Threading.Tasks.Task<bool> SendRoomMessageAsync(System.Guid player, System.Guid room, string message) {
            return base.Channel.SendRoomMessageAsync(player, room, message);
        }

        public bool SetConfig(System.Guid player, System.Guid room) {
            return base.Channel.SetConfig(player, room);
        }

        public System.Threading.Tasks.Task<bool> SetConfigAsync(System.Guid player, System.Guid room) {
            return base.Channel.SetConfigAsync(player, room);
        }

        public bool SetName(System.Guid player, System.Guid room, string newName) {
            return base.Channel.SetName(player, room, newName);
        }

        public System.Threading.Tasks.Task<bool> SetNameAsync(System.Guid player, System.Guid room, string newName) {
            return base.Channel.SetNameAsync(player, room, newName);
        }

        public bool SetMaster(System.Guid player, System.Guid room, string newMaster) {
            return base.Channel.SetMaster(player, room, newMaster);
        }

        public System.Threading.Tasks.Task<bool> SetMasterAsync(System.Guid player, System.Guid room, string newMaster) {
            return base.Channel.SetMasterAsync(player, room, newMaster);
        }

        public LibrairieService.LobbyGameProxy.RoomInfo[] GetOpenRoomsInfo() {
            return base.Channel.GetOpenRoomsInfo();
        }

        public System.Threading.Tasks.Task<LibrairieService.LobbyGameProxy.RoomInfo[]> GetOpenRoomsInfoAsync() {
            return base.Channel.GetOpenRoomsInfoAsync();
        }

        public System.Collections.Generic.Dictionary<string, byte> GetLoggedUsers() {
            return base.Channel.GetLoggedUsers();
        }

        public System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string, byte>> GetLoggedUsersAsync() {
            return base.Channel.GetLoggedUsersAsync();
        }

        public string[] GetRoomPlayers(System.Guid room) {
            return base.Channel.GetRoomPlayers(room);
        }

        public System.Threading.Tasks.Task<string[]> GetRoomPlayersAsync(System.Guid room) {
            return base.Channel.GetRoomPlayersAsync(room);
        }

        public LibrairieService.LobbyGameProxy.UserMessage[] GetRoomMessages(System.Guid room, int limit) {
            return base.Channel.GetRoomMessages(room, limit);
        }

        public System.Threading.Tasks.Task<LibrairieService.LobbyGameProxy.UserMessage[]> GetRoomMessagesAsync(System.Guid room, int limit) {
            return base.Channel.GetRoomMessagesAsync(room, limit);
        }

        public string GetMasterName(System.Guid room) {
            return base.Channel.GetMasterName(room);
        }

        public System.Threading.Tasks.Task<string> GetMasterNameAsync(System.Guid room) {
            return base.Channel.GetMasterNameAsync(room);
        }

        public bool SetTeam(System.Guid player, System.Guid room, int team) {
            return base.Channel.SetTeam(player, room, team);
        }

        public System.Threading.Tasks.Task<bool> SetTeamAsync(System.Guid player, System.Guid room, int team) {
            return base.Channel.SetTeamAsync(player, room, team);
        }

        public int GetCurrentTeamIndex(System.Guid player) {
            return base.Channel.GetCurrentTeamIndex(player);
        }

        public System.Threading.Tasks.Task<int> GetCurrentTeamIndexAsync(System.Guid player) {
            return base.Channel.GetCurrentTeamIndexAsync(player);
        }

        public bool SetRoomName(System.Guid room, string newName) {
            return base.Channel.SetRoomName(room, newName);
        }

        public System.Threading.Tasks.Task<bool> SetRoomNameAsync(System.Guid room, string newName) {
            return base.Channel.SetRoomNameAsync(room, newName);
        }

        public System.Nullable<System.Guid> GetCurrentGameToken(System.Guid room) {
            return base.Channel.GetCurrentGameToken(room);
        }

        public System.Threading.Tasks.Task<System.Nullable<System.Guid>> GetCurrentGameTokenAsync(System.Guid room) {
            return base.Channel.GetCurrentGameTokenAsync(room);
        }

        public LibrairieService.LobbyGameProxy.UserMessage[] GetNewMessageFrom(System.Guid player, string name) {
            return base.Channel.GetNewMessageFrom(player, name);
        }

        public System.Threading.Tasks.Task<LibrairieService.LobbyGameProxy.UserMessage[]> GetNewMessageFromAsync(System.Guid player, string name) {
            return base.Channel.GetNewMessageFromAsync(player, name);
        }

        public string[] DoTheBigBastardThatWaveHisFlagHasNewMessageFromSomeoneIfSoTellMeLad(System.Guid player) {
            return base.Channel.DoTheBigBastardThatWaveHisFlagHasNewMessageFromSomeoneIfSoTellMeLad(player);
        }

        public System.Threading.Tasks.Task<string[]> DoTheBigBastardThatWaveHisFlagHasNewMessageFromSomeoneIfSoTellMeLadAsync(System.Guid player) {
            return base.Channel.DoTheBigBastardThatWaveHisFlagHasNewMessageFromSomeoneIfSoTellMeLadAsync(player);
        }

        public bool SendPrivateMessage(System.Guid from, string to, string message) {
            return base.Channel.SendPrivateMessage(from, to, message);
        }

        public System.Threading.Tasks.Task<bool> SendPrivateMessageAsync(System.Guid from, string to, string message) {
            return base.Channel.SendPrivateMessageAsync(from, to, message);
        }

        public LibrairieService.LobbyGameProxy.PlayerConfigEntry[] GetPlayerConfig(System.Guid roomToken) {
            return base.Channel.GetPlayerConfig(roomToken);
        }

        public System.Threading.Tasks.Task<LibrairieService.LobbyGameProxy.PlayerConfigEntry[]> GetPlayerConfigAsync(System.Guid roomToken) {
            return base.Channel.GetPlayerConfigAsync(roomToken);
        }
    }
}


text:
import controller.GameController;
import model.GameModel;
import view.GameBoard;
import view.MainFrame;
import view.listener.GameListener;

import javax.swing.JFrame;

/**
 * Classic Tic Tac Toe example in java.
 * Uses Java GUI
 *
 * @author WolfCoder
 * @author 11-08-2007
 */
public class Main extends JFrame {

    /**
     * Starts the game of Tic Tac Toe.
     *
     * @param args This is ignored.
     */
    public static void main(String[] args) {
        // Model
        GameModel gameModel = new GameModel();

        // View
        GameBoard gameBoard = new GameBoard();
        MainFrame mainFrame = new MainFrame(gameBoard);

        // Controller
        GameController gameController = new GameController(gameModel, gameBoard);
        gameBoard.addMouseListener(new GameListener(gameController));
	}
}


text:
package com.datumbox.framework.common.concurrency;

import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.Semaphore;

/**
 * The ThrottledExecutor enables us to throttle the input of the executor. This
 * can be useful when we don't wish to submit all the tasks at once in order to
 * preserve memory.
 *
 * @author Vasilis Vryniotis <bbriniotis@datumbox.com>
 */
public class ThrottledExecutor implements Executor {

    private final Executor wrappedExecutor;

    private final Semaphore semaphore;

    /**
     * This Executor will block the main thread (when execute() is called) if the
     * number of submitted and unfinished tasks reaches the provided limit. This
     * enabled us to pace the input and reduce memory consumption.
     *
     * @param executor
     * @param maxConcurrentTasks
     */
    public ThrottledExecutor(Executor executor, int maxConcurrentTasks) {
        this.wrappedExecutor = executor;
        this.semaphore = new Semaphore(maxConcurrentTasks);
    }

    /** {@inheritDoc} */
    @Override
    public void execute(final Runnable command) {
        try {
            semaphore.acquire();
        }
        catch (InterruptedException ex) {
            throw new RuntimeException(ex);
        }

        try {
            wrappedExecutor.execute(() -> {
                try {
                    command.run();
                }
                finally {
                    semaphore.release();
                }
            });
        }
        catch (RejectedExecutionException ex) {
            semaphore.release();
            throw new RuntimeException(ex);
        }
    }
}


text:
// AtlantisEngine.java - Copyright (C) Yannick Comte.
// This file is subject to the terms and conditions defined in
// file 'LICENSE', which is part of this source code package.
package atlantis.engine.graphics;

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

import atlantis.engine.Application;
import atlantis.framework.GameTime;
import atlantis.framework.content.ContentManager;
import atlantis.framework.graphics.SpriteBatch;

/**
 * An Entity collection which will update and draw its children.
 * @author Yannick
 */
public class SpriteGroup extends Sprite {
	protected ArrayList<Sprite> entities;

	public SpriteGroup() {
		this.entities = new ArrayList<Sprite>();
	}

	/**
	 * Compute the bouding rectangle of the group.
	 */
	public void computeBoundingRectangle() {
		int maxWidth = 0;
		int maxHeight = 0;

		for (int i = 0, l = this.entities.size(); i < l; i++) {
			maxWidth = Math.max(maxWidth, this.entities.get(i).getWidth());
			maxHeight = Math.max(maxHeight, this.entities.get(i).getHeight());
		}
	}

	/**
	 * Initialize entities
	 */
	public void initialize() {
		for (int i = 0, l = this.entities.size(); i < l; i++) {
			this.entities.get(i).initialize();
		}

		this.initialized = true;
	}

	/**
	 * Load asset for each entity
	 */
	public void loadContent(ContentManager content) {
		for (int i = 0, l = this.entities.size(); i < l; i++) {
			this.entities.get(i).loadContent(content);
		}

		this.assetLoaded = true;
	}

	/**
	 * Update entities logic
	 */
	public void update(GameTime gameTime) {
		if (this.enabled) {
			for (int i = 0, l = this.entities.size(); i < l; i++) {
				this.entities.get(i).update(gameTime);
			}
		}
	}

	/**
	 * Draw entities on screen
	 */
	public void draw(GameTime gameTime, SpriteBatch spriteBatch) {
		if (this.visible) {
			for (int i = 0, l = this.entities.size(); i < l; i++) {
				this.entities.get(i).draw(gameTime, spriteBatch);
			}
		}
	}

	/**
	 * Gets entities
	 * @return
	 */
	public List<Sprite> getEntities() {
		return this.entities;
	}

	/**
	 * Count the number of entity contains in the collection
	 * @return
	 */
	public int count() {
		return this.entities.size();
	}

	/**
	 * Add an Entity to the collection, if assets hasn't loaded they are loaded and initialized
	 * @param entity
	 */
	public void add(Sprite entity) {
		if (this.initialized) {
			entity.initialize();
		}

		if (this.assetLoaded) {
			entity.loadContent(Application.content);
		}

		this.entities.add(entity);
	}

	/**
	 * Remove an Entity from the collection
	 * @param entity
	 */
	public boolean remove(Sprite entity) {
		return this.entities.remove(entity);
	}

	/**
	 * Get an Entity from the collection
	 * @param position
	 * @return
	 */
	public Sprite get(int position) {
		return this.entities.get(position);
	}

	/**
	 * Clear the collection
	 */
	public void clear() {
		this.entities.clear();
	}
}


text:
import os
import subprocess
import unittest
from tempfile import NamedTemporaryFile

class DiffTestCase(unittest.TestCase):
    def assertNoDiff(self, diff):
        self.assertFalse(diff, msg='\n{}'.format(diff))

def run_mock(filename):
    current_dir = os.path.dirname(os.path.realpath(__file__))
    test_path = os.path.join(current_dir, 'mock', filename)
    check_sieve_path = os.path.join(current_dir, '../..', 'check-sieve')

    return subprocess.check_output([check_sieve_path, '--trace-tree', test_path])

def diff(output, filename):
    current_dir = os.path.dirname(os.path.realpath(__file__))
    out_path = os.path.join(current_dir, 'mock', filename)
    check_sieve_path = os.path.join(current_dir, '../..', 'check-sieve')

    diff = False

    temp = NamedTemporaryFile(delete=False)
    temp.write(output)
    temp.close()

    diff = subprocess.Popen(["/usr/bin/diff", "-ru", temp.name, out_path], stdout=subprocess.PIPE).communicate()[0]

    return diff


text:
<?php
/**
 * Created by PhpStorm.
 * User: minhao
 * Date: 2015-10-16
 * Time: 16:51
 */

namespace Oasis\Mlib\Cli;

class CommandLineOption
{
    protected $name;
    protected $followable       = true;
    protected $mustBeFollowed   = false;
    protected $isOptional       = true;
    protected $defaultValue     = null;
    protected $aliasTo          = [];
    protected $description      = '';
    protected $valueDescription = '';

    protected $value              = null;
    protected $isSetInCommandLine = false;

    function __construct($name)
    {
        $this->name      = $name;
        $this->aliasTo[] = $name;
    }

    function __call($name, $arguments)
    {
        call_user_func_array([CommandLineArgParser::parser(), $name], $arguments);
    }

    /**
     * This is simply a helper function to make IDE happy
     *
     * @return CommandLineArgParser
     */
    public function end()
    {
        return CommandLineArgParser::parser();
    }

    public function cannotBeFollowed()
    {
        $this->followable = false;

        return $this;
    }

    public function requiresValue()
    {
        $this->mustBeFollowed = true;

        return $this;
    }

    public function isMandatory()
    {
        $this->isOptional = false;

        return $this;
    }

    public function hasDefaultValue($val)
    {
        $this->defaultValue = $val;

        return $this;
    }

    public function interprets($name)
    {
        return in_array($name, $this->aliasTo);
    }

    public function validate()
    {
        if (!$this->isOptional && !$this->isSetInCommandLine) {
            throw new CommandLineParsingException("Mandatory option <{$this->name}> is missing!");
        }
        if ($this->isSetInCommandLine
            && $this->mustBeFollowed
            && $this->value === null
        ) {
            throw new CommandLineParsingException("Option <{$this->name}> is not followed by a value!");
        }
    }

    public function aliasTo($alias)
    {
        $this->aliasTo[] = $alias;
        $this->aliasTo   = array_values($this->aliasTo);

        return $this;
    }

    public function getAllAliases()
    {
        return $this->aliasTo;
    }

    public function setValue($val)
    {
        if (!$this->followable) {
            throw new CommandLineParsingException(
                "Option <{$this->name}> should not be followed by a value. Value got: $val"
            );
        }
        $this->value = $val;
    }

    public function getValue()
    {
        if ($this->value === null) {
            if ($this->defaultValue !== null) {
                return $this->defaultValue;
            }
            if ($this->isSetInCommandLine) {
                return false;
            }
        }

        return $this->value;
    }

    public function isActivated()
    {
        return $this->isSetInCommandLine;
    }

    public function activate()
    {
        $this->isSetInCommandLine = true;
    }

    /**
     * @return boolean
     */
    public function isFollowable()
    {
        return $this->followable;
    }

    /**
     * @param string $description
     *
     * @return CommandLineOption
     */
    public function usage($description)
    {
        $this->description = $description;

        return $this;
    }

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

    /**
     * @return boolean
     */
    public function isOptionalOption()
    {
        return $this->isOptional;
    }

    /**
     * @return boolean
     */
    public function isValueRequired()
    {
        return $this->mustBeFollowed;
    }

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

    /**
     * @param string $valueDescription
     */
    public function setValueDescription($valueDescription)
    {
        $this->valueDescription = $valueDescription;
    }

    /**
     * @return mixed
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @return mixed
     */
    public function getDefaultValue()
    {
        return $this->defaultValue;
    }
}


text:
/**
 */
package CIM.IEC61970.Generation.GenerationDynamics.util;

import CIM.Element;

import CIM.IEC61970.Core.Curve;
import CIM.IEC61970.Core.IdentifiedObject;
import CIM.IEC61970.Core.PowerSystemResource;

import CIM.IEC61970.Generation.GenerationDynamics.*;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.util.Switch;

/**
 *
 * The Switch for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the caseXXX method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 *
 * @see CIM.IEC61970.Generation.GenerationDynamics.GenerationDynamicsPackage
 * @generated
 */
public class GenerationDynamicsSwitch<T> extends Switch<T> {
	/**
	 * The cached model package
	 *
	 *
	 * @generated
	 */
	protected static GenerationDynamicsPackage modelPackage;

	/**
	 * Creates an instance of the switch.
	 *
	 *
	 * @generated
	 */
	public GenerationDynamicsSwitch() {
		if (modelPackage == null) {
			modelPackage = GenerationDynamicsPackage.eINSTANCE;
		}
	}

	/**
	 * Checks whether this is a switch for the given package.
	 *
	 *
	 * @param ePackage the package in question.
	 * @return whether this is a switch for the given package.
	 * @generated
	 */
	@Override
	protected boolean isSwitchFor(EPackage ePackage) {
		return ePackage == modelPackage;
	}

	/**
	 * Calls caseXXX for each class of the model until one returns a non null result; it yields that result.
	 *
	 *
	 * @return the first non-null result returned by a caseXXX call.
	 * @generated
	 */
	@Override
	protected T doSwitch(int classifierID, EObject theEObject) {
		switch (classifierID) {
			case GenerationDynamicsPackage.SUPERCRITICAL: {
				Supercritical supercritical = (Supercritical)theEObject;
				T result = caseSupercritical(supercritical);
				if (result == null) result = caseFossilSteamSupply(supercritical);
				if (result == null) result = caseSteamSupply(supercritical);
				if (result == null) result = casePowerSystemResource(supercritical);
				if (result == null) result = caseIdentifiedObject(supercritical);
				if (result == null) result = caseElement(supercritical);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.COMBUSTION_TURBINE: {
				CombustionTurbine combustionTurbine = (CombustionTurbine)theEObject;
				T result = caseCombustionTurbine(combustionTurbine);
				if (result == null) result = casePrimeMover(combustionTurbine);
				if (result == null) result = casePowerSystemResource(combustionTurbine);
				if (result == null) result = caseIdentifiedObject(combustionTurbine);
				if (result == null) result = caseElement(combustionTurbine);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.FOSSIL_STEAM_SUPPLY: {
				FossilSteamSupply fossilSteamSupply = (FossilSteamSupply)theEObject;
				T result = caseFossilSteamSupply(fossilSteamSupply);
				if (result == null) result = caseSteamSupply(fossilSteamSupply);
				if (result == null) result = casePowerSystemResource(fossilSteamSupply);
				if (result == null) result = caseIdentifiedObject(fossilSteamSupply);
				if (result == null) result = caseElement(fossilSteamSupply);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.CT_TEMP_ACTIVE_POWER_CURVE: {
				CTTempActivePowerCurve ctTempActivePowerCurve = (CTTempActivePowerCurve)theEObject;
				T result = caseCTTempActivePowerCurve(ctTempActivePowerCurve);
				if (result == null) result = caseCurve(ctTempActivePowerCurve);
				if (result == null) result = caseIdentifiedObject(ctTempActivePowerCurve);
				if (result == null) result = caseElement(ctTempActivePowerCurve);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.SUBCRITICAL: {
				Subcritical subcritical = (Subcritical)theEObject;
				T result = caseSubcritical(subcritical);
				if (result == null) result = caseFossilSteamSupply(subcritical);
				if (result == null) result = caseSteamSupply(subcritical);
				if (result == null) result = casePowerSystemResource(subcritical);
				if (result == null) result = caseIdentifiedObject(subcritical);
				if (result == null) result = caseElement(subcritical);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.STEAM_SUPPLY: {
				SteamSupply steamSupply = (SteamSupply)theEObject;
				T result = caseSteamSupply(steamSupply);
				if (result == null) result = casePowerSystemResource(steamSupply);
				if (result == null) result = caseIdentifiedObject(steamSupply);
				if (result == null) result = caseElement(steamSupply);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.PRIME_MOVER: {
				PrimeMover primeMover = (PrimeMover)theEObject;
				T result = casePrimeMover(primeMover);
				if (result == null) result = casePowerSystemResource(primeMover);
				if (result == null) result = caseIdentifiedObject(primeMover);
				if (result == null) result = caseElement(primeMover);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.HEAT_RECOVERY_BOILER: {
				HeatRecoveryBoiler heatRecoveryBoiler = (HeatRecoveryBoiler)theEObject;
				T result = caseHeatRecoveryBoiler(heatRecoveryBoiler);
				if (result == null) result = caseFossilSteamSupply(heatRecoveryBoiler);
				if (result == null) result = caseSteamSupply(heatRecoveryBoiler);
				if (result == null) result = casePowerSystemResource(heatRecoveryBoiler);
				if (result == null) result = caseIdentifiedObject(heatRecoveryBoiler);
				if (result == null) result = caseElement(heatRecoveryBoiler);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.BWR_STEAM_SUPPLY: {
				BWRSteamSupply bwrSteamSupply = (BWRSteamSupply)theEObject;
				T result = caseBWRSteamSupply(bwrSteamSupply);
				if (result == null) result = caseSteamSupply(bwrSteamSupply);
				if (result == null) result = casePowerSystemResource(bwrSteamSupply);
				if (result == null) result = caseIdentifiedObject(bwrSteamSupply);
				if (result == null) result = caseElement(bwrSteamSupply);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.DRUM_BOILER: {
				DrumBoiler drumBoiler = (DrumBoiler)theEObject;
				T result = caseDrumBoiler(drumBoiler);
				if (result == null) result = caseFossilSteamSupply(drumBoiler);
				if (result == null) result = caseSteamSupply(drumBoiler);
				if (result == null) result = casePowerSystemResource(drumBoiler);
				if (result == null) result = caseIdentifiedObject(drumBoiler);
				if (result == null) result = caseElement(drumBoiler);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.STEAM_TURBINE: {
				SteamTurbine steamTurbine = (SteamTurbine)theEObject;
				T result = caseSteamTurbine(steamTurbine);
				if (result == null) result = casePrimeMover(steamTurbine);
				if (result == null) result = casePowerSystemResource(steamTurbine);
				if (result == null) result = caseIdentifiedObject(steamTurbine);
				if (result == null) result = caseElement(steamTurbine);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.PWR_STEAM_SUPPLY: {
				PWRSteamSupply pwrSteamSupply = (PWRSteamSupply)theEObject;
				T result = casePWRSteamSupply(pwrSteamSupply);
				if (result == null) result = caseSteamSupply(pwrSteamSupply);
				if (result == null) result = casePowerSystemResource(pwrSteamSupply);
				if (result == null) result = caseIdentifiedObject(pwrSteamSupply);
				if (result == null) result = caseElement(pwrSteamSupply);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case GenerationDynamicsPackage.HYDRO_TURBINE: {
				HydroTurbine hydroTurbine = (HydroTurbine)theEObject;
				T result = caseHydroTurbine(hydroTurbine);
				if (result == null) result = casePrimeMover(hydroTurbine);
				if (result == null) result = casePowerSystemResource(hydroTurbine);
				if (result == null) result = caseIdentifiedObject(hydroTurbine);
				if (result == null) result = caseElement(hydroTurbine);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			default: return defaultCase(theEObject);
		}
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Supercritical'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Supercritical'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseSupercritical(Supercritical object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Combustion Turbine'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Combustion Turbine'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCombustionTurbine(CombustionTurbine object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Fossil Steam Supply'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Fossil Steam Supply'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseFossilSteamSupply(FossilSteamSupply object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'CT Temp Active Power Curve'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'CT Temp Active Power Curve'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCTTempActivePowerCurve(CTTempActivePowerCurve object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Subcritical'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Subcritical'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseSubcritical(Subcritical object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Steam Supply'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Steam Supply'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseSteamSupply(SteamSupply object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Prime Mover'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Prime Mover'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T casePrimeMover(PrimeMover object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Heat Recovery Boiler'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Heat Recovery Boiler'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseHeatRecoveryBoiler(HeatRecoveryBoiler object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'BWR Steam Supply'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'BWR Steam Supply'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseBWRSteamSupply(BWRSteamSupply object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Drum Boiler'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Drum Boiler'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseDrumBoiler(DrumBoiler object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Steam Turbine'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Steam Turbine'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseSteamTurbine(SteamTurbine object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'PWR Steam Supply'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'PWR Steam Supply'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T casePWRSteamSupply(PWRSteamSupply object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Hydro Turbine'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Hydro Turbine'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseHydroTurbine(HydroTurbine object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Element'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Element'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseElement(Element object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Identified Object'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Identified Object'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseIdentifiedObject(IdentifiedObject object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Power System Resource'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Power System Resource'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T casePowerSystemResource(PowerSystemResource object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Curve'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Curve'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCurve(Curve object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'EObject'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch, but this is the last case anyway.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'EObject'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
	 * @generated
	 */
	@Override
	public T defaultCase(EObject object) {
		return null;
	}

} //GenerationDynamicsSwitch


text:
/*jslint indent: 2 */
/*global $: false, document: false, togglbutton: false*/

'use strict';

togglbutton.render('.convo-toolbar:not(.toggl)', {observe: true}, function () {

  var link,
    description = '#' + $('#tkHeader strong').innerHTML + ' ' + $('#subjectLine').innerHTML;

  link = togglbutton.createTimerLink({
    className: 'helpscout',
    description: description
  });

  link.setAttribute('style', 'margin-top: 10px');

  $('.convo-toolbar').appendChild(link);
});


text:
@class IOSObjectArray;

@interface OrgOcpsoftPrettytimeI18nResources_vi : JavaUtilListResourceBundle

#pragma mark Public

- (instancetype __nonnull)init;

- (IOSObjectArray *)getContents;

@end

J2OBJC_STATIC_INIT(OrgOcpsoftPrettytimeI18nResources_vi)

FOUNDATION_EXPORT void OrgOcpsoftPrettytimeI18nResources_vi_init(OrgOcpsoftPrettytimeI18nResources_vi *self);

FOUNDATION_EXPORT OrgOcpsoftPrettytimeI18nResources_vi *new_OrgOcpsoftPrettytimeI18nResources_vi_init(void) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgOcpsoftPrettytimeI18nResources_vi *create_OrgOcpsoftPrettytimeI18nResources_vi_init(void);

J2OBJC_TYPE_LITERAL_HEADER(OrgOcpsoftPrettytimeI18nResources_vi)

#endif

#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#pragma pop_macro("INCLUDE_ALL_OrgOcpsoftPrettytimeI18nResources_vi")


text:
Virtual Environments for Node

## Installation

If you want a global `nave` command, you could install this thing with npm.
But that's not really necessary.  You can run the `nave.sh` shell script
from here, or symlink it wherever you want.

## Usage

    Usage: nave <cmd>

    Commands:

    install <version>    Install the version passed (ex: 0.1.103)
    use <version>        Enter a subshell where <version> is being used
    use <ver> <program>  Enter a subshell, and run "<program>", then exit
    use <name> <ver>     Create a named env, using the specified version.
                         If the name already exists, but the version differs,
                         then it will update the link.
    usemain <version>    Install in /usr/local/bin (ie, use as your main nodejs)
    clean <version>      Delete the source code for <version>
    uninstall <version>  Delete the install for <version>
    ls                   List versions currently installed
    ls-remote            List remote node versions
    ls-all               List remote and local node versions
    latest               Show the most recent dist version
    help                 Output help information

    <version> can be the string "latest" to get the latest distribution.
    <version> can be the string "stable" to get the latest stable version.

That's about it.  Enjoy.

When you're done using a specific version of node, just exit the shell to return
to where you were before using nave.

## env vars

* `$NAVE` The current shell.  Either a version, or a name and version.
* `$NAVENAME` The name of the current shell.  Equal to `$NAVEVERSION` in
  unnammed environments.
* `$NAVEVERSION` The version of node that the current shell is pointing
  to.  (This should comply with `node -v`.)
* `$NAVELVL` The level of nesting in the subshell.
* `$NAVE_DEBUG` Set to 1 to run nave in `bash -x` style.
* `$NAVE_DIR` Set to the location where you'd like nave to do its
  business.  Defaults to `~/.nave`.
* `$NAVE_CONFIG` Set this to an array of arguments to pass to
  `./configure`.  Defaults to `("--debug")`.  (Note that parens are
  required to supply multiple arguments.  I use `("--debug"
  "--without-npm")` on my own system, since I'm usually using nave to
  test npm, so installing it in the subshell doesn't help much.)  This
  can be set in the `~/.naverc` file, or in your normal
  `~/.bash{rc,_profile}` files.
* `$NAVE_JOBS` If set, this will be the number of jobs to run when
  building node.  If this isn't set, it'll use the `$JOBS` env, then try
  to guess a reasonable value based on the number of CPUs, then fall
  back on 2 if `sysctl -n hw.ncpu` fails.

## Compatibility

Prior to version 0.2, nave would run programs as `node <program>`.
However, this is somewhat more limiting, so was dropped.  If you prefer the
old style, just prefix your command with `node`.

Nave requires bash.  It will probably never work on Windows, or other systems
lack a native Bourne Again Shell.  Sorry.

Nave logins work with bash and zsh.  If your shell doesn't set the
`BASH` environment variable, then nave assumes you're using zsh.  As
such, strange archaic shells like sh, csh, tcsh, ksh, and the like will not
work.

## Configuration

Nave will source `~/.naverc` on initialization of a new subshell, if it
exists and is readable.

You may control the place where nave puts things by setting the
`NAVE_DIR` environment variable.  However, note that this must be set
somewhere *other* than `~/.naverc`, since it needs to be set in the
*parent* shell where the `nave` command is invoked.

By default, nave puts its stuff in `~/.nave/`.  If this directory does
not exist and cannot be created, then it will attempt to use the location
of the nave.sh bash script itself.  If it cannot write to this location,
then it will exit with an error.

## Credits

nave borrows concepts, inspiration, and code from Tim Caswell's "nvm" and Kris
Kowal's "sea" programs.

Sea is really nice, but is very tied to Narwhal.  Also, it's a require.paths
manager, which nave is not.

Nvm is also really nice, but has to be sourced rather than being run, and
thus is a little bit wonky for some use cases.  But it doesn't involve
subshells, which makes it better for some others.


text:
namespace Microsoft.ApplicationInsights.Metrics.Extensibility
{
    using System;

    /// The abstraction for a metric aggregator.
    /// An aggregator is a data processing type that inspects all values tracked for a metric series across an aggregation
    /// period and creates an aggregate that summarizes the period when it is completed. The most common aggregator is
    /// the <see cref="MeasurementAggregator"/>, which produces aggregates that contain the Min, Max, Sum and
    /// Count of values tracked over the aggregation time period.
    public interface IMetricSeriesAggregator
    {
        /// Gets the data series aggregated by this aggregator.
        MetricSeries DataSeries { get; }

        /// Attempts to reset this aggregator so it ban be reused for a new aggregation period.
        /// <returns>Whether the reset was successful (if not, this aggregator may not be reused).</returns>
        bool TryRecycle();

        /// Resets this aggregator and prepares it for a new aggregation period.
        /// <param name="periodStart">The start of the new aggregation period.</param>
        /// <param name="valueFilter">The filter for the values to be used.</param>
        /// @PublicExposureCandidate
        void Reset(DateTimeOffset periodStart, IMetricValueFilter valueFilter);

        /// Resets this aggregator and prepares it for a new aggregation period.
        /// <param name="periodStart">The start of the new aggregation period.</param>
        void Reset(DateTimeOffset periodStart);

        /// Wraps up the ongping aggregation period and procudes the resulting aggregate.
        /// <param name="periodEnd">The end timestamp of the period.</param>
        /// <returns>The aggregate containing the sumary of the completed period.</returns>
        MetricAggregate CompleteAggregation(DateTimeOffset periodEnd);

        /// Creates the aggregate for the ongoing aggregation period without completing the period. May not be thread safe.
        /// <param name="periodEnd">The ent timestamp for the aggregate.</param>
        /// <returns>An aggregate representing the ongoing period so far.</returns>
        MetricAggregate CreateAggregateUnsafe(DateTimeOffset periodEnd);

        /// Adds a value to the aggregation.
        /// <param name="metricValue">Metric value to be tracked.</param>
        void TrackValue(double metricValue);

        /// Adds a value to the aggregation.
        /// <param name="metricValue">Metric value to be tracked.</param>
        void TrackValue(object metricValue);
    }
}