text:
package com.b2international.snowowl.core.request;

import static com.google.common.collect.Maps.newHashMap;

import java.util.*;
import java.util.Map.Entry;

import com.b2international.commons.collections.Collections3;
import com.b2international.commons.exceptions.AlreadyExistsException;
import com.b2international.commons.exceptions.BadRequestException;
import com.b2international.commons.exceptions.CycleDetectedException;
import com.b2international.commons.exceptions.NotFoundException;
import com.b2international.snowowl.core.Resource;
import com.b2international.snowowl.core.Resources;
import com.b2international.snowowl.core.ServiceProvider;
import com.b2international.snowowl.core.bundle.Bundle;
import com.b2international.snowowl.core.bundle.Bundles;
import com.b2international.snowowl.core.domain.IComponent;
import com.b2international.snowowl.core.domain.TransactionContext;
import com.b2international.snowowl.core.events.Request;
import com.b2international.snowowl.core.internal.ResourceDocument;
import com.b2international.snowowl.core.internal.ResourceDocument.Builder;
import com.b2international.snowowl.core.internal.ResourceRepository;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;

/**
 * @since 8.0
 */
public abstract class BaseResourceUpdateRequest extends UpdateRequest<TransactionContext> {

	private static final long serialVersionUID = 2L;

	@JsonProperty
	private String url;

	@JsonProperty
	private String title;

	@JsonProperty
	private String language;

	@JsonProperty
	private String description;

	@JsonProperty
	private String status;

	@JsonProperty
	private String copyright;

	@JsonProperty
	private String owner;

	@JsonProperty
	private String contact;

	@JsonProperty
	private String usage;

	@JsonProperty
	private String purpose;

	@JsonProperty
	private String bundleId;

	@JsonProperty
	private Map<String, Object> settings;

	private transient ResourceDocument resource;

	protected final void setUrl(String url) {
		this.url = url;
	}

	protected final void setTitle(String title) {
		this.title = title;
	}

	protected final void setLanguage(String language) {
		this.language = language;
	}

	protected final void setDescription(String description) {
		this.description = description;
	}

	protected final void setStatus(String status) {
		this.status = status;
	}

	protected final void setCopyright(String copyright) {
		this.copyright = copyright;
	}

	protected final void setOwner(String owner) {
		this.owner = owner;
	}

	protected final void setContact(String contact) {
		this.contact = contact;
	}

	protected final void setUsage(String usage) {
		this.usage = usage;
	}

	protected final void setPurpose(String purpose) {
		this.purpose = purpose;
	}

	protected final void setBundleId(String bundleId) {
		this.bundleId = bundleId;
	}

	protected final void setSettings(Map<String, Object> settings) {
		this.settings = settings;
	}

	protected BaseResourceUpdateRequest(String componentId) {
		super(componentId);
	}

	@Override
	public final Boolean execute(TransactionContext context) {
		if (resource == null) {
			resource = context.lookup(componentId(), ResourceDocument.class);
		}
		final ResourceDocument.Builder updated = ResourceDocument.builder(resource);

		boolean changed = false;

		changed |= updateSpecializedProperties(context, resource, updated);
		changed |= updateSettings(resource, updated);

		// url checked against all resources
		if (url != null && !url.equals(resource.getUrl())) {
			if (url.isBlank()) {
				throw new BadRequestException("Resource.url should not be empty string");
			}

			final boolean existingUrl = ResourceRequests.prepareSearch()
				.setLimit(0)
				.filterByUrl(url)
				.build()
				.execute(context)
				.getTotal() > 0;

			if (existingUrl) {
				throw new AlreadyExistsException("Resource", ResourceDocument.Fields.URL, url);
			}

			changed |= updateProperty(url, resource::getUrl, updated::url);
		}

		changed |= updateBundle(context, resource.getId(), resource.getBundleId(), updated);

		changed |= updateProperty(title, resource::getTitle, updated::title);
		changed |= updateProperty(language, resource::getLanguage, updated::language);
		changed |= updateProperty(description, resource::getDescription, updated::description);
		changed |= updateProperty(status, resource::getStatus, updated::status);
		changed |= updateProperty(copyright, resource::getCopyright, updated::copyright);
		changed |= updateProperty(owner, resource::getOwner, updated::owner);
		changed |= updateProperty(contact, resource::getContact, updated::contact);
		changed |= updateProperty(usage, resource::getUsage, updated::usage);
		changed |= updateProperty(purpose, resource::getPurpose, updated::purpose);

		if (changed) {
			// make sure we null out the updatedAt property we before update
			updated.updatedAt(null);
			context.update(resource, updated.build());
		}

		return changed;
	}

	private boolean updateBundle(TransactionContext context, String resourceId, String oldBundleId, Builder updated) {
		if (bundleId == null || bundleId.equals(oldBundleId)) {
			return false;
		}

		final List<String> bundleAncestorIds = getBundleAncestorIds(context, resourceId);
		updated.bundleId(bundleId);
		updated.bundleAncestorIds(bundleAncestorIds);

		// Update bundle ancestor IDs on all descendants of the resource (their bundle ID does not change)
		final Iterator<Resource> descendants = ResourceRequests.prepareSearch()
			.filterByBundleAncestorId(resourceId)
			.setLimit(5_000)
			.stream(context)
			.flatMap(Resources::stream)
			.iterator();

		final Multimap<String, Resource> resourcesByParentId = Multimaps.index(descendants, Resource::getBundleId);

		// Calculate new ancestor ID list for direct children of this resource first
		final ImmutableList.Builder<String> ancestorIdsOfParent = ImmutableList.<String>builder().addAll(bundleAncestorIds);
		if (!IComponent.ROOT_ID.equals(bundleId)) {
			ancestorIdsOfParent.add(bundleId);
		}

		final Map<String, List<String>> newAncestorIdsByParentId = newHashMap(Map.of(resourceId, ancestorIdsOfParent.build()));

		// Start processing ancestor ID lists with the direct children of the resource
		final Deque<Map.Entry<String, Collection<Resource>>> toProcess = new ArrayDeque<>();
		toProcess.addLast(new AbstractMap.SimpleImmutableEntry<>(resourceId, resourcesByParentId.get(resourceId)));

		while (!toProcess.isEmpty()) {
			final Entry<String, Collection<Resource>> entry = toProcess.removeFirst();
			final String parentId = entry.getKey();
			final Collection<Resource> resources = entry.getValue();

			/*
			 * XXX: We will use the same ancestor ID list for all sibling resources. The
			 * call removes the entry from the map as it will never be read again after this
			 * iteration.
			 */
			final List<String> newAncestorIds = newAncestorIdsByParentId.remove(parentId);

			for (final Resource current : resources) {
				final String id = current.getId();
				final ResourceDocument resource = context.lookup(id, ResourceDocument.class);
				final ResourceDocument.Builder resourceBuilder = ResourceDocument.builder(resource);

				if (!Objects.equals(resource.getBundleAncestorIds(), newAncestorIds)) {
					resourceBuilder.bundleAncestorIds(newAncestorIds);
					context.update(resource, resourceBuilder.build());
				}

				final Collection<Resource> next = resourcesByParentId.get(id);
				if (!next.isEmpty()) {
					/*
					 * If the current resource has any children, make a note that we have to update
					 * bundleAncestorIds for them as well. The bundleId for these resources remains
					 * "id".
					 */
					final List<String> nextAncestorIds = ImmutableList.<String>builder()
						.addAll(newAncestorIds)
						.add(parentId)
						.build();

					newAncestorIdsByParentId.put(id, nextAncestorIds);
					toProcess.add(new AbstractMap.SimpleImmutableEntry<>(id, next));
				}
			}
		}

		return true;
	}

	private boolean updateSettings(final ResourceDocument resource, final ResourceDocument.Builder updated) {
		if (settings == null || settings.isEmpty()) {
			return false;
		}

		// Get mutable copy of existing settings, or an empty map for starters
		final Map<String, Object> updatedSettings = Optional.ofNullable(resource.getSettings())
				.map(Maps::newHashMap)
				.orElse(Maps.newHashMap());

		boolean changed = false;

		// Remove null values from map
		final Set<String> keysToRemove = Maps.filterValues(settings, v -> v == null).keySet();
		for (final String key : keysToRemove) {
			changed |= (updatedSettings.remove(key) != null);
		}

		// Merge (add or modify) non-null values
		final Set<String> keysToUpdate = Maps.filterValues(settings, v -> v != null).keySet();
		for (final String key : keysToUpdate) {
			changed |= updateProperty(settings.get(key), 			// value
					() -> updatedSettings.get(key),                 // getter
					value -> updatedSettings.put(key, value));      // setter
		}

		if (changed) {
			updated.settings(updatedSettings);
		}

		return changed;
	}

	private List<String> getBundleAncestorIds(final TransactionContext context, final String resourceId) {
		if (IComponent.ROOT_ID.equals(bundleId)) {
			return List.of(bundleId);
		}

		final Bundles bundles = ResourceRequests.bundles()
			.prepareSearch()
			.filterById(bundleId)
			.one()
			.build()
			.execute(context);

		if (bundles.getTotal() == 0) {
			throw new NotFoundException("Bundle parent", bundleId).toBadRequestException();
		}

		final Bundle parentBundle = bundles.first().get();
		if (parentBundle.getBundleId().equals(resourceId) || parentBundle.getBundleAncestorIds().contains(resourceId)) {
			throw new CycleDetectedException("Setting parent bundle ID to '" + bundleId + "' would create a loop.");
		}

		return parentBundle.getResourcePathSegments();
	}

	protected abstract boolean updateSpecializedProperties(TransactionContext context, ResourceDocument resource, Builder updated);

	@Override
	public final void collectAccessedResources(ServiceProvider context, Request<ServiceProvider, ?> req, List<String> accessedResources) {
		if (resource == null) {
			resource = context.service(ResourceRepository.class).read(searcher -> {
				return searcher.get(ResourceDocument.class, componentId());
			});
			if (resource == null) {
				throw new NotFoundException("Resource", componentId());
			}
		}
		accessedResources.add(componentId());
		// permission on any bundle is enough to update the contained resource
		accessedResources.add(resource.getBundleId());
		accessedResources.addAll(Collections3.toImmutableSet(resource.getBundleAncestorIds()));
	}

}


text:
	<title>Sarah Storey's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Sarah Storey's panel show appearances

Sarah Storey (born 1977-10-26[ref]) has appeared in 7 episodes between 2012-2016.  Sarah Storey on Wikipedia.

2012

2013

2014

2015

2016

2016-09-17 / The Last Leg

2016-09-02 / A Question of Sport

2015-10-14 / A Question of Sport

2013-12-20 / A Question of Sport

2013-09-06 / A League Of Their Own

2013-01-27 / A Question of Sport

2012-03-18 / A Question of Sport

redpajama_set_name: RedPajamaGithub


text:
function result = prtTestDecisionBinarySpecifiedPf

% Copyright (c) 2014 CoVar Applied Technologies
%
% Permission is hereby granted, free of charge, to any person obtaining a
% copy of this software and associated documentation files (the
% "Software"), to deal in the Software without restriction, including
% without limitation the rights to use, copy, modify, merge, publish,
% distribute, sublicense, and/or sell copies of the Software, and to permit
% persons to whom the Software is furnished to do so, subject to the
% following conditions:
%
% The above copyright notice and this permission notice shall be included
% in all copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
% OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
% NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
% DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
% OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
% USE OR OTHER DEALINGS IN THE SOFTWARE.

result = true;

