text:
This package contains a React component for rendering the drop-down element on a single cell. This drop-down provides users with the ability to hide and show cells, convert cells between different types, and more.

## Installation

```
$ yarn add @nteract/dropdown-menu
```

```
$ npm install --save @nteract/dropdown-menu
```

## Usage

The example below showcases how we can use the components within this package to create a drop-down menu with actions specific to code cells.

```javascript
import {
  DropdownMenu,
  DropdownTrigger,
  DropdownContent
} from "@nteract/dropdown-menu";

export default () => {
  return (
    <DropdownMenu>
      <DropdownTrigger>
        <button title="show additional actions">
          <span className="octicon toggle-menu">
            <ChevronDownOcticon />
          </span>
        </button>
      </DropdownTrigger>
      {type === "code" ? (
        <DropdownContent>
          <li
            onClick={this.props.clearOutputs}
            className="clearOutput"
            role="option"
            aria-selected="false"
            tabIndex="0"
          >
            <a>Clear Cell Output</a>
          </li>
          <li
            onClick={this.props.toggleCellInputVisibility}
            className="inputVisibility"
            role="option"
            aria-selected="false"
            tabIndex="0"
          >
            <a>Toggle Input Visibility</a>
          </li>
        </DropdownContent>
      ) : null}
    </DropdownMenu>
  );
};
```

## Documentation

We're working on adding more documentation for this component. Stay tuned by watching this repository!

## Support

If you experience an issue while using this package or have a feature request, please file an issue on the [issue board](https://github.com/nteract/nteract/issues/new/choose) and add the `pkg:dropdown-menu` label.

## License

[BSD-3-Clause](https://choosealicense.com/licenses/bsd-3-clause/)


text:
#include <device.h>
#include <init.h>
#include <kernel.h>
#include <soc.h>
#include <arch/arm/cortex_m/cmsis.h>
#include <arch/arm/cortex_m/mpu/arm_mpu.h>
#include <arch/arm/cortex_m/mpu/arm_core_mpu.h>
#include <logging/sys_log.h>

#define ARM_MPU_DEV ((volatile struct arm_mpu *) ARM_MPU_BASE)

/* ARM MPU Enabled state */
static u8_t arm_mpu_enabled;

/**
 * The attributes referenced in this function are described at:
 * https://goo.gl/hMry3r
 * This function is private to the driver.
 */
static inline u32_t _get_region_attr(u32_t xn, u32_t ap, u32_t tex,
				     u32_t c, u32_t b, u32_t s,
				     u32_t srd, u32_t size)
{
	return ((xn << 28) | (ap) | (tex << 19) | (s << 18)
		| (c << 17) | (b << 16) | (srd << 5) | (size));
}

/**
 * This internal function is utilized by the MPU driver to parse the intent
 * type (i.e. THREAD_STACK_REGION) and return the correct parameter set.
 */
static inline u32_t _get_region_attr_by_type(u32_t type, u32_t size)
{
	switch (type) {
	case THREAD_STACK_REGION:
		return 0;
	case THREAD_STACK_GUARD_REGION:
		return _get_region_attr(1, P_RO_U_RO, 0, 1, 0,
					1, 0, REGION_32B);
	default:
		/* Size 0 region */
		return 0;
	}
}

static inline u8_t _get_num_regions(void)
{
	u32_t type = ARM_MPU_DEV->type;

	type = (type & 0xFF00) >> 8;

	return (u8_t)type;
}

static void _region_init(u32_t index, u32_t region_addr,
			 u32_t region_attr)
{
	/* Select the region you want to access */
	ARM_MPU_DEV->rnr = index;
	/* Configure the region */
	ARM_MPU_DEV->rbar = (region_addr & REGION_BASE_ADDR_MASK)
				| REGION_VALID | index;
	ARM_MPU_DEV->rasr = region_attr | REGION_ENABLE;
}

/**
 * This internal function is utilized by the MPU driver to parse the intent
 * type (i.e. THREAD_STACK_REGION) and return the correct region index.
 */
static inline u32_t _get_region_index_by_type(u32_t type)
{
	/*
	 * The new MPU regions are allocated per type after the statically
	 * configured regions. The type is one-indexed rather than
	 * zero-indexed, therefore we need to subtract by one to get the region
	 * index.
	 */
	switch (type) {
	case THREAD_STACK_REGION:
		return mpu_config.num_regions + type - 1;
	case THREAD_STACK_GUARD_REGION:
		return mpu_config.num_regions + type - 1;
	case THREAD_DOMAIN_PARTITION_REGION:
#if defined(CONFIG_MPU_STACK_GUARD)
		return mpu_config.num_regions + type - 1;
#else
		/*
		 * Start domain partition region from stack guard region
		 * since stack guard is not enabled.
		 */
		return mpu_config.num_regions + type - 2;
#endif
	default:
		__ASSERT(0, "Unsupported type");
		return 0;
	}
}

static inline u32_t round_up_to_next_power_of_two(u32_t v)
{
	v--;
	v |= v >> 1;
	v |= v >> 2;
	v |= v >> 4;
	v |= v >> 8;
	v |= v >> 16;
	v++;

	return v;
}

/**
 * This internal function converts the region size to
 * the SIZE field value of MPU_RASR.
 */
static inline u32_t _size_to_mpu_rasr_size(u32_t size)
{
	/* The minimal supported region size is 32 bytes */
	if (size <= 32) {
		return REGION_32B;
	}

	/*
	 * A size value greater than 2^31 could not be handled by
	 * round_up_to_next_power_of_two() properly. We handle
	 * it separately here.
	 */
	if (size > (1 << 31)) {
		return REGION_4G;
	}

	size = round_up_to_next_power_of_two(size);

	return (find_msb_set(size) - 2) << 1;
}

/* ARM Core MPU Driver API Implementation for ARM MPU */

/**
 * @brief enable the MPU
 */
void arm_core_mpu_enable(void)
{
	if (arm_mpu_enabled == 0) {
		/* Enable MPU */
		ARM_MPU_DEV->ctrl = ARM_MPU_ENABLE | ARM_MPU_PRIVDEFENA;

		arm_mpu_enabled = 1;
	}
}

/**
 * @brief disable the MPU
 */
void arm_core_mpu_disable(void)
{
	if (arm_mpu_enabled == 1) {
		/* Disable MPU */
		ARM_MPU_DEV->ctrl = 0;

		arm_mpu_enabled = 0;
	}
}

/**
 * @brief configure the base address and size for an MPU region
 *
 * @param   type    MPU region type
 * @param   base    base address in RAM
 * @param   size    size of the region
 */
void arm_core_mpu_configure(u8_t type, u32_t base, u32_t size)
{
	SYS_LOG_DBG("Region info: 0x%x 0x%x", base, size);
	u32_t region_index = _get_region_index_by_type(type);
	u32_t region_attr = _get_region_attr_by_type(type, size);

	/* ARM MPU supports up to 16 Regions */
	if (region_index > _get_num_regions()) {
		return;
	}

	_region_init(region_index, base, region_attr);
}

#if defined(CONFIG_USERSPACE)
/**
 * @brief configure MPU regions for the memory partitions of the memory domain
 *
 * @param   mem_domain    memory domain that thread belongs to
 */
void arm_core_mpu_configure_mem_domain(struct k_mem_domain *mem_domain)
{
	u32_t region_index =
		_get_region_index_by_type(THREAD_DOMAIN_PARTITION_REGION);
	u32_t region_attr;
	u32_t num_partitions;
	struct k_mem_partition *pparts;

	if (mem_domain) {
		SYS_LOG_DBG("configure domain: %p", mem_domain);
		num_partitions = mem_domain->num_partitions;
		pparts = mem_domain->partitions;
	} else {
		SYS_LOG_DBG("disable domain partition regions");
		num_partitions = 0;
		pparts = NULL;
	}

	for (; region_index < _get_num_regions(); region_index++) {
		if (num_partitions && pparts->size) {
			SYS_LOG_DBG("set region 0x%x 0x%x 0x%x",
				    region_index, pparts->start, pparts->size);
			region_attr = pparts->attr |
				      _size_to_mpu_rasr_size(pparts->size);
			_region_init(region_index, pparts->start, region_attr);
			num_partitions--;
		} else {
			SYS_LOG_DBG("disable region 0x%x", region_index);
			/* Disable region */
			ARM_MPU_DEV->rnr = region_index;
			ARM_MPU_DEV->rbar = 0;
			ARM_MPU_DEV->rasr = 0;
		}
		pparts++;
	}
}

/**
 * @brief configure MPU region for a single memory partition
 *
 * @param   part_index  memory partition index
 * @param   part        memory partition info
 */
void arm_core_mpu_configure_mem_partition(u32_t part_index,
					  struct k_mem_partition *part)
{
	u32_t region_index =
		_get_region_index_by_type(THREAD_DOMAIN_PARTITION_REGION);
	u32_t region_attr;

	SYS_LOG_DBG("configure partition index: %u", part_index);

	if (part) {
		SYS_LOG_DBG("set region 0x%x 0x%x 0x%x",
			    region_index + part_index, part->start, part->size);
		region_attr = part->attr | _size_to_mpu_rasr_size(part->size);
		_region_init(region_index + part_index, part->start,
			     region_attr);
	} else {
		SYS_LOG_DBG("disable region 0x%x", region_index + part_index);
		/* Disable region */
		ARM_MPU_DEV->rnr = region_index + part_index;
		ARM_MPU_DEV->rbar = 0;
		ARM_MPU_DEV->rasr = 0;
	}
}

/**
 * @brief get the maximum number of free regions for memory domain partitions
 */
int arm_core_mpu_get_max_domain_partition_regions(void)
{
	/*
	 * Subtract the start of domain partition regions from total regions
	 * will get the maximum number of free regions for memory domain
	 * partitions.
	 */
	return _get_num_regions() -
		_get_region_index_by_type(THREAD_DOMAIN_PARTITION_REGION);
}
#endif /* CONFIG_USERSPACE */

/* ARM MPU Driver Initial Setup */

/*
 * @brief MPU default configuration
 *
 * This function provides the default configuration mechanism for the Memory
 * Protection Unit (MPU).
 */
static void _arm_mpu_config(void)
{
	u32_t r_index;

	/* ARM MPU supports up to 16 Regions */
	if (mpu_config.num_regions > _get_num_regions()) {
		return;
	}

	/* Disable MPU */
	ARM_MPU_DEV->ctrl = 0;

	/* Configure regions */
	for (r_index = 0; r_index < mpu_config.num_regions; r_index++) {
		_region_init(r_index,
			     mpu_config.mpu_regions[r_index].base,
			     mpu_config.mpu_regions[r_index].attr);
	}

	/* Enable MPU */
	ARM_MPU_DEV->ctrl = ARM_MPU_ENABLE | ARM_MPU_PRIVDEFENA;

	arm_mpu_enabled = 1;

	/* Make sure that all the registers are set before proceeding */
	__DSB();
	__ISB();
}

static int arm_mpu_init(struct device *arg)
{
	ARG_UNUSED(arg);

	_arm_mpu_config();

	return 0;
}

SYS_INIT(arm_mpu_init, PRE_KERNEL_1,
	 CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
    assembly="CRP.Core" namespace="CRP.Core.Domain">
  <class
    name="Template"
    table="Templates" >
    <id name="Id" column="id">
      <generator class="identity" />
    </id>

    <many-to-one name="Item" class="CRP.Core.Domain.Item, CRP.Core" column="ItemId" />
    <property name="Text" column="Text" />
    <property name="Default" column="[Default]" />

  </class>
</hibernate-mapping>


text:
package com.gdn.venice.server.app.administration.presenter.commands;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import com.djarum.raf.utilities.Locator;
import com.gdn.venice.client.app.DataNameTokens;
import com.gdn.venice.facade.RafProfilePermissionSessionEJBRemote;
import com.gdn.venice.persistence.RafApplicationObject;
import com.gdn.venice.persistence.RafPermissionType;
import com.gdn.venice.persistence.RafProfile;
import com.gdn.venice.persistence.RafProfilePermission;
import com.gdn.venice.server.command.RafDsCommand;
import com.gdn.venice.server.data.RafDsRequest;
import com.gdn.venice.server.data.RafDsResponse;

/**
 * Add Command for Profile Detail
 *
 * @author Roland
 */

public class AddProfileDetailDataCommand implements RafDsCommand {

	RafDsRequest request;

	public AddProfileDetailDataCommand(RafDsRequest request){
		this.request=request;
	}

	@Override
	public RafDsResponse execute() {
		RafDsResponse rafDsResponse = new RafDsResponse();
		Locator<Object> locator=null;
		List<RafProfilePermission> rafProfilePermissionListCheck = new ArrayList<RafProfilePermission>();
		List<HashMap<String, String>> dataList=new ArrayList<HashMap<String,String>>();
		Boolean status=false;
		String profileId="";
		String screenId="";
		String permissionTypeId="";

		//because only screen and permission can be changed in screen, so only screen and permission id sent from servlet, profile id must be sent as parameter.
		profileId=request.getParams().get(DataNameTokens.RAFPROFILE_PROFILEID).toString();
		try{
			locator = new Locator<Object>();
			RafProfilePermissionSessionEJBRemote sessionHome = (RafProfilePermissionSessionEJBRemote) locator.lookup(RafProfilePermissionSessionEJBRemote.class, "RafProfilePermissionSessionEJBBean");
			dataList=request.getData();

			RafProfilePermission rafProfilePermission = new RafProfilePermission();
			for(int i=0;i< dataList.size();i++){
				Map<String, String> data = dataList.get(i);
				Iterator<String> iter=data.keySet().iterator();

				while(iter.hasNext()){
					String key=iter.next();

					if (key.equals(DataNameTokens.RAFPROFILEPERMISSION_PROFILEID)) {
						RafProfile profile = new RafProfile();
						profile.setProfileId(new Long(profileId));
						rafProfilePermission.setRafProfile(profile);
					} else if (key.equals(DataNameTokens.RAFPROFILEPERMISSION_APPLICATIONOBJECTID)) {
						screenId=new Long(data.get(key)).toString();
						RafApplicationObject screen = new RafApplicationObject();
						screen.setApplicationObjectId(new Long(screenId));
						rafProfilePermission.setRafApplicationObject(screen);
					} else if (key.equals(DataNameTokens.RAFPROFILEPERMISSION_PERMISSIONTYPEID)) {
						permissionTypeId=new Long(data.get(key)).toString();
						RafPermissionType permission =  new RafPermissionType();
						permission.setPermissionTypeId(new Long(permissionTypeId));
						rafProfilePermission.setRafPermissionType(permission);
					}
				}
			}

			//check first if the profile and screen already exist in database
			String query = "select o from RafProfilePermission o  where o.rafProfile.profileId="+profileId+" and o.rafApplicationObject.applicationObjectId="+screenId+" and o.rafPermissionType.permissionTypeId="+permissionTypeId;
			rafProfilePermissionListCheck = sessionHome.queryByRange(query, 0, 0);
			if(rafProfilePermissionListCheck.size()>0){
				status=true;
			}else{
				status=false;
			}

			if(status==false){
				//data is unique so update the database
				rafProfilePermission=sessionHome.persistRafProfilePermission(rafProfilePermission);
				rafDsResponse.setStatus(0);
			}else{
				//data already exist
				rafDsResponse.setStatus(2);
			}
		}catch(Exception e){
			e.printStackTrace();
			rafDsResponse.setStatus(-1);
		}finally{
			try{
				if(locator!=null){
					locator.close();
				}
			}catch(Exception e){
				e.printStackTrace();
			}
		}
		rafDsResponse.setData(dataList);
		return rafDsResponse;
	}
}


text:
<?php

/* TwigBundle:Exception:trace.txt.twig */
class __TwigTemplate_69dd176da44037972a2c83a216fa85d02eb49f852f7bbdc0930f06b8331747c1 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $__internal_38d0e7735a879e73919f85fbfe509b77518110ca9a97ae8fd8409ca170d8800e = $this->env->getExtension("native_profiler");
        $__internal_38d0e7735a879e73919f85fbfe509b77518110ca9a97ae8fd8409ca170d8800e->enter($__internal_38d0e7735a879e73919f85fbfe509b77518110ca9a97ae8fd8409ca170d8800e_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "TwigBundle:Exception:trace.txt.twig"));

        // line 1
        if ($this->getAttribute((isset($context["trace"]) ? $context["trace"] : $this->getContext($context, "trace")), "function", array())) {
            // line 2
            echo "    at ";
            echo (($this->getAttribute((isset($context["trace"]) ? $context["trace"] : $this->getContext($context, "trace")), "class", array()) . $this->getAttribute((isset($context["trace"]) ? $context["trace"] : $this->getContext($context, "trace")), "type", array())) . $this->getAttribute((isset($context["trace"]) ? $context["trace"] : $this->getContext($context, "trace")), "function", array()));
            echo "(";
            echo $this->env->getExtension('code')->formatArgsAsText($this->getAttribute((isset($context["trace"]) ? $context["trace"] : $this->getContext($context, "trace")), "args", array()));
            echo ")
";
        } else {
            // line 4
            echo "    at n/a
";
        }
        // line 6
        if (($this->getAttribute((isset($context["trace"]) ? $context["trace"] : null), "file", array(), "any", true, true) && $this->getAttribute((isset($context["trace"]) ? $context["trace"] : null), "line", array(), "any", true, true))) {
            // line 7
            echo "        in ";
            echo $this->getAttribute((isset($context["trace"]) ? $context["trace"] : $this->getContext($context, "trace")), "file", array());
            echo " line ";
            echo $this->getAttribute((isset($context["trace"]) ? $context["trace"] : $this->getContext($context, "trace")), "line", array());
            echo "
";
        }

        $__internal_38d0e7735a879e73919f85fbfe509b77518110ca9a97ae8fd8409ca170d8800e->leave($__internal_38d0e7735a879e73919f85fbfe509b77518110ca9a97ae8fd8409ca170d8800e_prof);

    }

    public function getTemplateName()
    {
        return "TwigBundle:Exception:trace.txt.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  38 => 7,  36 => 6,  32 => 4,  24 => 2,  22 => 1,);
    }
}
/* {% if trace.function %}*/
/*     at {{ trace.class ~ trace.type ~ trace.function }}({{ trace.args|format_args_as_text }})*/
/* {% else %}*/
/*     at n/a*/
/* {% endif %}*/
/* {% if trace.file is defined and trace.line is defined %}*/
/*         in {{ trace.file }} line {{ trace.line }}*/
/* {% endif %}*/
/* */


