text:
/**
 *     This code was auto-generated by a Codezu.
 *
 *     Changes to this file may cause incorrect behavior and will be lost if
 *     the code is regenerated.
 */
package com.mozu.api.clients.commerce.carts;

import java.util.List;
import java.util.ArrayList;
import com.mozu.api.MozuClient;
import com.mozu.api.MozuClientFactory;
import com.mozu.api.MozuUrl;
import com.mozu.api.Headers;
import com.mozu.api.security.AuthTicket;
import org.apache.commons.lang.StringUtils;

/**
 * commerce/carts/cartextendedproperties related resources. DOCUMENT_HERE
 *
 */
public class ExtendedPropertyClient {

	/**
	 * carts-cartextendedproperties Get GetExtendedProperties description DOCUMENT_HERE
	 *

	 * MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>> mozuClient=GetExtendedPropertiesClient();
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * ExtendedProperty extendedProperty = client.Result();
	 *

	 * @return Mozu.Api.MozuClient <List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>>
	 * @see com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty
	 */
	public static MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>> getExtendedPropertiesClient() throws Exception
	{
		MozuUrl url = com.mozu.api.urls.commerce.carts.ExtendedPropertyUrl.getExtendedPropertiesUrl();
		String verb = "GET";
		Class<?> clz = new ArrayList<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>(){}.getClass();
		MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>> mozuClient = (MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>>) MozuClientFactory.getInstance(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		return mozuClient;

	}

	/**
	 * carts-cartextendedproperties Post AddExtendedProperties description DOCUMENT_HERE
	 *

	 * MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>> mozuClient=AddExtendedPropertiesClient( extendedProperties);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * ExtendedProperty extendedProperty = client.Result();
	 *

	 * @param extendedProperties Mozu.CommerceRuntime.Contracts.Commerce.ExtendedProperty ApiType DOCUMENT_HERE
	 * @return Mozu.Api.MozuClient <List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>>
	 * @see com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty
	 * @see com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty
	 */
	public static MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>> addExtendedPropertiesClient(List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty> extendedProperties) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.commerce.carts.ExtendedPropertyUrl.addExtendedPropertiesUrl();
		String verb = "POST";
		Class<?> clz = new ArrayList<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>(){}.getClass();
		MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>> mozuClient = (MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>>) MozuClientFactory.getInstance(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		mozuClient.setBody(extendedProperties);
		return mozuClient;

	}

	/**
	 * carts-cartextendedproperties Put UpdateExtendedProperty description DOCUMENT_HERE
	 *

	 * MozuClient<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty> mozuClient=UpdateExtendedPropertyClient( extendedProperty,  key);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * ExtendedProperty extendedProperty = client.Result();
	 *

	 * @param key
	 * @param extendedProperty Mozu.CommerceRuntime.Contracts.Commerce.ExtendedProperty ApiType DOCUMENT_HERE
	 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>
	 * @see com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty
	 * @see com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty
	 */
	public static MozuClient<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty> updateExtendedPropertyClient(com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty extendedProperty, String key) throws Exception
	{
		return updateExtendedPropertyClient( extendedProperty,  key,  null,  null);
	}

	/**
	 * carts-cartextendedproperties Put UpdateExtendedProperty description DOCUMENT_HERE
	 *

	 * MozuClient<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty> mozuClient=UpdateExtendedPropertyClient( extendedProperty,  key,  upsert,  responseFields);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * ExtendedProperty extendedProperty = client.Result();
	 *

	 * @param key
	 * @param responseFields A list or array of fields returned for a call. These fields may be customized and may be used for various types of data calls in Mozu. For example, responseFields are returned for retrieving or updating attributes, carts, and messages in Mozu.
	 * @param upsert
	 * @param extendedProperty Mozu.CommerceRuntime.Contracts.Commerce.ExtendedProperty ApiType DOCUMENT_HERE
	 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>
	 * @see com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty
	 * @see com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty
	 */
	public static MozuClient<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty> updateExtendedPropertyClient(com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty extendedProperty, String key, Boolean upsert, String responseFields) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.commerce.carts.ExtendedPropertyUrl.updateExtendedPropertyUrl(key, responseFields, upsert);
		String verb = "PUT";
		Class<?> clz = com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty.class;
		MozuClient<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty> mozuClient = (MozuClient<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>) MozuClientFactory.getInstance(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		mozuClient.setBody(extendedProperty);
		return mozuClient;

	}

	/**
	 * carts-cartextendedproperties Put UpdateExtendedProperties description DOCUMENT_HERE
	 *

	 * MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>> mozuClient=UpdateExtendedPropertiesClient( extendedProperties);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * ExtendedProperty extendedProperty = client.Result();
	 *

	 * @param extendedProperties Mozu.CommerceRuntime.Contracts.Commerce.ExtendedProperty ApiType DOCUMENT_HERE
	 * @return Mozu.Api.MozuClient <List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>>
	 * @see com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty
	 * @see com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty
	 */
	public static MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>> updateExtendedPropertiesClient(List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty> extendedProperties) throws Exception
	{
		return updateExtendedPropertiesClient( extendedProperties,  null);
	}

	/**
	 * carts-cartextendedproperties Put UpdateExtendedProperties description DOCUMENT_HERE
	 *

	 * MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>> mozuClient=UpdateExtendedPropertiesClient( extendedProperties,  upsert);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * ExtendedProperty extendedProperty = client.Result();
	 *

	 * @param upsert
	 * @param extendedProperties Mozu.CommerceRuntime.Contracts.Commerce.ExtendedProperty ApiType DOCUMENT_HERE
	 * @return Mozu.Api.MozuClient <List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>>
	 * @see com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty
	 * @see com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty
	 */
	public static MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>> updateExtendedPropertiesClient(List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty> extendedProperties, Boolean upsert) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.commerce.carts.ExtendedPropertyUrl.updateExtendedPropertiesUrl(upsert);
		String verb = "PUT";
		Class<?> clz = new ArrayList<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>(){}.getClass();
		MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>> mozuClient = (MozuClient<List<com.mozu.api.contracts.commerceruntime.commerce.ExtendedProperty>>) MozuClientFactory.getInstance(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		mozuClient.setBody(extendedProperties);
		return mozuClient;

	}

	/**
	 * carts-cartextendedproperties Delete DeleteExtendedProperties description DOCUMENT_HERE
	 *

	 * MozuClient mozuClient=DeleteExtendedPropertiesClient( keys);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 *

	 * @param keys
	 * @return Mozu.Api.MozuClient
	 * @see string
	 */
	public static MozuClient deleteExtendedPropertiesClient(List<String> keys) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.commerce.carts.ExtendedPropertyUrl.deleteExtendedPropertiesUrl();
		String verb = "DELETE";
				MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance();
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		mozuClient.setBody(keys);
		return mozuClient;

	}

	/**
	 * carts-cartextendedproperties Delete DeleteExtendedProperty description DOCUMENT_HERE
	 *

	 * MozuClient mozuClient=DeleteExtendedPropertyClient( key);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 *

	 * @param key
	 * @return Mozu.Api.MozuClient
	 */
	public static MozuClient deleteExtendedPropertyClient(String key) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.commerce.carts.ExtendedPropertyUrl.deleteExtendedPropertyUrl(key);
		String verb = "DELETE";
				MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance();
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		return mozuClient;

	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 297028 $ -->
<section xml:id="ncurses.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 &reftitle.install;
 <para>
  &pecl.info;
  <link xlink:href="&url.pecl.package;ncurses">&url.pecl.package;ncurses</link>.
 </para>
 <para>
  Wide character <acronym>CRT</acronym> screen handling (ncursesw) support
  was added in version 1.0.1 of this PECL extension.
 </para>
</section>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

redpajama_set_name: RedPajamaGithub


text:
package sessions

import (
	"errors"
	"net/http"
	"strings"
)

const headerAuthorization = "Authorization"
const schemeBearer = "Bearer "

//ErrNoSessionID is used when no session ID was found in the Authorization header
var ErrNoSessionID = errors.New("no session ID found in " + headerAuthorization + " header")

//ErrInvalidScheme is used when the authorization scheme is not supported
var ErrInvalidScheme = errors.New("scheme used in Authorization header is not supported")

//BeginSession creates a new session ID, saves the state to the store, adds a
//header to the response with the session ID, and returns the new session ID
func BeginSession(signingKey string, store Store, state interface{}, w http.ResponseWriter) (SessionID, error) {
	//create a new SessionID
	//if you get an error, return InvalidSessionID and the error
	sid, err := NewSessionID(signingKey)
	if err != nil {
		return InvalidSessionID, err
	}

	//save the state to the store
	//if you get an error, return InvalidSessionID and the error
	if err := store.Save(sid, state); err != nil {
		return InvalidSessionID, err
	}

	//Add a response header like this:
	//  Authorization: Bearer <sid>
	//where <sid> is the new SessionID
	w.Header().Add(headerAuthorization, schemeBearer+sid.String())

	//return the new SessionID and nil
	return sid, nil
}

//GetSessionID extracts and validates the SessionID from the request headers
func GetSessionID(r *http.Request, signingKey string) (SessionID, error) {
	//get the value of the Authorization header
	ha := r.Header.Get(headerAuthorization)

	//if it's zero-length, return InvalidSessionID and ErrNoSessionID
	if len(ha) == 0 {
		return InvalidSessionID, ErrNoSessionID
	}

	//if it doesn't start with "Bearer ",
	//return InvalidSessionID and ErrInvalidScheme
	if !strings.HasPrefix(ha, schemeBearer) {
		return InvalidSessionID, ErrInvalidScheme
	}

	//trim off the "Bearer " prefix and validate the remaining id
	//if you get an error return InvalidSessionID and the error
	id := strings.Trim(ha, schemeBearer)
	sid, err := ValidateID(id, signingKey)
	if err != nil {
		return InvalidSessionID, err
	}

	//return the validated SessionID and nil
	return sid, nil
}

//GetState extracts the SessionID from the request,
//and gets the associated state from the provided store
func GetState(r *http.Request, signingKey string, store Store, state interface{}) (SessionID, error) {
	//get the SessionID from the request
	//if you get an error, return the SessionID and error
	sid, err := GetSessionID(r, signingKey)
	if err != nil {
		return sid, err
	}

	//get the associated state data from the provided store
	//if you get an error return the SessionID and the error
	if err := store.Get(sid, state); err != nil {
		return sid, err
	}

	//return the SessionID and nil
	return sid, nil
}

//EndSession extracts the SessionID from the request,
//and deletes the associated data in the provided store
func EndSession(r *http.Request, signingKey string, store Store) (SessionID, error) {
	//get the SessionID from the request
	//if you get an error return the SessionID and error
	sid, err := GetSessionID(r, signingKey)
	if err != nil {
		return sid, err
	}

	//delete the associated data in the provided store
	if err := store.Delete(sid); err != nil {
		return sid, err
	}

	//return the SessionID and nil
	return sid, nil
}


text:
class <warning descr="Utility class 'UtilityClassCanBeEnum' can be 'enum'">UtilityClassCanBeEnum</warning> {