dsTrain = prtDataGenUnimodal;
dsTest = prtDataGenUnimodal;

% Try the algorithm technique
try
    algo = prtClassKnn;
    dec  =  prtDecisionBinarySpecifiedPf;
    dec.pf =.5;
    algo = algo + dec;
    algo = algo.train(dsTrain);
    outAlgo = algo.run(dsTest);
catch
    result = false;
    disp('prtDecisionBinarySpecifiedPf algo fail')
end

try
    myKnn = prtClassKnn;
    myKnn.internalDecider = prtDecisionBinarySpecifiedPf;
    myKnn.internalDecider.pf = .5;
    myKnn = myKnn.train(dsTrain);
    outIntDec = myKnn.run(dsTest);
catch
    result = false;
    disp('prtDecisionBinarySpecifiedPf internal dec fail')
    result = false;
end

% check that the results are the same
% Which are the class labels????
if ~isequal(outAlgo.getX, outIntDec.getX)
    result = false;
    disp('prtDecisionBinarySpecifiedPf algo/int not equal')
end

% check that plot works in both cases
try
    algo.plot;
    close all;
catch
    disp('prtDecisionBinarySpecPf algo plot fail');
    close all
    result = false;
end

% check that plot works in both cases
try
    myKnn.plot;
    close all;
catch
    disp('prtDecisionBinarySpecPf internal decider plot fail');
    close all
    result = false;
end

% check that errors when pf not set
try

    dsTrain = prtDataGenUnimodal;
    dsTest = prtDataGenUnimodal;
    myKnn = prtClassKnn;
    myKnn.internalDecider = prtDecisionBinarySpecifiedPf;
    myKnn = myKnn.train(dsTrain);
    outIntDec = myKnn.run(dsTest);
    disp('prtDecisionBinarySpecPf runs with unset pf')
    result = false;
catch
    %noop
end


text:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008-2017. All Rights Reserved.                        */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package edu.wpi.first.wpilibj;

/**
 * This interface allows PIDController to write it's results to its output.
 */
@FunctionalInterface
public interface PIDOutput {

  /**
   * Set the output to the value calculated by PIDController.
   *
   * @param output the value calculated by PIDController
   */
  void pidWrite(double output);
}


text:
#ifndef QWT_SCALE_ENGINE_H
#define QWT_SCALE_ENGINE_H

#include "qwt_global.h"
#include "qwt_scale_div.h"

class QwtInterval;
class QwtTransform;

/*!
  \brief Arithmetic including a tolerance
*/
class QWT_EXPORT QwtScaleArithmetic
{
public:
    static double ceilEps( double value, double intervalSize );
    static double floorEps( double value, double intervalSize );

    static double divideEps( double intervalSize, double numSteps );

    static double divideInterval( double intervalSize,
        int numSteps, uint base );
};

/*!
  \brief Base class for scale engines.

  A scale engine tries to find "reasonable" ranges and step sizes
  for scales.

  The layout of the scale can be varied with setAttribute().

  Qwt offers implementations for logarithmic and linear scales.
*/

class QWT_EXPORT QwtScaleEngine
{
public:
    /*!
       Layout attributes
       \sa setAttribute(), testAttribute(), reference(),
           lowerMargin(), upperMargin()
     */

    enum Attribute
    {
        //! No attributes
        NoAttribute = 0x00,

        //! Build a scale which includes the reference() value.
        IncludeReference = 0x01,

        //! Build a scale which is symmetric to the reference() value.
        Symmetric = 0x02,

        /*!
           The endpoints of the scale are supposed to be equal the
           outmost included values plus the specified margins
           (see setMargins()).
           If this attribute is *not* set, the endpoints of the scale will
           be integer multiples of the step size.
         */
        Floating = 0x04,

        //! Turn the scale upside down.
        Inverted = 0x08
    };

    //! Layout attributes
    typedef QFlags<Attribute> Attributes;

    explicit QwtScaleEngine( uint base = 10 );
    virtual ~QwtScaleEngine();

    void setBase( uint base );
    uint base() const;

    void setAttribute( Attribute, bool on = true );
    bool testAttribute( Attribute ) const;

    void setAttributes( Attributes );
    Attributes attributes() const;

    void setReference( double );
    double reference() const;

    void setMargins( double lower, double upper );
    double lowerMargin() const;
    double upperMargin() const;

    /*!
      Align and divide an interval

      \param maxNumSteps Max. number of steps
      \param x1 First limit of the interval (In/Out)
      \param x2 Second limit of the interval (In/Out)
      \param stepSize Step size (Return value)
    */
    virtual void autoScale( int maxNumSteps,
        double &x1, double &x2, double &stepSize ) const = 0;

    /*!
      \brief Calculate a scale division

      \param x1 First interval limit
      \param x2 Second interval limit
      \param maxMajorSteps Maximum for the number of major steps
      \param maxMinorSteps Maximum number of minor steps
      \param stepSize Step size. If stepSize == 0.0, the scaleEngine
                   calculates one.

      \return Calculated scale division
    */
    virtual QwtScaleDiv divideScale( double x1, double x2,
        int maxMajorSteps, int maxMinorSteps,
        double stepSize = 0.0 ) const = 0;

    void setTransformation( QwtTransform * );
    QwtTransform *transformation() const;

protected:
    bool contains( const QwtInterval &, double value ) const;
    QList<double> strip( const QList<double>&, const QwtInterval & ) const;

    double divideInterval( double intervalSize, int numSteps ) const;

    QwtInterval buildInterval( double value ) const;

private:
    Q_DISABLE_COPY(QwtScaleEngine)

    class PrivateData;
    PrivateData *d_data;
};

/*!
  \brief A scale engine for linear scales

  The step size will fit into the pattern
  \f$\left\{ 1,2,5\right\} \cdot 10^{n}\f$, where n is an integer.
*/

class QWT_EXPORT QwtLinearScaleEngine: public QwtScaleEngine
{
public:
    explicit QwtLinearScaleEngine( uint base = 10 );
    virtual ~QwtLinearScaleEngine();

    virtual void autoScale( int maxNumSteps,
        double &x1, double &x2, double &stepSize ) const QWT_OVERRIDE;

    virtual QwtScaleDiv divideScale( double x1, double x2,
        int maxMajorSteps, int maxMinorSteps,
        double stepSize = 0.0 ) const QWT_OVERRIDE;

protected:
    QwtInterval align( const QwtInterval&, double stepSize ) const;

    void buildTicks(
        const QwtInterval &, double stepSize, int maxMinorSteps,
        QList<double> ticks[QwtScaleDiv::NTickTypes] ) const;

    QList<double> buildMajorTicks(
        const QwtInterval &interval, double stepSize ) const;

    void buildMinorTicks( const QList<double>& majorTicks,
        int maxMinorSteps, double stepSize,
        QList<double> &minorTicks, QList<double> &mediumTicks ) const;
};

/*!
  \brief A scale engine for logarithmic scales

  The step size is measured in *decades*
  and the major step size will be adjusted to fit the pattern
  \f$\left\{ 1,2,3,5\right\} \cdot 10^{n}\f$, where n is a natural number
  including zero.

  \warning the step size as well as the margins are measured in *decades*.
*/

class QWT_EXPORT QwtLogScaleEngine: public QwtScaleEngine
{
public:
    explicit QwtLogScaleEngine( uint base = 10 );
    virtual ~QwtLogScaleEngine();

    virtual void autoScale( int maxNumSteps,
        double &x1, double &x2, double &stepSize ) const QWT_OVERRIDE;

    virtual QwtScaleDiv divideScale( double x1, double x2,
        int maxMajorSteps, int maxMinorSteps,
        double stepSize = 0.0 ) const QWT_OVERRIDE;

protected:
    QwtInterval align( const QwtInterval&, double stepSize ) const;

    void buildTicks(
        const QwtInterval &, double stepSize, int maxMinorSteps,
        QList<double> ticks[QwtScaleDiv::NTickTypes] ) const;

    QList<double> buildMajorTicks(
        const QwtInterval &interval, double stepSize ) const;

    void buildMinorTicks( const QList<double>& majorTicks,
        int maxMinorSteps, double stepSize,
        QList<double> &minorTicks, QList<double> &mediumTicks ) const;
};

Q_DECLARE_OPERATORS_FOR_FLAGS( QwtScaleEngine::Attributes )

#endif


text:
A chatbot guide who could take users through exercises based on Cognitive Behavioral Therapy, which helps people interrupt and reframe negative thought patterns.

It's very transparently non-human.

https://www.woebot.io/


text:
namespace Graphics {
class Specular: public Material {
private:
	void init_ks();
public:
	Colour colour;
	double k_ambient;
	double k_diffuse;
	double k_specular;
	double k_reflective;
	double k_distribution;

	Specular();
	Specular(const Colour &colour);
	Specular(int red, int green, int blue);
	~Specular();

	Colour get_colour(const Vector3 &point, const Vector3 &direction, const Vector3 &normal,
		int depth, bool debug = false);
};
}


text:
"use strict";

const jquery = require("jquery");

// so the tests can mock jQuery
delete require.cache[require.resolve("jquery")];

module.exports = jquery;


text:
using Aliyun.OSS.Model;

namespace Aliyun.OSS
{
    /// <summary>
    /// The result class of the operation to get bucket logging config
    /// </summary>
   public class BucketLoggingResult : GenericResult
    {
       /// <summary>
       /// Target bucket.
       /// </summary>
       public string TargetBucket { get; internal set; }

       /// <summary>
       /// Target logging file's prefix. If it's empty, the OSS system will name the file instead.
       /// </summary>
       public string TargetPrefix { get; internal set; }
    }
}


text:
// This code is auto-generated, do not modify
package com.spectralogic.ds3client.commands;

import com.spectralogic.ds3client.networking.HttpVerb;
import com.spectralogic.ds3client.commands.interfaces.AbstractRequest;

public class GetServiceRequest extends AbstractRequest {

    // Variables

    // Constructor

    public GetServiceRequest() {

    }

    @Override
    public HttpVerb getVerb() {
        return HttpVerb.GET;
    }

    @Override
    public String getPath() {
        return "/";
    }
    }


text:
<?php
/**
 * Tests for the {@link ManifestFileFinder} class.
 *
 * @package framework
 * @subpackage tests
 */
class ManifestFileFinderTest extends SapphireTest {

	protected $base;

	public function __construct() {
		$this->base = dirname(__FILE__) . '/fixtures/manifestfilefinder';
		parent::__construct();
	}

	public function assertFinderFinds($finder, $expect, $message = null) {
		$found = $finder->find($this->base);

		foreach ($expect as $k => $file) {
			$expect[$k] = "{$this->base}/$file";
		}

		sort($expect);
		sort($found);

		$this->assertEquals($expect, $found, $message);
	}

	public function testBasicOperation() {
		$finder = new ManifestFileFinder();
		$finder->setOption('name_regex', '/\.txt$/');

		$this->assertFinderFinds($finder, array(
			'module/module.txt'
		));
	}

	public function testIgnoreTests() {
		$finder = new ManifestFileFinder();
		$finder->setOption('name_regex', '/\.txt$/');
		$finder->setOption('ignore_tests', false);

		$this->assertFinderFinds($finder, array(
			'module/module.txt',
			'module/tests/tests.txt'
		));
	}

	public function testIncludeThemes() {
		$finder = new ManifestFileFinder();
		$finder->setOption('name_regex', '/\.txt$/');
		$finder->setOption('include_themes', true);

		$this->assertFinderFinds($finder, array(
			'module/module.txt',
			'themes/themes.txt'
		));
	}

}