text:
[![Build Status][build-image]][build-link]

[build-image]: https://travis-ci.org/haxney/rust-asn1.svg?branch=master
[build-link]: https://travis-ci.org/haxney/rust-asn1

# asn1

ASN.1 parser and (de)serializer in Rust


text:
package com.aerospike.hadoop.mapreduce;

import java.io.IOException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.mapreduce.RecordWriter;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.util.Progressable;

import com.aerospike.client.AerospikeClient;
import com.aerospike.client.policy.ClientPolicy;
import com.aerospike.client.policy.WritePolicy;

public abstract class AerospikeRecordWriter<KK, VV>
    extends RecordWriter<KK, VV>
    implements org.apache.hadoop.mapred.RecordWriter<KK, VV> {

    private static final Log log =
        LogFactory.getLog(AerospikeRecordWriter.class);

    protected final Configuration cfg;
    protected boolean initialized = false;

    private static String namespace;
    private static String setName;
    private static AerospikeClient client;
    private static WritePolicy writePolicy;

    public AerospikeRecordWriter(Configuration cfg) {
        this.cfg = cfg;
    }

    public abstract void writeAerospike(KK key,
                                        VV value,
                                        AerospikeClient client,
                                        WritePolicy writePolicy,
                                        String namespace,
                                        String setName) throws IOException;

    @Override
    public void write(KK key, VV value) throws IOException {
        if (!initialized) {
            initialized = true;
            init();
        }

        writeAerospike(key, value, client, writePolicy, namespace, setName);
    }

    protected void init() throws IOException {

        String host = AerospikeConfigUtil.getOutputHost(cfg);
        int port = AerospikeConfigUtil.getOutputPort(cfg);

        namespace = AerospikeConfigUtil.getOutputNamespace(cfg);
        setName = AerospikeConfigUtil.getOutputSetName(cfg);

        log.info(String.format("init: %s %d %s %s",
                               host, port, namespace, setName));

        ClientPolicy policy = new ClientPolicy();
        policy.user = "";
        policy.password = "";
        policy.failIfNotConnected = true;

        client = AerospikeClientSingleton.getInstance(policy, host, port);

        writePolicy = new WritePolicy();
    }

    @Override
    public void close(TaskAttemptContext context) throws IOException {
        doClose(context);
    }

    public void close(org.apache.hadoop.mapred.Reporter reporter
                      ) throws IOException {
        doClose(reporter);
    }

    protected void doClose(Progressable progressable) {
        log.info("doClose");
        initialized = false;
    }
}

// Local Variables:
// mode: java
// c-basic-offset: 4
// tab-width: 4
// indent-tabs-mode: nil
// End:
// vim: softtabstop=4:shiftwidth=4:expandtab


text:
PLUGIN_PATH=$1
cd $PLUGIN_PATH

if [ ! -z "$SLURM_JOB_ID" ]; then
    python3.6 $PLUGIN_PATH/setup.py install --user
else
    python $PLUGIN_PATH/setup.py install
fi

wget --quiet --directory-prefix=$PLUGIN_PATH/classifier https://smartshark2.informatik.uni-goettingen.de/classifier/ft_title_clf.p >>/dev/null
wget --quiet --directory-prefix=$PLUGIN_PATH/classifier https://smartshark2.informatik.uni-goettingen.de/classifier/ft_text_clf.p >>/dev/null


text:
<?php
namespace RGeyer\Guzzle\Rs\Tests\Command\Ec2;

use RGeyer\Guzzle\Rs\Common\ClientFactory;

class S3BucketCommandsTest extends \RGeyer\Guzzle\Rs\Tests\Utils\ClientCommandsBase {

  /**
   * @group v1_0
   * @group unit
   */
  public function testHasDestroyCommand() {
    $client = ClientFactory::getClient();
    $command = $client->getCommand('s3_buckets_destroy');
    $this->assertNotNull($command);
  }

  /**
   * @group v1_0
   * @group unit
   */
  public function testDestroyUsesCorrectVerb() {
    $client = ClientFactory::getClient();
    $this->setMockResponse($client,
      array(
        '1.0/login',
        '1.0/s3_buckets_destroy/response'
      )
    );

    $command = $client->getCommand('s3_buckets_destroy',array('id' => 1234));
    $command->execute();

    $this->assertEquals('DELETE', $command->getRequest()->getMethod());
  }

  /**
   * @group v1_0
   * @group unit
   */
  public function testDestroyCommandExtendsDefaultCommand() {
    $client = ClientFactory::getClient();
    $command = $client->getCommand('s3_buckets_destroy');
    $this->assertInstanceOf('RGeyer\Guzzle\Rs\Command\DefaultCommand', $command);
  }

  /**
   * @group v1_0
   * @group unit
   * @expectedException Guzzle\Service\Exception\ValidationException
   * @expectedExceptionMessage  id argument be supplied.
   */
  public function testDestroyRequiresId() {
    $client = ClientFactory::getClient();
    $this->setMockResponse($client,
      array(
        '1.0/login',
        '1.0/s3_buckets_destroy/response'
      )
    );

    $command = $client->getCommand('s3_buckets_destroy');
    $command->execute();
  }

  /**
   * @group v1_0
   * @group unit
   * @expectedException Guzzle\Service\Exception\ValidationException
   * @expectedExceptionMessage id: Value must be numeric
   */
  public function testDestroyRequiresIdToBeAnInt() {
    $client = ClientFactory::getClient();
    $this->setMockResponse($client,
      array(
        '1.0/login',
        '1.0/s3_buckets_destroy/response'
      )
    );

    $command = $client->getCommand('s3_buckets_destroy', array('id' => 'abc'));
    $command->execute();
  }

  /**
   * @group v1_0
   * @group unit
   */
  public function testHasCreateCommand() {
    $client = ClientFactory::getClient();
    $command = $client->getCommand('s3_buckets_create');
    $this->assertNotNull($command);
  }

  /**
   * @group v1_0
   * @group unit
   */
  public function testCreateUsesCorrectVerb() {
    $client = ClientFactory::getClient();
    $this->setMockResponse($client,
      array(
        '1.0/login',
        '1.0/s3_buckets_create/response'
      )
    );

    $command = $client->getCommand('s3_buckets_create',
      array(
        's3_bucket[name]' => 'name'
      )
    );
    $command->execute();

    $this->assertEquals('POST', $command->getRequest()->getMethod());
  }

  /**
   * @group v1_0
   * @group unit
   */
  public function testCreateCommandExtendsDefaultCommand() {
    $client = ClientFactory::getClient();
    $command = $client->getCommand('s3_buckets_create');
    $this->assertInstanceOf('RGeyer\Guzzle\Rs\Command\DefaultCommand', $command);
  }

  /**
   * @group v1_0
   * @group unit
   * @expectedException Guzzle\Service\Exception\ValidationException
   * @expectedExceptionMessage s3_bucket[name] argument be supplied.
   */
  public function testCreateRequiresName() {
    $client = ClientFactory::getClient();
    $this->setMockResponse($client,
      array(
        '1.0/login',
        '1.0/s3_buckets_create/response'
      )
    );

    $command = $client->getCommand('s3_buckets_create');
    $command->execute();
  }

  /**
   * @group v1_0
   * @group unit
   */
  public function testCreateCommandReturnsAModel() {
    $this->markTestSkipped("A model does not yet exist");
  }

}