  public static int notReligious() {
    return 1;
  }
}
enum Other {
  ;

  public static void util() {}
}
class Similar {

  public Similar() {
    barbeque();
  }

  public static boolean barbeque() {
    return true;
  }
}


text:
<?php namespace Tuurbo\Spreedly;

use GuzzleHttp\Client;
use Illuminate\Support\ServiceProvider;

class SpreedlyServiceProvider extends ServiceProvider {

	/**
	 * Indicates if loading of the provider is deferred.
	 *
	 * @var bool
	 */
	protected $defer = false;

	/**
	 * Register the service provider.
	 *
	 * @return void
	 */
	public function register()
	{
		$this->app['spreedly'] = $this->app->share(function($app)
		{
			$config = $app['config']->get('services.spreedly');

			return new Spreedly($config);
		});
	}

}


text:
package org.kuali.rice.ken.bo;

import org.kuali.rice.ken.api.notification.NotificationRecipient;
import org.kuali.rice.ken.api.notification.NotificationRecipientContract;
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
import org.kuali.rice.krad.data.KradDataServiceLocator;
import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;

import javax.persistence.*;

/**
 * This class houses information pertaining to each recipient for a Notification message.  This
 * recipient can be either a user or a group - which is specified by the recipient type.
 * @author Kuali Rice Team (rice.collab@kuali.org)
 */
@Entity
@Table(name="KREN_RECIP_T")
public class NotificationRecipientBo extends PersistableBusinessObjectBase implements NotificationRecipientContract {
    @Id
    @GeneratedValue(generator="KREN_RECIP_S")
    @PortableSequenceGenerator(name="KREN_RECIP_S")
	@Column(name="RECIP_ID")
	private Long id;
    @Column(name="RECIP_TYP_CD", nullable=false)
	private String recipientType;
    @Column(name="PRNCPL_ID", nullable=false)
	private String recipientId;

    // Added for JPA uni-directional one-to-many (not yet supported by JPA)
    @ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST, CascadeType.REMOVE})
    @JoinColumn(name="NTFCTN_ID", nullable = false)
    private NotificationBo notification;

    /**
     * Constructs a NotificationRecipient instance.
     */
    public NotificationRecipientBo() {
    }

    /**
     * Gets the id attribute.
     * @return Returns the id.
     */
    public Long getId() {
	    return id;
    }

    /**
     * Sets the id attribute value.
     * @param id The id to set.
     */
    public void setId(Long id) {
	    this.id = id;
    }

    /**
     * Gets the notificationId attribute.
     * @return Returns the notificationId.
     */
    public Long getNotificationId() {
	    return (notification == null) ? null : notification.getId();
    }

    /**
     * Gets the recipientId attribute.
     * @return Returns the recipientId.
     */
    public String getRecipientId() {
	    return recipientId;
    }

    /**
     * Sets the recipientId attribute value.
     * @param recipientId The recipientId to set.
     */
    public void setRecipientId(String recipientId) {
	    this.recipientId = recipientId;
    }

    /**
     * Gets the recipientType attribute.
     * @return Returns the recipientType.
     */
    public String getRecipientType() {
	    return recipientType;
    }

    /**
     * Sets the recipientType attribute value.
     * @param recipientType The recipientType to set.
     */
    public void setRecipientType(String recipientType) {
	    this.recipientType = recipientType;
    }

    public NotificationBo getNotification() {
        return notification;
    }

    public void setNotification(NotificationBo notification) {
        this.notification = notification;
    }

    /**
     * Converts a mutable bo to its immutable counterpart
     * @param bo the mutable business object
     * @return the immutable object
     */
    public static NotificationRecipient to(NotificationRecipientBo bo) {
        if (bo == null) {
            return null;
        }

        return NotificationRecipient.Builder.create(bo).build();
    }

    /**
     * Converts a immutable object to its mutable counterpart
     * @param im immutable object
     * @return the mutable bo
     */
    public static NotificationRecipientBo from(NotificationRecipient im) {
        if (im == null) {
            return null;
        }

        NotificationRecipientBo bo = new NotificationRecipientBo();
        bo.setId(im.getId());
        bo.setVersionNumber(im.getVersionNumber());
        bo.setObjectId(im.getObjectId());

        bo.setRecipientType(im.getRecipientType());
        bo.setRecipientId(im.getRecipientId());
        if (im.getNotificationId() != null) {
            NotificationBo notification =
                    KradDataServiceLocator.getDataObjectService().find(NotificationBo.class, im.getNotificationId());
            bo.setNotification(notification);
        }
        return bo;
    }
}


text:
namespace Svelto.ECS.Components
{
    public struct ECSVector3
    {
        public float x, y, z;

        public static readonly ECSVector3 forward = new ECSVector3(0f, 0f, 1f);
        public static readonly ECSVector3 back = new ECSVector3(0f, 0f, -1f);
        public static readonly ECSVector3 right = new ECSVector3(1f, 0f, 0f);
        public static readonly ECSVector3 left = new ECSVector3(-1f, 0f, 0f);
        public static readonly ECSVector3 up = new ECSVector3(0f, 1f, 0f);
        public static readonly ECSVector3 down = new ECSVector3(0f, -1f, 0f);

        public static readonly ECSVector3 zero = new ECSVector3(0f, 0f, 0f);
        public static readonly ECSVector3 one = new ECSVector3(1f, 1f, 1f);

        public ECSVector3(float X, float Y, float Z)
        {
            x = X;
            y = Y;
            z = Z;
        }
   }
}


text:
/*
 * queueExecutor.cpp
 *
 *  Created on: 13. 7. 2016
 *      Author: ondra
 */

#include "queueExecutor.h"

#include "../../mt/thread.h"
#include "../sync/synchronize.h"
#include "../containers/queue.tcc"

namespace LightSpeed {

void QueueExecutor::wakeThread() {
	//try lock will lock semaphore if unlocked, otherwise keep locked
	//this prevents to accumulate counter value if semaphore is already unlocked
	semaphore.tryLock();
	//now unlock semaphore to have counter = 1, now any thread can continue to grab action from the queue
	semaphore.unlock();
}

void QueueExecutor::execute(const IExecAction& action) {
	//lock internals
	Synchronized<FastLock> _(lock);
	//if finish flag active, reject request
	if (finishFlag) return;

	//clone the action
	SharedPtr<IExecAction> a = action.clone();
	//push to the queue
	queue.push(a);
	//wake possible sleeping thread
	wakeThread();
}

QueueExecutor::QueueExecutor():semaphore(1),runningMessages(0),threadsIn(0) {

}

///handles entering and exitting from the serving thread
class QueueExecutor::Server {
public:

	///enteringing to the serving thread
	Server(QueueExecutor *owner) throw();
	///exiting from the serving thread
	~Server() throw();
	///server function
	void serve();

protected:
	QueueExecutor *owner;
};

QueueExecutor::Server::Server(QueueExecutor *owner) throw()
	:owner(owner) {
	//lock internals
	Synchronized<FastLock> _(owner->lock);

	//increase count of serving threads
	owner->threadsIn++;
	//close gate "noThreads"
	owner->noThreads.close();
}

QueueExecutor::Server::~Server() throw() {
	//lock internals
	Synchronized<FastLock> _(owner->lock);
	//decrement count of serving threads
	owner->threadsIn--;
	//if count of serving thread is zero
	if (owner->threadsIn == 0)
		//open gate "noThreads"
		owner->noThreads.open();
	else
		//wake another possible sleeping thread to re-check the queue status.
		owner->wakeThread();
}

void QueueExecutor::Server::serve() {

	while(true) {

		{
			//lock internals
			Synchronized<FastLock> _(owner->lock);
			//if finish flag or thread is marked finish, break
			if (owner->finishFlag || Thread::canFinish()) break;
			//while queue is not empty
			while (!owner->queue.empty()) {
				//pick next action
				SharedPtr<IExecAction> action = owner->queue.top();
				//remove it from queue
				owner->queue.pop();
				//increase running actions
				owner->runningMessages++;
				try
				{
					//unlock the lock temporary
					SyncReleased<FastLock> _(owner->lock);
					//perform action (in case of exception, continue after catch
					(*action)();
					//decrease running actions
					owner->runningMessages--;
				} catch (...) {
					//in case of exception, decrease running actions
					owner->runningMessages--;
					//throw above
					throw;
				}
				//if finish reported or thread will finish, break
				if (owner->finishFlag || Thread::canFinish()) break;
			}
		}
		//counts idle cycles
		natural counter=0;

		//if queue is empty, we need to wait for next message
		//when message is added, semaphore is unlocked
		//we can wait for infinite time, but it is better to give
		//implementator chance to control his thread. Call onIdle repeatedly
		bool contWait;
		do {
			//call onIdle and determine timeout (default infinite)
			Timeout tm = owner->onIdle(counter++);
			//wait for unlock semaphore and determine whether it succeed
			contWait = !owner->semaphore.lock(tm);
			//repeat if not
		} while (contWait);
	}
}

void QueueExecutor::serve() {
	//create server
	Server server(this);
	//run server
	server.serve();
}

bool LightSpeed::QueueExecutor::stopAll(natural timeout) {
	//finish all threads
	finish();
	//wait for everyone leave
	return noThreads.wait(timeout);

}

Timeout  QueueExecutor::onIdle(natural ) {
	//return infinity
	return Timeout(null);
}

void QueueExecutor::finish() {
	Synchronized<FastLock> _(lock);
	//clear queue
	queue.clear();
	//mark finished
	finishFlag=true;
	//wake up possible sleeping thread to receive finish flag status
	wakeThread();

}
void QueueExecutor::join() {
	//join is equal to stopAll
	stopAll(naturalNull);
}

QueueExecutor::~QueueExecutor() {
	//join all threads
	join();
	//ensure that nothing is running there and protect the destructor until lock is destroyed
	lock.lock();
}

bool QueueExecutor::isRunning() const {
	//function must return true, if there are running messages
	return runningMessages > 0;
}

void QueueExecutor::reset() {
	//reset finish flag
	finishFlag = false;
}

}


text:
package com.spacetimecat.server;

/**
 *

 *     Serve a guest, or lead a guest to something that can serve it.
 *

 */
public interface Usher extends AutoCloseable
{
    @Override
    void close ();

    /**
     *

     *     This must close the guest if there are no seats left.
     *

     *

     *     This must not throw any exception.
     *

     * @param guest
     * a source of requests
     */
    void handle (Guest guest);
}


text:
{license_header}

from typing import Any, Callable, Dict

from datadog_checks.base import AgentCheck
from datadog_checks.base.stubs.aggregator import AggregatorStub
from datadog_checks.dev.utils import get_metadata_metrics
from datadog_checks.{check_name} import {check_class}

def test_check(dd_run_check, aggregator, instance):
    # type: (Callable[[AgentCheck, bool], None], AggregatorStub, Dict[str, Any]) -> None
    check = {check_class}('{check_name}', {{}}, [instance])
    dd_run_check(check)

    aggregator.assert_all_metrics_covered()
    aggregator.assert_metrics_using_metadata(get_metadata_metrics())