text:
package com.thinkgem.jeesite.common.utils;

import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;

import org.apache.shiro.cache.ehcache.EhCacheManager;

/**
 * Cache工具类
 * @author ThinkGem
 * @version 2013-5-29
 */
public class CacheUtils {

	private static CacheManager cacheManager = ((EhCacheManager)SpringContextHolder.getBean("cacheManager")).getCacheManager();

	private static final String SYS_CACHE = "sysCache";

	public static Object get(String key) {
		return get(SYS_CACHE, key);
	}

	public static void put(String key, Object value) {
		put(SYS_CACHE, key, value);
	}

	public static void remove(String key) {
		remove(SYS_CACHE, key);
	}

	public static Object get(String cacheName, String key) {
		Element element = getCache(cacheName).get(key);
		return element==null?null:element.getObjectValue();
	}

	public static void put(String cacheName, String key, Object value) {
		Element element = new Element(key, value);
		getCache(cacheName).put(element);
	}

	public static void remove(String cacheName, String key) {
		getCache(cacheName).remove(key);
	}

	/**
	 * 获得一个Cache,没有则创建一个。
	 * @param cacheName
	 * @return
	 */
	private static Cache getCache(String cacheName){
		Cache cache = cacheManager.getCache(cacheName);
		if (cache == null){
			cacheManager.addCache(cacheName);
			cache = cacheManager.getCache(cacheName);
			cache.getCacheConfiguration().setEternal(true);
		}
		return cache;
	}

}


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use LucaDegasperi\OAuth2Server\Support\Migration;

class CreateOauthClientEndpointsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $this->schema()->create('oauth_client_endpoints', function (Blueprint $table) {
            $table->increments('id');
            $table->string('client_id', 40);
            $table->string('redirect_uri');

            $table->timestamps();

            $table->unique(['client_id', 'redirect_uri']);

            $table->foreign('client_id')
                ->references('id')->on('oauth_clients')
                ->onDelete('cascade')
                ->onUpdate('cascade');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        $this->schema()->table('oauth_client_endpoints', function (Blueprint $table) {
            $table->dropForeign('oauth_client_endpoints_client_id_foreign');
        });

        $this->schema()->drop('oauth_client_endpoints');
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans         http://www.springframework.org/schema/beans/spring-beans.xsd">
  <bean id="BudgetSubAwards" parent="BudgetSubAwards-parentBean" />
  <bean id="BudgetSubAwards-parentBean" abstract="true" parent="BusinessObjectEntry">
    <property name="businessObjectClass" value="org.kuali.coeus.propdev.impl.budget.subaward.BudgetSubAwards" />
		<property name="objectLabel" value="Budget Subawards" />
    <property name="inquiryDefinition" >
      <ref bean="BudgetSubAwards-inquiryDefinition" />
    </property>
    <property name="lookupDefinition" >
      <ref bean="BudgetSubAwards-lookupDefinition" />
    </property>
    <property name="titleAttribute" value="subAwardNumber" />
    <property name="attributes" >
      <list>
        <ref bean="BudgetSubAwards-subAwardNumber" />
        <ref bean="BudgetSubAwards-comments" />
        <ref bean="BudgetSubAwards-proposalNumber" />
        <ref bean="BudgetSubAwards-budgetVersionNumber" />
        <ref bean="BudgetSubAwards-organizationId" />
        <ref bean="BudgetSubAwards-organizationName" />
        <ref bean="BudgetSubAwards-subAwardStatusCode" />
        <ref bean="BudgetSubAwards-subAwardXfdFileName" />
        <ref bean="BudgetSubAwards-translationComments" />
        <ref bean="BudgetSubAwards-xfdUpdateTimestamp" />
        <ref bean="BudgetSubAwards-xfdUpdateUser" />
        <ref bean="BudgetSubAwards-xmlUpdateTimestamp" />
        <ref bean="BudgetSubAwards-xmlUpdateUser" />
        <ref bean="BudgetSubAwards-versionNumber" />
        <ref bean="BudgetSubAwards-namespace" />
        <ref bean="BudgetSubAwards-formName" />
      </list>
    </property>
  </bean>

<!-- Attribute Definitions -->

  <bean id="BudgetSubAwards-subAwardNumber" parent="BudgetSubAwards-subAwardNumber-parentBean" />

  <bean id="BudgetSubAwards-subAwardNumber-parentBean" abstract="true" parent="AttributeDefinition">
    <property name="name" value="subAwardNumber" />
    <property name="forceUppercase" value="false" />
    <property name="label" value="subAwardNumber" />
    <property name="shortLabel" value="subAwardNumber" />
    <property name="maxLength" value="3" />
    <property name="validationPattern" >
      <bean parent="NumericValidationPattern" />
    </property>
    <property name="validCharactersConstraint">
      <bean parent="NumericPatternConstraint"/>
    </property>
    <property name="control" >
      <bean parent="HiddenControlDefinition" />
    </property>
    <property name="controlField">
      <bean parent="Uif-HiddenControl"/>
    </property>
    <property name="summary" value="subAwardNumber" />
    <property name="description" value="subAwardNumber" />
  </bean>

  <bean id="BudgetSubAwards-comments" parent="BudgetSubAwards-comments-parentBean"/>
  <bean id="BudgetSubAwards-comments-parentBean" abstract="true" parent="AttributeDefinition">
    <property name="name" value="comments" />
    <property name="forceUppercase" value="false" />
    <property name="label" value="Comments" />
    <property name="shortLabel" value="Comments" />
    <property name="maxLength" value="2000" />
    <property name="validationPattern" >
      <bean parent="AnyCharacterValidationPattern" p:allowWhitespace="true"/>
    </property>
    <property name="validCharactersConstraint">
      <bean parent="AnyCharacterPatternConstraint">
        <property name="allowWhitespace" value="true"/>
      </bean>
    </property>
    <property name="control" >
      <bean parent="TextareaControlDefinition" p:rows="3" p:cols="30"/>
    </property>
    <property name="controlField">
      <bean p:rows="3" p:cols="30" parent="Uif-TextAreaControl"/>
    </property>
    <property name="summary" value="Comments" />
    <property name="description" value="Comments" />
  </bean>

  <bean id="BudgetSubAwards-proposalNumber" parent="BudgetSubAwards-proposalNumber-parentBean"/>
  <bean id="BudgetSubAwards-proposalNumber-parentBean" abstract="true" parent="AttributeDefinition">
    <property name="name" value="proposalNumber" />
    <property name="forceUppercase" value="false" />
    <property name="label" value="Proposal Number" />
    <property name="shortLabel" value="Proposal Number" />
    <property name="maxLength" value="12" />
    <property name="validationPattern" >
      <bean parent="AlphaNumericValidationPattern" />
    </property>
    <property name="validCharactersConstraint">
      <bean parent="AlphaNumericPatternConstraint"/>
    </property>
    <property name="control" >
      <bean parent="TextControlDefinition" p:size="12"/>
    </property>
    <property name="controlField">
      <bean p:size="12" parent="Uif-TextControl"/>
    </property>
    <property name="summary" value="Proposal Number" />
    <property name="description" value="Proposal Number" />
  </bean>

  <bean id="BudgetSubAwards-budgetVersionNumber" parent="BudgetSubAwards-budgetVersionNumber-parentBean"/>
  <bean id="BudgetSubAwards-budgetVersionNumber-parentBean" abstract="true" parent="AttributeDefinition">
    <property name="name" value="budgetVersionNumber" />
    <property name="forceUppercase" value="false" />
    <property name="label" value="Budget Version Number" />
    <property name="shortLabel" value="Budget Version Number" />
    <property name="maxLength" value="3" />
    <property name="validationPattern" >
      <bean parent="NumericValidationPattern" />
    </property>
    <property name="validCharactersConstraint">
      <bean parent="NumericPatternConstraint"/>
    </property>
    <property name="control" >
      <bean parent="TextControlDefinition" p:size="3"/>
    </property>
    <property name="controlField">
      <bean p:size="3" parent="Uif-TextControl"/>
    </property>
    <property name="summary" value="Budget Version Number" />
    <property name="description" value="Budget Version Number" />
  </bean>

  <bean id="BudgetSubAwards-organizationId" parent="BudgetSubAwards-organizationId-parentBean"/>
  <bean id="BudgetSubAwards-organizationId-parentBean" abstract="true" parent="Organization-organizationId">
    <property name="name" value="organizationId" />
  </bean>

  <bean id="BudgetSubAwards-organizationName" parent="BudgetSubAwards-organizationName-parentBean"/>
  <bean id="BudgetSubAwards-organizationName-parentBean" abstract="true" parent="Organization-organizationName">
    <property name="name" value="organizationName" />
  </bean>

  <bean id="BudgetSubAwards-subAwardStatusCode" parent="BudgetSubAwards-subAwardStatusCode-parentBean"/>
  <bean id="BudgetSubAwards-subAwardStatusCode-parentBean" abstract="true" parent="AttributeDefinition">
    <property name="name" value="subAwardStatusCode" />
    <property name="forceUppercase" value="false" />
    <property name="label" value="Subaward Status Code" />
    <property name="shortLabel" value="Subaward Status Code" />
    <property name="maxLength" value="3" />
    <property name="validationPattern" >
      <bean parent="NumericValidationPattern" />
    </property>
    <property name="validCharactersConstraint">
      <bean parent="NumericPatternConstraint"/>
    </property>
    <property name="control" >
      <bean parent="TextControlDefinition" p:size="3"/>
    </property>
    <property name="controlField">
      <bean p:size="3" parent="Uif-TextControl"/>
    </property>
    <property name="summary" value="Subaward Status Code" />
    <property name="description" value="Subaward Status Code" />
  </bean>

  <bean id="BudgetSubAwards-subAwardXfdFileName" parent="BudgetSubAwards-subAwardXfdFileName-parentBean"/>
  <bean id="BudgetSubAwards-subAwardXfdFileName-parentBean" abstract="true" parent="AttributeDefinition">
    <property name="name" value="subAwardXfdFileName" />
    <property name="forceUppercase" value="false" />
    <property name="label" value="Subaward PDF File Name" />
    <property name="shortLabel" value="Subaward PDF File Name" />
    <property name="maxLength" value="256" />
    <property name="validationPattern" >
      <bean parent="AnyCharacterValidationPattern" p:allowWhitespace="true"/>
    </property>
    <property name="validCharactersConstraint">
      <bean parent="AnyCharacterPatternConstraint">
        <property name="allowWhitespace" value="true"/>
      </bean>
    </property>
    <property name="control" >
      <bean parent="TextControlDefinition" p:size="256"/>
    </property>
    <property name="controlField">
      <bean p:size="256" parent="Uif-TextControl"/>
    </property>
    <property name="summary" value="Subaward PDF File Name" />
    <property name="description" value="Subaward PDF File Name" />
  </bean>

  <bean id="BudgetSubAwards-translationComments" parent="BudgetSubAwards-translationComments-parentBean"/>
  <bean id="BudgetSubAwards-translationComments-parentBean" abstract="true" parent="AttributeDefinition">
    <property name="name" value="translationComments" />
    <property name="forceUppercase" value="false" />
    <property name="label" value="Translation Comments" />
    <property name="shortLabel" value="Translation Comments" />
    <property name="maxLength" value="2000" />
    <property name="validationPattern" >
      <bean parent="AnyCharacterValidationPattern" p:allowWhitespace="true"/>
    </property>
    <property name="validCharactersConstraint">
      <bean parent="AnyCharacterPatternConstraint">
        <property name="allowWhitespace" value="true"/>
      </bean>
    </property>
    <property name="control" >
      <bean parent="TextareaControlDefinition" p:rows="3" p:cols="30"/>
    </property>
    <property name="controlField">
      <bean p:rows="3" p:cols="30" parent="Uif-TextAreaControl"/>
    </property>
    <property name="summary" value="Translation Comments" />
    <property name="description" value="Translation Comments" />
  </bean>

  <bean id="BudgetSubAwards-xfdUpdateTimestamp" parent="BudgetSubAwards-xfdUpdateTimestamp-parentBean"/>
  <bean id="BudgetSubAwards-xfdUpdateTimestamp-parentBean" abstract="true" parent="AttributeReferenceDummy-genericTimestamp">
    <property name="name" value="xfdUpdateTimestamp" />
    <property name="label" value="Pdf Last Updated" />
  </bean>

  <bean id="BudgetSubAwards-xfdUpdateUser" parent="BudgetSubAwards-xfdUpdateUser-parentBean"/>
  <bean id="BudgetSubAwards-xfdUpdateUser-parentBean" abstract="true" parent="AttributeDefinition">
    <property name="name" value="xfdUpdateUser" />
    <property name="forceUppercase" value="false" />
    <property name="label" value="xfdUpdateUser" />
    <property name="shortLabel" value="xfdUpdateUser" />
    <property name="maxLength" value="60" />
    <property name="validationPattern" >
      <bean parent="AnyCharacterValidationPattern" />
    </property>
    <property name="validCharactersConstraint">
      <bean parent="AnyCharacterPatternConstraint"/>
    </property>
    <property name="required" value="false" />
    <property name="control" >
      <bean parent="TextControlDefinition" p:size="60"/>
    </property>
    <property name="controlField">
      <bean p:size="60" parent="Uif-TextControl"/>
    </property>
    <property name="summary" value="xfdUpdateUser" />
    <property name="description" value="xfdUpdateUser" />
  </bean>

  <bean id="BudgetSubAwards-xmlUpdateTimestamp" parent="BudgetSubAwards-xmlUpdateTimestamp-parentBean"/>
  <bean id="BudgetSubAwards-xmlUpdateTimestamp-parentBean" abstract="true" parent="AttributeReferenceDummy-genericTimestamp">
    <property name="name" value="xmlUpdateTimestamp" />
    <property name="label" value="Xml Last Updated" />
  </bean>

  <bean id="BudgetSubAwards-xmlUpdateUser" parent="BudgetSubAwards-xmlUpdateUser-parentBean"/>
  <bean id="BudgetSubAwards-xmlUpdateUser-parentBean" abstract="true" parent="AttributeDefinition">
    <property name="name" value="xmlUpdateUser" />
    <property name="forceUppercase" value="false" />
    <property name="label" value="xmlUpdateUser" />
    <property name="shortLabel" value="xmlUpdateUser" />
    <property name="maxLength" value="60" />
    <property name="validationPattern" >
      <bean parent="AnyCharacterValidationPattern" />
    </property>
    <property name="validCharactersConstraint">
      <bean parent="AnyCharacterPatternConstraint"/>
    </property>
    <property name="required" value="false" />
    <property name="control" >
      <bean parent="TextControlDefinition" p:size="60"/>
    </property>
    <property name="controlField">
      <bean p:size="60" parent="Uif-TextControl"/>
    </property>
    <property name="summary" value="xmlUpdateUser" />
    <property name="description" value="xmlUpdateUser" />
  </bean>

  <bean id="BudgetSubAwards-versionNumber" parent="BudgetSubAwards-versionNumber-parentBean"/>
  <bean id="BudgetSubAwards-versionNumber-parentBean" abstract="true" parent="AttributeReferenceDummy-versionNumber"/>
  <bean id="BudgetSubAwards-namespace" parent="BudgetSubAwards-namespace-parentBean" />
  <bean id="BudgetSubAwards-namespace-parentBean" abstract="true" parent="AttributeDefinition">
    <property name="name" value="namespace" />
    <property name="forceUppercase" value="false" />
    <property name="label" value="Namespace" />
    <property name="shortLabel" value="Namespace" />
    <property name="maxLength" value="200" />
    <property name="validationPattern" >
      <bean parent="AnyCharacterValidationPattern" p:allowWhitespace="true"/>
    </property>
    <property name="validCharactersConstraint">
      <bean parent="AnyCharacterPatternConstraint">
        <property name="allowWhitespace" value="true"/>
      </bean>
    </property>
    <property name="control" >
      <bean parent="TextControlDefinition" p:size="3"/>
    </property>
    <property name="controlField">
      <bean p:size="3" parent="Uif-TextControl"/>
    </property>
    <property name="summary" value="Namespace" />
    <property name="description" value="Namespace" />
  </bean>

  <bean id="BudgetSubAwards-formName" parent="BudgetSubAwards-formName-parentBean"/>
  <bean id="BudgetSubAwards-formName-parentBean" abstract="true" parent="AttributeDefinition">
    <property name="name" value="formName" />
    <property name="forceUppercase" value="false" />
    <property name="label" value="Form Name" />
    <property name="shortLabel" value="Form Name" />
    <property name="maxLength" value="100" />
    <property name="validationPattern" >
      <bean parent="AnyCharacterValidationPattern" p:allowWhitespace="true"/>
    </property>
    <property name="validCharactersConstraint">
      <bean parent="AnyCharacterPatternConstraint">
        <property name="allowWhitespace" value="true"/>
      </bean>
    </property>
    <property name="control" >
      <bean parent="TextControlDefinition" p:size="3"/>
    </property>
    <property name="controlField">
      <bean p:size="3" parent="Uif-TextControl"/>
    </property>
    <property name="summary" value="Form Name" />
    <property name="description" value="Form Name" />
  </bean>

<!-- Business Object Inquiry Definition -->
  <bean id="BudgetSubAwards-inquiryDefinition" parent="BudgetSubAwards-inquiryDefinition-parentBean" />
  <bean id="BudgetSubAwards-InquiryView" parent="BudgetSubAwards-InquiryView-parentBean"/>
  <bean id="BudgetSubAwards-inquiryDefinition-parentBean" abstract="true" parent="InquiryDefinition">
    <property name="title" value="Budget Subawards" />
    <property name="inquirySections" >
      <list>
        <bean parent="InquirySectionDefinition">
          <property name="title" value="Budget Details" />
          <property name="numberOfColumns" value="1" />
          <property name="inquiryFields" >
            <list>
              <bean parent="FieldDefinition" p:attributeName="proposalNumber" p:forceInquiry="true"/>
              <bean parent="FieldDefinition" p:attributeName="subAwardNumber" p:forceInquiry="true"/>
              <bean parent="FieldDefinition" p:attributeName="budgetVersionNumber" p:forceInquiry="true"/>
              <bean parent="FieldDefinition" p:attributeName="versionNumber" p:forceInquiry="true"/>
              <bean parent="FieldDefinition" p:attributeName="comments"/>
              <bean parent="FieldDefinition" p:attributeName="organizationName"/>
              <bean parent="FieldDefinition" p:attributeName="subAwardStatusCode"/>
              <bean parent="FieldDefinition" p:attributeName="translationComments"/>
              <bean parent="FieldDefinition" p:attributeName="xfdUpdateTimestamp"/>
              <bean parent="FieldDefinition" p:attributeName="xfdUpdateUser"/>
              <bean parent="FieldDefinition" p:attributeName="xmlUpdateTimestamp"/>
              <bean parent="FieldDefinition" p:attributeName="xmlUpdateUser"/>
            </list>
          </property>
        </bean>
      </list>
    </property>
  </bean>

  <bean id="BudgetSubAwards-InquiryView-parentBean" abstract="true" parent="Uif-InquiryView">
    <property name="headerText" value="Budget Subawards"/>
    <property name="dataObjectClassName" value="org.kuali.coeus.propdev.impl.budget.subaward.BudgetSubAwards"/>
    <property name="items">
      <list>
        <bean parent="Uif-Disclosure-GridSection">
          <property name="headerText" value="Budget Details"/>
          <property name="layoutManager.numberOfColumns" value="2"/>
          <property name="items">
            <list>
              <bean p:propertyName="proposalNumber" parent="Uif-DataField"/>
              <bean p:propertyName="subAwardNumber" parent="Uif-DataField"/>
              <bean p:propertyName="budgetVersionNumber" parent="Uif-DataField"/>
              <bean p:propertyName="versionNumber" parent="Uif-DataField"/>
              <bean p:propertyName="comments" parent="Uif-DataField"/>
              <bean p:propertyName="organizationName" parent="Uif-DataField"/>
              <bean p:propertyName="subAwardStatusCode" parent="Uif-DataField"/>
              <bean p:propertyName="translationComments" parent="Uif-DataField"/>
              <bean p:propertyName="xfdUpdateTimestamp" parent="Uif-DataField"/>
              <bean p:propertyName="xfdUpdateUser" parent="Uif-DataField"/>
              <bean p:propertyName="xmlUpdateTimestamp" parent="Uif-DataField"/>
              <bean p:propertyName="xmlUpdateUser" parent="Uif-DataField"/>
            </list>
          </property>
        </bean>
      </list>
    </property>
  </bean>

  <!-- Business Object Lookup Definition -->
  <bean id="BudgetSubAwards-lookupDefinition" parent="BudgetSubAwards-lookupDefinition-parentBean" />
  <bean id="BudgetSubAwards-LookupView" parent="BudgetSubAwards-LookupView-parentBean"/>
  <bean id="BudgetSubAwards-lookupDefinition-parentBean" abstract="true" parent="LookupDefinition">
    <property name="title" value="Budget Subawards" /><property name="defaultSort" >
      <bean parent="SortDefinition"/>
    </property>
    <property name="lookupFields" >
      <list>
        <bean parent="FieldDefinition" p:attributeName="subAwardNumber"/>
        <bean parent="FieldDefinition" p:attributeName="budgetVersionNumber"/>
        <bean parent="FieldDefinition" p:attributeName="proposalNumber"/>
        <bean parent="FieldDefinition" p:attributeName="versionNumber"/>
        <bean parent="FieldDefinition" p:attributeName="comments"/>
        <bean parent="FieldDefinition" p:attributeName="organizationName"/>
        <bean parent="FieldDefinition" p:attributeName="subAwardStatusCode"/>
        <bean parent="FieldDefinition" p:attributeName="translationComments"/>
        <bean parent="FieldDefinition" p:attributeName="xfdUpdateTimestamp"/>
        <bean parent="FieldDefinition" p:attributeName="xfdUpdateUser"/>
        <bean parent="FieldDefinition" p:attributeName="xmlUpdateTimestamp"/>
        <bean parent="FieldDefinition" p:attributeName="xmlUpdateUser"/>
      </list>
    </property>
    <property name="resultFields" >
      <list>
        <bean parent="FieldDefinition" p:attributeName="subAwardNumber" p:forceInquiry="true"/>
        <bean parent="FieldDefinition" p:attributeName="budgetVersionNumber" p:forceInquiry="true"/>
        <bean parent="FieldDefinition" p:attributeName="proposalNumber" p:forceInquiry="true"/>
        <bean parent="FieldDefinition" p:attributeName="versionNumber" p:forceInquiry="true"/>
        <bean parent="FieldDefinition" p:attributeName="comments"/>
        <bean parent="FieldDefinition" p:attributeName="organizationName"/>
        <bean parent="FieldDefinition" p:attributeName="subAwardStatusCode"/>
        <bean parent="FieldDefinition" p:attributeName="translationComments"/>
        <bean parent="FieldDefinition" p:attributeName="xfdUpdateTimestamp"/>
        <bean parent="FieldDefinition" p:attributeName="xfdUpdateUser"/>
        <bean parent="FieldDefinition" p:attributeName="xmlUpdateTimestamp"/>
        <bean parent="FieldDefinition" p:attributeName="xmlUpdateUser"/>
      </list>
    </property>
  </bean>

  <bean id="BudgetSubAwards-LookupView-parentBean" abstract="true" parent="Uif-LookupView">
    <property name="dataObjectClassName" value="org.kuali.coeus.propdev.impl.budget.subaward.BudgetSubAwards"/>
    <property name="headerText" value="Budget Subawards"/>
    <property name="criteriaFields">
      <list>
        <bean p:propertyName="subAwardNumber" parent="Uif-LookupCriteriaInputField"/>
        <bean p:propertyName="budgetVersionNumber" parent="Uif-LookupCriteriaInputField"/>
        <bean p:propertyName="proposalNumber" parent="Uif-LookupCriteriaInputField"/>
        <bean p:propertyName="versionNumber" parent="Uif-LookupCriteriaInputField"/>
        <bean p:propertyName="comments" parent="Uif-LookupCriteriaInputField"/>
        <bean p:propertyName="organizationName" parent="Uif-LookupCriteriaInputField"/>
        <bean p:propertyName="subAwardStatusCode" parent="Uif-LookupCriteriaInputField"/>
        <bean p:propertyName="translationComments" parent="Uif-LookupCriteriaInputField"/>
        <bean p:propertyName="xfdUpdateTimestamp" parent="Uif-LookupCriteriaInputField"/>
        <bean p:propertyName="xfdUpdateUser" parent="Uif-LookupCriteriaInputField"/>
        <bean p:propertyName="xmlUpdateTimestamp" parent="Uif-LookupCriteriaInputField"/>
        <bean p:propertyName="xmlUpdateUser" parent="Uif-LookupCriteriaInputField"/>
      </list>
    </property>
    <property name="resultFields">
      <list>
        <bean p:propertyName="subAwardNumber" parent="Uif-DataField"/>
        <bean p:propertyName="budgetVersionNumber" parent="Uif-DataField"/>
        <bean p:propertyName="proposalNumber" parent="Uif-DataField"/>
        <bean p:propertyName="versionNumber" parent="Uif-DataField"/>
        <bean p:propertyName="comments" parent="Uif-DataField"/>
        <bean p:propertyName="organizationName" parent="Uif-DataField"/>
        <bean p:propertyName="subAwardStatusCode" parent="Uif-DataField"/>
        <bean p:propertyName="translationComments" parent="Uif-DataField"/>
        <bean p:propertyName="xfdUpdateTimestamp" parent="Uif-DataField"/>
        <bean p:propertyName="xfdUpdateUser" parent="Uif-DataField"/>
        <bean p:propertyName="xmlUpdateTimestamp" parent="Uif-DataField"/>
        <bean p:propertyName="xmlUpdateUser" parent="Uif-DataField"/>
      </list>
    </property>
  </bean>

</beans>


text:
<!--
    Copyright (c) 2012 C4Biz.
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v1.0
    which accompanies this distribution, and is available at
    http://www.eclipse.org/legal/epl-v10.html

    Contributors:
        cvgaviao - initial implementation
 -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.eclipse.gemini</groupId>
		<artifactId>org.eclipse.gemini.jpa.parent</artifactId>
		<version>1.1.0-SNAPSHOT</version>
	</parent>

  <artifactId>org.eclipse.gemini.jpa.test.embeddedjdbc</artifactId>
  <packaging>eclipse-test-plugin</packaging>

  <build>
    <sourceDirectory>src</sourceDirectory>
  </build>
</project>


text:
module.exports = function (grunt) {

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        watch: {
            // watch for SCSS files and compile to css
            sass: {
                files: ['src/sass/*.scss'],
                tasks: ['sass'],
                options: {
                    // use live reload that is build in with grunt watch and use default port
                    livereload: {
                        port: 35730
                    }
                }
            },
            html: {
                files: ['demo.html', 'mqtt-lens.html', 'index.html'],
                options: {
                    // use live reload that is build in with grunt watch and use default port
                    livereload: {
                        port: 35730
                    }
                }
            }
        },
        // the SASS task
        sass: {
            dist: {                            // Target
                files: [{
                    expand: true,
                    flatten: true,
                    src: ['mqtt-lens.scss'],
                    dest: '.',
                    ext: '.css'
                }]
            }
        },
        connect: {
            server: {
                options: {
                    open: {
                        target: 'http://localhost:9002/mqtt-lens/demo.html'
                    },
                    port: 9002,
                    base: '../.'
                }
            }
        }

    });

    // a task that creates the initial folder structure and copies some dependencies
    grunt.registerTask('init');

    // a task that builds the overall app
    grunt.registerTask('build', ['sass']);

    grunt.registerTask('srv', ['build', 'connect', 'watch']);

    // load sass
    grunt.loadNpmTasks('grunt-contrib-sass');

    // watch
    grunt.loadNpmTasks('grunt-contrib-watch');

    // connect
    grunt.loadNpmTasks('grunt-contrib-connect');

    // Default task(s).
    grunt.registerTask('default', ['build']);

};