text:
"use strict";
import { Action } from "material-flux";
export var keys = {
    addSlackURL: Symbol("addSlackURL"),
    switchAccount: Symbol("switchAccount")
};
export default class AccountAction extends Action {
    addSlackURL(URL) {
        this.dispatch(keys.addSlackURL, URL);
    }

    switchAccount(account) {
        this.dispatch(keys.switchAccount, account);
    }
}


text:
        <link rel="stylesheet" type="text/css" href="webconsole.css" />

<title>OGNL Console</title>

   <form onsubmit="return false" id="wc-form">

             Welcome to the OGNL console!

             :->

        <input type="hidden" name="debug" value="command" />
        <input name="expression" onkeyup="keyEvent(event)" class="wc-command" id="wc-command" type="text" />
    </form>


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

<TITLE>
com.jgoodies.forms.extras (JGoodies Forms 1.3 API)
</TITLE>

<META NAME="date" CONTENT="2009-12-21">

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

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package com.jgoodies.forms.extras

Contains optional Forms framework classes that ship only with
the JGoodies Forms source distribution and are not yet part
of the binary Forms library.

See:

          Description

Class Summary

FormLayoutUtils
Consists only of static methods that provide convenience behavior
 for working with the FormLayout.

FormLayoutUtils.ConstraintIterator
Iterates over a FormLayout container's CellConstraints.

Package com.jgoodies.forms.extras Description

Contains optional Forms framework classes that ship only with
the JGoodies Forms source distribution and are not yet part
of the binary Forms library.

The API of these classes is work in progress and may change without notice.

If you want to use a class from this package,
you may consider copying it into your codebase.

Related Documentation

For more information see:

  http://www.jgoodies.com/articles/forms.pdf

See Also:
com.jgoodies.forms.layout

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2002-2009 JGoodies Karsten Lentzsch. All Rights Reserved.


text:
package host

import (
	"os"
	"path/filepath"
	"strings"

	"github.com/appoptics/appoptics-apm-go/v1/ao/internal/log"
	"github.com/appoptics/appoptics-apm-go/v1/ao/internal/utils"
)

// IsPhysicalInterface returns true if the specified interface name is physical
func IsPhysicalInterface(ifname string) bool {
	fn := filepath.Join("/sys/class/net/", ifname)
	link, err := os.Readlink(fn)
	if err != nil {
		log.Infof("cannot read link %s", fn)
		return true
	}
	if strings.Contains(link, "/virtual/") {
		return false
	}
	return true
}