def test_emits_critical_service_check_when_service_is_down(dd_run_check, aggregator, instance):
    # type: (Callable[[AgentCheck, bool], None], AggregatorStub, Dict[str, Any]) -> None
    check = {check_class}('{check_name}', {{}}, [instance])
    dd_run_check(check)
    aggregator.assert_service_check('{check_name}.can_connect', {check_class}.CRITICAL)


text:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>image_loop</title>
</head>
<body bgcolor="#000000">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="600" id="image_loop" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="image_loop.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="image_loop.swf" quality="high" bgcolor="#000000" width="800" height="600" name="image_loop" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>


text:
/**
 * Transformation functions: used to transform a raw data value. For example, a template or axis label
 *  can convert from pvalue to -log10pvalue by specifying the following field name (the `|funcname` syntax
 *  indicates applying a function):
 *
 * `{{assoc:pvalue|neglog10}}`
 *
 * Transforms can also be chained so that several are used in order from left to right:
 * `{{log_pvalue|logtoscinotation|htmlescape}}`
 *
 * Most parts of LocusZoom that rely on being given a field name (or value) can be used this way: axis labels, position,
 *  match/filter logic, tooltip HTML template, etc. If your use case is not working with filters, please file a
 *  bug report!
 *
 * NOTE: for best results, don't specify filters in the `fields` array of a data layer- only specify them where the
 *  transformed value will be used.
 * @module LocusZoom_TransformationFunctions
 */

/**
 * Return the log10 of a value. Can be applied several times in a row for, eg, loglog plots.
 * @param {number} value
 * @return {null|number}
 */
export function log10 (value) {
    if (isNaN(value) || value <= 0) {
        return null;
    }
    return Math.log(value) / Math.LN10;
}

/**
 * Return the -log (base 10), a common means of representing pvalues in locuszoom plots
 * @param {number} value
 * @return {number}
 */
export function neglog10 (value) {
    if (isNaN(value) || value <= 0) {
        return null;
    }
    return -Math.log(value) / Math.LN10;
}

/**
 * Convert a number from logarithm to scientific notation. Useful for, eg, a datasource that returns -log(p) by default
 * @param {number} value
 * @return {string}
 */
export function logtoscinotation (value) {
    if (isNaN(value)) {
        return 'NaN';
    }
    if (value === 0) {
        return '1';
    }
    const exp = Math.ceil(value);
    const diff = exp - value;
    const base = Math.pow(10, diff);
    if (exp === 1) {
        return (base / 10).toFixed(4);
    } else if (exp === 2) {
        return (base / 100).toFixed(3);
    } else {
        return `${base.toFixed(2)} × 10^-${exp}`;
    }
}

/**
 * Represent a number in scientific notation
 * @param {Number} value
 * @returns {String}
 */
export function scinotation (value) {
    if (isNaN(value)) {
        return 'NaN';
    }
    if (value === 0) {
        return '0';
    }

    const abs = Math.abs(value);
    let log;
    if (abs > 1) {
        log = Math.ceil(Math.log(abs) / Math.LN10);
    } else {  // 0...1
        log = Math.floor(Math.log(abs) / Math.LN10);
    }
    if (Math.abs(log) <= 3) {
        return value.toFixed(3);
    } else {
        return value.toExponential(2).replace('+', '').replace('e', ' × 10^');
    }
}

/**
 * HTML-escape user entered values for use in constructed HTML fragments
 *
 * For example, this filter can be used on tooltips with custom HTML display. This protects against some forms of
 *  XSS injection when plotting user-provided data, as well as display artifacts from field values with HTML symbols
 *  such as `<` or `>`.
 * @param {String} value HTML-escape the provided value
 * @return {string}
 */