text:
#ifndef MORPHEUZ_H_
#define MORPHEUZ_H_

#include "pebble.h"

#define VERSION 34
#define VERSION_TXT "3.4"

// Comment out for production build - leaves errors on BASALT and nothing on APLITE as this is much tighter for memory
//#define TESTING_BUILD

#ifdef TESTING_BUILD
  #define LOG_ERROR(fmt, args...) app_log(APP_LOG_LEVEL_ERROR, "", 0, fmt, ## args)
  #define LOG_WARN(fmt, args...) app_log(APP_LOG_LEVEL_WARNING, "", 0, fmt, ## args)
  #define LOG_INFO(fmt, args...) app_log(APP_LOG_LEVEL_INFO, "", 0, fmt, ## args)
  #define LOG_DEBUG(fmt, args...) app_log(APP_LOG_LEVEL_DEBUG, "", 0, fmt, ## args)
#else
  #ifdef PBL_PLATFORM_BASALT
    #define LOG_ERROR(fmt, args...) app_log(APP_LOG_LEVEL_ERROR, "", 0, fmt, ## args)
  #else
    #define LOG_ERROR(fmt, args...)
  #endif
  #define LOG_WARN(fmt, args...)
  #define LOG_INFO(fmt, args...)
  #define LOG_DEBUG(fmt, args...)
#endif

#define LAST_SENT_INIT -4

#define FUDGE 4

#define FROM_HR_DEF 6
#define FROM_MIN_DEF 30
#define TO_HR_DEF 7
#define TO_MIN_DEF 15

#define ALARM_PATTERN_MAX_REPEAT 5

#define TIMELINE_LAUNCH_USE 0
#define TIMELINE_LAUNCH_SLEEP_NOW 1
#define TIMELINE_LAUNCH_CLEAR_AUTOSLEEP 2

#define DUMMY_PREVIOUS_TO_PHONE 0xFFFFFFFF

#define POWER_NAP_MINUTES 27
#define POWER_NAP_SETTLE 2
#define POWER_NAP_SETTLE_THRESHOLD 1000
#define CLOCK_UPDATE_THRESHOLD 1000
#define SNOOZE_PERIOD_MS (9*60*1000)
#define MENU_ACTION_MS 750
#define MENU_ACTION_HIDE_MS 500
#define WEEKEND_PERIOD (12*60*60)

#define BED_FINISH GRect(8, 17, 127, 70)
#define SLEEPER_FINISH GRect(25, 24, 110, 29)
#define HEAD_FINISH GRect(25, 24, 19, 16)
#define TEXT_FINISH GRect(26, 72, 92, 15)
#define BLOCK_FINISH GRect(0,169,144,78)
#define MOON_FINISH GRect(6, 5, 58, 46)
#define ICON_TOPS 1
#define ICON_PAD 5
#define ICON_PAD_BATTERY 4
#define ICON_BAR_WIDTH 118
#define BED_START GRect(-144-8, 17, 127, 70)
#define SLEEPER_START GRect(25+144, 24, 110, 29)
#define HEAD_START GRect(25, -24, 19, 16)
#define TEXT_START GRect(26, 25, 92, 15)
#define BLOCK_START GRect(0,91,144,78)
#define MOON_START GRect(144+6, 72, 58, 46)

#ifdef PBL_COLOR
  #define BACKGROUND_COLOR GColorDukeBlue
  #define SETTING_BACKGROUND_COLOR BACKGROUND_COLOR
  #define ACTION_BAR_BACKGROUND_COLOR GColorWhite
  #define HIGHLIGHT_BG_COLOR GColorBlack
  #define NON_HIGHLIGHT_BG_COLOR BACKGROUND_COLOR
  #define HIGHLIGHT_FG_COLOR GColorWhite
  #define NON_HIGHLIGHT_FG_COLOR GColorWhite
  #define FROM_TIME_COLOR GColorGreen
  #define TO_TIME_COLOR GColorRed
  #define START_TIME_COLOR GColorYellow
  #define PROGRESS_COLOR GColorWhite
  #define ANALOGUE_COLOR GColorWhite
  #define FAILURE_COLOR GColorRed
  #define BATTERY_BAR_COLOR GColorYellow
  #define BATTERY_BAR_COLOR_CRITICAL GColorRed
  #define BATTERY_BAR_COLOR_WARN GColorRajah
  #define BAR_CHART_MARKS GColorLightGray
  #define ANIMATE_MAIN_DURATION 500
  #define ANIMATE_HEAD_DURATION 250
  #define ANIMATE_ANALOGUE_DURATION 375
  #define PRE_ANIMATE_DELAY 1500
  #define MENU_TEXT_COLOR GColorWhite
  #define MENU_HIGHLIGHT_BACKGROUND_COLOR GColorBlack
  #define MENU_BACKGROUND_COLOR BACKGROUND_COLOR
  #define MENU_HEAD_COLOR GColorWhite
  #define MINUTE_HAND_COLOR GColorWhite
  #define HOUR_HAND_COLOR GColorPictonBlue
  #define MINUTE_HAND_OUTLINE GColorWhite
  #define HOUR_HAND_OUTLINE GColorPictonBlue
  #define CENTRE_OUTLINE GColorWhite
  #define CENTRE_COLOR GColorPictonBlue
  #define MINUTE_MARK_COLOR GColorDarkGray
  #define HOUR_MARK_COLOR GColorWhite
  #define MINUTE_STEP 24
  #define PROGRESS_STEP 24
  #define COPYRIGHT_COLOR GColorPictonBlue