// initDistro gets distribution identification
// TODO: should we cache the initDistro? does it never change?
func initDistro() (distro string) {
	// Note: Order of checking is important because some distros share same file names
	// but with different function.
	// Keep this order: redhat based -> ubuntu -> debian

	// redhat
	if distro = utils.GetStrByKeyword(REDHAT, ""); distro != "" {
		return distro
	}
	// amazon linux
	distro = utils.GetStrByKeyword(AMAZON, "")

	ds := strings.Split(distro, ":")
	distro = ds[len(ds)-1]
	if distro != "" {
		distro = "Amzn Linux " + distro
		return distro
	}
	// ubuntu
	distro = utils.GetStrByKeyword(UBUNTU, "DISTRIB_DESCRIPTION")
	if distro != "" {
		ds = strings.Split(distro, "=")
		distro = ds[len(ds)-1]
		if distro != "" {
			distro = strings.Trim(distro, "\"")
		} else {
			distro = "Ubuntu unknown"
		}
		return distro
	}

	pathes := []string{DEBIAN, SUSE, SLACKWARE, GENTOO, OTHER}
	if path, line := utils.GetStrByKeywordFiles(pathes, ""); path != "" && line != "" {
		distro = line
		if path == "Debian" {
			distro = "Debian " + distro
		}
	} else {
		distro = "Unknown"
	}
	return distro
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Play Bones 2048</title>

  <link href="style/main.css" rel="stylesheet" type="text/css">
  <link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:400,600,700' rel='stylesheet' type='text/css'>
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="apple-touch-icon" href="meta/apple-touch-icon.png">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="keywords" content="HTML,CSS,Javascript,Make your own 2048,Play 2048">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">

  <meta name="HandheldFriendly" content="True">
  <meta name="MobileOptimized" content="320">
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0, maximum-scale=1, user-scalable=no, minimal-ui">
  <meta name="format-detection" content="telephone=no" />

  <meta property="og:title" content="2048 game"/>
  <meta property="og:site_name" content="2048 game"/>
  <meta property="og:description" content="Play Udacity 2048. Then, make your own 2048 game in Udacity's 2 hour mini course for programming beginners!"/>
  <meta property="og:image" content="http://gabrielecirulli.github.io/2048/meta/og_image.png"/>

Bones-2048

0

0

      New Game
      Use the arrow keys to slide  pictures of Bones. Combine similar pictures to create new, awesome ones.

Do you have any more pics of bones?? Thanks to Bean and Hans for the input so far!.
Free Course!

	        Take the Class!
          Play Again

      Make your own version: If you'd like to make your own version of this game, check out Udacity's newest course for beginners Make your own 2048. No programming experience is required and in less than half an hour you'll dig into the source code, make some changes, and have your own version of the game to share.

      How to play: Use your arrow keys to move the tiles. When two tiles with the same value touch, they merge into one!

    This is a modified version of the original game created by Gabriele Cirulli.


text:
extern Context context;

////////////////////////////////////////////////////////////////////////////////
CmdSummary::CmdSummary ()
{
  _keyword               = "summary";
  _usage                 = "task <filter> summary";
  _description           = STRING_CMD_SUMMARY_USAGE;
  _read_only             = true;
  _displays_id           = false;
  _needs_gc              = true;
  _uses_context          = true;
  _accepts_filter        = true;
  _accepts_modifications = false;
  _accepts_miscellaneous = false;
  _category              = Command::Category::graphs;
}

////////////////////////////////////////////////////////////////////////////////
// Project  Remaining  Avg Age  Complete  0%                  100%
// A               12      13d       55%  XXXXXXXXXXXXX-----------
// B              109   3d 12h       10%  XXX---------------------
int CmdSummary::execute (std::string& output)
{
  int rc = 0;
  bool showAllProjects = context.config.getBoolean ("summary.all.projects");

  // Apply filter.
  handleRecurrence ();
  Filter filter;
  std::vector <Task> filtered;
  filter.subset (filtered);

  // Generate unique list of project names from all pending tasks.
  std::map <std::string, bool> allProjects;
  for (auto& task : filtered)
    if (showAllProjects || task.getStatus () == Task::pending)
      allProjects[task.get ("project")] = false;

  // Initialize counts, sum.
  std::map <std::string, int> countPending;
  std::map <std::string, int> countCompleted;
  std::map <std::string, double> sumEntry;
  std::map <std::string, int> counter;
  time_t now = time (NULL);

  // Initialize counters.
  for (auto& project : allProjects)
  {
    countPending   [project.first] = 0;
    countCompleted [project.first] = 0;
    sumEntry       [project.first] = 0.0;
    counter        [project.first] = 0;
  }

  // Count the various tasks.
  for (auto& task : filtered)
  {
    std::string project = task.get ("project");
    std::vector <std::string> projects = extractParents (project);
    projects.push_back (project);

    for (auto& parent : projects)
      ++counter[parent];

    if (task.getStatus () == Task::pending ||
        task.getStatus () == Task::waiting)
    {
      for (auto& parent : projects)
      {
        ++countPending[parent];

        time_t entry = strtol (task.get ("entry").c_str (), NULL, 10);
        if (entry)
          sumEntry[parent] = sumEntry[parent] + (double) (now - entry);
      }
    }

    else if (task.getStatus () == Task::completed)
    {
      for (auto& parent : projects)
      {
        ++countCompleted[parent];

        time_t entry = strtol (task.get ("entry").c_str (), NULL, 10);
        time_t end   = strtol (task.get ("end").c_str (), NULL, 10);
        if (entry && end)
          sumEntry[parent] = sumEntry[parent] + (double) (end - entry);
      }
    }
  }

  // Create a table for output.
  ViewText view;
  view.width (context.getWidth ());
  view.add (Column::factory ("string",            STRING_CMD_SUMMARY_PROJECT));
  view.add (Column::factory ("string.right",      STRING_CMD_SUMMARY_REMAINING));
  view.add (Column::factory ("string.right",      STRING_CMD_SUMMARY_AVG_AGE));
  view.add (Column::factory ("string.right",      STRING_CMD_SUMMARY_COMPLETE));
  view.add (Column::factory ("string.left_fixed", "0%                        100%"));

  Color bar_color (context.config.get ("color.summary.bar"));
  Color bg_color  (context.config.get ("color.summary.background"));
  Color label     (context.config.get ("color.label"));

  view.colorHeader (label);

  int barWidth = 30;
  std::vector <std::string> processed;
  for (auto& i : allProjects)
  {
    if (showAllProjects || countPending[i.first] > 0)
    {
      const std::vector <std::string> parents = extractParents (i.first);
      for (auto& parent : parents)
      {
        if (std::find (processed.begin (), processed.end (), parent)
           == processed.end ())
        {
          int row = view.addRow ();
          view.set (row, 0, indentProject (parent));
          processed.push_back (parent);
        }
      }

      int row = view.addRow ();
      view.set (row, 0, (i.first == ""
                          ? STRING_CMD_SUMMARY_NONE
                          : indentProject (i.first, "  ", '.')));

      view.set (row, 1, countPending[i.first]);
      if (counter[i.first])
        view.set (row, 2, ISO8601p ((int) (sumEntry[i.first] / (double)counter[i.first])).formatVague ());

      int c = countCompleted[i.first];
      int p = countPending[i.first];
      int completedBar = 0;
      if (c + p)
        completedBar = (c * barWidth) / (c + p);

      std::string bar;
      std::string subbar;
      if (context.color ())
      {
        bar += bar_color.colorize (std::string (           completedBar, ' '));
        bar += bg_color.colorize  (std::string (barWidth - completedBar, ' '));
      }
      else
      {
        bar += std::string (           completedBar, '=')
            +  std::string (barWidth - completedBar, ' ');
      }
      view.set (row, 4, bar);

      char percent[12] = "0%";
      if (c + p)
        sprintf (percent, "%d%%", 100 * c / (c + p));
      view.set (row, 3, percent);
      processed.push_back (i.first);
    }
  }

  std::stringstream out;
  if (view.rows ())
  {
    out << optionalBlankLine ()
        << view.render ()
        << optionalBlankLine ();

    if (view.rows ())
      out << format (STRING_CMD_PROJECTS_SUMMARY2, view.rows ());
    else
      out << STRING_CMD_PROJECTS_SUMMARY;

    out << "\n";
  }
  else {
    out << STRING_CMD_PROJECTS_NO << "\n";
    rc = 1;
  }

  output = out.str ();
  return rc;
}

////////////////////////////////////////////////////////////////////////////////


text:
<configuration>
	  <adapter name="Validator">
      <receiver name="testtool-Validator">
         <listener className="nl.nn.adapterframework.receivers.JavaListener"
                   serviceName="testtool-Validator"/>
      </receiver>
		    <receiver>
			      <listener className="nl.nn.adapterframework.receivers.JavaListener"
                   serviceName="validator"
                   throwException="false"/>
		    </receiver>
      <receiver name="testtool-Validator-1">
         <listener className="nl.nn.adapterframework.receivers.JavaListener"
                   serviceName="testtool-Validator-1"/>
      </receiver>
		    <pipeline>
			      <exits>
				        <exit path="EXIT" state="success"/>
			      </exits>
			<!--<inputValidator className="nl.nn.adapterframework.soap.SoapValidator"
                         schemaLocation="urn:items /Validators/xsd/Items.xsd"
                         soapBody="Item_Request"
                         outputSoapBody="Item_Response,SpecialResponse,InputValidationFailure,OutputValidationFailure"
                         allowPlainXml="true"/>-->

			<!--<outputValidator className="nl.nn.adapterframework.soap.SoapValidator"
                          schemaLocation="urn:items /Validators/xsd/Items.xsd"
                          soapBody="Item_Request"
                          outputSoapBody="Item_Response,SpecialResponse,InputValidationFailure,OutputValidationFailure"
                          allowPlainXml="true"/>-->
		</pipeline>
	  </adapter>
</configuration>


text:
class ChangePendingUploadCurationConcernId < ActiveRecord::Migration
  def up
    change_column :pending_uploads, :curation_concern_id, :string
  end

  def down
    change_column :pending_uploads, :curation_concern_id, :integer
  end
end


text:
<#
    .SYNOPSIS
    AD2-Post-Config.ps1

    .DESCRIPTION
    This script installs the active directory binaries but does promote the server to a domain controller.
    It sets some minor settings and cleans up the DSC configuration

    .EXAMPLE
    .\AD2-Post-Config -VPCCIDR '10.0.0.0/16'
#>

[CmdletBinding()]
Param(
    [Parameter(Mandatory = $true)][string]$VPCCIDR
)

#==================================================
# Main
#==================================================

Write-Output 'Enabling Certificate Auto-Enrollment Policy'
Try {
    Set-CertificateAutoEnrollmentPolicy -ExpirationPercentage 10 -PolicyState 'Enabled' -EnableTemplateCheck -EnableMyStoreManagement -StoreName 'MY' -Context 'Machine' -ErrorAction Stop
} Catch [System.Exception] {
    Write-Output "Failed to enable Certificate Auto-Enrollment Policy $_"
}

Write-Output 'Enabling SMBv1 Auditing'
Try {
    Set-SmbServerConfiguration -AuditSmb1Access $true -Force -ErrorAction Stop
} Catch [System.Exception] {
    Write-Output "Failed to enable SMBv1 Audit log $_"
}

Write-Output 'Re-enabling Windows Firewall'
Try {
    Get-NetFirewallProfile -ErrorAction Stop | Set-NetFirewallProfile -Enabled 'True' -ErrorAction Stop
} Catch [System.Exception] {
    Write-Output "Failed to re-enable firewall $_"
}

Write-Output 'Setting Windows Firewall WinRM Public rule to allow VPC CIDR traffic'
Try {
    Set-NetFirewallRule -Name 'WINRM-HTTP-In-TCP-PUBLIC' -RemoteAddress $VPCCIDR
} Catch [System.Exception] {
    Write-Output "Failed allow WinRM Traffic from VPC CIDR $_"
}

Write-Output 'Removing DSC Configuration'
Try {
    Remove-DscConfigurationDocument -Stage 'Current' -ErrorAction Stop
} Catch [System.Exception] {
    Write-Output "Failed to remove DSC Configuration $_"
}

Write-Output 'Removing QuickStart build files'
Try {
    Remove-Item -Path 'C:\AWSQuickstart' -Recurse -Force -ErrorAction Stop
} Catch [System.Exception] {
    Write-Output "Failed remove QuickStart build files $_"
}

Write-Output 'Removing self signed cert'
Try {
    $SelfSignedThumb = Get-ChildItem -Path 'cert:\LocalMachine\My\' -ErrorAction Stop | Where-Object { $_.Subject -eq 'CN=AWSQSDscEncryptCert' } | Select-Object -ExpandProperty 'Thumbprint'
    Remove-Item -Path "cert:\LocalMachine\My\$SelfSignedThumb" -DeleteKey
} Catch [System.Exception] {
    Write-Output "Failed remove self signed cert $_"
}

Write-Output 'Checking domain membership'
Try {
    $AmIDomainMember = Get-CimInstance -ClassName 'Win32_ComputerSystem' -ErrorAction Stop | Select-Object -ExpandProperty 'PartOfDomain'
} Catch [System.Exception] {
    Write-Output "Failed checking domain membership $_"
}

If ($AmIDomainMember) {
    Write-Output 'Running Group Policy update'
    Invoke-GPUpdate -RandomDelayInMinutes '0' -Force
}


text:
import { TypeScriptReporterConfiguration } from './TypeScriptReporterConfiguration';
declare function assertTypeScriptSupport(configuration: TypeScriptReporterConfiguration): void;
export { assertTypeScriptSupport };


text:
'use strict';

angular.module("bham.directives", [])

    .directive('datepicker', function () {
        return {
            restrict: 'A',
            require: 'ngModel',
            link: function (scope, element, attrs, ngModelCtrl) {
                element.datepicker({
                    dateFormat: 'mm/dd/yy',
                    onSelect: function (date) {
                        scope.$apply(function () {
                            ngModelCtrl.$setViewValue(date);
                        });
                    }
                });
            }
        };
    })
;


text:
// Copyright (c) 2016 BlueConcord. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using AutoMapper;
using BlueConcord.IdentityServer.EntityFrameworkCore.Entities;
using Models = IdentityServer4.Models;

namespace BlueConcord.IdentityServer.EntityFrameworkCore.Extensions
{
    public class EntitiesMapProfile : Profile
    {
        public EntitiesMapProfile()
        {
            CreateMap<Consent, Models.Consent>(MemberList.Destination)
                .ForMember(x => x.Scopes, opts => opts.MapFrom(src => src.Scopes.ParseScopes()))
                .ForMember(x => x.Subject, opts => opts.MapFrom(src => src.SubjectId));
        }
    }
}


text:
package com.webtec2.auth.permission;

import org.apache.shiro.authz.Permission;
import com.webtec2.DBCategory;
import org.apache.shiro.subject.Subject;

public class ReadCategoryItemPermission implements Permission {

	private final DBCategory category;
	private final Subject user;

	public ReadCategoryItemPermission(final DBCategory category, final Subject user) {
		this.category = category;
		this.user = user;
	}
	@Override
	public boolean implies(Permission p) {
		return false;
	}

	public boolean check() {
		//Only registered users incl. admin should be permitted to read category
		if(user.isAuthenticated())
		{
			System.out.println(user.getPrincipal() + " is allowed to read category " + category.getName());
			return true;
		}
		System.out.println(user.getPrincipal() + " is not allowed to read category " + category.getName());
		return false;
	}
}


text:
package fi.ni.ifc2x3.interfaces;

/*
 * IFC type select 2 Java interface
 * @author Jyrki Oraskari
 * @license This work is licensed under a Creative Commons Attribution 3.0 Unported License.
 * http://creativecommons.org/licenses/by/3.0/
 */

public interface IfcStructuralActivityAssignmentSelect
{
}


text:
package eu.chargetime.ocpp.feature.profile;

import eu.chargetime.ocpp.model.core.*;

import java.util.UUID;

public interface ServerCoreEventHandler {
    AuthorizeConfirmation handleAuthorizeRequest(UUID sessionIndex, AuthorizeRequest request);

    BootNotificationConfirmation handleBootNotificationRequest(UUID sessionIndex, BootNotificationRequest request);

    DataTransferConfirmation handleDataTransferRequest(UUID sessionIndex, DataTransferRequest request);

    HeartbeatConfirmation handleHeartbeatRequest(UUID sessionIndex, HeartbeatRequest request);

    MeterValuesConfirmation handleMeterValuesRequest(UUID sessionIndex, MeterValuesRequest request);

    StartTransactionConfirmation handleStartTransactionRequest(UUID sessionIndex, StartTransactionRequest request);

    StatusNotificationConfirmation handleStatusNotificationRequest(UUID sessionIndex, StatusNotificationRequest request);

    StopTransactionConfirmation handleStopTransactionRequest(UUID sessionIndex, StopTransactionRequest request);
}


text:
package com.jeesuite.mybatis.plugin.autofield;

import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.ibatis.mapping.MappedStatement;

import com.jeesuite.common.CurrentRuntimeContext;
import com.jeesuite.common.ThreadLocalContext;
import com.jeesuite.common.guid.GUID;
import com.jeesuite.mybatis.MybatisConfigs;
import com.jeesuite.mybatis.core.BaseEntity;
import com.jeesuite.mybatis.core.InterceptorHandler;
import com.jeesuite.mybatis.metadata.MapperMetadata;
import com.jeesuite.mybatis.parser.MybatisMapperParser;
import com.jeesuite.mybatis.plugin.InvocationVals;
import com.jeesuite.mybatis.plugin.JeesuiteMybatisInterceptor;
import com.jeesuite.mybatis.plugin.autofield.annotation.CreatedAt;
import com.jeesuite.mybatis.plugin.autofield.annotation.CreatedBy;
import com.jeesuite.mybatis.plugin.autofield.annotation.UpdatedAt;
import com.jeesuite.mybatis.plugin.autofield.annotation.UpdatedBy;
import com.jeesuite.spring.InstanceFactory;

/**
 * 字段自动填充
 *
 *

 * Class Name   : AutoFieldFillHandler
 *
 * @author vakin
 * @version 1.0.0
 * @date Aug 8, 2021
 */
public class AutoFieldFillHandler implements InterceptorHandler {

	private static final String INSERT_LIST_METHOD_NAME = "insertList";
	private static final String ATTR_CONTEXT_NAME = "__attr_cxt_name";
	private static final String ATTR_VALUE_CONTEXT_NAME = "__attrval_cxt_name:%s:%s";

	private static Map<String, Field[]> methodFieldMappings = new HashMap<>();

	private  IDGenerator idGenerator;

	private IDGenerator getIdGenerator() {
		if(idGenerator != null)return idGenerator;
		synchronized (AutoFieldFillHandler.class) {
			idGenerator = InstanceFactory.getInstance(IDGenerator.class);
			if(idGenerator == null) {
				idGenerator = new IDGenerator() {
					@Override
					public Serializable nextId() {
						return String.valueOf(GUID.guid());
					}
				};
			}
		}
		return idGenerator;
	}

	@Override
	public void start(JeesuiteMybatisInterceptor context) {
		List<MapperMetadata> mappers = MybatisMapperParser.getMapperMetadatas(context.getGroupName());

		String tenantSharddingField = MybatisConfigs.getTenantSharddingField(context.getGroupName());
		for (MapperMetadata mm : mappers) {
			Field[] createdFields = new Field[4];
			Field[] updatedFields = new Field[3];
			Field[] fields = FieldUtils.getAllFields(mm.getEntityClass());
			for (Field field : fields) {
				if(field.isAnnotationPresent(Id.class) && !field.isAnnotationPresent(GeneratedValue.class)) {
					field.setAccessible(true);
					createdFields[0] = field;
				}else if(field.isAnnotationPresent(CreatedBy.class)) {
					field.setAccessible(true);
					createdFields[1] = field;
				}else if(field.isAnnotationPresent(CreatedAt.class)) {
					field.setAccessible(true);
					createdFields[2] = field;
				}else if(field.isAnnotationPresent(UpdatedBy.class)) {
					field.setAccessible(true);
					updatedFields[1] = field;
				}else if(field.isAnnotationPresent(UpdatedAt.class)) {
					field.setAccessible(true);
					updatedFields[2] = field;
				}else if(tenantSharddingField != null && field.getName().endsWith(tenantSharddingField)) {
					field.setAccessible(true);
					createdFields[3] = field;
				}
			}

			String keyPrefix = mm.getMapperClass().getName() + ".";
			if(hasAnyValue(createdFields)) {
	        	methodFieldMappings.put(keyPrefix + "insert", createdFields);
	        	methodFieldMappings.put(keyPrefix + "insertSelective", createdFields);
	        	methodFieldMappings.put(keyPrefix + INSERT_LIST_METHOD_NAME, createdFields);
	        }
			if(hasAnyValue(updatedFields)) {
	        	methodFieldMappings.put(keyPrefix + "updateByPrimaryKey", updatedFields);
	        	methodFieldMappings.put(keyPrefix + "updateByPrimaryKeySelective", updatedFields);
	        	methodFieldMappings.put(keyPrefix + "updateByPrimaryKeyWithVersion", updatedFields);
	        }
		}

	}

	@SuppressWarnings("unchecked")
	@Override
	public Object onInterceptor(InvocationVals invocation) throws Throwable {
		if(invocation.isSelect())return null;
		Object parameter = invocation.getParameter();
		//动态拓展字段
		boolean dynaFieldEnabled = ThreadLocalContext.exists(ATTR_CONTEXT_NAME);

		if(!dynaFieldEnabled && methodFieldMappings.isEmpty())return null;

        final MappedStatement orignMappedStatement = invocation.getMappedStatement();

        Field[] fields = methodFieldMappings.get(orignMappedStatement.getId());
		if(fields == null) return null;

		if(orignMappedStatement.getId().endsWith(INSERT_LIST_METHOD_NAME)) {
			if(parameter instanceof Map) {
				try {
					List<Object> list = (List<Object>) ((Map<String, Object>)parameter).get("arg0");
					for (Object obj : list) {
						setFieldValue(fields,obj);
					}
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}else {
			setFieldValue(fields,parameter);
		}

		return null;
	}

	private void setFieldValue(Field[] fields, Object parameter) {
		String tmpVal;
		if(fields[0] != null && getIdGenerator() != null && isNullValue(parameter, fields[0])) {
			Serializable id = idGenerator.nextId();
//			if(fields[0].getType() == int.class || fields[0].getType() == Integer.class){
//				id = Integer.parseInt(id.toString());
//			}else if(fields[0].getType() == long.class || fields[0].getType() == Long.class){
//				id = Long.parseLong(id.toString());
//			}
			try {fields[0].set(parameter, id);} catch (Exception e) {}
		}

		if(fields[1] != null && (tmpVal = CurrentRuntimeContext.getCurrentUserId()) != null && isNullValue(parameter, fields[1])) {
			try {fields[1].set(parameter, tmpVal);} catch (Exception e) {}
		}

		if(fields[2] != null && isNullValue(parameter, fields[2])) {
			try {fields[2].set(parameter, new Date());} catch (Exception e) {}
		}

		if(fields.length > 3 && fields[3] != null && (tmpVal = CurrentRuntimeContext.getTenantId()) != null && isNullValue(parameter, fields[3])) {
			try {fields[3].set(parameter, tmpVal);} catch (Exception e) {}
		}

		//
		setDynaFieldValues(parameter);
	}

	private boolean isNullValue(Object obj,Field field) {
		try {
			Object value = field.get(field);
			return value == null || StringUtils.isBlank(value.toString());
		} catch (Exception e) {
			return true;
		}
	}

	private boolean hasAnyValue(Field[] fields) {
		for (Field field : fields) {
			if(field != null)return true;
		}
		return false;
	}

	public void setFieldValue(Object target ,Field field,Object value) {
		try {
			field.set(target, value);
		} catch (IllegalArgumentException | IllegalAccessException e) {
			throw new RuntimeException(e);
		}
	}

	private Object readFieldValue(final Object target, final String fieldName) {
		Field field;
		try {
			Class<?> clazz = target.getClass();
			field = FieldUtils.getDeclaredField(clazz, fieldName, true);
			while(field == null && clazz.getSuperclass() != null) {
				clazz = clazz.getSuperclass();
				field = FieldUtils.getDeclaredField(clazz, fieldName, true);
			}
			if(field == null)return null;
			return field.get(target);
		} catch (IllegalAccessException e) {
			throw new RuntimeException(e);
		}
	}

	private void setDynaFieldValues(Object entity) {
		Map<String, String> dynaValueMap = tryGetDynaAttrValues(entity);
		if(dynaValueMap != null) {
			dynaValueMap.forEach( (k,v) -> {
				try {
					FieldUtils.writeDeclaredField(entity, k, v, true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			} );
		}
	}

	private Map<String, String> tryGetDynaAttrValues(Object parameter){

		if(parameter instanceof BaseEntity == false)return null;

		Class<?> entityClass = parameter.getClass();
		if(!ThreadLocalContext.exists(ATTR_CONTEXT_NAME))return null;

		String key;
		Map<String, String> dynaValueMap;
		//
		Object id = readFieldValue(parameter, "id");
		if(id != null) {
			key = String.format(ATTR_VALUE_CONTEXT_NAME, entityClass.getSimpleName(),id);
			dynaValueMap = ThreadLocalContext.get(key);
			if(dynaValueMap != null) {
				ThreadLocalContext.remove(key);
				return dynaValueMap;
			}
		}

		for (int i = 0; i < 10; i++) {
			key = String.format(ATTR_VALUE_CONTEXT_NAME, entityClass.getSimpleName(),i);
			dynaValueMap = ThreadLocalContext.get(key);
			if(dynaValueMap != null) {
				ThreadLocalContext.remove(key);
				return dynaValueMap;
			}
		}
		return null;
	}

	@Override
	public void onFinished(InvocationVals invocationVal, Object result) {}

	@Override
	public void close() {}

	@Override
	public int interceptorOrder() {
		return 1;
	}

}


text:
const IEVector3 SceneLights::pLightDir[CubeSide] =
{
	IEVector3::XAxis,
	-IEVector3::XAxis,
	IEVector3::YAxis,
	-IEVector3::YAxis,
	IEVector3::ZAxis,
	-IEVector3::ZAxis
};

const IEVector3 SceneLights::pLightUp[CubeSide] =
{
	-IEVector3::YAxis,
	-IEVector3::YAxis,
	IEVector3::ZAxis,
	-IEVector3::ZAxis,
	-IEVector3::YAxis,
	-IEVector3::YAxis
};

const IEVector3 SceneLights::aLightDir[CubeSide] =
{
	IEQuaternion(static_cast<float>(IEMathConstants::DegToRadCoef * 22.5), -IEVector3::ZAxis).ApplyRotation(IEVector3::XAxis),
	IEQuaternion(static_cast<float>(IEMathConstants::DegToRadCoef * 22.5), IEVector3::ZAxis).ApplyRotation(-IEVector3::XAxis),
	IEVector3::ZeroVector,	// Unused
	-IEVector3::YAxis,
	IEQuaternion(static_cast<float>(IEMathConstants::DegToRadCoef * 22.5), IEVector3::XAxis).ApplyRotation(IEVector3::ZAxis),
	IEQuaternion(static_cast<float>(IEMathConstants::DegToRadCoef * 22.5), -IEVector3::XAxis).ApplyRotation(-IEVector3::ZAxis)
};

const IEVector3 SceneLights::aLightUp[CubeSide] =
{
	IEQuaternion(static_cast<float>(IEMathConstants::DegToRadCoef * 22.5), -IEVector3::ZAxis).ApplyRotation(-IEVector3::YAxis),
	IEQuaternion(static_cast<float>(IEMathConstants::DegToRadCoef * 22.5), IEVector3::ZAxis).ApplyRotation(-IEVector3::YAxis),
	IEVector3::ZeroVector,	// Unused
	-IEVector3::ZAxis,
	IEQuaternion(static_cast<float>(IEMathConstants::DegToRadCoef * 22.5), IEVector3::XAxis).ApplyRotation(-IEVector3::YAxis),
	IEQuaternion(static_cast<float>(IEMathConstants::DegToRadCoef * 22.5), -IEVector3::XAxis).ApplyRotation(-IEVector3::YAxis)
};

float SceneLights::CalculateCascadeLength(float frustumFar,
										  unsigned int cascadeNo)
{
	// Geometric sum
	static constexpr float exponent = 1.1f;
	float chunkSize = (std::powf(exponent, static_cast<float>(LightDrawBuffer::DirectionalCascadesCount)) - 1.0f) / (exponent - 1.0f);
	return std::powf(exponent, static_cast<float>(cascadeNo)) * (frustumFar / chunkSize);
}

IEBoundingSphere SceneLights::CalculateShadowCascasde(float cascadeNear,
													  float cascadeFar,
													  const Camera& camera,
													  const IEVector3& lightDir)
{
	float cascadeDiff = cascadeFar - cascadeNear;

	// Shadow Map Generation
	// Calculate Frustum Parameters from Render Camera
	float tanHalfFovX = std::tan(static_cast<float>(IEMathConstants::DegToRadCoef * camera.fovX * 0.5f));
	float aspectRatio = camera.width / camera.height;
	IEVector3 camDir = (camera.centerOfInterest - camera.pos).NormalizeSelf();
	IEVector3 right = camDir.CrossProduct(camera.up).NormalizeSelf();
	IEVector3 camUp = camDir.CrossProduct(right).NormalizeSelf();

	float farHalfWidth = cascadeFar * tanHalfFovX;
	float farHalfHeight = farHalfWidth / aspectRatio;

	// Plane Center Points
	IEVector3 planeCenterFar = camera.pos + camDir * cascadeFar;

	IEVector3 farTopRight = planeCenterFar + (camUp * farHalfHeight) + (right * farHalfWidth);
	IEVector3 farBottomLeft = planeCenterFar - (camUp * farHalfHeight) - (right * farHalfWidth);
	IEVector3 farBottomRight = planeCenterFar - (camUp * farHalfHeight) + (right * farHalfWidth);

	// Frustum Span (sized)
	const IEVector3 span[3] =
	{
		farTopRight - farBottomRight,
		-cascadeDiff * camDir,
		farBottomLeft - farBottomRight
	};

	// Converting to bounding sphere
	float diam = (span[0] + span[1] + span[2]).Length();
	float radius = diam * 0.5f;
	IEVector3 centerPoint = farBottomRight + radius * (span[0] + span[1] + span[2]).NormalizeSelf();
	return IEBoundingSphere(centerPoint, radius);
}

void SceneLights::GenerateMatrices(const Camera& camera)
{
	// Render From Dir of the light	with proper view params
	for(int i = 0; i < static_cast<int>(lights.size()); i++)
	{
		const Light& currentLight = lights[i];
		LightType t = static_cast<LightType>(static_cast<uint32_t>(currentLight.position.getW()));
		switch(t)
		{
			case LightType::POINT:
			{
				// Each Side will have 90 degree FOV
				// Geom shader will render for each layer
				IEMatrix4x4 projection = IEMatrix4x4::Perspective(90.0f, 1.0f,
																  PointLightNear, currentLight.color.getW());
				for(int j = 0; j < CubeSide; j++)
				{
					IEMatrix4x4 view = IEMatrix4x4::LookAt(currentLight.position,
														   currentLight.position + SceneLights::pLightDir[j],
														   SceneLights::pLightUp[j]);
					lightViewProjMatrices[i * 6 + j] = projection * view;
					lightProjMatrices[i * 6 + j] = projection;
					lightInvViewProjMatrices[i * 6 + j] = (projection * view).Inverse();
				}
				break;
			}
			case LightType::DIRECTIONAL:
			{
				float totalLength = 0.0f;
				for(int j = 0; j < LightDrawBuffer::DirectionalCascadesCount; j++)
				{
					float cascade = CalculateCascadeLength(camera.far, j);
					IEBoundingSphere viewSphere = CalculateShadowCascasde(totalLength,
																		  totalLength + cascade,
																		  camera,
																		  currentLight.direction);
					totalLength += cascade;

					// Squre Orto Projection
					float radius = viewSphere.radius;
					//float factor = static_cast<float>(2.0 / IEMathConstants::Sqrt2);
					IEMatrix4x4 projection = IEMatrix4x4::Ortogonal(2.0f * radius, 2.0f * radius,
																	DirectionalLightNear,
																	DirectionalLightFar);

					IEMatrix4x4 view = IEMatrix4x4::LookAt(viewSphere.center,
														   viewSphere.center + currentLight.direction,
														   camera.up);

					// To eliminate shadow shimmering only change pixel sized frusutm changes
					IEVector3 unitPerTexel = (2.0f * IEVector3(radius)) /
											 IEVector3(static_cast<float>(LightDrawBuffer::ShadowMapWH));
					unitPerTexel *= static_cast<float>(1 << (LightDrawBuffer::ShadowMipSampleCount));
					IEVector3 translatedOrigin = view * IEVector3::ZeroVector;
					IEVector3 texelTranslate;
					texelTranslate.setX(std::fmod(translatedOrigin.getX(), unitPerTexel.getX()));
					texelTranslate.setY(std::fmod(translatedOrigin.getY(), unitPerTexel.getY()));
					texelTranslate.setZ(std::fmod(translatedOrigin.getZ(), unitPerTexel.getZ()));
					texelTranslate = unitPerTexel - texelTranslate;

					IEMatrix4x4 texelTranslateMatrix = IEMatrix4x4::Translate(texelTranslate);
					lightViewProjMatrices[i * 6 + j] = projection * texelTranslateMatrix * view;
					lightProjMatrices[i * 6 + j] = projection;
					lightInvViewProjMatrices[i * 6 + j] = (projection * texelTranslateMatrix * view).Inverse();
				}
				break;
			}
			//case LightType::RECTANGULAR:
			//{
			//	IEMatrix4x4 projections[2] =
			//	{
			//		IEMatrix4x4::Perspective(45.0f, 1.0f, 0.1f, currentLight.color.getW()),
			//		IEMatrix4x4::Perspective(90.0f, 1.0f, 0.1f, currentLight.color.getW())
			//	};

			//	// we'll use 5 sides but each will comply different ares that a point light
			//	for(unsigned int j = 0; j < 6; j++)
			//	{
			//		uint32_t projIndex = (j == 3) ? 1 : 0;
			//		IEMatrix4x4 view = IEMatrix4x4::LookAt(currentLight.position,
			//											   currentLight.position + SceneLights::aLightDir[j],
			//											   SceneLights::aLightUp[j]);

			//		lightViewProjMatrices[i * 6 + j] = projections[projIndex] * view;
			//		lightProjMatrices[i * 6 + j] = projections[projIndex];
			//		lightInvViewProjMatrices[i * 6 + j] = (projections[projIndex] * view).Inverse();
			//	}
			//	break;
			//}
		}
	}
}

SceneLights::SceneLights()
	: lightOffset(0)
	, matrixOffset(0)
	, lightShadowMaps(0)
	, shadowMapArrayView(0)
	, shadowMapCubeDepth(0)
{
	for(auto& l : lightCounts) l = 0;
}

SceneLights::SceneLights(const std::vector<Light>& lights)
	: gpuData(lights.size() * (sizeof(Light) + sizeof(IEMatrix4x4) * CubeSide + sizeof(uint32_t)))
	, lightOffset(0)
	, matrixOffset(0)
	, lightShadowMaps(0)
	, shadowMapArrayView(0)
	, shadowMapCubeDepth(0)
	, shadowMapViews(lights.size())
	, shadowMapFBOs(lights.size())
	, lights(lights)
	, lightViewProjMatrices(lights.size() * CubeSide)
	, lightProjMatrices(lights.size() * CubeSide)
	, lightInvViewProjMatrices(lights.size() * CubeSide)
	, lightShadowCast(lights.size(), true)
{
	for(auto& l : lightCounts) l = 0;
	GLsizei lightCount = static_cast<GLsizei>(lights.size());

	glGenTextures(1, &lightShadowMaps);
	glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, lightShadowMaps);
	glTexStorage3D(GL_TEXTURE_CUBE_MAP_ARRAY, LightDrawBuffer::ShadowMapMipCount,
				   GL_R32F, LightDrawBuffer::ShadowMapWH, LightDrawBuffer::ShadowMapWH,
				   CubeSide * lightCount);
	glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);
	glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_COMPARE_FUNC, GL_GREATER);
	glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_MAX_LEVEL, LightDrawBuffer::ShadowMapMipCount);
	glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_BASE_LEVEL, 0);

	glGenFramebuffers(lightCount, shadowMapFBOs.data());
	glGenTextures(lightCount, shadowMapViews.data());

	// Depth Texture For
	glGenTextures(1, &shadowMapCubeDepth);
	glBindTexture(GL_TEXTURE_CUBE_MAP, shadowMapCubeDepth);
	glTexStorage2D(GL_TEXTURE_CUBE_MAP, 1, GL_DEPTH_COMPONENT32F,
				   LightDrawBuffer::ShadowMapWH,
				   LightDrawBuffer::ShadowMapWH);
	glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAX_LEVEL, 0);
	glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_BASE_LEVEL, 0);

	// Interpret CubemapTexture Array as 2D Texture
	// Used for Directional Lights (each cube side is a cascade)
	glGenTextures(1, &shadowMapArrayView);
	glTextureView(shadowMapArrayView, GL_TEXTURE_2D_ARRAY, lightShadowMaps, GL_R32F,
				  0, LightDrawBuffer::ShadowMapMipCount, 0, CubeSide * lightCount);

	for(GLsizei i = 0; i < lightCount; i++)
	{
		glBindFramebuffer(GL_FRAMEBUFFER, shadowMapFBOs[i]);
		glTextureView(shadowMapViews[i], GL_TEXTURE_CUBE_MAP, lightShadowMaps, GL_R32F,
					  0, 1, 6 * i, 6);
		glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, shadowMapViews[i], 0);
		glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, shadowMapCubeDepth, 0);
		assert(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
	}
	glBindFramebuffer(GL_FRAMEBUFFER, 0);

	//Generate Light Index Buffer
	int index = 0;
	std::array<std::vector<uint32_t>, LightTypeCount> lightTypeIndices;
	for(const Light& l : lights)
	{
		int typeIndex = static_cast<int>(l.position.getW());
		lightTypeIndices[typeIndex].push_back(index);
		lightCounts[typeIndex]++;
		index++;
	}
	for(const auto& indices : lightTypeIndices)
	{
		lightIndices.insert(lightIndices.end(), indices.begin(), indices.end());
	}

	// Everything is Generated Now Construct Buffer
	size_t totalSize = 0;
	// LightStruct
	lightOffset = totalSize;
	totalSize += lights.size() * sizeof(Light);
	// ViewProjTransforms
	totalSize = DeviceOGLParameters::SSBOAlignOffset(totalSize);
	matrixOffset = totalSize;
	totalSize += lightViewProjMatrices.size() * sizeof(IEMatrix4x4);
	// LightIndexOffset
	//totalSize = DeviceOGLParameters::SSBOAlignOffset(totalSize);
	lightIndexOffset = totalSize;
	totalSize += lightIndices.size() * sizeof(uint32_t);

	// Copy To Buffer
	auto& cpuImage = gpuData.CPUData();
	cpuImage.resize(totalSize);
	std::copy(reinterpret_cast<const uint8_t*>(lights.data()),
			  reinterpret_cast<const uint8_t*>(lights.data() + lights.size()),
			  cpuImage.data() + lightOffset);
	std::copy(reinterpret_cast<uint8_t*>(lightViewProjMatrices.data()),
			  reinterpret_cast<uint8_t*>(lightViewProjMatrices.data() + lightViewProjMatrices.size()),
			  cpuImage.data() + matrixOffset);
	std::copy(reinterpret_cast<uint8_t*>(lightIndices.data()),
			  reinterpret_cast<uint8_t*>(lightIndices.data() + lightIndices.size()),
			  cpuImage.data() + lightIndexOffset);

	// Finalize and Send
	gpuData.SendData();
}