export function htmlescape (value) {
    if (!value) {
        return '';
    }
    value = `${value}`;

    return value.replace(/['"<>&`]/g, function (s) {
        switch (s) {
        case "'":
            return ''';
        case '"':
            return '"';
        case '<':
            return '<';
        case '>':
            return '>';
        case '&':
            return '&';
        case '`':
            return '`';
        }
    });
}

/**
 * Return true if the value is numeric (including 0)
 *
 * This is useful in template code, where we might wish to hide a field that is absent, but show numeric values even if they are 0
 *   Eg, `{{#if value|is_numeric}}...{{/if}}
 *
 * @param {Number} value
 * @return {boolean}
 */
export function is_numeric(value) {
    return typeof value === 'number';
}

/**
 * URL-encode the provided text, eg for constructing hyperlinks
 * @param {String} value
 * @return {string}
 */
export function urlencode (value) {
    return encodeURIComponent(value);
}


text:
package dixi.soft.fx_watcher.widgets;

import java.util.Arrays;

import dixi.soft.fx_watcher.R;
import dixi.soft.fx_watcher.main.UserDataDialogActivity;
import dixi.soft.fx_watcher.service.GetData;
import dixi.soft.fx_watcher.service.GetData.GetDataListener;
import dixi.soft.fx_watcher.service.PammData;
import dixi.soft.fx_watcher.utils.Config;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import android.widget.Button;
import android.widget.RemoteViews;

public class WidgetProvider extends AppWidgetProvider implements GetDataListener {

	public static final String TAG = "WidgetProvider";

	public static String ACTION_RESTART = "dixi.soft.fx_watcher.ACTION_RESTART";

	@Override
	public void onEnabled(Context context) {
		super.onEnabled(context);
		Log.d(TAG, "onEnabled");
	}

	@Override
	public void onDeleted(Context context, int[] appWidgetIds) {
		super.onDeleted(context, appWidgetIds);
		Log.d(TAG, "onDeleted " + Arrays.toString(appWidgetIds));
	}

	@Override
	public void onDisabled(Context context) {
		super.onDisabled(context);
		Log.d(TAG, "onDisabled");
	}

	@Override
	public void onUpdate(Context context, AppWidgetManager appWidgetManager,
			int[] appWidgetIds) {

		if (Config.DEBUG) {
			Log.i(TAG, "onUpdate");
		}

		if (PammData.getLogin(context).equals("")
				|| PammData.getPass(context).equals("")) {
			if (Config.DEBUG) {
				Log.i(TAG, "Âûõîäèì - íåòó ëîãèíà è ïàðîëÿ!");
			}
			return;
		}

		// Loading data
		GetData getData = new GetData(context, this);
		getData.execute();
	}

	@Override
    public void onReceive(Context context, Intent intent) {

		if (Config.DEBUG) {
			Log.i(TAG, "onReceive " + intent.getAction());
		}

         //Ëîâèì íàø Broadcast, ïðîâåðÿåì è âûâîäèì ñîîáùåíèå
         final String action = intent.getAction();
         if (action.equals(ACTION_RESTART)) {
        	 updateWidget(context);
         }

         super.onReceive(context, intent);
	}

	private Intent getAdapterIntent(Context context) {
		Intent svcIntent = new Intent(context, WidgetService.class);
		svcIntent.setData(Uri.parse(svcIntent
				.toUri(Intent.URI_INTENT_SCHEME)));
		return svcIntent;
	}

	@Override
	public void onDownloadDone(Context context) {

		if (Config.DEBUG) {
			Log.i(TAG, "onDownloadDone");
		}

		AppWidgetManager appWidgetManager = AppWidgetManager
				.getInstance(context.getApplicationContext());
		ComponentName thisWidget = new ComponentName(
				context.getApplicationContext(), WidgetProvider.class);
		int[] appWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);

		RemoteViews widget = new RemoteViews(context.getPackageName(),
				R.layout.widget);

		// Create action to restart button
		Intent active = new Intent(context, WidgetProvider.class);
		active.setAction(ACTION_RESTART);
		PendingIntent actionPendingIntent = PendingIntent.getBroadcast(
				context, 0, active, 0);
		// Add action to restart button
		widget.setOnClickPendingIntent(R.id.button1, actionPendingIntent);

		// Show update button
		widget.setViewVisibility(R.id.button1, Button.VISIBLE);
		// Show configure button
		widget.setViewVisibility(R.id.button2, Button.VISIBLE);
		// Hide update progress
		widget.setViewVisibility(R.id.progressBar1, Button.GONE);

		// Add data to list
		widget.setRemoteAdapter(R.id.listView1, getAdapterIntent(context));

		// Update all widgets
		for (int i = 0; i < appWidgetIds.length; i++) {
			// Add action to change user authenticate data
			setClickOnUserChangeAuth(context, widget, appWidgetIds[i]);
			appWidgetManager.updateAppWidget(appWidgetIds[i], widget);
			appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds[i],
			        R.id.listView1);
		}
	}

	private void updateWidget(Context context) {

		if (PammData.getLogin(context).equals("")
				|| PammData.getPass(context).equals("")) {
			if (Config.DEBUG) {
				Log.i(TAG, "Âûõîäèì - íåòó ëîãèíà è ïàðîëÿ!");
			}
			return;
		}

		new Thread(new Runnable() {
			@Override
			public void run() {
				for (int i = 0; i < 200; i ++) {
					Log.e(TAG, "" + i);
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			}
		}).start();

		AppWidgetManager appWidgetManager = AppWidgetManager
				.getInstance(context.getApplicationContext());
		ComponentName thisWidget = new ComponentName(
				context.getApplicationContext(), WidgetProvider.class);
		int[] appWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);

		RemoteViews widget = new RemoteViews(context.getPackageName(),
				R.layout.widget);

		// Hide update button
		widget.setViewVisibility(R.id.button1, Button.GONE);
		// Hide configure button
		widget.setViewVisibility(R.id.button2, Button.GONE);
		// Show update progress
		widget.setViewVisibility(R.id.progressBar1, Button.VISIBLE);

		// Update all widgets
		for (int i = 0; i < appWidgetIds.length; i++) {
			// Add action to change user authenticate data
			setClickOnUserChangeAuth(context, widget, appWidgetIds[i]);
			appWidgetManager.updateAppWidget(appWidgetIds[i], widget);
		}

		if (appWidgetIds != null && appWidgetIds.length > 0) {
			onUpdate(context, appWidgetManager, appWidgetIds);
		}
	}

	private void setClickOnUserChangeAuth(Context context, RemoteViews widget, int appWidgetId) {
		Intent intent = new Intent(context, UserDataDialogActivity.class);
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
		PendingIntent pIntent = PendingIntent.getActivity(context, 0, intent,
				PendingIntent.FLAG_UPDATE_CURRENT);
		widget.setOnClickPendingIntent(R.id.button2, pIntent);
	}

}


text:
package org.apache.activemq.artemis.core.protocol.stomp;

import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;

import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
import org.apache.activemq.artemis.core.protocol.stomp.v10.StompFrameV10;

/**
 * Represents all the data in a STOMP frame.
 */
public class StompFrame {

   protected static final byte[] END_OF_FRAME = new byte[]{0, '\n'};

   protected final String command;

   protected Map<String, String> headers;

   private String body;

   protected byte[] bytesBody;

   protected ActiveMQBuffer buffer = null;

   protected int size;

   private boolean disconnect;

   private boolean isPing;

   public StompFrame(String command) {
      this(command, false);
   }

   public StompFrame(String command, boolean disconnect) {
      this.command = command;
      this.headers = new LinkedHashMap<>();
      this.disconnect = disconnect;
   }

   public StompFrame(String command, Map<String, String> headers, byte[] content) {
      this.command = command;
      this.headers = headers;
      this.bytesBody = content;
   }

   public String getCommand() {
      return command;
   }

   public int getEncodedSize() throws Exception {
      if (buffer == null) {
         buffer = toActiveMQBuffer();
      }
      return size;
   }

   @Override
   public String toString() {
      return "StompFrame[command=" + command + ", headers=" + headers + ", content= " + this.body + " bytes " +
         Arrays.toString(bytesBody);
   }

   public boolean isPing() {
      return isPing;
   }

   public void setPing(boolean ping) {
      isPing = ping;
   }

   public ActiveMQBuffer toActiveMQBuffer() throws Exception {
      if (buffer == null) {
         if (isPing()) {
            buffer = ActiveMQBuffers.fixedBuffer(1);
            buffer.writeByte((byte) 10);
            size = buffer.writerIndex();
            return buffer;
         }

         StringBuilder head = new StringBuilder(512);
         head.append(command);
         head.append(Stomp.NEWLINE);
         // Output the headers.
         encodeHeaders(head);
         if (bytesBody != null && bytesBody.length > 0 && !hasHeader(Stomp.Headers.CONTENT_LENGTH) && !(this instanceof StompFrameV10)) {
            head.append(Stomp.Headers.CONTENT_LENGTH);
            head.append(Stomp.Headers.SEPARATOR);
            head.append(bytesBody.length);
            head.append(Stomp.NEWLINE);
         }
         // Add a newline to separate the headers from the content.
         head.append(Stomp.NEWLINE);

         byte[] headBytes = head.toString().getBytes(StandardCharsets.UTF_8);
         int bodyLength = (bytesBody == null) ? 0 : bytesBody.length;

         buffer = ActiveMQBuffers.fixedBuffer(headBytes.length + bodyLength + END_OF_FRAME.length);

         buffer.writeBytes(headBytes);
         if (bytesBody != null) {
            buffer.writeBytes(bytesBody);
         }
         buffer.writeBytes(END_OF_FRAME);

         size = buffer.writerIndex();
      } else {
         buffer.readerIndex(0);
      }
      return buffer;
   }

   protected void encodeHeaders(StringBuilder head) {
      for (Map.Entry<String, String> header : headers.entrySet()) {
         head.append(header.getKey());
         head.append(Stomp.Headers.SEPARATOR);
         head.append(header.getValue());
         head.append(Stomp.NEWLINE);
      }
   }

   public String getHeader(String key) {
      return headers.get(key);
   }

   public void addHeader(String key, String val) {
      headers.put(key, val);
   }

   public Map<String, String> getHeadersMap() {
      return headers;
   }

   public class Header {

      public String key;
      public String val;

      public Header(String key, String val) {
         this.key = key;
         this.val = val;
      }

      public String getEncodedKey() {
         return encode(key);
      }

      public String getEncodedValue() {
         return encode(val);
      }
   }

   public String encode(String str) {
      int len = str.length();

      char[] buffer = new char[2 * len];
      int iBuffer = 0;
      for (int i = 0; i < len; i++) {
         char c = str.charAt(i);

         // \n
         if (c == (byte) 10) {
            buffer[iBuffer] = (byte) 92;
            buffer[++iBuffer] = (byte) 110;
         } else if (c == (byte) 13) { // \r
            buffer[iBuffer] = (byte) 92;
            buffer[++iBuffer] = (byte) 114;
         } else if (c == (byte) 92) { // \

            buffer[iBuffer] = (byte) 92;
            buffer[++iBuffer] = (byte) 92;
         } else if (c == (byte) 58) { // :
            buffer[iBuffer] = (byte) 92;
            buffer[++iBuffer] = (byte) 99;
         } else {
            buffer[iBuffer] = c;
         }
         iBuffer++;
      }

      return new String(buffer, 0, iBuffer);
   }

   public void setBody(String body) {
      this.body = body;
      this.bytesBody = body.getBytes(StandardCharsets.UTF_8);
   }

   public boolean hasHeader(String key) {
      return headers.containsKey(key);
   }

   public String getBody() {
      if (body == null) {
         if (bytesBody != null) {
            body = new String(bytesBody, StandardCharsets.UTF_8);
         }
      }
      return body;
   }

   //Since 1.1, there is a content-type header that needs to take care of
   public byte[] getBodyAsBytes() {
      return bytesBody;
   }

   public boolean needsDisconnect() {
      return disconnect;
   }

   public void setByteBody(byte[] content) {
      this.bytesBody = content;
   }

   public void setNeedsDisconnect(boolean b) {
      disconnect = b;
   }
}


text:
List the attendees for the meeting

## Agenda
Pre-arranged stuff to talk about.
Email core team on Monday of the week of the dev meeting to ask for things to talk about.

## Discussion
Notes from todays dev meeting

## Check in on previous action items
Copy previous action items from last meeting agenda.

## New Action items
Copy new action items to next meetings agenda so we can check in.
Make sure each action item is assigned to someone or it will likely not get done.

[ ]  List resultant action items here


text:
package org.jnet.core;

import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.Collectors;

import javassist.util.proxy.MethodHandler;
import javassist.util.proxy.ProxyFactory;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jnet.core.connection.Connection;
import org.jnet.core.connection.messages.Message;
import org.jnet.core.helper.BeanHelper;
import org.jnet.core.helper.Unchecker;
import org.jnet.core.synchronizer.CloneStrategy;
import org.jnet.core.synchronizer.Event;
import org.jnet.core.synchronizer.MetaData;
import org.jnet.core.synchronizer.MetaDataManager;
import org.jnet.core.synchronizer.ObjectId;
import org.jnet.core.synchronizer.SerializableEvent;
import org.jnet.core.synchronizer.State;

public abstract class AbstractGameEngine implements AutoCloseable {
	private static final Logger logger = LogManager.getLogger(AbstractGameEngine.class);

	protected final Map<ObjectId, ManagedObject<?>> handlers = new HashMap<>();

	protected final Map<ObjectId, InvokeHandler<?>> handlers2 = new HashMap<>();

	protected final MetaDataManager metaDataManager;

	public abstract String name();

	abstract protected Set<Connection> getConnections();
	abstract protected void handleMessage(Message message);

	protected AbstractGameEngine(MetaDataManager metaDataManager) {
		this.metaDataManager = metaDataManager;
	}

	public ObjectId getIdForProxy(Object proxy) {
		if (proxy instanceof ManagedObject) {
			return ((ManagedObject<?>) proxy)._getMoId_();
		}

		return null;
	}

	public void updateGameState() {
		for (Connection connection : getConnections()) {
			Message message = null;
			while ((message = connection.nextMessage()) != null) {
				handleMessage(message);
			}
		}
	}

	@SuppressWarnings("unchecked")
	public <T> T getObject(Class<T> clazz, ObjectId id) {
		ManagedObject<T> ret = (ManagedObject<T>) handlers.get(id);
		if (ret == null) {
			throw new RuntimeException("no entity found for id " + id);
		}

		if (!clazz.isAssignableFrom(ret.getClass())) {
			throw new RuntimeException("entity with id " + id + " is not assignable to class " + clazz.getName() + " => " + ret.getClass().getName());
		}

		return (T) ret;
	}

	public <T> State<T> getLastTrustedState(Class<T> clazz, ObjectId id) {
		InvokeHandler<T> ret = getHandler(id);
		if (ret == null) {
			throw new RuntimeException("no entity found for id " + id);
		}

		if (!clazz.isAssignableFrom(ret.getLastTrustedState().getState().getClass())) {
			throw new RuntimeException("entity with id " + id + " is not assignable to class " + clazz.getName());
		}

		return ret.getLastTrustedState();
	}

	@SuppressWarnings("unchecked")
	protected<T> InvokeHandler<T> getHandler(ObjectId objectId) {
		return (InvokeHandler<T>) handlers2.get(objectId);
	}

	public abstract int serverTime();

	protected abstract void distributeEvent(SerializableEvent event);

	@SuppressWarnings("unchecked")
	public <T> T createProxy(T impl) {
		logger.info("creating proxy for " + impl);
		// reuse existing proxies
		ManagedObject<T> existingHandler = (ManagedObject<T>) handlers.values().stream()
				.filter(v -> v._getMoLastTrustedState_() == impl).findFirst().orElseGet(() -> null);

		if (existingHandler != null) {
			System.out.println(existingHandler);
			return (T) existingHandler;
		}

		// create proxies for all the attributes of that object
		BeanHelper.forEachRelevantField(impl.getClass(), field -> {
			Object fieldValue = field.get(impl);
			Object mayBeAProxy = createProxyOrNot(fieldValue);
			field.set(impl, mayBeAProxy);
		});

		// create proxy for the given object
		ObjectId objectId = metaDataManager.createObjectId(impl.getClass());
		InvokeHandler<T> handler = new InvokeHandler<>(objectId, impl, this);

		ProxyFactory factory = new ProxyFactory();
		factory.setSuperclass(impl.getClass());
		factory.setInterfaces(new Class<?>[]{ManagedObject.class});
		T proxy;
		try {
			proxy = (T) factory.create(new Class[0], new Object[0], handler);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
		handlers.put(objectId, (ManagedObject<T>) proxy);
		handlers2.put(objectId, handler);

		return proxy;
	}

	@SuppressWarnings("unchecked")
	private Object createProxyOrNot(Object o) throws Exception {
		if (o == null) {
			return null;
		} else if (BeanHelper.isPrimitive(o.getClass())) {
			return o;
		} else if (o.getClass().isArray()) {
		    int length = Array.getLength(o);
		    for (int i = 0; i < length; i ++) {
		        Object arrayElement = Array.get(o, i);
		        Array.set(o, i, createProxyOrNot(arrayElement));
		    }
		    return o;
		} else if (o instanceof Map) {
			Map<Object, Object> newMap = (Map<Object, Object>) o.getClass().newInstance();
			for (Entry<Object, Object> entry : ((Map<Object, Object>) o).entrySet()) {
				newMap.put(createProxyOrNot(entry.getKey()), createProxyOrNot(entry.getValue()));
			}

			return newMap;
		} else if (o instanceof Collection) {
			Collection<Object> newCollection = (Collection<Object>) o.getClass().newInstance();
			for (Iterator<Object> it = ((Collection<Object>)o).iterator(); it.hasNext(); ) {
				newCollection.add(createProxyOrNot(it.next()));
			}

			return newCollection;
		} else {
			return createProxy(o);
		}
	}

	public MetaDataManager getMetaDataManager() {
		return metaDataManager;
	}
}

class InvokeHandler<T> implements MethodHandler {
	private static final Method getIdMethod = Unchecker.uncheck(() -> {
		return ManagedObject.class.getMethod("_getMoId_", new Class[0]);
	});

	private static final Method getMetaDataMethod = Unchecker.uncheck(() -> {
		return ManagedObject.class.getMethod("_getMoMetaData_", new Class[0]);
	});

	private static final Method getMoLatestStateMethod = Unchecker.uncheck(() -> {
		return ManagedObject.class.getMethod("_getMoLatestState_", new Class[0]);
	});

	private static final Method getMoLastTrustedStateMethod = Unchecker.uncheck(() -> {
		return ManagedObject.class.getMethod("_getMoLastTrustedState_", new Class[0]);
	});

	private final ObjectId id;

	private final MetaData metaData;

	private State<T> lastTrustedState;

	private State<T> latestState;

	private final AbstractGameEngine gameEngine;

	private List<Event> sortedEvents = new LinkedList<>();

	public InvokeHandler(ObjectId id, T impl, AbstractGameEngine gameEngine) {
		super();
		this.id = id;
		this.lastTrustedState = new State<T>(impl, 0);
		this.metaData = gameEngine.getMetaDataManager().get(impl.getClass());
		resetLatestState();
		this.gameEngine = gameEngine;
	}

	public State<T> getLastTrustedState() {
		return lastTrustedState;
	}

	public T getLatestState(int now) {
		if (now < latestState.getTimestamp()) {
			resetLatestState();
		}

		return latestState.updateState(sortedEvents, now);
	}

	private void addEvent(Event event) {
		sortedEvents.add(event);
		Collections.sort(sortedEvents);

		// TODO: muss der reset immer erfolgen, oder nur wenn event.ts < lateststate.ts?
		resetLatestState();
	}

	@Override
	public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable {
		// handle generic ManagedObject-interface methods
		if (thisMethod.equals(getIdMethod)) {
			return id;
		} else if (thisMethod.equals(getMetaDataMethod)) {
			return metaData;
		} else if (thisMethod.equals(getMoLatestStateMethod)) {
			return getLatestState(gameEngine.serverTime());
		} else if (thisMethod.equals(getMoLastTrustedStateMethod)) {
			return getLastTrustedState().getState();
		}

		// handle events
		return handleEvent(gameEngine.serverTime(),
				metaData.getClazz().getMethod(thisMethod.getName(), thisMethod.getParameterTypes()), args, true);
	}

	public Object handleEvent(int eventTime, Method implMethod, Object[] args, boolean doDistribute) throws Throwable {
		if (implMethod.getAnnotation(Action.class) != null) {
			SerializableEvent event = new SerializableEvent(id, eventTime, implMethod, args);
			addEvent(event);
			if (doDistribute) {
				gameEngine.distributeEvent(event);
			}
		}

		return implMethod.invoke(getLatestState(gameEngine.serverTime()), args);
	}

	public void newState(int ts, Map<Field, Object> state) throws Exception {
		BeanHelper.merge(state, lastTrustedState.getState());
		lastTrustedState.setTimestamp(ts);
		resetLatestState();
		sortedEvents = sortedEvents.stream().filter(e -> e.getTs() > ts).collect(Collectors.toList());
	}

	private void resetLatestState() {
		latestState = lastTrustedState.clone(new CloneStrategy() {

			@Override
			public <C> C clone(C object) {
				return BeanHelper.cloneGameObject(object);
			}
		});
	}

	public ObjectId getId() {
		return id;
	}
}


text:
<title>File</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="css/black-tie/jquery-ui-1.8.2.custom.css" type="text/css"></link><link rel="stylesheet" href="css/jquery.treeview.css" type="text/css"></link><link rel="stylesheet" href="css/default.css" type="text/css"></link><link rel="stylesheet" href="css/theme.css" type="text/css"></link><base target="content"></base>

API Documentation

ZendX/JQuery/View/Helper/AjaxLink.php

Includes |Classes |

Properties

category

copyright

license

package

subpackage

version

Description
Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.

Includes
Zend/View/Helper/HtmlElement.php (Include Once)

Classes

ZendX_JQuery_View_Helper_AjaxLink

Properties

Extends

Implements

copyright

Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)

license

http://framework.zend.com/license/new-bsd     New BSD License

package

ZendX_JQuery

subpackage

View

uses

Zend_Json

Abstract
No

Final
No

Description

jQuery Accordion Pane, goes with Accordion Container

Methods

_determineRequestHandler,
      ajaxLink,

_determineRequestHandler(
          Array

            $options,
          Boolean

            $hasParams,

          )

        :
        String

Description

Determine which request method (GET or POST) should be used.

Normally the request method is determined implicitly by the rule,
if addiotional params are sent, POST, if not GET. You can overwrite
this behaviiour by implicitly setting $options['method'] = "POST|GET";

Arguments

Name
Type
Description
Default

$options
Array |

$hasParams
Boolean |

Return value

Type
Description

String

ajaxLink(
          String

            $label,
          String

            $url,
          Array

            $options
            = null,
          Array

            $params
            = null,

          )

        :
        String

Description

Create an anchor that enables ajax-based requests and handling of the response.

This helper creates links that make XmlHttpRequests to the server. It allows to
inject the response into the DOM. Fancy effects going with the links can be enabled
via simple callback shortnames. The functionality is mostly controlled by the $options
array:

$options
 Key                Behaviour
 =================================================================================
 'update'        Update a container with the content fetched from $url
 'method'        Explicit Requesting method mimicing the jQuery functionality: GET, POST
 'inline'        True or false, wheater to inline the javascript in onClick=""
                    atttribute or append it to jQuery onLoad Stack.
 'complete'      String specifies javascript called after successful request or a
                    shortname of a jQuery effect that should be applied to the 'update' element.
 'beforeSend'   String specifies javascript called before the request is sent, or a
                    shortname of a jQuery effect that should be applied to the link clicked.
 'noscript'     True/false, include a noscript variant that directly requests
                    the given $url (make sure to check $request->isXmlHttpRequest())
 'dataType'     What type of data is the response returning? text, html, json?
 'title'            HTML Attribute title of the Anchor
 'class'            HTML Attribute class of the Anchor
 'id'           HTML Attribute id of the Anchor
 'attribs'      Array of Key-Value pairs with HTML Attribute names and their content.

BeforeSend Callback:
Can include shortcuts as a string assignment to fire of effects before sending of request.
Possible shortcuts are 'fadeOut', 'fadeOutSlow', 'hide', 'hideSlow', 'slideUp', 'flash',

Arguments

Name
Type
Description
Default

$label
String |

Urls Title

$url
String |

Link to Point to

$options
Array |

null

$params
Array |

Key Value Pairs of GET/POST Parameters
null

Return value

Type
Description

String

Tags

Name
Description

example
$options = array(&#039;beforeSend&#039; =&gt; &#039;hideSlow&#039;, &#039;complete&#039; =&gt; &#039;show&#039;);

link
http://docs.jquery.com/Ajax

Properties

$currentLinkCallbackId,

          private
          static $currentLinkCallbackId
          =
          1

Static because multiple instances accross views of AjaxLink could reset the counter and a
subcontainer because of this single private class variable seems too much overhead.

Documentation was generated by DocBlox.


text:
using System.ComponentModel;
using System.Linq;
using System.Reflection;

namespace YJingLee.Office.Npoi
{
    public static class ObjectExtensions
    {
        public static PropertyInfo[] GetProperties<T>(this T entity)
        {
            return entity == null ? new PropertyInfo[0] : entity.GetType().GetProperties();
        }

        public static string GetDescription(this PropertyInfo propertyInfo)
        {
            var attribute = propertyInfo.GetCustomAttributes(typeof(DescriptionAttribute), true).FirstOrDefault();
            return attribute == null ? propertyInfo.Name : ((DescriptionAttribute)attribute).Description;
        }

        public static dynamic GetValue<T>(this T entity, PropertyInfo propertyInfo)
        {
            return propertyInfo.GetValue(entity, null);
        }
    }
}


text:
package h;
import java.util.Arrays;
import java.util.List;

//2 5yq6nwzfy7wrzq92i583nbcxk

public interface Agcbdisc_t extends Agcbdisc_s {
	public static List<String> DEFINITION = Arrays.asList(
"typedef struct Agcbdisc_s Agcbdisc_t");
}

// typedef struct Agcbdisc_s Agcbdisc_t;


text:
.guardar{
color: white;
background: red;
font-size: 12px;
font-family: Verdana,Helvetica;
font-weight: bold;
border: 0px;
width: 80px;
height: 30px;
border-radius: 15px;
}

::-webkit-input-placeholder{
padding-left: 22px;
}

div.form
{
	width: 80%;
}

div.form input,
div.form textarea,
div.form select
{
	margin: 0.2em 0 0.1em 0;
}

#alumno-form input[type="text"], textarea, select{
	border: 2px solid red;
	height: 39px;
}

#alumno-form select{
	border: 2px solid red;
	height: 39px;
}

#consulta-form input[type="text"], textarea{
	border: 2px solid red;
	height: 25px;
}

#logon-form input[type="text"], textarea,input[type="password"]{
	border: 2px solid red;
	height: 25px;
}

#logon-form input[type="submit"]{
	color: white;
	background: red;
	font-size: 12px;
	font-family: Verdana,Helvetica;
	font-weight: bold;
	border: 0px;
	width: 80px;
	height: 30px;
	border-radius: 15px;
}

#noticia-form input[type="text"], textarea,input[type="password"]{
	border: 2px solid red;
	height: 25px;
}
div.form textarea{
	height: 62px;

}
div.form fieldset
{
	border: 1px solid #DDD;
	padding: 10px;
	margin: 0 0 10px 0;
    -moz-border-radius:7px;
}

div.form label
{
	font-weight: bold;
	font-size: 0.9em;
	display: block;
}

div.form .row
{
	margin: 3px 0;
}

div.form .hint
{
	margin: 0;
	padding: 0;
	color: #999;
}

div.form .note
{
	font-style: italic;
}

div.form span.required
{
	color: red;
}

div.form div.error label:first-child,
div.form label.error,
div.form span.error
{
	color: #C00;
}

div.form div.error input,
div.form div.error textarea,
div.form div.error select,
div.form input.error,
div.form textarea.error,
div.form select.error
{
	background: #FEE;
	border-color: #C00;
}

div.form div.success input,
div.form div.success textarea,
div.form div.success select,
div.form input.success,
div.form textarea.success,
div.form select.success
{
	background: #E6EFC2;
	border-color: #C6D880;
}

div.form div.success label
{
	color: inherit;
}

div.form .errorSummary
{
	border: 2px solid #C00;
	padding: 7px 7px 12px 7px;
	margin: 0 0 20px 0;
	background: #FEE;
	font-size: 0.9em;
}

div.form .errorMessage
{
	color: red;
	font-size: 0.9em;
}

div.form .errorSummary p
{
	margin: 0;
	padding: 5px;
}

div.form .errorSummary ul
{
	margin: 0;
	padding: 0 0 0 20px;
}

div.wide.form label
{
	float: left;
	margin-right: 10px;
	position: relative;
	text-align: right;
}

div.wide.form .row
{
	clear: left;
}

div.wide.form .buttons, div.wide.form .hint, div.wide.form .errorMessage
{
	clear: left;
	padding-left: 110px;
}


text:
import sys
try:
    from cStringIO import StringIO
except ImportError:
    from StringIO import StringIO
from psparser import PSStackParser
from psparser import PSSyntaxError, PSEOF
from psparser import KWD, STRICT
from pdftypes import PDFException
from pdftypes import PDFStream, PDFObjRef
from pdftypes import int_value
from pdftypes import dict_value

##  Exceptions
##
class PDFSyntaxError(PDFException):
    pass

##  PDFParser
##
class PDFParser(PSStackParser):

    """
    PDFParser fetch PDF objects from a file stream.
    It can handle indirect references by referring to
    a PDF document set by set_document method.
    It also reads XRefs at the end of every PDF file.

    Typical usage:
      parser = PDFParser(fp)
      parser.read_xref()
      parser.read_xref(fallback=True) # optional
      parser.set_document(doc)
      parser.seek(offset)
      parser.nextobject()

    """

    def __init__(self, fp):
        PSStackParser.__init__(self, fp)
        self.doc = None
        self.fallback = False
        return

    def set_document(self, doc):
        """Associates the parser with a PDFDocument object."""
        self.doc = doc
        return

    KEYWORD_R = KWD('R')
    KEYWORD_NULL = KWD('null')
    KEYWORD_ENDOBJ = KWD('endobj')
    KEYWORD_STREAM = KWD('stream')
    KEYWORD_XREF = KWD('xref')
    KEYWORD_STARTXREF = KWD('startxref')

    def do_keyword(self, pos, token):
        """Handles PDF-related keywords."""

        if token in (self.KEYWORD_XREF, self.KEYWORD_STARTXREF):
            self.add_results(*self.pop(1))

        elif token is self.KEYWORD_ENDOBJ:
            self.add_results(*self.pop(4))

        elif token is self.KEYWORD_NULL:
            # null object
            self.push((pos, None))

        elif token is self.KEYWORD_R:
            # reference to indirect object
            try:
                ((_, objid), (_, genno)) = self.pop(2)
                (objid, genno) = (int(objid), int(genno))
                obj = PDFObjRef(self.doc, objid, genno)
                self.push((pos, obj))
            except PSSyntaxError:
                pass

        elif token is self.KEYWORD_STREAM:
            # stream object
            ((_, dic),) = self.pop(1)
            dic = dict_value(dic)
            objlen = 0
            if not self.fallback:
                try:
                    objlen = int_value(dic['Length'])
                except KeyError:
                    if STRICT:
                        raise PDFSyntaxError('/Length is undefined: %r' % dic)
            self.seek(pos)
            try:
                (_, line) = self.nextline()  # 'stream'
            except PSEOF:
                if STRICT:
                    raise PDFSyntaxError('Unexpected EOF')
                return
            pos += len(line)
            self.fp.seek(pos)
            data = self.fp.read(objlen)
            self.seek(pos+objlen)
            while 1:
                try:
                    (linepos, line) = self.nextline()
                except PSEOF:
                    if STRICT:
                        raise PDFSyntaxError('Unexpected EOF')
                    break
                if 'endstream' in line:
                    i = line.index('endstream')
                    objlen += i
                    data += line[:i]
                    break
                objlen += len(line)
                data += line
            self.seek(pos+objlen)
            # XXX limit objlen not to exceed object boundary
            if 2 <= self.debug:
                print >>sys.stderr, 'Stream: pos=%d, objlen=%d, dic=%r, data=%r...' % \
                                    (pos, objlen, dic, data[:10])
            obj = PDFStream(dic, data, self.doc.decipher)
            self.push((pos, obj))

        else:
            # others
            self.push((pos, token))

        return

##  PDFStreamParser
##
class PDFStreamParser(PDFParser):

    """
    PDFStreamParser is used to parse PDF content streams
    that is contained in each page and has instructions
    for rendering the page. A reference to a PDF document is
    needed because a PDF content stream can also have
    indirect references to other objects in the same document.
    """

    def __init__(self, data):
        PDFParser.__init__(self, StringIO(data))
        return

    def flush(self):
        self.add_results(*self.popall())
        return

    def do_keyword(self, pos, token):
        if token is self.KEYWORD_R:
            # reference to indirect object
            try:
                ((_, objid), (_, genno)) = self.pop(2)
                (objid, genno) = (int(objid), int(genno))
                obj = PDFObjRef(self.doc, objid, genno)
                self.push((pos, obj))
            except PSSyntaxError:
                pass
            return
        # others
        self.push((pos, token))
        return


text:
use warnings;
use strict;
use Getopt::Long qw(:config pass_through);
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Utils::Exception qw(throw);
use Bio::EnsEMBL::Compara::DBSQL::XrefAssociationAdaptor;
use Data::Dumper;

my ( $reg_conf, $gene_tree_id, $help, $compara_name, $db_name );

GetOptions( 'help'               => \$help,
			'compara|c=s'       => \$compara_name,
			'db_name|n=s'       => \$db_name,
			'reg_conf|regfile=s' => \$reg_conf,
			'gene_tree_id|g=s' => \$gene_tree_id );

if ( $help or !$reg_conf or !$gene_tree_id or !$compara_name or !$db_name) {
	pod2usage(1);
}

Bio::EnsEMBL::Registry->load_all($reg_conf);

# get compara database
my ($compara) = grep {$_->dbc()->dbname() eq $compara_name} @{Bio::EnsEMBL::Registry->get_all_DBAdaptors(-GROUP=>'compara')};

throw("Could not find compara $compara_name") unless (defined $compara);

my $gene_tree_adaptor = $compara->get_GeneTreeAdaptor();

my $gt = $gene_tree_adaptor->fetch_by_stable_id($gene_tree_id);

 my $adaptor = Bio::EnsEMBL::Compara::DBSQL::XrefAssociationAdaptor->new($compara);

 for my $xref (@{$adaptor->get_associated_xrefs_for_tree($gt,$db_name)}) {
 	print "$xref\n";
 	for my $member (@{$adaptor->get_members_for_xref($gt,$xref,$db_name)}) {
 		print $member->stable_id()."\n"
 	}
 }
 my $stuff = $adaptor->get_all_member_associations($gt, $db_name);
 while( my($xref,$ms) = each %$stuff) {
 	print "$xref\n";
 	for my $member (@$ms) {
 		print $member->stable_id()."\n"
 	}
 }


text:
import { attachedRoot } from '../../util/dom'
import { VNodeDirective } from 'vue/types/vnode'
import { VNode } from 'vue'

interface ClickOutsideBindingArgs {
  handler: (e: Event) => void
  closeConditional?: (e: Event) => boolean
  include?: () => HTMLElement[]
}

interface ClickOutsideDirective extends VNodeDirective {
  value?: ((e: Event) => void) | ClickOutsideBindingArgs
}

function defaultConditional () {
  return true
}

function checkEvent (e: PointerEvent, el: HTMLElement, binding: ClickOutsideDirective): boolean {
  // The include element callbacks below can be expensive
  // so we should avoid calling them when we're not active.
  // Explicitly check for false to allow fallback compatibility
  // with non-toggleable components
  if (!e || checkIsActive(e, binding) === false) return false

  // If we're clicking inside the shadowroot, then the app root doesn't get the same
  // level of introspection as to _what_ we're clicking. We want to check to see if
  // our target is the shadowroot parent container, and if it is, ignore.
  const root = attachedRoot(el)
  if (
    typeof ShadowRoot !== 'undefined' &&
    root instanceof ShadowRoot &&
    root.host === e.target
  ) return false

  // Check if additional elements were passed to be included in check
  // (click must be outside all included elements, if any)
  const elements = ((typeof binding.value === 'object' && binding.value.include) || (() => []))()
  // Add the root element for the component this directive was defined on
  elements.push(el)

  // Check if it's a click outside our elements, and then if our callback returns true.
  // Non-toggleable components should take action in their callback and return falsy.
  // Toggleable can return true if it wants to deactivate.
  // Note that, because we're in the capture phase, this callback will occur before
  // the bubbling click event on any outside elements.
  return !elements.some(el => el.contains(e.target as Node))
}

function checkIsActive (e: PointerEvent, binding: ClickOutsideDirective): boolean | void {
  const isActive = (typeof binding.value === 'object' && binding.value.closeConditional) || defaultConditional

  return isActive(e)
}

function directive (e: PointerEvent, el: HTMLElement, binding: ClickOutsideDirective) {
  const handler = typeof binding.value === 'function' ? binding.value : binding.value!.handler

  el._clickOutside!.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(() => {
    checkIsActive(e, binding) && handler && handler(e)
  }, 0)
}

function handleShadow (el: HTMLElement, callback: Function): void {
  const root = attachedRoot(el)

  callback(document)

  if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) {
    callback(root)
  }
}

export const ClickOutside = {
  // [data-app] may not be found
  // if using bind, inserted makes
  // sure that the root element is
  // available, iOS does not support
  // clicks on body
  inserted (el: HTMLElement, binding: ClickOutsideDirective, vnode: VNode) {
    const onClick = (e: Event) => directive(e as PointerEvent, el, binding)
    const onMousedown = (e: Event) => {
      el._clickOutside!.lastMousedownWasOutside = checkEvent(e as PointerEvent, el, binding)
    }

    handleShadow(el, (app: HTMLElement) => {
      app.addEventListener('click', onClick, true)
      app.addEventListener('mousedown', onMousedown, true)
    })

    if (!el._clickOutside) {
      el._clickOutside = {
        lastMousedownWasOutside: true,
      }
    }

    el._clickOutside[vnode.context!._uid] = {
      onClick,
      onMousedown,
    }
  },

  unbind (el: HTMLElement, binding: ClickOutsideDirective, vnode: VNode) {
    if (!el._clickOutside) return

    handleShadow(el, (app: HTMLElement) => {
      if (!app || !el._clickOutside?.[vnode.context!._uid]) return

      const { onClick, onMousedown } = el._clickOutside[vnode.context!._uid]!

      app.removeEventListener('click', onClick, true)
      app.removeEventListener('mousedown', onMousedown, true)
    })

    delete el._clickOutside[vnode.context!._uid]
  },
}

export default ClickOutside


text:
require "conduit/sprint/parsers/base"

module Conduit::Driver::Sprint
  class QueryPendingPortIns::Parser < Parser::Base
    attribute :messages do
      root.xpath("//accessNumberRecord").map do |port_message|
        {}.tap do |message|
          message[:access_number] = content_for("accessNumber", port_message)
          message[:port_due_date] = content_for("portDueDate", port_message)
          message[:port_status]   = content_for("portStatus", port_message)
        end
      end
    end
  end
end


text:
body, table td, select, button, input, textarea {
	font-family: verdana,helvetica,arial;
	font-size: 11px;
	color: #333333;
}

textarea {
    resize: none;
}

a, a:link, a:visited, a:hover, a:active {
	color: #29477F;
	text-decoration: none;
}

.gwt-DialogBox .Caption {
	font-family: verdana,helvetica,arial;
	color: #4B4A4A;
	font-weight: bold;
	white-space: nowrap;
}

.gwt-MenuBar .gwt-MenuItem {
	font-family: verdana,helvetica,arial;
	font-size: 11px;
}

.gwt-MenuBar .gwt-MenuItem-disabled {
	color: #999999 !important;
}

.gwt-TextArea, .gwt-TextBox {
	font-family: verdana,helvetica,arial;
	font-size: 11px;
	color: #333333;
	padding: 4px;
}

.gwt-CheckBox label {
	margin-left: 2px;
}

.gwt-Button {
	font-family: verdana,helvetica,arial;
	font-size: 11px;
	color: #333333;
}

.busy-icon-center {
	background-image: url('images/spinner.gif') !important;
	background-size: 16px 16px !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
}

.busy-icon-right-padded {
	padding-right: 16px !important;
}

.busy-icon-right {
	background-image: url('images/spinner.gif') !important;
	background-size: 16px 16px !important;
	background-repeat: no-repeat !important;
	background-position: right !important;
}

.error-icon-right {
	background-image: url('images/error.png') !important;
	background-size: 16px 16px !important;
	background-repeat: no-repeat !important;
	background-position: right !important;
}

.busy-icon-left {
	background-image: url('images/spinner.gif') !important;
	background-repeat: no-repeat !important;
	background-position: left !important;
}

.error-icon-left {
	background-image: url('images/error.png') !important;
	background-size: 16px 16px !important;
	background-repeat: no-repeat !important;
	background-position: left !important;
	color: #930000;
}

.info-icon-left {
	background-image: url('images/info.png') !important;
	background-size: 16px 16px !important;
	background-repeat: no-repeat !important;
	background-position: left !important;
	padding-left: 20px !important;
}

.text-area-right-padded {
	padding-right: 10px;
}


text:
@import Foundation;
@import UIKit;
@import PLTableManager;
@import PLForm;

@interface PLSwitchCell : UITableViewCell <PLModelTransfer>

@property (nonatomic, readonly) PLFormSwitchField *switchField;

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>net.lr.tutorial.karaf.vaadin</groupId>
	<artifactId>tasklist-ui-vaadin</artifactId>
	<packaging>bundle</packaging>
	<version>1.0.0-SNAPSHOT</version>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<vaadin.version>6.7.1</vaadin.version>
		<gwt.version>2.3.0</gwt.version>
		<gwt.plugin.version>2.2.0</gwt.plugin.version>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>2.3.7</version>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<repositories>
		<repository>
			<id>vaadin-addons</id>
			<url>http://maven.vaadin.com/vaadin-addons</url>
		</repository>
	</repositories>

	<dependencies>
		<dependency>
			<groupId>net.lr.tasklist</groupId>
			<artifactId>tasklist-model</artifactId>
			<version>1.0.0-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin</artifactId>
			<version>${vaadin.version}</version>
		</dependency>
		<dependency>
			<groupId>net.lr</groupId>
			<artifactId>vaadinbridge</artifactId>
			<version>1.0.0-SNAPSHOT</version>
		</dependency>

	</dependencies>

</project>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
        android:gravity="center_vertical"
        android:background="@drawable/reward_list_background"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="3dp"
            android:gravity="center_vertical"
            android:orientation="horizontal" >

            <RelativeLayout
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp">

                <util.RoundedCornerImageView
                    android:id="@+id/iv_reward_info_headImage"
                    android:layout_width="50dp"
                    android:layout_height="50dp"
                    android:clickable="false"
                    android:focusable="false"
                    android:layout_centerVertical="true"
                    android:scaleType="centerCrop"
                    android:src="@mipmap/wangzhenhua" />
            </RelativeLayout>

            <LinearLayout
                android:id="@+id/me_usermsg"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    >

                    <TextView
                        android:id="@+id/tv_reward_info_list_name"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="王振华"
                        android:layout_marginLeft="10dp"
                        android:background="@android:color/transparent"
                        android:textColor="#647697"
                        android:textSize="15sp" />
                    <TextView
                        android:id="@+id/tv_reward_info_list_academy"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="10dp"
                        android:text="设计学院"
                        android:layout_centerVertical="true"
                        android:textColor="@color/reward_list_line"
                        android:textSize="12sp" />
                </LinearLayout>

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="right"
                android:orientation="vertical" >

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical" >

                    <TextView
                        android:id="@+id/tv_reward_info_list_time"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"

                        android:layout_marginRight="10dp"
                        android:textSize="12sp" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    android:gravity="center_vertical|right" >
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="0.5dp"
            android:layout_marginTop="5dp"
            android:background="#eaeaea"></View>

    </LinearLayout>
</LinearLayout>


text:
package com.microsoft.azure.management.resources;

import com.microsoft.azure.management.apigeneration.Beta;
import com.microsoft.azure.management.apigeneration.Beta.SinceVersion;
import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByName;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBeginDeletingByName;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingByName;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListingByTag;

/**
 * Entry point to resource group management API.
 */
@Fluent
public interface ResourceGroups extends
        SupportsListing<ResourceGroup>,
        SupportsListingByTag<ResourceGroup>,
        SupportsGettingByName<ResourceGroup>,
        SupportsCreating<ResourceGroup.DefinitionStages.Blank>,
        SupportsDeletingByName,
        SupportsBeginDeletingByName,
        SupportsBatchCreation<ResourceGroup> {
    /**
     * Checks whether resource group exists.
     *
     * @param name The name of the resource group to check. The name is case insensitive
     * @return true if the resource group exists; false otherwise
     * @deprecated Use contain() instead.
     */
    @Deprecated
    boolean checkExistence(String name);

    /**
     * Checks whether resource group exists.
     *
     * @param name the name (case insensitive) of the resource group to check for
     * @return true of exists, otherwise false
     */
    @Beta(SinceVersion.V1_4_0)
    boolean contain(String name);
}


text:
package org.apache.camel.component.netty;

import org.apache.camel.builder.RouteBuilder;
import org.junit.Test;

public class NettyProducerPoolDisabledTest extends BaseNettyTest {

    @Test
    public void testProducerPoolDisabled() throws Exception {
        for (int i = 0; i < 10; i++) {
            String reply = template.requestBody("direct:start", "Hello " + i, String.class);
            assertEquals("Bye " + i, reply);
        }
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start")
                    .to("netty:tcp://localhost:{{port}}?textline=true&sync=true&producerPoolEnabled=false");

                from("netty:tcp://localhost:{{port}}?textline=true&sync=true")
                    // body should be a String when using textline codec
                    .validate(body().isInstanceOf(String.class))
                    .transform(body().regexReplaceAll("Hello", "Bye"));
            }
        };
    }
}


text:
pyxray.util module
==================

.. automodule:: pyxray.util
    :members:
    :undoc-members:
    :show-inheritance:


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

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

    <title>Get Information about a known share — ownCloud Administrators Manual 6.0 documentation</title>

    <link rel="stylesheet" href="../_static/style.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/style.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" />

    <link rel="top" title="ownCloud Administrators Manual 6.0 documentation" href="../index.html" />
    <link rel="up" title="Sharing API" href="index.html" />
    <link rel="next" title="Create a new Share" href="create_a_new_share.html" />
    <link rel="prev" title="Get Shares from a Specific File or Folder" href="get_shares_from_a_specific_file_or_folder.html" />

ownCloud Administrators Manual

Overview

ownCloud 6.0 Admin Documentation

Installation

Configuration

Apps

Maintenance

Driving Events with Cron

Quota Calculation

Sharing API

Get All Shares

Get Shares from a Specific File or Folder

Get Information about a known share

Poster

Curl

Output

Create a new Share

Delete Share

Introduction

The Configuration File

Issues

Get Information about a known share¶

To get information about a share when the share ID is known, use the following.

Note: the share ID can be obtained from the output of any of the previous Share API calls or the creation of a new share.

<colgroup>
<col width="25%" />
<col width="75%" />
</colgroup>

Syntax
<Base URL>/<share id>

Method
GET

Arguments
Share id (int)

Result
XML code with share information

The following is a list of returned status codes:

<colgroup>
<col width="46%" />
<col width="54%" />
</colgroup>

HTTP Status Code
Description

100
Successful

404
Share doesn't exist

Poster¶

This example shows the output of share information for share ID "7"

<colgroup>
<col width="21%" />
<col width="79%" />
</colgroup>

Field
Value

URL
Base URL for the API of the ownCloud server/<share id>

User Auth
User ID of the file owner

Password
User's Password

Curl¶

$ curl http://<user>:<passowrd>@<ip>/ocs/v1.php/apps/files_sharing/api/v1/shares/<share_id>

Output¶

<colgroup>
<col width="70%" />
<col width="30%" />
</colgroup>

<?xml version=”1.0”?>

<ocs>

<meta>

<status>ok</status>
Status=100: successful

<statuscode>100</statuscode>

<message/>

</meta>

<data>

<element>

<id>7</id>
Share ID = 7

<item_type>file</item_type>

<item_source>675</item_source>

<parent/>

<share_type>0</share_type>
Share type = 0: user

<share_with>ser72</share_with>
Share with user ser72

<file_source>675</file_source>

<path>/test share api/ieee.txt</path>

<permissions>27</permissions>

<stime>1386698116</stime>

<expiration/>

<token/>

<storage>4</storage>

<mail_send>0</mail_send>

<share_with_displayname>ser72</share_with_displayname>

</element>

</data>

</ocs>


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_height="48dp"
    android:layout_width="match_parent">

    <ImageView
        android:id="@+id/nav_list_icon"
        android:layout_centerVertical="true"
        tools:src="@drawable/great_sword1"
        style="@style/main_image"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"/>

    <TextView
        android:id="@+id/nav_list_item"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="left|start"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@+id/nav_list_icon"
        android:textAppearance="?android:attr/textAppearanceListItem"
        android:textColor="@color/list_text"
        android:background="@drawable/generic_clicked_states"
        tools:layout_gravity=""
        tools:text="List Item 1"
        style="@style/text_medium"/>

</RelativeLayout>


text:
<?php

namespace App\Http\Controllers;

use EasyWeChat\Message\Text;
use Log;

class WechatController extends Controller
{

    /**
     * Overtrue wechat实例
     *
     * @var \EasyWeChat\Foundation\Application
     */
    private $wechat;

    /**
     * WechatController实例化
     */
    public function __construct()
    {
        // 获取wechat singleton
        $this->wechat = app('wechat');
    }

    /**
     * 处理微信服务器验证
     */
    public function verify()
    {
        return $this->wechat->server->serve();
    }

    /**
     * 处理微信的请求消息
     *
     * @return string
     */
    public function serve()
    {
        Log::info('request arrived.');

        $wechatServer = $this->wechat->server;

        $wechatServer->setMessageHandler(function($message){
            // 注意,这里的 $message 不仅仅是用户发来的消息,也可能是事件
            // 当 $message->MsgType 为 event 时为事件
            if ($message->MsgType === 'event') {
                switch ($message->Event) {
                    case 'subscribe':
                        return new Text(['content' => $this->getSubText()]);
                        break;
                    default:
                        break;
                }
            }

            return '';
        });

        Log::info('return response.');

        return $wechatServer->serve();
    }
}


text:
import React, { Component } from 'react'
import { Container, Row, Col } from 'reactstrap'

import infographic from './infographic.png'

class Infograph extends Component {
  render () {
    return (
      <Container>
        <Row>
          <Col style={{ textAlign: 'center' }}>
            <img src={infographic} alt="" style={{maxWidth: '100%'}} />
          </Col>
        </Row>
      </Container>
    )
  }
}

export default Infograph


text:
.class public Landroid/graphics/ColorMatrixColorFilter;
.super Landroid/graphics/ColorFilter;
.source "ColorMatrixColorFilter.java"

# instance fields
.field private final mMatrix:Landroid/graphics/ColorMatrix;

# direct methods
.method public constructor <init>(Landroid/graphics/ColorMatrix;)V
    .locals 1
    .param p1, "matrix"    # Landroid/graphics/ColorMatrix;

    .prologue
    .line 35
    invoke-direct {p0}, Landroid/graphics/ColorFilter;-><init>()V

    .line 26
    new-instance v0, Landroid/graphics/ColorMatrix;

    invoke-direct {v0}, Landroid/graphics/ColorMatrix;-><init>()V

    iput-object v0, p0, Landroid/graphics/ColorMatrixColorFilter;->mMatrix:Landroid/graphics/ColorMatrix;

    .line 36
    iget-object v0, p0, Landroid/graphics/ColorMatrixColorFilter;->mMatrix:Landroid/graphics/ColorMatrix;

    invoke-virtual {v0, p1}, Landroid/graphics/ColorMatrix;->set(Landroid/graphics/ColorMatrix;)V

    .line 37
    invoke-direct {p0}, Landroid/graphics/ColorMatrixColorFilter;->update()V

    .line 35
    return-void
.end method

.method public constructor <init>([F)V
    .locals 2
    .param p1, "array"    # [F

    .prologue
    .line 47
    invoke-direct {p0}, Landroid/graphics/ColorFilter;-><init>()V

    .line 26
    new-instance v0, Landroid/graphics/ColorMatrix;

    invoke-direct {v0}, Landroid/graphics/ColorMatrix;-><init>()V

    iput-object v0, p0, Landroid/graphics/ColorMatrixColorFilter;->mMatrix:Landroid/graphics/ColorMatrix;

    .line 48
    array-length v0, p1

    const/16 v1, 0x14

    if-ge v0, v1, :cond_0

    .line 49
    new-instance v0, Ljava/lang/ArrayIndexOutOfBoundsException;

    invoke-direct {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>()V

    throw v0

    .line 51
    :cond_0
    iget-object v0, p0, Landroid/graphics/ColorMatrixColorFilter;->mMatrix:Landroid/graphics/ColorMatrix;

    invoke-virtual {v0, p1}, Landroid/graphics/ColorMatrix;->set([F)V

    .line 52
    invoke-direct {p0}, Landroid/graphics/ColorMatrixColorFilter;->update()V

    .line 47
    return-void
.end method

.method private static native nativeColorMatrixFilter([F)J
.end method

.method private update()V
    .locals 4

    .prologue
    .line 122
    iget-object v1, p0, Landroid/graphics/ColorMatrixColorFilter;->mMatrix:Landroid/graphics/ColorMatrix;

    invoke-virtual {v1}, Landroid/graphics/ColorMatrix;->getArray()[F

    move-result-object v0

    .line 123
    .local v0, "colorMatrix":[F
    iget-wide v2, p0, Landroid/graphics/ColorMatrixColorFilter;->native_instance:J

    invoke-static {v2, v3}, Landroid/graphics/ColorMatrixColorFilter;->destroyFilter(J)V

    .line 124
    invoke-static {v0}, Landroid/graphics/ColorMatrixColorFilter;->nativeColorMatrixFilter([F)J

    move-result-wide v2

    iput-wide v2, p0, Landroid/graphics/ColorMatrixColorFilter;->native_instance:J

    .line 121
    return-void
.end method

# virtual methods
.method public getColorMatrix()Landroid/graphics/ColorMatrix;
    .locals 1

    .prologue
    .line 65
    iget-object v0, p0, Landroid/graphics/ColorMatrixColorFilter;->mMatrix:Landroid/graphics/ColorMatrix;

    return-object v0
.end method

.method public setColorMatrix(Landroid/graphics/ColorMatrix;)V
    .locals 1
    .param p1, "matrix"    # Landroid/graphics/ColorMatrix;

    .prologue
    .line 82
    if-nez p1, :cond_1

    .line 83
    iget-object v0, p0, Landroid/graphics/ColorMatrixColorFilter;->mMatrix:Landroid/graphics/ColorMatrix;

    invoke-virtual {v0}, Landroid/graphics/ColorMatrix;->reset()V

    .line 87
    :cond_0
    :goto_0
    invoke-direct {p0}, Landroid/graphics/ColorMatrixColorFilter;->update()V

    .line 81
    return-void

    .line 84
    :cond_1
    iget-object v0, p0, Landroid/graphics/ColorMatrixColorFilter;->mMatrix:Landroid/graphics/ColorMatrix;

    if-eq p1, v0, :cond_0

    .line 85
    iget-object v0, p0, Landroid/graphics/ColorMatrixColorFilter;->mMatrix:Landroid/graphics/ColorMatrix;

    invoke-virtual {v0, p1}, Landroid/graphics/ColorMatrix;->set(Landroid/graphics/ColorMatrix;)V

    goto :goto_0
.end method

.method public setColorMatrix([F)V
    .locals 2
    .param p1, "array"    # [F

    .prologue
    .line 109
    if-nez p1, :cond_0

    .line 110
    iget-object v0, p0, Landroid/graphics/ColorMatrixColorFilter;->mMatrix:Landroid/graphics/ColorMatrix;

    invoke-virtual {v0}, Landroid/graphics/ColorMatrix;->reset()V

    .line 118
    :goto_0
    invoke-direct {p0}, Landroid/graphics/ColorMatrixColorFilter;->update()V

    .line 108
    return-void

    .line 112
    :cond_0
    array-length v0, p1

    const/16 v1, 0x14

    if-ge v0, v1, :cond_1

    .line 113
    new-instance v0, Ljava/lang/ArrayIndexOutOfBoundsException;

    invoke-direct {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>()V

    throw v0

    .line 116
    :cond_1
    iget-object v0, p0, Landroid/graphics/ColorMatrixColorFilter;->mMatrix:Landroid/graphics/ColorMatrix;

    invoke-virtual {v0, p1}, Landroid/graphics/ColorMatrix;->set([F)V

    goto :goto_0
.end method


text:
using System.Collections;
using Xunit;

namespace System.Text.RegularExpressions.Tests
{
    public static partial class MatchCollectionTests
    {
        [Fact]
        public static void GetEnumerator()
        {
            Regex regex = new Regex("e");
            MatchCollection matches = regex.Matches("dotnet");
            IEnumerator enumerator = matches.GetEnumerator();
            for (int i = 0; i < 2; i++)
            {
                int counter = 0;
                while (enumerator.MoveNext())
                {
                    Assert.Same(matches[counter], enumerator.Current);
                    counter++;
                }
                Assert.False(enumerator.MoveNext());
                Assert.Equal(matches.Count, counter);
                enumerator.Reset();
            }
        }

        [Fact]
        public static void GetEnumerator_Invalid()
        {
            Regex regex = new Regex("e");
            MatchCollection matches = regex.Matches("dotnet");
            IEnumerator enumerator = matches.GetEnumerator();

            Assert.Throws<InvalidOperationException>(() => enumerator.Current);

            while (enumerator.MoveNext()) ;
            Assert.Throws<InvalidOperationException>(() => enumerator.Current);

            enumerator.Reset();
            Assert.True(enumerator.MoveNext());
            enumerator.Reset();
            Assert.Throws<InvalidOperationException>(() => enumerator.Current);
        }

        [Fact]
        public static void Item_Get()
        {
            MatchCollection collection = CreateCollection();
            Assert.Equal("t", collection[0].ToString());
            Assert.Equal("t", collection[1].ToString());
        }

        [Fact]
        public static void Item_Get_InvalidIndex_ThrowsArgumentOutOfRangeException()
        {
            Regex regex = new Regex("e");
            MatchCollection matches = regex.Matches("dotnet");
            AssertExtensions.Throws<ArgumentOutOfRangeException>("i", () => matches[-1]);
            AssertExtensions.Throws<ArgumentOutOfRangeException>("i", () => matches[matches.Count]);
        }

        [Fact]
        public static void ICollection_Properties()
        {
            Regex regex = new Regex("e");
            MatchCollection matches = regex.Matches("dotnet");
            ICollection collection = matches;

            Assert.False(collection.IsSynchronized);
            Assert.NotNull(collection.SyncRoot);
            Assert.Same(matches, collection.SyncRoot);
        }

        [Theory]
        [InlineData(0)]
        [InlineData(5)]
        public static void ICollection_CopyTo(int index)
        {
            Regex regex = new Regex("e");
            MatchCollection matches = regex.Matches("dotnet");
            ICollection collection = matches;

            Match[] copy = new Match[collection.Count + index];
            collection.CopyTo(copy, index);

            for (int i = 0; i < index; i++)
            {
                Assert.Null(copy[i]);
            }
            for (int i = index; i < copy.Length; i++)
            {
                Assert.Same(matches[i - index], copy[i]);
            }
        }

        [Fact]
        public static void ICollection_CopyTo_Invalid()
        {
            Regex regex = new Regex("e");
            ICollection collection = regex.Matches("dotnet");

            // Array is null
            AssertExtensions.Throws<ArgumentNullException>("destinationArray", "dest", () => collection.CopyTo(null, 0));

            // Array is multidimensional
            Assert.Throws<ArgumentException>(null, () => collection.CopyTo(new object[10, 10], 0));

            // Array has a non-zero lower bound
            Array o = Array.CreateInstance(typeof(object), new int[] { 10 }, new int[] { 10 });
            AssertExtensions.Throws<ArgumentOutOfRangeException>("destinationIndex", "dstIndex", () => collection.CopyTo(o, 0));

            // Index < 0
            AssertExtensions.Throws<ArgumentOutOfRangeException>("destinationIndex", "dstIndex", () => collection.CopyTo(new object[collection.Count], -1));

            // Invalid index + length
            AssertExtensions.Throws<ArgumentException>("destinationArray", string.Empty, () => collection.CopyTo(new object[collection.Count], 1));
            AssertExtensions.Throws<ArgumentException>("destinationArray", string.Empty, () => collection.CopyTo(new object[collection.Count + 1], 2));
        }

        private static MatchCollection CreateCollection() => new Regex("t").Matches("dotnet");
    }
}