#else
  #define BACKGROUND_COLOR GColorBlack
  #define SETTING_BACKGROUND_COLOR GColorWhite
  #define ACTION_BAR_BACKGROUND_COLOR GColorBlack
  #define HIGHLIGHT_BG_COLOR GColorBlack
  #define NON_HIGHLIGHT_BG_COLOR GColorWhite
  #define HIGHLIGHT_FG_COLOR GColorWhite
  #define NON_HIGHLIGHT_FG_COLOR GColorBlack
  #define FROM_TIME_COLOR GColorWhite
  #define TO_TIME_COLOR GColorWhite
  #define START_TIME_COLOR GColorWhite
  #define PROGRESS_COLOR GColorWhite
  #define ANALOGUE_COLOR GColorWhite
  #define FAILURE_COLOR GColorWhite
  #define BATTERY_BAR_COLOR GColorWhite
  #define BATTERY_BAR_COLOR_CRITICAL GColorWhite
  #define BATTERY_BAR_COLOR_WARN GColorWhite
  #define BAR_CHART_MARKS GColorWhite
  #define ANIMATE_MAIN_DURATION 1000
  #define ANIMATE_HEAD_DURATION 500
  #define ANIMATE_ANALOGUE_DURATION 750
  #define PRE_ANIMATE_DELAY 3000
  #define MENU_HEAD_COLOR GColorBlack
  #define MINUTE_HAND_COLOR GColorWhite
  #define HOUR_HAND_COLOR GColorWhite
  #define MINUTE_HAND_OUTLINE GColorBlack
  #define HOUR_HAND_OUTLINE GColorBlack
  #define CENTRE_OUTLINE GColorBlack
  #define CENTRE_COLOR GColorWhite
  #define MINUTE_MARK_COLOR GColorWhite
  #define HOUR_MARK_COLOR GColorWhite
  #define MINUTE_STEP 24
  #define PROGRESS_STEP 12
  #define COPYRIGHT_COLOR GColorWhite
#endif

// These save space and time to run and a direct cast is claimed to be supported in the documentation
#define bitmap_layer_get_layer_jf(x) ((Layer *)(x))
#define text_layer_get_layer_jf(x) ((Layer *)(x))
#define inverter_layer_get_layer_jf(x) ((Layer *)(x))
#define menu_layer_get_layer_jf(x) ((Layer *)(x))

#define to_mins(h,m) (((h) * 60) + (m))

enum MorpKey {
  KEY_POINT = 1,
  KEY_CTRL = 2,
  KEY_FROM = 3,
  KEY_TO = 4,
  KEY_BASE = 5,
  KEY_VERSION = 6,
  KEY_GONEOFF = 7,
  KEY_TRANSMIT = 8,
  KEY_AUTO_RESET = 9
};

enum CtrlValues {
  CTRL_TRANSMIT_DONE = 1,
  CTRL_VERSION_DONE = 2,
  CTRL_GONEOFF_DONE = 4,
  CTRL_DO_NEXT = 8,
  CTRL_SET_LAST_SENT = 16,
  CTRL_LAZARUS = 32
};

typedef enum {
  IS_COMMS = 0,
  IS_RECORD,
  IS_IGNORE,
  IS_WEEKEND,
  IS_ALARM,
  IS_ALARM_RING,
  IS_BLUETOOTH,
  IS_EXPORT
} IconState;

// Failure recording
typedef enum {
  FAIL_ACCEL = 1,
  FAIL_WAKEUP = 2,
  FAIL_TEXT_LONG = 3,
  FAIL_TEXT_MISSING = 4
} FailureNote;

#define NO_FAILURE "E....."

#define MAX_ICON_STATE 8

#define PERSIST_MEMORY_KEY 12121
#define PERSIST_CONFIG_KEY 12122
#define PERSIST_PRESET_KEY 12123
#define PERSIST_MEMORY_MS (5*60*1000)
#define PERSIST_CONFIG_MS 30000
#define SHORT_RETRY_MS 200
#define LONG_RETRY_MS 60000
#define NOTICE_DISPLAY_MS 7000
#define FIVE_MINUTES_MS (5*60*1000)
#define TEN_SECONDS_MS (10*1000)
#define COMPLETE_OUTSTANDING_MS (15*1000)
#define FIVE_MINUTES (5*60)
#define FIVE_SECONDS 5
#define VERSION_SEND_INTERVAL_MS (1000)
#define VERSION_SEND_SLOW_INTERVAL_MS (60*1000)

#define LIMIT 60
#define DIVISOR 600

#define LOGO_BED_ANIMATION 0
#define LOGO_SLEEPER_ANIMATION 1
#define LOGO_HEAD_ANIMATION 2
#define LOGO_TEXT_ANIMATION 3
#define BLOCK_ANIMATION 4
#define MAX_ANIMATIONS 5

#define BUFFER_SIZE 50

#define TWENTY_FOUR_HOURS_IN_SECONDS (24*60*60)
#define ELEVEN_HOURS_IN_SECONDS (11*60*60)
#define WAKEUP_AUTO_RESTART 1
#define WAKEUP_FOR_TRANSMIT 2
#define WAKEUP_LAZARUS 3
#define ONE_MINUTE 60

// Change INTERNAL_VER only if the InternalData struct changes
#define INTERNAL_VER 42
typedef struct {
  uint8_t internal_ver;
  uint32_t base;
  uint16_t gone_off;
  uint8_t highest_entry;
  int8_t last_sent;
  uint16_t points[LIMIT];
  bool ignore[LIMIT];
  bool has_been_reset;
  bool gone_off_sent;
  bool transmit_sent;
} InternalData;

// Change the CONFIG_VER only if the ConfigData struct changes
#define CONFIG_VER 42
typedef struct {
  uint8_t config_ver;
  bool invert;
  bool analogue;
  bool smart;
  bool auto_reset;
  bool lazarus;
  uint8_t autohr;
  uint8_t automin;
  uint8_t fromhr;
  uint8_t frommin;
  uint8_t tohr;
  uint8_t tomin;
  uint32_t from;
  uint32_t to;
  time_t weekend_until;
} ConfigData;

typedef struct {
  BitmapLayer *layer;
  GBitmap *bitmap;
} BitmapLayerComp;

void init_morpheuz();
void set_smart_status_on_screen(bool show_special_text, char *special_text);
void invert_screen();
void revive_clock_on_movement(uint16_t last_movement);
void power_nap_countdown();
void power_nap_check(uint16_t biggest);
void click_config_provider(Window *window);
void set_smart_status();
void power_nap_reset();
void reset_sleep_period();
void server_processing(uint16_t biggest);
void set_progress();
InternalData *get_internal_data();
void read_internal_data();
void save_internal_data();
void save_config_data(void *data);
void read_config_data();
ConfigData *get_config_data();
void show_notice(uint32_t resource_id);
void hide_notice_layer(void *data);
void cancel_alarm();
void fire_alarm();
void snooze_alarm();
void init_alarm();
uint16_t every_minute_processing();
void toggle_weekend_mode();
TextLayer* macro_text_layer_create(GRect frame, Layer *parent, GColor tcolor, GColor bcolor, GFont font, GTextAlignment text_alignment);
int32_t join_value(int16_t top, int16_t bottom);
int32_t dirty_checksum(void *data, uint8_t data_size);
void set_ignore_on_current_time_segment();
void resend_all_data(bool silent);
void bed_visible(bool value);
bool is_animation_complete();
void show_menu();
void toggle_power_nap();
void close_morpheuz();
bool is_notice_showing();
void macro_bitmap_layer_create(BitmapLayerComp *comp, GRect frame, Layer *parent, uint32_t resource_id, bool visible);
void macro_bitmap_layer_destroy(BitmapLayerComp *comp);
void wakeup_init();
void wakeup_toggle();
void set_next_wakeup();
uint8_t twenty_four_to_twelve(uint8_t hour);
void post_init_hook();
void show_set_alarm();
void trigger_config_save();
bool is_doing_powernap();
void open_comms();
void set_icon(bool enabled, IconState icon);
bool get_icon(IconState icon);
void mark_failure(FailureNote fn);
void show_preset_menu();
void manual_shutdown_request();
void lazarus();
bool is_monitoring_sleep();

#endif /* MORPHEUZ_H_ */


text:
package org.cytoscape.netInfo.internal;

import java.util.Properties;

import org.cytoscape.service.util.AbstractCyActivator;
import org.cytoscape.app.CyAppAdapter;
import org.cytoscape.io.BasicCyFileFilter;
import org.cytoscape.io.DataCategory;
import org.cytoscape.io.util.StreamUtil;
import org.cytoscape.model.CyNetworkManager;
import org.cytoscape.netInfo.writer.NetInfoWriterFactory;
import static org.cytoscape.work.ServiceProperties.ID;

import org.osgi.framework.BundleContext;

/**
 * @author SrikanthB
 */

public class CyActivator extends AbstractCyActivator {
    private static CyAppAdapter appAdapter;
    public static final String FILE_EXTENSION = "csv";

    public CyActivator() {
            super();
    }

    @Override
    public void start(BundleContext bc) {
            final StreamUtil streamUtil = getService(bc, StreamUtil.class);
            final BasicCyFileFilter netInfoFilter = new BasicCyFileFilter(new String[] {FILE_EXTENSION},
                            new String[] { "application" }, "Networks and their sizes information", DataCategory.NETWORK, streamUtil);
            // get services for readers
            this.appAdapter = getService(bc, CyAppAdapter.class);
            final CyNetworkManager cyNetworkManager = getService(bc, CyNetworkManager.class);
            final NetInfoWriterFactory writerFactory = new NetInfoWriterFactory(netInfoFilter, cyNetworkManager);
            final Properties adjWriterFactoryProperties = new Properties();
            adjWriterFactoryProperties.put(ID, "adjWriterFactory");
            registerAllServices(bc, writerFactory, adjWriterFactoryProperties);
    }

    public static CyAppAdapter getCyAppAdapter(){
        return appAdapter;
    }
}


text:
///<amd-dependency path="angular"/>
///<amd-dependency path="angular-mocks"/>
///<amd-dependency path="angular-route"/>
import AuthenticationHolder = require("../../../app/ts/controllers/LoginController");

describe("LoginController Spec:", (): void => {

    //var LoginController = require("ts/controllers/LoginController");
    var rootScope: ng.IScope;
    var location: ng.ILocationService;
    //var loginController: any;
    //var httpBackend: ng.IHttpBackendService;
    var controller: ng.IControllerService;

    beforeEach((): void => angular.mock.module("openCbs"));

    beforeEach(
        inject(function ($injector: ng.auto.IInjectorService): void {
            rootScope = $injector.get("$rootScope");
            controller = $injector.get("$controller");
            location = $injector.get("$location");
            //httpBackend = $injector.get("$httpBackend");

            //loginController = controller("ts/controllers/LoginController",
            //{ $scope: rootScope, $location: location, authService: null });

        }));

    describe("The login method:", (): void => {
        //it("should do somthing ", (): void => {

        //loginController = controller("ts/controllers/LoginController",
        //{ $scope: rootScope, $location: location, authService: null });
        //loginController = new LoginController(rootScope, location, null);
        //expect(loginController.login(1)).toThrow();

        //});
    });

});


text:
package com.microsoft.azure.management.authorization.v2018_09_01_preview.implementation;

import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.CloudException;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import java.io.IOException;
import okhttp3.ResponseBody;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.Response;
import rx.functions.Func1;
import rx.Observable;

/**
 * An instance of this class provides access to all the operations defined
 * in GlobalAdministrators.
 */
public class GlobalAdministratorsInner {
    /** The Retrofit service to perform REST calls. */
    private GlobalAdministratorsService service;
    /** The service client containing this operation class. */
    private AuthorizationManagementClientImpl client;

    /**
     * Initializes an instance of GlobalAdministratorsInner.
     *
     * @param retrofit the Retrofit instance built from a Retrofit Builder.
     * @param client the instance of the service client containing this operation class.
     */
    public GlobalAdministratorsInner(Retrofit retrofit, AuthorizationManagementClientImpl client) {
        this.service = retrofit.create(GlobalAdministratorsService.class);
        this.client = client;
    }