SceneLights::SceneLights(SceneLights&& other)
	: gpuData(std::move(other.gpuData))
	, lightOffset(other.lightOffset)
	, matrixOffset(other.matrixOffset)
	, lightIndexOffset(other.lightIndexOffset)
	, lightShadowMaps(other.lightShadowMaps)
	, shadowMapArrayView(other.shadowMapArrayView)
	, shadowMapCubeDepth(other.shadowMapCubeDepth)
	, shadowMapViews(std::move(other.shadowMapViews))
	, shadowMapFBOs(std::move(other.shadowMapFBOs))
	, lightCounts(std::move(other.lightCounts))
	, lightIndices(std::move(other.lightIndices))
	, lights(std::move(other.lights))
	, lightViewProjMatrices(std::move(other.lightViewProjMatrices))
	, lightProjMatrices(std::move(other.lightProjMatrices))
	, lightInvViewProjMatrices(std::move(other.lightInvViewProjMatrices))
	, lightShadowCast(std::move(other.lightShadowCast))
{
	other.lightShadowMaps = 0;
	other.shadowMapArrayView = 0;
	other.shadowMapCubeDepth = 0;
}

SceneLights& SceneLights::operator=(SceneLights&& other)
{
	assert(this != &other);
	if(shadowMapFBOs.size() > 0) glDeleteFramebuffers(static_cast<GLsizei>(shadowMapFBOs.size()),
													  shadowMapFBOs.data());
	if(shadowMapViews.size() > 0) glDeleteFramebuffers(static_cast<GLsizei>(shadowMapViews.size()),
													   shadowMapViews.data());
	glDeleteTextures(1, &shadowMapCubeDepth);
	glDeleteTextures(1, &lightShadowMaps);
	glDeleteTextures(1, &shadowMapArrayView);

	gpuData = std::move(other.gpuData);
	lightOffset = other.lightOffset;
	matrixOffset = other.matrixOffset;
	lightIndexOffset = other.lightIndexOffset;
	lightShadowMaps = other.lightShadowMaps;
	shadowMapArrayView = other.shadowMapArrayView;
	shadowMapCubeDepth = other.shadowMapCubeDepth;
	shadowMapViews = std::move(other.shadowMapViews);
	shadowMapFBOs = std::move(other.shadowMapFBOs);
	lightCounts = std::move(other.lightCounts);
	lightIndices = std::move(other.lightIndices);
	lights = std::move(other.lights);
	lightViewProjMatrices = std::move(other.lightViewProjMatrices);
	lightProjMatrices = std::move(other.lightProjMatrices);
	lightInvViewProjMatrices = std::move(other.lightInvViewProjMatrices);
	lightShadowCast = std::move(other.lightShadowCast);

	other.lightShadowMaps = 0;
	other.shadowMapArrayView = 0;
	other.shadowMapCubeDepth = 0;
	return *this;
}