    /**
     * The interface defining all the services for GlobalAdministrators to be
     * used by Retrofit to perform actually REST calls.
     */
    interface GlobalAdministratorsService {
        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.authorization.v2018_09_01_preview.GlobalAdministrators elevateAccess" })
        @POST("providers/Microsoft.Authorization/elevateAccess")
        Observable<Response<ResponseBody>> elevateAccess(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

    }

    /**
     * Elevates access for a Global Administrator.
     *
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     */
    public void elevateAccess() {
        elevateAccessWithServiceResponseAsync().toBlocking().single().body();
    }

    /**
     * Elevates access for a Global Administrator.
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<Void> elevateAccessAsync(final ServiceCallback<Void> serviceCallback) {
        return ServiceFuture.fromResponse(elevateAccessWithServiceResponseAsync(), serviceCallback);
    }

    /**
     * Elevates access for a Global Administrator.
     *
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceResponse} object if successful.
     */
    public Observable<Void> elevateAccessAsync() {
        return elevateAccessWithServiceResponseAsync().map(new Func1<ServiceResponse<Void>, Void>() {
            @Override
            public Void call(ServiceResponse<Void> response) {
                return response.body();
            }
        });
    }

    /**
     * Elevates access for a Global Administrator.
     *
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceResponse} object if successful.
     */
    public Observable<ServiceResponse<Void>> elevateAccessWithServiceResponseAsync() {
        final String apiVersion = "2015-07-01";
        return service.elevateAccess(apiVersion, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
                @Override
                public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<Void> clientResponse = elevateAccessDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<Void> elevateAccessDelegate(Response<ResponseBody> response) throws CloudException, IOException {
        return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<Void>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

}


text:
<!doctype html>
<title>WebSockets: origin</title>


text:
import styled from "styled-components";

export default styled.div`
  background-color: hsla(0, 0%, 0%, 0.02);
  border-radius: 10px;
  box-shadow: inset 0px 0px 1px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  user-select: none;
  cursor: default;
  width: 300px;
  max-width: 300px;
`;


text:
import IPython
import matplotlib.pyplot as plt
import numpy as np
import sys
import tensorflow as tf
import keras.backend as K
import time

from Training import Training
from Callbacks import Callbacks
from Parameters import Parameters
from DataGenerators import CAMVIDImageDataGenerator
from Evaluation import EvaluateModel
from models.ENet import ENet
from models.uNet import uNet
from utils import parse_args_experiment, get_generator_from_experiment
from utils import get_model_from_experiment

ROOT_EXPERIMENT = "experiments/"
SUFFIX = "/experiment.json"
DATA_PATH = "data/camvid"
EXPERIMENT = "ENet_Camvid_4"

if __name__ == "__main__":
    K.set_learning_phase(0)
    exp_name = EXPERIMENT
    params = Parameters()
    experiment = ROOT_EXPERIMENT + exp_name
    params.load_experiment(experiment + SUFFIX)
    # Get model
    model = get_model_from_experiment(params)
    model = model.build_model(params)
    # Train model
    model = Training(model, params=params)
    # Get some data
    generator = get_generator_from_experiment(params)
    tgen = generator(data_split="test")
    tdat = tgen.flow_from_directory(DATA_PATH,
                                    batch_size=100,
                                    #save_to_dir="augdata/train/",
                                    shuffle=True)
    # Load the model
    trained_model = model.load_pretrained(path=experiment + "/saved_weights.hdf5")
    IPython.embed()
    # Get some test data
    img, y = tdat.next()

    sess = K.get_session()
    input_tensor = trained_model.input
    output_tensor = trained_model.output

    # Get predictions from tensorflow
    def testrunTF():
        total_time = 0
        for b in img:
            x = np.expand_dims(b, 0)
            start_time = time.time()
            output_tensor.eval(feed_dict={input_tensor: x}, session=sess)
            elapsed_time = time.time() - start_time
            total_time += elapsed_time
        print ("Total time using TF")
        print total_time

    # Get predictions from Keras
    def testrunK():
        total_time = 0
        for b in img:
            x = np.expand_dims(b, 0)
            start_time = time.time()
            trained_model.predict(x)
            elapsed_time = time.time() - start_time
            total_time += elapsed_time
        print ("Total time using Keras")
        print total_time

    testrunK()
    testrunTF()
    IPython.embed()
    # x = tf.placeholder(tf.float32, shape=(None, 360, 480, 3))
    # y = trained_model(x)
    # Get the tensorflow session
    # sess = K.get_session()
    # output_tensor = trained_model.output
    # feed_dict = {x: img}
    # sess.run(y, feed_dict=feed_dict)


text:
//===-- WebAssemblyRegisterInfo.cpp - WebAssembly Register Information ----===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief This file contains the WebAssembly implementation of the
/// TargetRegisterInfo class.
///
//===----------------------------------------------------------------------===//

#include "WebAssemblyRegisterInfo.h"
#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
#include "WebAssemblyFrameLowering.h"
#include "WebAssemblyInstrInfo.h"
#include "WebAssemblyMachineFunctionInfo.h"
#include "WebAssemblySubtarget.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetOptions.h"
using namespace llvm;

#define DEBUG_TYPE "wasm-reg-info"

#define GET_REGINFO_TARGET_DESC
#include "WebAssemblyGenRegisterInfo.inc"

WebAssemblyRegisterInfo::WebAssemblyRegisterInfo(const Triple &TT)
    : WebAssemblyGenRegisterInfo(0), TT(TT) {}

const MCPhysReg *
WebAssemblyRegisterInfo::getCalleeSavedRegs(const MachineFunction *) const {
  static const MCPhysReg CalleeSavedRegs[] = {0};
  return CalleeSavedRegs;
}

BitVector
WebAssemblyRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
  BitVector Reserved(getNumRegs());
  for (auto Reg : {WebAssembly::SP32, WebAssembly::SP64, WebAssembly::FP32,
                   WebAssembly::FP64})
    Reserved.set(Reg);
  return Reserved;
}

void WebAssemblyRegisterInfo::eliminateFrameIndex(
    MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum,
    RegScavenger *RS) const {
  llvm_unreachable("WebAssemblyRegisterInfo::eliminateFrameIndex"); // FIXME
}

unsigned
WebAssemblyRegisterInfo::getFrameRegister(const MachineFunction &MF) const {
  static const unsigned Regs[2][2] = {
      /*            !isArch64Bit       isArch64Bit      */
      /* !hasFP */ {WebAssembly::SP32, WebAssembly::SP64},
      /*  hasFP */ {WebAssembly::FP32, WebAssembly::FP64}};
  const WebAssemblyFrameLowering *TFI = getFrameLowering(MF);
  return Regs[TFI->hasFP(MF)][TT.isArch64Bit()];
}


text:
{% load i18n %}
{% load wagtailadmin_tags %}

    {% if show_ordering_column %}
        <col width="50px" />
    {% endif %}
    <col />
    {% if show_parent %}
        <col />
    {% endif %}
    <col width="12%" />
    <col width="12%" />
    <col width="12%" />
    <col width="10%" />

        {% block pre_parent_page_headers %}
        {% endblock %}

        {% if parent_page %}
            {% page_permissions parent_page as parent_page_perms %}

                    {% block parent_page_title %}
                    {% endblock %}

                {% if parent_page.latest_revision_created_at %}
{% blocktrans with time_period=parent_page.latest_revision_created_at|timesince %}{{ time_period }} ago{% endblocktrans %}
{% endif %}

                    {% if not parent_page.is_root %}
                        {{ parent_page.content_type.model_class.get_verbose_name }}
                    {% endif %}

                    {% if not parent_page.is_root %}
                        {% include "wagtailadmin/shared/page_status_tag.html" with page=parent_page %}
                    {% endif %}

        {% endif %}

        {% block post_parent_page_headers %}
        {% endblock %}

        {% if pages %}
            {% for page in pages %}
                {% page_permissions page as page_perms %}

                    {% if show_ordering_column %}
                        {% if orderable and ordering == "ord" %}
{% trans 'Drag' %}
{% endif %}
                    {% endif %}

                        {% block page_title %}
                        {% endblock %}

                    {% if show_parent %}
                        {% with page.get_parent as parent %}

                                {% if parent %}
                                    {{ parent.get_admin_display_title }}
                                {% endif %}

                        {% endwith %}
                    {% endif %}
                    {% if page.latest_revision_created_at %}
{% blocktrans with time_period=page.latest_revision_created_at|timesince %}{{ time_period }} ago{% endblocktrans %}
{% endif %}
                    {{ page.content_type.model_class.get_verbose_name }}

                        {% include "wagtailadmin/shared/page_status_tag.html" with page=page %}

                    {% block page_navigation %}
                    {% endblock %}

            {% endfor %}
        {% else %}
            {% block no_results %}{% endblock %}
        {% endif %}


text:
package RedditApiDemo;

import java.util.List;

public class Reddit{
   	public Data data;
   	public  String kind;

}


text:
package org.swellrt.beta.client;

import org.swellrt.beta.client.rest.operations.params.Account;
import org.waveprotocol.wave.model.wave.ParticipantId;

/**
 * Tracks HTTP session info for the current logged in participant.
 *
 * @author pablojan@gmail.com (Pablo Ojanguren)
 *
 */
public interface ServiceSession {

  public interface Factory {

    ServiceSession create(Account accountData);

    String getWindowId();

  }

  /**
   * Creates a session object for an user that is logged in.
   *
   * @param accountData
   * @return
   */
  public static ServiceSession create(Account account) {
    return ServiceDeps.serviceSessionFactory.create(account);
  }

  /**
   * Returns an id identifying the current browser tab. This is a static method
   * as long as it doesn't change during execution.
   */
  public static String getWindowId() {
    return ServiceDeps.serviceSessionFactory.getWindowId();
  }

  /** Clean up session info, e.g. cookies */
  public void destroy();

  /** Set if there is a session cookie */
  public void setSessionCookie(boolean inPlace);

  /** Check if there is a session cookie */
  public boolean isSessionCookie();

  /**
   * Returns the HTTP session id. If cookies are available, this session is kept
   * in the browser indefinitely.
   */
  public String getHttpSessionId();

  /**
   * Returns a transient session id. This id lives as long as the browser is
   * open.
   */
  public String getTransientSessionId();

  /**
   * The session token puts together all session id's (http, transient, window)
   * in a single string.
   */
  public String getSessionToken();

  /** Returns the participant id of this session */
  public ParticipantId getParticipantId();

  /** Returns wave domain of the current server */
  public String getWaveDomain();

}


text:
/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.facebook.thrift.op;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import java.util.BitSet;
import java.util.Arrays;
import com.facebook.thrift.*;
import com.facebook.thrift.annotations.*;
import com.facebook.thrift.async.*;
import com.facebook.thrift.meta_data.*;
import com.facebook.thrift.server.*;
import com.facebook.thrift.transport.*;
import com.facebook.thrift.protocol.*;

/**
 * A patch for a 32-bit integer value.
 */
@SuppressWarnings({ "unused", "serial" })
public class I32Patch implements TBase, java.io.Serializable, Cloneable, Comparable<I32Patch> {
  private static final TStruct STRUCT_DESC = new TStruct("I32Patch");
  private static final TField ASSIGN_FIELD_DESC = new TField("assign", TType.I32, (short)1);
  private static final TField CLEAR_FIELD_DESC = new TField("clear", TType.BOOL, (short)2);
  private static final TField ADD_FIELD_DESC = new TField("add", TType.I32, (short)8);

  /**
   * Assigns to a (set) value.
   *
   * If set, all other patch operations are ignored.
   *
   * Note: Only modifies set field values.
   */
  public int assign;
  /**
   * Clears any set value.
   */
  public boolean clear;
  /**
   * Add to a given value.
   */
  public int add;
  public static final int ASSIGN = 1;
  public static final int CLEAR = 2;
  public static final int ADD = 8;

  // isset id assignments
  private static final int __ASSIGN_ISSET_ID = 0;
  private static final int __CLEAR_ISSET_ID = 1;
  private static final int __ADD_ISSET_ID = 2;
  private BitSet __isset_bit_vector = new BitSet(3);

  public static final Map<Integer, FieldMetaData> metaDataMap;

  static {
    Map<Integer, FieldMetaData> tmpMetaDataMap = new HashMap<Integer, FieldMetaData>();
    tmpMetaDataMap.put(ASSIGN, new FieldMetaData("assign", TFieldRequirementType.OPTIONAL,
        new FieldValueMetaData(TType.I32)));
    tmpMetaDataMap.put(CLEAR, new FieldMetaData("clear", TFieldRequirementType.DEFAULT,
        new FieldValueMetaData(TType.BOOL)));
    tmpMetaDataMap.put(ADD, new FieldMetaData("add", TFieldRequirementType.DEFAULT,
        new FieldValueMetaData(TType.I32)));
    metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap);
  }

  static {
    FieldMetaData.addStructMetaDataMap(I32Patch.class, metaDataMap);
  }

  public I32Patch() {
  }

  public I32Patch(
      boolean clear,
      int add) {
    this();
    this.clear = clear;
    setClearIsSet(true);
    this.add = add;
    setAddIsSet(true);
  }

  public I32Patch(
      int assign,
      boolean clear,
      int add) {
    this();
    this.assign = assign;
    setAssignIsSet(true);
    this.clear = clear;
    setClearIsSet(true);
    this.add = add;
    setAddIsSet(true);
  }

  public static class Builder {
    private int assign;
    private boolean clear;
    private int add;

    BitSet __optional_isset = new BitSet(3);

    public Builder() {
    }

    public Builder setAssign(final int assign) {
      this.assign = assign;
      __optional_isset.set(__ASSIGN_ISSET_ID, true);
      return this;
    }

    public Builder setClear(final boolean clear) {
      this.clear = clear;
      __optional_isset.set(__CLEAR_ISSET_ID, true);
      return this;
    }

    public Builder setAdd(final int add) {
      this.add = add;
      __optional_isset.set(__ADD_ISSET_ID, true);
      return this;
    }

    public I32Patch build() {
      I32Patch result = new I32Patch();
      if (__optional_isset.get(__ASSIGN_ISSET_ID)) {
        result.setAssign(this.assign);
      }
      if (__optional_isset.get(__CLEAR_ISSET_ID)) {
        result.setClear(this.clear);
      }
      if (__optional_isset.get(__ADD_ISSET_ID)) {
        result.setAdd(this.add);
      }
      return result;
    }
  }

  public static Builder builder() {
    return new Builder();
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public I32Patch(I32Patch other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.assign = TBaseHelper.deepCopy(other.assign);
    this.clear = TBaseHelper.deepCopy(other.clear);
    this.add = TBaseHelper.deepCopy(other.add);
  }

  public I32Patch deepCopy() {
    return new I32Patch(this);
  }

  /**
   * Assigns to a (set) value.
   *
   * If set, all other patch operations are ignored.
   *
   * Note: Only modifies set field values.
   */
  public int getAssign() {
    return this.assign;
  }

  /**
   * Assigns to a (set) value.
   *
   * If set, all other patch operations are ignored.
   *
   * Note: Only modifies set field values.
   */
  public I32Patch setAssign(int assign) {
    this.assign = assign;
    setAssignIsSet(true);
    return this;
  }

  public void unsetAssign() {
    __isset_bit_vector.clear(__ASSIGN_ISSET_ID);
  }

  // Returns true if field assign is set (has been assigned a value) and false otherwise
  public boolean isSetAssign() {
    return __isset_bit_vector.get(__ASSIGN_ISSET_ID);
  }

  public void setAssignIsSet(boolean __value) {
    __isset_bit_vector.set(__ASSIGN_ISSET_ID, __value);
  }

  /**
   * Clears any set value.
   */
  public boolean isClear() {
    return this.clear;
  }

  /**
   * Clears any set value.
   */
  public I32Patch setClear(boolean clear) {
    this.clear = clear;
    setClearIsSet(true);
    return this;
  }

  public void unsetClear() {
    __isset_bit_vector.clear(__CLEAR_ISSET_ID);
  }

  // Returns true if field clear is set (has been assigned a value) and false otherwise
  public boolean isSetClear() {
    return __isset_bit_vector.get(__CLEAR_ISSET_ID);
  }

  public void setClearIsSet(boolean __value) {
    __isset_bit_vector.set(__CLEAR_ISSET_ID, __value);
  }

  /**
   * Add to a given value.
   */
  public int getAdd() {
    return this.add;
  }

  /**
   * Add to a given value.
   */
  public I32Patch setAdd(int add) {
    this.add = add;
    setAddIsSet(true);
    return this;
  }

  public void unsetAdd() {
    __isset_bit_vector.clear(__ADD_ISSET_ID);
  }

  // Returns true if field add is set (has been assigned a value) and false otherwise
  public boolean isSetAdd() {
    return __isset_bit_vector.get(__ADD_ISSET_ID);
  }

  public void setAddIsSet(boolean __value) {
    __isset_bit_vector.set(__ADD_ISSET_ID, __value);
  }

  public void setFieldValue(int fieldID, Object __value) {
    switch (fieldID) {
    case ASSIGN:
      if (__value == null) {
        unsetAssign();
      } else {
        setAssign((Integer)__value);
      }
      break;

    case CLEAR:
      if (__value == null) {
        unsetClear();
      } else {
        setClear((Boolean)__value);
      }
      break;

    case ADD:
      if (__value == null) {
        unsetAdd();
      } else {
        setAdd((Integer)__value);
      }
      break;

    default:
      throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
    }
  }

  public Object getFieldValue(int fieldID) {
    switch (fieldID) {
    case ASSIGN:
      return new Integer(getAssign());

    case CLEAR:
      return new Boolean(isClear());

    case ADD:
      return new Integer(getAdd());

    default:
      throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
    }
  }

  @Override
  public boolean equals(Object _that) {
    if (_that == null)
      return false;
    if (this == _that)
      return true;
    if (!(_that instanceof I32Patch))
      return false;
    I32Patch that = (I32Patch)_that;

    if (!TBaseHelper.equalsNobinary(this.isSetAssign(), that.isSetAssign(), this.assign, that.assign)) { return false; }

    if (!TBaseHelper.equalsNobinary(this.clear, that.clear)) { return false; }

    if (!TBaseHelper.equalsNobinary(this.add, that.add)) { return false; }

    return true;
  }

  @Override
  public int hashCode() {
    return Arrays.deepHashCode(new Object[] {assign, clear, add});
  }

  @Override
  public int compareTo(I32Patch other) {
    if (other == null) {
      // See java.lang.Comparable docs
      throw new NullPointerException();
    }

    if (other == this) {
      return 0;
    }
    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetAssign()).compareTo(other.isSetAssign());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(assign, other.assign);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetClear()).compareTo(other.isSetClear());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(clear, other.clear);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetAdd()).compareTo(other.isSetAdd());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(add, other.add);
    if (lastComparison != 0) {
      return lastComparison;
    }
    return 0;
  }