SceneLights::~SceneLights()
{
	if(shadowMapFBOs.size() > 0) glDeleteFramebuffers(static_cast<GLsizei>(shadowMapFBOs.size()),
													  shadowMapFBOs.data());
	if(shadowMapViews.size() > 0) glDeleteFramebuffers(static_cast<GLsizei>(shadowMapViews.size()),
													   shadowMapViews.data());
	glDeleteTextures(1, &shadowMapCubeDepth);
	glDeleteTextures(1, &lightShadowMaps);
	glDeleteTextures(1, &shadowMapArrayView);
}

uint32_t SceneLights::getLightCount() const
{
	return static_cast<uint32_t>(lightShadowCast.size());
}

uint32_t SceneLights::getLightCount(LightType t) const
{
	return lightCounts[static_cast<int>(t)];
}

const std::vector<IEMatrix4x4>&	SceneLights::getLightProjMatrices() const
{
	return lightProjMatrices;
}

const std::vector<IEMatrix4x4>& SceneLights::getLightInvViewProjMatrices() const
{
	return lightInvViewProjMatrices;
}

float SceneLights::getCascadeLength(float cameraFar) const
{
	return CalculateCascadeLength(cameraFar, 0);
}

void SceneLights::ChangeLightPos(uint32_t index, IEVector3 position)
{
	lights[index].position[0] = position[0];
	lights[index].position[1] = position[1];
	lights[index].position[2] = position[2];
}

void SceneLights::ChangeLightDir(uint32_t index, IEVector3 direction)
{
	lights[index].direction[0] = direction[0];
	lights[index].direction[1] = direction[1];
	lights[index].direction[2] = direction[2];
}

void SceneLights::ChangeLightColor(uint32_t index, IEVector3 color)
{
	lights[index].color[0] = color[0];
	lights[index].color[1] = color[1];
	lights[index].color[2] = color[2];
}

void SceneLights::ChangeLightRadius(uint32_t index, float radius)
{
	lights[index].direction[3] = radius;
}

void SceneLights::ChangeLightIntensity(uint32_t index, float intensity)
{
	lights[index].color[3] = intensity;
}

void SceneLights::ChangeLightShadow(uint32_t index, bool shadowStatus)
{
	lightShadowCast[index] = shadowStatus;
}

IEVector3 SceneLights::getLightPos(uint32_t index) const
{
	return lights[index].position;
}

LightType SceneLights::getLightType(uint32_t index) const
{
	return static_cast<LightType>(static_cast<int>(lights[index].position.getW()));
}

IEVector3 SceneLights::getLightDir(uint32_t index) const
{
	return lights[index].direction;
}

IEVector3 SceneLights::getLightColor(uint32_t index) const
{
	return lights[index].color;
}

float SceneLights::getLightRadius(uint32_t index) const
{
	return lights[index].direction.getW();
}

float SceneLights::getLightIntensity(uint32_t index) const
{
	return lights[index].color.getW();
}

bool SceneLights::getLightCastShadow(uint32_t index) const
{
	return lightShadowCast[index];
}

void SceneLights::BindLightFramebuffer(uint32_t light)
{
	glBindFramebuffer(GL_FRAMEBUFFER, shadowMapFBOs[light]);
}

void SceneLights::BindViewProjectionMatrices(GLuint bindPoint)
{
	gpuData.BindAsShaderStorageBuffer(bindPoint,
									  static_cast<GLuint>(matrixOffset),
									  static_cast<GLuint>(lightViewProjMatrices.size() * sizeof(IEMatrix4x4)));
}

void SceneLights::BindLightParameters(GLuint bindPoint)
{
	gpuData.BindAsShaderStorageBuffer(bindPoint,
									  static_cast<GLuint>(lightOffset),
									  static_cast<GLuint>(lights.size() * sizeof(Light)));
}

GLuint SceneLights::getGLBuffer()
{
	return gpuData.getGLBuffer();
}

GLuint SceneLights::getShadowTextureCubemapArray()
{
	return lightShadowMaps;
}

GLuint SceneLights::getShadowTextureArrayView()
{
	return shadowMapArrayView;
}

size_t SceneLights::getLightOffset() const
{
	return lightOffset;
}

size_t SceneLights::getLightIndexOffset() const
{
	return lightIndexOffset;
}

size_t SceneLights::getMatrixOffset() const
{
	return matrixOffset;
}

void SceneLights::SendVPMatricesToGPU()
{
	std::copy(reinterpret_cast<uint8_t*>(lightViewProjMatrices.data()),
			  reinterpret_cast<uint8_t*>(lightViewProjMatrices.data() + lightViewProjMatrices.size()),
			  gpuData.CPUData().data() + matrixOffset);
	gpuData.SendSubData(static_cast<uint32_t>(matrixOffset),
						static_cast<uint32_t>(lightViewProjMatrices.size() * sizeof(IEMatrix4x4)));
}

void SceneLights::SendLightDataToGPU()
{
	std::copy(reinterpret_cast<uint8_t*>(lights.data()),
			  reinterpret_cast<uint8_t*>(lights.data() + lights.size()),
			  gpuData.CPUData().data() + lightOffset);
	gpuData.SendSubData(static_cast<uint32_t>(lightOffset),
						static_cast<uint32_t>(lights.size() * sizeof(Light)));
}


text:
package org.ovirt.engine.core.common.queries;

import org.ovirt.engine.core.compat.*;

public class StoragePoolQueryParametersBase extends VdcQueryParametersBase {
    private static final long serialVersionUID = 7256579055993119209L;

    private Guid privateStoragePoolId = Guid.Empty;

    public Guid getStoragePoolId() {
        return privateStoragePoolId;
    }

    private void setStoragePoolId(Guid value) {
        privateStoragePoolId = value;
    }

    public StoragePoolQueryParametersBase(Guid storagePoolId) {
        setStoragePoolId(storagePoolId);
    }

    public StoragePoolQueryParametersBase() {
    }
}


text:
package org.testobject.kernel.imgproc.classifier;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.testobject.kernel.imgproc.classifier.TestUtils.classify;

import org.junit.Test;
import org.testobject.kernel.imgproc.classifier.*;
import org.testobject.kernel.imgproc.util.ImageUtil;
import org.testobject.commons.util.config.Debug;
import org.testobject.kernel.imgproc.classifier.Classes.Icon;
import org.testobject.kernel.imgproc.classifier.Classes.TextParagraph;
import org.testobject.kernel.imgproc.classifier.TestUtils.Result;

/**
 *
 * @author enijkamp
 *
 */
public class TextParagraphClassifierTest
{
	public static final boolean DEBUG = Debug.toDebugMode(false);

	@Test
	public void testTweet() throws Throwable
	{
		// classify
		Classifier[] before = {
				new GroupClassifier(),
				new TextCharClassifier(),
				new TextWordClassifier(),
				new TextLineClassifier(),
		};

		// classify
		Result<Icon> result = classify(ImageUtil.read(toTwitterPath("tweet.png")), before, new TextParagraphClassifier(), DEBUG);

		// assert
		assertThat(result.widgets.isEmpty(), is(false));
		assertThat(result.widgets.peek().cls, is(TextParagraph.class));

		// TODO check content (en)
		TextParagraph para = (TextParagraph) result.widgets.peek().cls;
	}

	private static String toTwitterPath(String file) {
		return "android/4_0_3/classifier/textline/positives/" + file;
	}
}


text:
package com.intel.realsense.librealsense;

import android.graphics.Rect;
import android.opengl.GLES10;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;

public class GLPointsFrame extends GLFrame {
    private Frame mTexture;
    private IntBuffer mGlTexture;
    private float mDeltaX = 0;
    private float mDeltaY = 0;
    private float mRotationFactor = 0.1f;

    public synchronized void setTextureFrame(Frame frame) {
        if(mTexture != null)
            mTexture.close();
        mTexture = frame.clone();
    }
    public int getTexture() { return mGlTexture.array()[0]; }

    private void drawPoints(float[] verArray, byte[] colorArray)
    {
        if(colorArray != null){
            ByteBuffer tex = ByteBuffer.allocateDirect(colorArray.length);
            tex.order(ByteOrder.nativeOrder());
            tex.put(colorArray);
            tex.position(0);

            GLES10.glEnableClientState(GLES10.GL_COLOR_ARRAY);
            GLES10.glColorPointer(4, GLES10.GL_UNSIGNED_BYTE, 0, tex);
        }

        ByteBuffer ver = ByteBuffer.allocateDirect(verArray.length * 4);
        ver.order(ByteOrder.nativeOrder());
        ver.asFloatBuffer().put(verArray);

        GLES10.glEnableClientState(GLES10.GL_VERTEX_ARRAY);
        GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 0, ver);
        GLES10.glDrawArrays(GLES10.GL_POINTS,0,verArray.length / 3);

        GLES10.glDisableClientState(GLES10.GL_VERTEX_ARRAY);
        if(colorArray != null)
            GLES10.glDisableClientState(GLES10.GL_COLOR_ARRAY);
    }

    @Override
    public synchronized void draw(Rect rect)
    {
        if (mFrame == null || !(mFrame.is(Extension.POINTS)))
            return;

        setViewport(rect);

        GLES10.glMatrixMode(GLES10.GL_PROJECTION);
        GLES10.glPushMatrix();
        GLES10.glLoadIdentity();

        GLES10.glOrthof(1f, -1f, -1f, 1f, -7f, 0f);

        GLES10.glRotatef(180, 0.0f, 0.0f, 1.0f);
        GLES10.glRotatef(-mDeltaY * mRotationFactor, 1.0f, 0.0f, 0.0f);
        GLES10.glRotatef(mDeltaX * mRotationFactor, 0.0f, 1.0f, 0.0f);

        Points points = mFrame.as(Extension.POINTS);
        float[] data = points.getVertices();
        byte[] tex = mTexture == null ? createTexture(data, 1.2f) : createTexture(points);
        drawPoints(data, tex);

        GLES10.glMatrixMode(GLES10.GL_PROJECTION);
        GLES10.glPopMatrix();
    }

    //fallback to gray scale if no texture is available
    private byte[] createTexture(float[] data, float maxRange){
        int size = data.length / 3;
        byte[] texture = new byte[size * 4];
        for(int i = 0; i < size; i++){
            float z = data[i * 3 + 2];
            byte val = (byte) (z / maxRange * 255);
            for(int j = 0; j < 3; j++)
                texture[i*4+j] = val;
            texture[i*4+3] = (byte) 255;
        }
        return texture;
    }

    public byte[] createTexture(Points points){
        if(mTexture == null)
            return null;

        VideoFrame vf = mTexture.as(Extension.VIDEO_FRAME);
        int textureSize = vf.getWidth() * vf.getHeight();
        int pointCount = points.getCount();
        float[] pointsData = points.getVertices();
        byte[] textureData = new byte[textureSize * 3];
        byte[] texture = new byte[pointCount * 4];
        float[] textureCoordinates = points.getTextureCoordinates();

        vf.getData(textureData);
        int w = vf.getWidth();
        int h = vf.getHeight();
        for(int i = 0; i < pointCount; i++){
            if(pointsData[i * 3 + 2] == 0)
                continue;
            float x = (float) Math.round(textureCoordinates[2 * i] * w);
            float y = (float) Math.round(textureCoordinates[2 * i + 1] * h);
            if(x <= 0 || y <= 0 || x >= w || y >= h)
                continue;
            long texIndex = (long) (x + y * w);
            for(int j = 0; j < 3; j++)
                texture[i*4+j] = textureData[(int) (texIndex * 3 + j)];
            texture[i*4+3] = (byte) 255;
        }
        return texture;
    }

    @Override
    public synchronized void close() {
        if(mFrame != null)
            mFrame.close();

        if (mTexture != null) {
            mTexture.close();
            mTexture = null;
        }

        if(mGlTexture != null)
            GLES10.glDeleteTextures(1, mGlTexture);
        mGlTexture = null;
    }

    public synchronized void rotate(float deltaX, float deltaY) {
        mDeltaX += deltaX;
        mDeltaY += deltaY;
    }
}


text:
require 'aws-sdk'
require 'yaml'

exit false unless ARGV && ARGV.length >= 1

hostname = ARGV[0]
ec2 = Aws::EC2::Client.new
result = ec2.describe_instances filters: [
  {
    name: 'private-dns-name',
    values: [hostname]
  }
]

# Make sure instance asking is AWS instance
return if !result.reservations.any? || !result.reservations.first.instances.any?

instance = result.reservations.first.instances.first
class_tag = instance.tags.find { |tag| tag.key == 'Puppet Classes' }
classes = class_tag.value.split(',')
node_definition = { classes: classes }

# Output node definition
puts node_definition.to_yaml


text:
import os
import sys
import time
import uuid
import logging

from .RuleModel import PolicyRuleModel
from .RuleTableModel import PolicyRuleTableModel
from policies.pypelib.parsing.ParseEngine import ParseEngine
from policies.pypelib.Rule import Rule
from policies.pypelib.RuleTable import*
from policies.pypelib.resolver.Resolver import Resolver
from policies.pypelib.utils.Logger import Logger
from policies.pypelib.utils.Exceptions import *

from utils.commonbase import DB_SESSION

from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
from sqlalchemy import DateTime, create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import exists

'''
        @author: SergioVidiella
	@organization: i2CAT, OFELIA FP7

	SQLAlchemy backend driver
	Implementes SQLAlchemy model-based backend
'''

#XXX: SQLAlchemy is required to run this driver
class SQLAlchemy():

	logger = Logger.getLogger()
	#Driver attributes
	_types = ["Rule","RuleTable"]

	def __init__(self):
		raise Exception("Static class cannot be instanciated")

	'''
	Stores object
	@params:
		parser - parser to be used
	@returns persisted instance
	'''
	@staticmethod
	def save(obj, parser):

		if parser == None:
			parser = obj._parser
		try:
			ruleTable = DB_SESSION.query(PolicyRuleTableModel).filter(PolicyRuleTableModel.name == obj.name).first()
			ruleTable.type = obj._policy
			ruleTable.defaultParser = obj._parser
			ruleTable.defaultPersistence = obj._persistenceBackend
			ruleTable.defaultPersistenceFlag = obj._persist
			DB_SESSION.add(ruleTable)
			DB_SESSION.commit()
			DB_SESSION.expunge(ruleTable)
		except:
			ruleTable = PolicyRuleTableModel(name = obj.name, uuid = obj.uuid, type = obj._policy, defaultParser = parser, defaultPersistence = obj._persistenceBackend, defaultPersistenceFlag = obj._persist)

			DB_SESSION.add(ruleTable)
			DB_SESSION.commit()
			DB_SESSION.expunge(ruleTable)

		#flag to know if save comes from addRule or removeRule()
		addRule = 0
		uuidInRuleSet=list()
		for rule in obj._ruleSet:

			#need to removeRule later
			uuidInRuleSet.append(rule.rule.getUUID())
			#lbergesio: Rule is saved parsed, as a string
			#Possibly if Rule exists (try) it is not required to update its fields.==>
			#==> IT IS NEEDED FOR THE RuleTable.moveRule()
			try:
				ruleModel = DB_SESSION.query(PolicyRuleModel).filter(PolicyRuleModel.RuleUUID == rule.rule.getUUID()).first()
			except:
				# If #Rules == #Models then it is the PolicyRuleTableModel being
				# deleted, not the PolicyRuleModel (last is the normal case)
				if len(obj._ruleSet) != DB_SESSION.query(PolicyRuleModel).all().count():
				    addRule = 1
				    ruleModel = DB_SESSION.query(PolicyRuleModel).filter(PolicyRuleModel.RuleUUID == rule.rule.getUUID()).first()

			ruleModel.RuleTableName = obj.name
			ruleModel.Rule = ParseEngine.craftRule(rule.rule, obj._parser)
			ruleModel.RuleIsEnabled = rule.enabled
			ruleModel.RulePosition = obj._ruleSet.index(rule)
			DB_SESSION.add(ruleModel)
			DB_SESSION.commit()
			DB_SESSION.expunge_all()
		#if the save() comes from a removeRule, check which one was removed and delete
		if not addRule:
			for ruleModel in DB_SESSION.query(PolicyRuleModel).filter(PolicyRuleModel.RuleTableName == obj.name).all():
				if ruleModel.RuleUUID not in uuidInRuleSet:
					DB_SESSION.delete(ruleModel)
					DB_SESSION.commit()
					DB_SESSION.expunge_all()
					break
			DB_SESSION.expunge_all()

	@staticmethod
	def load(tableName, mappings, parser):
		SQLAlchemy.logger.info('SQLAlchemy.load')
		try:
			Table =  DB_SESSION.query(PolicyRuleTableModel).filter(PolicyRuleTableModel.name == tableName).one()
		# Translation of exceptions: SQLAlchemy -> PyPElib
		except NoResultFound:
			raise ZeroPolicyObjectsReturned("[SQLAlchemy Driver] There is no table with name: " + tableName)
		except MultipleResultsFound:
			raise MultiplePolicyObjectsReturned("[SQLAlchemy Driver] There are multiple tables with name: " + tableName)
		except Exception as e:
			raise Exception("[SQLAlchemy Driver] Some error occurred when trying to fetch table table with name: " + tableName + ". Exception: " + str(e))

		ruleTable = RuleTable(Table.name,mappings,Table.defaultParser, Table.defaultPersistence,False, eval(Table.type), Table.uuid)
		ruleTable._ruleSet = SQLAlchemy.loadRuleSet(Table.uuid)
		ruleTable._persist = Table.defaultPersistenceFlag
		ruleTable._mappings = mappings
		ruleTable._resolver = Resolver(mappings)
		return ruleTable

	'''
	Retrieves every PolicyRuleTable object by name.
	This method should be seldom used.
	'''
	@staticmethod
	def loadAll(tableName):
		Django.logger.debug('Loading RuleTable set...')
		try:
			return DB_SESSION.query(PolicyRuleTableModel).filter(PolicyRuleTableModel.name == tableName).order_by(PolicyRuleTableModel.id).all()
		except:
			SQLAlchemy.logger.warning('[SQLAlchemy Driver] Could not retrieve any PolicyRuleTable object by the name: %s' % tableName)
			DB_SESSION.expunge_all()
			return list()

        '''
        Deletes a PolicyRuleTable object for a given ID.
        This method should be seldom used.
        '''
        @staticmethod
        def delete(tableID):
                SQLAlchemy.logger.debug('Deleting RuleTable with id = %s...' % tableID)
                try:
                        table = DB_SESSION.query(PolicyRuleTableModel).filter(PolicyRuleTableModel.id == tableID).first()
			# If this is the latest PolicyRuleTable, delete its associated PolicyRule's
			if DB_SESSION.query(PolicyRuleTableModel).filter(PolicyRuleTableModel.name==table.name).count() == 1:
				PolicyRuleModel.objects.filter(RuleTableName=table.name).delete()
			DB_SESSION.delete(table)
			DB_SESSION.commit()
			DB_SESSION.expunge_all()
                except Exception as e:
                        SQLAlchemy.logger.warning('[SQLAlchemy Driver] Could not delete the PolicyRuleTable object with ID: %s. Exception: %s' % (tableID,str(e)))

	@staticmethod
	def loadRuleSet(table_uuid):
		SQLAlchemy.logger.debug('Loading Rule set...')
		try:
			ruleTable = DB_SESSION.query(PolicyRuleTableModel).filter(PolicyRuleTableModel.uuid == table_uuid).first()
		except:
			return list()
		rules = DB_SESSION.query(PolicyRuleModel).filter(PolicyRuleModel.RuleTableName == ruleTable.name).order_by(PolicyRuleModel.RulePosition).all()
		ruleSet = []
		#The rules sort by priority
		for rule in rules:
			ruleObj= ParseEngine.parseRule(rule.Rule)
			ruleObj._uuid = rule.RuleUUID
			ruleEntry = RuleEntry(ruleObj,rule.RuleIsEnabled)
			ruleSet.append(ruleEntry)
		DB_SESSION.expunge_all()
		return ruleSet