  public void read(TProtocol iprot) throws TException {
    TField __field;
    iprot.readStructBegin(metaDataMap);
    while (true)
    {
      __field = iprot.readFieldBegin();
      if (__field.type == TType.STOP) {
        break;
      }
      switch (__field.id)
      {
        case ASSIGN:
          if (__field.type == TType.I32) {
            this.assign = iprot.readI32();
            setAssignIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        case CLEAR:
          if (__field.type == TType.BOOL) {
            this.clear = iprot.readBool();
            setClearIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        case ADD:
          if (__field.type == TType.I32) {
            this.add = iprot.readI32();
            setAddIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, __field.type);
          break;
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    validate();
  }

  public void write(TProtocol oprot) throws TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    if (isSetAssign()) {
      oprot.writeFieldBegin(ASSIGN_FIELD_DESC);
      oprot.writeI32(this.assign);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(CLEAR_FIELD_DESC);
    oprot.writeBool(this.clear);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(ADD_FIELD_DESC);
    oprot.writeI32(this.add);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

  @Override
  public String toString() {
    return toString(1, true);
  }

  @Override
  public String toString(int indent, boolean prettyPrint) {
    String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : "";
    String newLine = prettyPrint ? "\n" : "";
    String space = prettyPrint ? " " : "";
    StringBuilder sb = new StringBuilder("I32Patch");
    sb.append(space);
    sb.append("(");
    sb.append(newLine);
    boolean first = true;

    if (isSetAssign())
    {
      sb.append(indentStr);
      sb.append("assign");
      sb.append(space);
      sb.append(":").append(space);
      sb.append(TBaseHelper.toString(this.getAssign(), indent + 1, prettyPrint));
      first = false;
    }
    if (!first) sb.append("," + newLine);
    sb.append(indentStr);
    sb.append("clear");
    sb.append(space);
    sb.append(":").append(space);
    sb.append(TBaseHelper.toString(this.isClear(), indent + 1, prettyPrint));
    first = false;
    if (!first) sb.append("," + newLine);
    sb.append(indentStr);
    sb.append("add");
    sb.append(space);
    sb.append(":").append(space);
    sb.append(TBaseHelper.toString(this.getAdd(), indent + 1, prettyPrint));
    first = false;
    sb.append(newLine + TBaseHelper.reduceIndent(indentStr));
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws TException {
    // check for required fields
  }

}


text:
import Headroom from 'headroom.js/dist/headroom.min'

const scrollMixins = {
  mounted () {
    let myElement = this.$refs.tabbar
    if (myElement) {
      let headroom = new Headroom(myElement.$el, {
        tolerance: 5,
        offset: 70
      })
      headroom.init()
    }
    let myElement2 = this.$refs.tabbar2
    if (myElement2) {
      let headroom = new Headroom(myElement2.$el, {
        tolerance: 5,
        offset: 70,
        classes: {
          pinned: 'headroom2--pinned',
          unpinned: 'headroom2--unpinned'
        }
      })
      headroom.init()
    }
  }
}

export {
  scrollMixins
}


text: "use strict";import"../../indicators/trix.src.js";


text:
module Jekyll
  class DetailsTag < Liquid::Tag
    def initialize(tag_name, text, tokens)
      super
      @text = text
    end

    def render(context)
      "#{@text}"
    end
  end
end

Liquid::Template.register_tag('details_tag', Jekyll::DetailsTag)


text:
package com.arkxu.aaas.api

import java.util.concurrent.TimeUnit

import akka.actor.Props
import akka.util.Timeout
import com.arkxu.aaas.Implicits
import com.arkxu.aaas.image.ImgeProcessActor

/**
  * Created by fangxu on 1/9/16.
  */
trait BaseRoute extends Implicits {
  val imageProcessActor = system.actorOf(Props[ImgeProcessActor], "imageProcessor")
  val timeoutConf = aaasConfig.getInt("aaas.timeout")
  implicit val timeout = Timeout(timeoutConf, TimeUnit.SECONDS)
}