text:
using System.Runtime.CompilerServices;

namespace System {

	/// <summary>
	/// The double data type which is mapped to the Number type in Javascript.
	/// </summary>
	[IgnoreNamespace]
	[Imported(ObeysTypeSystem = true)]
	[ScriptName("Number")]
	public struct Double : IComparable<Double>, IEquatable<Double>, IFormattable {
		[InlineCode("0")]
		public Double(DummyTypeUsedToAddAttributeToDefaultValueTypeConstructor _) {
		}

		[ScriptName("MAX_VALUE")]
		public const double MaxValue = 0;

		[ScriptName("MIN_VALUE")]
		public const double MinValue = 0;

		[PreserveCase]
		public const double NaN = 0;

		[ScriptName("NEGATIVE_INFINITY")]
		public const double NegativeInfinity = 0;

		[ScriptName("POSITIVE_INFINITY")]
		public const double PositiveInfinity = 0;

		[InlineCode("{$System.Script}.formatNumber({this}, {format})")]
		public string Format(string format) {
			return null;
		}

		[InlineCode("{$System.Script}.formatNumber({this}, {format})")]
		public string ToString(string format) {
			return null;
		}

		[InlineCode("{$System.Script}.localeFormatNumber({this}, {format})")]
		public string LocaleFormat(string format) {
			return null;
		}

		[ScriptAlias("parseFloat")]
		public static double Parse(string s) {
			return 0;
		}

		/// <summary>
		/// Returns a string containing the value represented in exponential notation.
		/// </summary>
		/// <returns>The exponential representation</returns>
		public string ToExponential() {
			return null;
		}

		/// <summary>
		/// Returns a string containing the value represented in exponential notation.
		/// </summary>
		/// <param name="fractionDigits">The number of digits after the decimal point from 0 - 20</param>
		/// <returns>The exponential representation</returns>
		public string ToExponential(int fractionDigits) {
			return null;
		}

		/// <summary>
		/// Returns a string representing the value in fixed-point notation.
		/// </summary>
		/// <returns>The fixed-point notation</returns>
		public string ToFixed() {
			return null;
		}

		/// <summary>
		/// Returns a string representing the value in fixed-point notation.
		/// </summary>
		/// <param name="fractionDigits">The number of digits after the decimal point from 0 - 20</param>
		/// <returns>The fixed-point notation</returns>
		public string ToFixed(int fractionDigits) {
			return null;
		}

		/// <summary>
		/// Returns a string containing the value represented either in exponential or
		/// fixed-point notation with a specified number of digits.
		/// </summary>
		/// <returns>The string representation of the value.</returns>
		public string ToPrecision() {
			return null;
		}

		/// <summary>
		/// Returns a string containing the value represented either in exponential or
		/// fixed-point notation with a specified number of digits.
		/// </summary>
		/// <param name="precision">The number of significant digits (in the range 1 to 21)</param>
		/// <returns>The string representation of the value.</returns>
		public string ToPrecision(int precision) {
			return null;
		}

		[ScriptAlias("isFinite")]
		public static bool IsFinite(double d) {
			return false;
		}

		[ScriptAlias("isNaN")]
		public static bool IsNaN(double d) {
			return false;
		}

		[InlineCode("{$System.Script}.compare({this}, {other})")]
		public int CompareTo(double other) {
			return 0;
		}

		[InlineCode("{$System.Script}.equalsT({this}, {other})")]
		public bool Equals(double other) {
			return false;
		}
	}
}


text:
package com.rocketfuel.sdbc.config

import com.typesafe.config.Config

trait HasConfig {
  def config: Config
}


text:
package org.virtue.game.entity.player.interactions;

import java.util.EnumMap;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.virtue.game.entity.Entity;
import org.virtue.game.entity.player.Player;
import org.virtue.network.event.context.impl.in.OptionButton;

/**
 * @author Im Frizzy <skype:kfriz1998>
 * @author Frosty Teh Snowman <skype:travis.mccorkle>
 * @author Arthur <skype:arthur.behesnilian>
 * @author Kayla <skype:ashbysmith1996>
 * @author Sundays211
 * @since 14/01/2015
 */
public class PlayerInteractions {

	public static enum PlayerOption {
		ATTACK(OptionButton.ONE, "Attack", -1, false, true),
		FOLLOW(OptionButton.TWO, "Follow", -1, false, true),
		TRADE(OptionButton.FOUR, "Trade with", -1, false, false),
		EXAMINE(OptionButton.EIGHT, "Examine", -1, false, true),
		CHALLENGE(OptionButton.ONE, "Challenge", -1, false, true),
		REMOVE_ATTACK(OptionButton.ONE, "null", -1, false, true);

		private final OptionButton button;
		private final String text;
		private final int cursor;
		private final boolean onTop;
		private final boolean isDistance;

		private PlayerOption (OptionButton button, String text, int cursor, boolean onTop, boolean distance) {
			this.button = button;
			this.text = text;
			this.cursor = cursor;
			this.onTop = onTop;
			this.isDistance = distance;
		}
	}

	private Player player;
	private EnumMap<OptionButton, PlayerOption> options = new EnumMap<OptionButton, PlayerOption>(OptionButton.class);

	private EnumMap<OptionButton, PlayerOptionHandler> handlers = new EnumMap<OptionButton, PlayerOptionHandler>(OptionButton.class);

	private Map<Integer, PlayerTargetHandler> widgetHandlers = new HashMap<Integer, PlayerTargetHandler>();

	private EnumMap<OptionButton, Set<Player>> availablePlayers = new EnumMap<OptionButton, Set<Player>>(OptionButton.class);

	private Entity currentTarget;

	public PlayerInteractions (Player player) {
		this.player = player;
	}

	public void initialise() {
		//addOption(PlayerOption.ATTACK, new PlayerAttackHandler());
		addOption(PlayerOption.FOLLOW, new FollowHandler());
		addOption(PlayerOption.TRADE, new TradeHandler());
		addOption(PlayerOption.EXAMINE, new PlayerExamineHandler());
		bindHandler(OptionButton.NINE, new ClanInviteResponse());
		//bindWidgetHandler(new PlayerAbilityHandler());
		bindWidgetHandler(new ClanRecruitAction());
		sendOptions();
	}

	public void sendOptions () {
		for (PlayerOption option : options.values()) {
			player.getDispatcher().sendPlayerOption(option.button, option.text, option.cursor, option.onTop);
		}
	}

	public void addOption (PlayerOption option, PlayerOptionHandler handler) {
		options.put(option.button, option);
		if (handler != null) {
			bindHandler(option.button, handler);
		}
	}

	public void bindHandler (OptionButton option, PlayerOptionHandler handler) {
		handlers.put(option, handler);
	}

	public void bindWidgetHandler (PlayerTargetHandler handler) {
		for (int id : handler.getInterfaceIDs()) {
			widgetHandlers.put(id, handler);
		}
	}

	public boolean isDistanceOption (OptionButton button) {
		if (options.containsKey(button)) {
			return options.get(button).isDistance;
		}
		return true;
	}

	public void addPossiblePlayer (OptionButton button, Player player) {
		if (!availablePlayers.containsKey(button)) {
			availablePlayers.put(button, new HashSet<Player>());
		}
		availablePlayers.get(button).add(player);
	}

	public boolean isPossiblePlayer (OptionButton button, Entity player) {
		if (!availablePlayers.containsKey(button)) {
			return false;
		}
		return availablePlayers.get(button).contains(player);
	}

	public void removePossiblePlayer (OptionButton button, Entity player) {
		if (!availablePlayers.containsKey(button)) {
			return;
		}
		availablePlayers.get(button).remove(player);
	}

	/**
	 * Runs an interaction with the target player
	 * @param target The player to interact with
	 * @param button The selected option
	 * @return True if the interaction was successful, false otherwise
	 */
	public boolean interactWith (Player target, OptionButton button) {
		PlayerOptionHandler handler = handlers.get(button);
		if (handler != null) {
			return handler.interact(player, target);
		} else {
			return false;
		}
	}

	public int interfaceOnPlayerRange (int interfaceID, int compID, int slot, int itemID) {
		if (widgetHandlers.containsKey(interfaceID)) {
			widgetHandlers.get(interfaceID).getRange(player, interfaceID, compID, slot, itemID);
		}
		return 1;
	}

	public boolean handleInterfaceOnPlayer (Player target, int interfaceID, int compID, int slot, int itemID) {
		if (widgetHandlers.containsKey(interfaceID)) {
			return widgetHandlers.get(interfaceID).handle(player, interfaceID, compID, slot, itemID, target);
		}
		return false;
	}

	public void setCurrentTarget (Entity target) {
		this.currentTarget = target;
	}

	public Entity getCurrentTarget () {
		return currentTarget;
	}
}


text:
//
//  CATSampleProgressView.h
//  CATSampleProgressView
//
//  Created by wit on 15/3/23.
//  Copyright (c) 2015年 cat. All rights reserved.
//

#import <UIKit/UIKit.h>

/** a sample of progress ring view */
@interface CATSampleProgressView : UIControl
/** progress */
@property (assign, nonatomic) CGFloat progress;
/** progress interval */
@property (assign, nonatomic) CGFloat interval;
/**
 set progress
 @param progress progress value
 @param animated animated or not
 */
- (void)setProgress:(CGFloat)progress animated:(BOOL)animated;
@end


text:
<?php
/**
 *
 * archive.php
 *
 * The archive template. Used when a category, author, or date is queried.
 * Note that this template will be overridden by category.php, author.php, and date.php for their respective query types.
 *
 * More detailed information about template's hierarchy: http://codex.wordpress.org/Template_Hierarchy
 *
 */
get_header(); ?>
			<?php get_sidebar('top'); ?>
			<?php
			if (have_posts()) {
				global $posts;
				$post = $posts[0];
				theme_ob_start();

				if (is_category()) {
					echo '
' . single_cat_title('', false) . '
';
					echo category_description();
				} elseif (is_tag()) {
					echo '
' . single_tag_title('', false) . '
';
				} elseif (is_day()) {
					echo '
' . sprintf(__('Daily Archives: %s', THEME_NS), get_the_date()) . '
';
				} elseif (is_month()) {
					echo '
' . sprintf(__('Monthly Archives: %s', THEME_NS), get_the_date('F Y')) . '
';
				} elseif (is_year()) {
					echo '
' . sprintf(__('Yearly Archives: %s', THEME_NS), get_the_date('Y')) . '
';
				} elseif (is_author()) {
					the_post();
					echo theme_get_avatar(array('id' => get_the_author_meta('user_email')));
					echo '
' . get_the_author() . '
';
					$desc = get_the_author_meta('description');
					if ($desc) {
						echo '
' . $desc . '
';
					}
					rewind_posts();
				} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
					echo '
' . __('Blog Archives', THEME_NS) . '
';
				}
				theme_post_wrapper(array('content' => theme_ob_get_clean(), 'class' => 'breadcrumbs'));

				/* Display navigation to next/previous pages when applicable */
				if (theme_get_option('theme_top_posts_navigation')) {
					theme_page_navigation();
				}

				/* Start the Loop */
				while (have_posts()) {
					the_post();
					get_template_part('content', get_post_format());
				}

				/* Display navigation to next/previous pages when applicable */
				if (theme_get_option('theme_bottom_posts_navigation')) {
					theme_page_navigation();
				}
			} else {
				theme_404_content();
			}
			?>
			<?php get_sidebar('bottom'); ?>
<?php get_footer();


text:
// SpringSecurityUI namespace
if (typeof SpringSecurityUI == 'undefined') {
	SpringSecurityUI = new Object();

	/**
	 * Displays a message.
	 * @param  type  the type of message
	 * @param  text  the message text
	 * @param  duration  how long to display the message
	 */
	/*public*/ SpringSecurityUI.message = function(type, text, duration) {
		var clazz = 'icon '
		if (type == 'error') {
			clazz += 'icon_error';
		}
		else if (type == 'info') {
			clazz += 'icon_info';
		}
		$.jGrowl('' + text + '', {
			life: duration
		});
	};
}