text:
package com.xinyuan.pub.common.utils;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Random;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Description: 生成GUID(Globally Unique Identifier 全球唯一标识符)
 * @author liangyongjian
 * @Version V1.0
 * @date 2017-10-01 下午08:24:55
 */
public class CreateGUID {

	private static final Logger LOGGER = LoggerFactory.getLogger(CreateGUID.class);

	private String valueBeforeMD5;
	private String valueAfterMD5;
	private static Random myRandom;
	private static SecureRandom mySecureRandom;
	private static String s_id;

	static {
		mySecureRandom = new SecureRandom();
		long secureInitializer = mySecureRandom.nextLong();
		myRandom = new Random(secureInitializer);
		try {
			s_id = InetAddress.getLocalHost().toString();
		} catch (UnknownHostException e) {
			e.printStackTrace();
			LOGGER.error("GetGUID不可获知主机错误!");
		}
	}

	/**
	 * 类的构造方法
	 */
	public CreateGUID() {
		valueBeforeMD5 = "";
		valueAfterMD5 = "";
		getRandmoGUID(false);
	}

	/**
	 * 类的构造方法
	 */
	public CreateGUID(boolean secure) {
		valueBeforeMD5 = "";
		valueAfterMD5 = "";
		getRandmoGUID(secure);
	}

	/**
	 * 生成MD5摘要
	 * @param secure
	 * @Author liangyongjian
	 * @Version V1.0
	 * @Create at 2017-10-01 下午08:24:55
	 */
	private void getRandmoGUID(boolean secure) {
		MessageDigest md5 = null;
		StringBuffer sbfValueBeforeMD5 = new StringBuffer();
		try {
			md5 = MessageDigest.getInstance("MD5");
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
			LOGGER.error("getRandmoGUID操作失败!失败原因:NoSuchAlgorithmException,没有MessageDigest.getInstance(\"MD5\")此算法!");
		}
		try {
			long time = System.currentTimeMillis();
			long rand = 0L;
			if (secure)
				rand = mySecureRandom.nextLong();
			else
				rand = myRandom.nextLong();
			sbfValueBeforeMD5.append(s_id);
			sbfValueBeforeMD5.append(":");
			sbfValueBeforeMD5.append(Long.toString(time));
			sbfValueBeforeMD5.append(":");
			sbfValueBeforeMD5.append(Long.toString(rand));
			valueBeforeMD5 = sbfValueBeforeMD5.toString();
			md5.update(valueBeforeMD5.getBytes());
			byte array[] = md5.digest();
			StringBuffer sbf = new StringBuffer();
			for (int j = 0; j < array.length; j++) {
				int b = array[j] & 0xff;
				if (b < 16)
					sbf.append('0');
				sbf.append(Integer.toHexString(b));
			}
			valueAfterMD5 = sbf.toString();
		} catch (Exception e) {
			e.printStackTrace();
			LOGGER.error("getRandmoGUID操作失败!失败原因:调用MD5算法计算过程有误!");
		}
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 * TODO:将生成的MD5摘要转化为大写格式,GetGUID类的调用接口函数
	 */
	public String toString() {
		String raw = valueAfterMD5.toUpperCase();
		return raw;
	}

	/**
	 * 获取GUID
	 * @param CreateGUID
	 * @return String
	 * @throws
	 * @author liangyongjian
	 * @date 2017-10-01 下午08:24:55
	 * @version V1.0
	 */
	public static String getGUID() {
		CreateGUID getGuid = new CreateGUID(true);
		return getGuid.toString();
	}

	/**
	 * 测试专用
	 * @param args
	 * @Author liangyongjian
	 * @Version V1.0
	 * @Create at 2017-10-01 下午08:24:55
	 */
	public static void main(String[] args) {
		for (int i = 0; i < 100; i++) {
			System.out.println(i + ": " + getGUID());
		}
	}

}


text:
<?php
use wenyuan\ueditor\Ueditor;
echo Ueditor::widget(['id' => 'myeditor']);
?>

redpajama_set_name: RedPajamaGithub


text:
/**
 * Created by Dean on 6/21/2015.
 */

var USERTEST = (function (USERTEST) {
	"use strict";
	function createLocationBase(pos, name) {
		var that = {};

		that.position = pos || "0:0";
		that.name = name || "";

		return that;
	}

	USERTEST.createLocationBase = createLocationBase;

	return USERTEST;
}(USERTEST || {}));


text:
@interface MOBProjectionEPSG32118 : MOBProjection

@end


text:
"""Humio Integration for Cortex XSOAR - Unit Tests file

This file contains the Unit Tests for the HelloWorld Integration based
on pytest. Cortex XSOAR contribution requirements mandate that every
integration should have a proper set of unit tests to automatically
verify that the integration is behaving as expected during CI/CD pipeline.

Test Execution
--------------

Unit tests can be checked in 3 ways:
- Using the command `lint` of demisto-sdk. The command will build a dedicated
  docker instance for your integration locally and use the docker instance to
  execute your tests in a dedicated docker instance.
- From the command line using `pytest -v` or `pytest -vv`
- From PyCharm

Example with demisto-sdk (from the content root directory):
demisto-sdk lint -d Packs/HelloWorld/Integrations/HelloWorld

Coverage
--------

There should be at least one unit test per command function. In each unit
test, the target command function is executed with specific parameters and the
output of the command function is checked against an expected output.

Unit tests should be self contained and should not interact with external
resources like (API, devices, ...). To isolate the code from external resources
you need to mock the API of the external resource using pytest-mock:
https://github.com/pytest-dev/pytest-mock/

In the following code we configure requests-mock (a mock of Python requests)
before each test to simulate the API calls to the HelloWorld API. This way we
can have full control of the API behavior and focus only on testing the logic
inside the integration code.

We recommend to use outputs from the API calls and use them to compare the
results when possible. See the ``test_data`` directory that contains the data
we use for comparison, in order to reduce the complexity of the unit tests and
avoding to manually mock all the fields.

NOTE: we do not have to import or build a requests-mock instance explicitly.
requests-mock library uses a pytest specific mechanism to provide a
requests_mock instance to any function with an argument named requests_mock.

More Details
------------

More information about Unit Tests in Cortex XSOAR:
https://xsoar.pan.dev/docs/integrations/unit-testing

"""

import json
import io
import os

def util_load_json(path):
    path = os.path.join(os.path.dirname(__file__), path)
    with io.open(path, mode="r", encoding="utf-8") as f:
        return json.loads(f.read())

headers = {}
headers["Content-Type"] = "application/json"
headers["Authorization"] = "Bearer APIKEY"

def test_humio_query(requests_mock):
    """Tests that a humio query can be issued"""
    from Humio import Client, humio_query

    mock_response = util_load_json("test_data/query_results.json")
    requests_mock.post(
        "https://test.com/api/v1/repositories/sandbox/query", json=mock_response
    )

    client = Client(base_url="https://test.com", verify=False, proxies=None)
    args = {
        "queryString": "test",
        "start": "24h",
        "end": "now",
        "isLive": "False",
        "timeZoneOffsetMinutes": 60,
        "repository": "sandbox",
    }

    _, outputs, _ = humio_query(client, args, headers)
    assert outputs == {"Humio.Query": [mock_response]}

def test_humio_query_job(requests_mock):
    """Tests that a humio queryjob can be issued"""
    from Humio import Client, humio_query_job

    mock_response = json.loads(
        """{"id": "1-xK13lC_jjtOYqPR1onSdlLm8","queryOnView": "<R:tail(limit=1.0)>"}"""
    )
    requests_mock.post(
        "https://test.com/api/v1/repositories/sandbox/queryjobs", json=mock_response
    )

    client = Client(base_url="https://test.com", verify=False, proxies=None)
    args = {
        "queryString": "tail(1)",
        "start": "24h",
        "end": "now",
        "isLive": "False",
        "timeZoneOffsetMinutes": 60,
        "repository": "sandbox",
    }

    _, outputs, _ = humio_query_job(client, args, headers)
    assert outputs["Humio.Job"]["id"] == mock_response["id"]

def test_humio_poll(requests_mock):
    """Tests that a humio queryjob can be polled"""
    from Humio import Client, humio_poll

    mock_response = util_load_json("test_data/poll_results.json")
    requests_mock.get(
        "https://test.com/api/v1/repositories/sandbox/queryjobs/testid",
        json=mock_response,
    )

    client = Client(base_url="https://test.com", verify=False, proxies=None)
    args = {"id": "testid", "repository": "sandbox"}

    _, outputs, _ = humio_poll(client, args, headers)
    assert (
        outputs["Humio.Result(val.job_id == obj.job_id)"]["events"]
        == mock_response["events"]
    )

def test_humio_list_alerts(requests_mock):
    """Tests that a humio alerts can be listed"""
    from Humio import Client, humio_list_alerts

    mock_response = util_load_json("test_data/list_alerts_results.json")
    requests_mock.get(
        "https://test.com/api/v1/repositories/sandbox/alerts", json=mock_response
    )

    client = Client(base_url="https://test.com", verify=False, proxies=None)
    args = {"repository": "sandbox"}

    _, outputs, _ = humio_list_alerts(client, args, headers)
    assert outputs["Humio.Alert(val.id == obj.id)"] == mock_response

def test_humio_get_alert_by_id(requests_mock):
    """Tests that a humio alert can be fetched based on its id"""
    from Humio import Client, humio_get_alert_by_id

    mock_response = util_load_json("test_data/get_alert_by_id_results.json")
    requests_mock.get(
        "https://test.com/api/v1/repositories/sandbox/alerts/zNVae7vz-DH7GpeQUPfx1KXMGXGg7bf7",
        json=mock_response,
    )

    client = Client(base_url="https://test.com", verify=False, proxies=None)
    args = {"repository": "sandbox", "id": "zNVae7vz-DH7GpeQUPfx1KXMGXGg7bf7"}

    _, outputs, _ = humio_get_alert_by_id(client, args, headers)
    assert outputs["Humio.Alert(val.id == obj.id)"] == mock_response

def test_humio_create_alert(requests_mock):
    """Tests that a humio alert can be fetched based on its id"""
    from Humio import Client, humio_create_alert

    mock_response = util_load_json("test_data/create_alert_results.json")
    requests_mock.post(
        "https://test.com/api/v1/repositories/sandbox/alerts",
        json=mock_response,
        status_code=201,
    )

    client = Client(base_url="https://test.com", verify=False, proxies=None)
    args = {
        "queryString": "alert=true",
        "start": "24h",
        "name": "TestingAlert",
        "description": "Description of TestingAlert",
        "throttleTimeMillis": "3000000",
        "repository": "sandbox",
        "silenced": "false",
        "notifiers": "BTkuj8QArhIFMh_L39FoN0tnyTUEXplc",
        "labels": "",
    }

    _, outputs, _ = humio_create_alert(client, args, headers)
    assert outputs["Humio.Alert(val.id == obj.id)"] == mock_response

def test_humio_list_notifiers(requests_mock):
    """Tests that a humio alerts can be listed"""
    from Humio import Client, humio_list_notifiers

    mock_response = util_load_json("test_data/list_notifiers_results.json")
    requests_mock.get(
        "https://test.com/api/v1/repositories/sandbox/alertnotifiers",
        json=mock_response,
    )

    client = Client(base_url="https://test.com", verify=False, proxies=None)
    args = {"repository": "sandbox"}

    _, outputs, _ = humio_list_notifiers(client, args, headers)
    assert outputs["Humio.Notifier(val.id == obj.id)"] == mock_response

def test_humio_get_notifier_by_id(requests_mock):
    """Tests that a humio alerts can be listed"""
    from Humio import Client, humio_get_notifier_by_id

    mock_response = util_load_json("test_data/notifier_by_id_results.json")
    requests_mock.get(
        "https://test.com/api/v1/repositories/sandbox/alertnotifiers/BTkuj8QArhIFMh_L39FoN0tnyTUEXplc",
        json=mock_response,
    )

    client = Client(base_url="https://test.com", verify=False, proxies=None)
    args = {"repository": "sandbox", "id": "BTkuj8QArhIFMh_L39FoN0tnyTUEXplc"}

    _, outputs, _ = humio_get_notifier_by_id(client, args, headers)
    assert outputs["Humio.Notifier(val.id == obj.id)"] == mock_response


text:
1.  UIImage+Categories
2.  UIView+SetFrame

## 组件
1.  SystemUnit
2.  AppStoreUtils


text:
require('dotenv').config();

const { getRollupConfig } = require('@elderjs/elderjs');
const svelteConfig = require('./svelte.config');
module.exports = [...getRollupConfig({ svelteConfig })];


text:
package tests;

import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

@Generated(
    value = "com.google.auto.factory.processor.AutoFactoryProcessor",
    comments = "https://github.com/google/auto/tree/master/factory"
    )
final class SimpleClassNullableParametersFactory {
  private final Provider<String> providedNullableProvider;

  private final Provider<String> providedQualifiedNullableProvider;

  @Inject
  SimpleClassNullableParametersFactory(
      Provider<String> providedNullableProvider,
      @BQualifier Provider<String> providedQualifiedNullableProvider) {
    this.providedNullableProvider = checkNotNull(providedNullableProvider, 1);
    this.providedQualifiedNullableProvider = checkNotNull(providedQualifiedNullableProvider, 2);
  }

  SimpleClassNullableParameters create(
      @Nullable String nullable, @Nullable @AQualifier String qualifiedNullable) {
    return new SimpleClassNullableParameters(
        nullable,
        qualifiedNullable,
        providedNullableProvider.get(),
        providedQualifiedNullableProvider.get());
  }

  private static <T> T checkNotNull(T reference, int argumentIndex) {
    if (reference == null) {
      throw new NullPointerException(
          "@AutoFactory method argument is null but is not marked @Nullable. Argument index: "
              + argumentIndex);
    }
    return reference;
  }
}


text:
from ..DiffusionModel import DiffusionModel
import numpy as np
from scipy import stats
import future.utils

__author__ = "Letizia Milli"
__license__ = "BSD-2-Clause"
__email__ = "letizia.milli@di.unipi.it"

class KerteszThresholdModel(DiffusionModel):
    """
         Node/Model Parameters to be specified via ModelConfig

        :param threshold: The node threshold. As default a value of 0.1 is assumed for all nodes.
        :param adopter_rate: The probability of spontaneous adoptions. Defaults value 0.
        :param fraction_infected: The percentage of blocked nodes. Default value 0.1.
     """

    def __init__(self, graph, seed=None):
        """
             Model Constructor

             :param graph: A networkx graph object
         """
        super(self.__class__, self).__init__(graph, seed)
        self.available_statuses = {
            "Susceptible": 0,
            "Infected": 1,
            "Blocked": -1
        }

        self.parameters = {
            "model": {
                "adopter_rate": {
                    "descr": "Exogenous adoption rate",
                    "range": [0, 1],
                    "optional": True,
                    "default": 0
                },
                "percentage_blocked": {
                    "descr": "Percentage of blocked nodes",
                    "range": [0, 1],
                    "optional": True,
                    "default": 0.1
                }
            },
            "nodes": {
                "threshold": {
                    "descr": "Node threshold",
                    "range": [0, 1],
                    "optional": True,
                    "default": 0.1
                }
            },
            "edges": {},
        }

        self.name = "Kertesz Threhold"

    def iteration(self, node_status=True):
        """
        Execute a single model iteration

        :return: Iteration_id, Incremental node status (dictionary node->status)
        """
        self.clean_initial_status(self.available_statuses.values())
        actual_status = {node: nstatus for node, nstatus in future.utils.iteritems(self.status)}

        if self.actual_iteration == 0:

            if min(actual_status.values()) == 0:
                number_node_blocked = int(float(self.graph.number_of_nodes()) *
                                          float(self.params['model']['percentage_blocked']))

                i = 0
                while i < number_node_blocked:
                    # select a random node
                    #print("aa", len(self.graph.nodes()))#, self.graph.number_of_nodes(), np.random.randint(0, self.graph.number_of_nodes()))
                    try:
                        node = list(self.graph.nodes())[np.random.randint(0, self.graph.number_of_nodes())]

                        # node not infected
                        if actual_status[node] == 0:

                            # node blocked
                            actual_status[node] = -1
                            self.status[node] = -1
                            i += 1
                    except:
                        i += 1

            self.actual_iteration += 1
            delta, node_count, status_delta = self.status_delta(actual_status)
            if node_status:
                return {"iteration": 0, "status": actual_status.copy(),
                        "node_count": node_count.copy(), "status_delta": status_delta.copy()}
            else:
                return {"iteration": 0, "status": {},
                        "node_count": node_count.copy(), "status_delta": status_delta.copy()}

        for node in self.graph.nodes:
            if self.status[node] == 0:
                if self.params['model']['adopter_rate'] > 0:
                    xk = (0, 1)
                    pk = (1-self.params['model']['adopter_rate'], self.params['model']['adopter_rate'])
                    probability = stats.rv_discrete(name='probability', values=(xk, pk))
                    number_probability = probability.rvs()

                    if number_probability == 1:
                        actual_status[node] = 1
                        continue

                neighbors = list(self.graph.neighbors(node))
                if len(neighbors) == 0:
                    continue

                if self.graph.directed:
                    neighbors = self.graph.predecessors(node)

                infected = 0
                for v in neighbors:
                    if self.status[v] != -1:
                        infected += self.status[v]

                infected_ratio = float(infected)/len(neighbors)
                if infected_ratio >= self.params['nodes']['threshold'][node]:
                    actual_status[node] = 1

        delta, node_count, status_delta = self.status_delta(actual_status)
        self.status = actual_status
        self.actual_iteration += 1

        if node_status:
            return {"iteration": self.actual_iteration - 1, "status": delta.copy(),
                    "node_count": node_count.copy(), "status_delta": status_delta.copy()}
        else:
            return {"iteration": self.actual_iteration - 1, "status": {},
                    "node_count": node_count.copy(), "status_delta": status_delta.copy()}


text:
<?php

namespace Symfony\Component\Routing\Tests\Loader;

use Symfony\Component\Routing\Loader\ClosureLoader;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;

class ClosureLoaderTest extends \PHPUnit_Framework_TestCase
{
    public function testSupports()
    {
        $loader = new ClosureLoader();

        $closure = function () {};

        $this->assertTrue($loader->supports($closure), '->supports() returns true if the resource is loadable');
        $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable');

        $this->assertTrue($loader->supports($closure, 'closure'), '->supports() checks the resource type if specified');
        $this->assertFalse($loader->supports($closure, 'foo'), '->supports() checks the resource type if specified');
    }

    public function testLoad()
    {
        $loader = new ClosureLoader();

        $route = new Route('/');
        $routes = $loader->load(function () use ($route) {
            $routes = new RouteCollection();

            $routes->add('foo', $route);

            return $routes;
        });

        $this->assertEquals($route, $routes->get('foo'), '->load() loads a \Closure resource');
    }
}


text:
EW_ENTER

class DLLIMPEXP_EWA_BASE String;
class DLLIMPEXP_EWA_BASE TimeSpan;
class DLLIMPEXP_EWA_BASE ElapsedTimer;

// TimePoint
class DLLIMPEXP_EWA_BASE TimePoint
{
public:

	TimePoint():val(0) {}

	explicit TimePoint(const String& s);
	explicit TimePoint(int64_t v):val(v){}

	// cast to time_t
	time_t GetTime() const
	{
		return val/1000000;
	}

	// set from time_t and microseconds
	void SetTime(time_t v,int microseconds=0)
	{
		val=(int64_t)v*1000000+(int64_t)microseconds;
	}

	// cast to string
	String Format(const String& f="") const;

	bool Parse(const String& s);

	// add a timespan
	TimePoint& operator+=(const TimeSpan& span);

	int64_t val;
};

// TimeDetail
class DLLIMPEXP_EWA_BASE TimeDetail
{
public:

	enum
	{
		LOCAL,
		UTC,
	};

	TimeDetail(int t=LOCAL);
	TimeDetail(const TimePoint& tp_,int t=LOCAL);

	int GetYear() const;
	int GetMonth() const;
	int GetDay() const;
	int GetHour() const;
	int GetMinute() const;
	int GetSecond() const;
	int GetMilliSecond() const;

	void SetYear(int y);
	void SetMonth(int m);
	void SetDay(int d);
	void SetHour(int h);
	void SetMinute(int m);
	void SetSecond(int s);
	void SetMilliSecond(int n);

	String Format(const String& f="") const;

	// Parse from string yy-mm-dd[ hh:mm:dd]
	bool Parse(const String& ts_,int t=LOCAL);

	bool Parse(const TimePoint& tp_,int t=LOCAL);

	TimePoint GetTimePoint() const;

	struct tm& GetTm(){return tk;}

private:
	mutable struct tm tk;
	int ms;
};

// TimeSpan
class DLLIMPEXP_EWA_BASE TimeSpan
{
public:
	TimeSpan():val(0) {}
	explicit TimeSpan(int64_t v):val(v) {}

	int64_t GetSeconds() const
	{
		return val/1000000;
	}
	int64_t GetMilliSeconds() const
	{
		return val/1000;
	}
	int64_t GetMicroSeconds() const
	{
		return val;
	}

	static TimeSpan Day(int64_t v)
	{
		return Seconds(60*60*24*v);
	}
	static TimeSpan Hours(int64_t v)
	{
		return Seconds(60*60*v);
	}
	static TimeSpan Minutes(int64_t v)
	{
		return Seconds(60*v);
	}
	static TimeSpan Seconds(int64_t v)
	{
		return TimeSpan(1000*1000*v);
	}
	static TimeSpan MilliSeconds(int64_t v)
	{
		return TimeSpan(1000*v);
	}
	static TimeSpan MicroSeconds(int64_t v)
	{
		return TimeSpan(v);
	}

	int64_t val;
};

#define BOOL_OPERATOR(TYPE,VALUE)\
	inline bool operator <(const TYPE& p1,const TYPE& p2){return p1.VALUE  < p2.VALUE;}\
	inline bool operator<=(const TYPE& p1,const TYPE& p2){return p1.VALUE <= p2.VALUE;}\
	inline bool operator>=(const TYPE& p1,const TYPE& p2){return p1.VALUE >= p2.VALUE;}\
	inline bool operator >(const TYPE& p1,const TYPE& p2){return p1.VALUE  > p2.VALUE;}\
	inline bool operator==(const TYPE& p1,const TYPE& p2){return p1.VALUE == p2.VALUE;}\
	inline bool operator!=(const TYPE& p1,const TYPE& p2){return p1.VALUE != p2.VALUE;}

BOOL_OPERATOR(TimePoint,val)
BOOL_OPERATOR(TimeSpan,val)

// TimeSpan and TimePoint operators

inline double operator/(const TimeSpan& s1,const TimeSpan& s2)
{
	return double(s1.val)/double(s2.val);
}

inline const TimeSpan operator/(const TimeSpan& s1,double v)
{
	return TimeSpan((int64_t)(double(s1.val)/v));
}

inline const TimeSpan operator*(const TimeSpan& s1,double v)
{
	return TimeSpan((int64_t)(double(s1.val)*v));
}

inline const TimeSpan operator*(double v,const TimeSpan& s1)
{
	return TimeSpan((int64_t)(double(s1.val)*v));
}

inline TimeSpan operator-(const TimePoint& p1,const TimePoint& p2)
{
	return TimeSpan(p1.val-p2.val);
}

inline TimePoint operator+(const TimePoint& p1,const TimeSpan& p2)
{
	return TimePoint(p1.val+p2.val);
}

inline TimePoint operator-(const TimePoint& p1,const TimeSpan& p2)
{
	return TimePoint(p1.val-p2.val);
}

inline TimePoint operator+(const TimeSpan& p1,const TimePoint& p2)
{
	return TimePoint(p1.val+p2.val);
}

inline TimeSpan operator+(const TimeSpan& p1,const TimeSpan& p2)
{
	return TimeSpan(p1.val+p2.val);
}

inline TimeSpan operator-(const TimeSpan& p1,const TimeSpan& p2)
{
	return TimeSpan(p1.val-p2.val);
}

class DLLIMPEXP_EWA_BASE Clock
{
public:

	// now() returns current TimePoint
	static TimePoint now();

	// process started time
	static const TimePoint tpStarted;
};

class DLLIMPEXP_EWA_BASE ElapsedTimer
{
public:

	ElapsedTimer()
	{
		tick();
	}

	void tick()
	{
		p1=p2=Clock::now();
	}

	double tack()
	{
		p2=Clock::now();
		return get();
	}

	double get()
	{
		return (p2-p1)/TimeSpan::Seconds(1);
	}

private:
	TimePoint p1;
	TimePoint p2;
};

template<> class hash_t<TimePoint> : public hash_pod<TimePoint> {};
template<> class hash_t<TimeSpan> : public hash_pod<TimeSpan> {};

EW_LEAVE

namespace tl
{
	template<> struct is_pod<ew::TimePoint> : public value_type<true>{};
	template<> struct is_pod<ew::TimeSpan> : public value_type<true>{};
};

#endif


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

<title>quarks.samples.apps.sensorAnalytics (Quarks v0.4.0)</title>
<meta name="date" content="2016-03-07">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package quarks.samples.apps.sensorAnalytics

The Sensor Analytics sample application demonstrates some common
 continuous sensor analytic application themes.

See: Description

Class Summary

Class
Description

Sensor1

Analytics for "Sensor1".

SensorAnalyticsApplication

A sample application demonstrating some common sensor analytic processing
 themes.

Package quarks.samples.apps.sensorAnalytics Description

The Sensor Analytics sample application demonstrates some common
 continuous sensor analytic application themes.
 See Sensor1 for the
 core of the analytics processing and
 SensorAnalyticsApplication
 for the main program.

 The themes include:

Batched Data Reduction - reducing higher frequency sensor reading
     samples down to a lower frequency using statistical aggregations
     of the raw readings.

Computing continuous historical statistics such as a
     30 second trailing average of sensor readings.

Outlier / threshold detection against a configurable range

Local logging of stream tuples

Publishing analytic results to an MQTT broker

Dynamic configuration control - subscribing to a MQTT broker
     to receive commands to adjust the threshold detection range value.

Generally, the configuration of the processing is driven via an
     external configuration description.

Conditional stream tracing - configuration controlled inclusion of tracing.

Prerequisites:

 The default configuration is for a local MQTT broker.
 A good resource is mosquitto.org
 if you want to download and setup your own MQTT broker.
 Or you can use some other broker available in your environment.

 Alternatively, there are some public MQTT brokers available to experiment with.
 Their availability status isn't guaranteed.  If you're unable to connect
 to the broker, it's likely that it isn't up or your firewalls don't
 allow you to connect.  DO NOT PUBLISH ANYTHING SENSITIVE - anyone
 can be listing.  A couple of public broker locations are noted
 in the application's properties file.

 The default mqttDevice.topic.prefix value, used by default in
 generated MQTT topic values and MQTT clientId, contains the user's
 local login id.  The SensorAnalytics sample application does not have any
 other sensitive information.

 Edit <quarks-release>/java8/scripts/apps/sensorAnalytics/sensoranalytics.properties
 to change the broker location or topic prefix.

Application output:

 The application periodically (every 30sec), publishes a list of
 the last 10 outliers to MQTT.  When enabled, it also publishes
 full details of individual outliers as they occur.
 It also subscribes to MQTT topics for commands to dynamically change the
 threshold range and whether to publish individual outliers.

 All MQTT configuration information, including topic patterns,
 are in the application.properties file.

 The application logs outlier events in local files.  The actual location
 is specified in the application.properties file.

 The application generates some output on stdout and stderr.
 The information includes:

MQTT device info. Lines 1 through 5 below.

URL for the Quarks development console.  Line 6.

Trace of the outlier event stream. Line 7.
     The output is a label, which includes the active threshold range,
     followed by the event's JSON.
     These are the events that will also be logged and conditionally published
     as well as included in the periodic lastN info published every 30sec.

Announcement when a "change threshold" or "enable publish of 1khz outliers"
     command is received and processed.
     Line 8 and 9.

At this time some INFO trace output from the MQTT connector

At this time some INFO trace output from the File connector

 Sample console output:

 [1] MqttDevice serverURLs [tcp://localhost:1883]
 [2] MqttDevice clientId id/012345
 [3] MqttDevice deviceId 012345
 [4] MqttDevice event topic pattern id/012345/evt/+/fmt/json
 [5] MqttDevice command topic pattern id/012345/cmd/+/fmt/json
 [6] Quarks Console URL for the job: http://localhost:57324/console
 [7] sensor1.outside1hzMeanRange[124..129]: {"id":"sensor1","reading":{"N":1000,"MIN":0.0,"MAX":254.0,"MEAN":130.23200000000006,"STDDEV":75.5535473324351},"msec":1454623874408,"agg.begin.msec":1454623873410,"agg.count":1000,"AvgTrailingMean":128,"AvgTrailingMeanCnt":4}
 ...
 [8] ===== Changing range to [125..127] ======
 sensor1.outside1hzMeanRange[125..127]: {"id":"sensor1","reading":{"N":1000,"MIN":0.0,"MAX":254.0,"MEAN":129.00099999999978,"STDDEV":74.3076080870567},"msec":1454624142419,"agg.begin.msec":1454624141420,"agg.count":1000,"AvgTrailingMean":127,"AvgTrailingMeanCnt":30}
 [9] ===== Changing isPublish1hzOutsideRange to true ======
 ...

Running, observing and controlling the application:

 $ ./runSensorAnalytics.sh

 To observe the locally logged outlier events:

 $ tail -f /tmp/SensorAnalytics/logs/.outside1hzMeanRange

 To observe the events that are getting published to MQTT:

 $ ./runDeviceComms.sh watch

 To change the outlier threshold setting:

The command value is the new range string: [<lowerBound>..<upperBound>].

 $ ./runDeviceComms.sh send sensor1.set1hzMeanRangeThreshold "[125..127]"

 To change the "publish individual 1hz outliers" control:

 $ ./runDeviceComms.sh send sensor1.setPublish1hzOutsideRange true

Alternative MQTT clients

 You can use any MQTT client but you will have to specify the
 MQTT server, the event topics to watch / subscribe to, and the command topics
 and JSON for publish commands.  The MqttDevice output above provides most
 of the necessary information.

 For example, the mosquitto_pub and
 mosquitto_sub commands equivalent to the above runDeviceComms.sh
 commands are:

 # Watch the device's event topics
 $ /usr/local/bin/mosquitto_sub -t id/012345/evt/+/fmt/json
 # change the outlier threshold setting
 $ /usr/local/bin/mosquitto_pub -m '{"value":"[125..127]"}' -t id/012345/cmd/sensor1.set1hzMeanRangeThreshold/fmt/json
 # change the "publish individual 1hz outliers" control
 $ /usr/local/bin/mosquitto_pub -m '{"value":"true"}' -t id/012345/cmd/sensor1.setPublish1hzOutsideRange/fmt/json

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

quarks-edge community @ github.com

Prev Package

Next Package

Frames

No Frames

All Classes

Copyright IBM 2015,2016 - 2f6ad0e-20160307-0902


text:
import { Command } from 'commander';
import bootstrap from './cmds/bootstrap';
import configure from './cmds/configure';
import backup from './cmds/backup';
import restore from './cmds/restore';
import upload from './cmds/upload';
import chalk from 'chalk';

const program = new Command();

// TODO
// bootstrap:
// Check whether config.json exists
// If config.json exists, import it
// Ask which categories in .runtimeconfig.json should be imported
//   - Ask which new categories (names) should be created
//   - Ask for the slug for each category
//   - Add name/slug objects to .runtimeconfig.json
// Save .runtimeconfig.json

console.log(`Gettin' spooky 👻  with ${chalk.hex('#fedc5d').bold('poltergeist')}`);

program.version('0.0.0', '-v, --version');

program
  .command('bootstrap [destination]')
  .description('bootstrap project')
  .action(bootstrap);

program
  .command('configure')
  .description('configure project')
  .action(configure);

program
  .command('backup [destination]')
  .option('--configuration', 'backup configuration')
  .option('--firestore', 'backup Firestore')
  .option('--storage', 'backup storage')
  .option('--accounts', 'backup accounts')
  .description('backup project data')
  .action(backup);

program
  .command('restore [source]')
  .option('--configuration', 'restore configuration')
  .option('--firestore', 'restore Firestore')
  .option('--storage', 'restore storage')
  .option('--accounts', 'restore accounts')
  .description('restore backup folder to project')
  .action(restore);

program
  .command('upload')
  .description('upload file or directory content')
  .action(upload);

program.parse(process.argv);


text:
from swgpy.object import *

def create(kernel):
	result = Weapon()

	result.template = "object/weapon/melee/2h_sword/shared_2h_sword_maul.iff"
	result.attribute_template_id = 10
	result.stfName("weapon_name","sword_2h_maul")

	#### BEGIN MODIFICATIONS ####
	####  END MODIFICATIONS  ####

	return result


text:
package com.intellij.codeInsight.completion;

/**
 * @author peter
 */
@Deprecated
public class UnfocusedComments extends CompletionConfidence {
}


text:
package com.gl.avs.model;

import java.io.Serializable;
import java.util.Date;

public abstract class BaseEntity implements Serializable{
	/**
	 *
	 */
	private static final long serialVersionUID = -6928120888327704487L;
	private Long oid;
	private Date createAt;
	private Date updateAt;

	public Long getOid() {
		return oid;
	}
	public void setOid(Long oid) {
		this.oid = oid;
	}
	public Date getCreateAt() {
		return createAt;
	}
	public void setCreateAt(Date createAt) {
		this.createAt = createAt;
	}
	public Date getUpdateAt() {
		return updateAt;
	}
	public void setUpdateAt(Date updateAt) {
		this.updateAt = updateAt;
	}

}


text:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yii message/extract' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * Message string can be used with plural forms format. Check i18n section
 * of the guide for details.
 *
 * NOTE: this file must be saved in UTF-8 encoding.
 */
return [
    'file preview and multiple file upload' => 'faili eelvaade ja mitme faili üleslaadimine',
    'Note:' => 'Märkus:',
    'multiple file upload' => 'mitme faili üleslaadimine',
    'Your browser does not support {validation}. Try an alternative or more recent browser to access these features.' => 'Sinu brauser ei toeta {validation}. Proovi kasutada mõnda teist või uuendatud brausrit, et neid võimalusi kasutada.'
];


text:
from ._op import OpRunUnaryNum

class Identity(OpRunUnaryNum):
    def _run(self, a):  # type: ignore
        if a is None:
            return (None,)
        return (a.copy(),)


text:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UniverseView : MonoBehaviour {
    public static UniverseView Instance;
    private float _universeTime;
    public float universeTime
    {
        get
        {
            return _universeTime;
        }
        set
        {
            _universeTime = value;
            startRealTicks = DateTime.UtcNow.Ticks;
            startUniverseTime = _universeTime;
        }
    }
    [HideInInspector]
    public UniverseObject uo;
    public float universeID;
    private float startUniverseTime;
    private long startRealTicks;
    // Use this for initialization
    void Awake()
    {
        Instance = this;
        uo = new UniverseObject();
        uo.Init();
        uo.uv = this;
        universeID = UnityEngine.Random.value;//不知道传输精度会不会导致问题
        long idTemp = (long)(universeID * 10000000.0f);
        universeID = (float)(idTemp % 10000000);
        universeID /= 1000.0f;
        //Debug.Log("uo ini232323234234234t");
    }

    void Start () {

	}

    public void UpdateUniverseTime()
    {
        universeTime = (DateTime.UtcNow.Ticks - startRealTicks) * 1.0f / 10000000 + startUniverseTime;
        //lastFrameTime = Time.time;
    }

    public void SetUniverseTime(float nTime)
    {
        universeTime = nTime;
    }

    // Update is called once per frame
    void Update () {

	}
}


text:
package cn.ytxu.androidbackflow.sample.launch_mode;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import cn.ytxu.androidbackflow.BackFlow;
import cn.ytxu.androidbackflow.BackFlowType;
import cn.ytxu.androidbackflow.BaseBackFlowActivity;
import cn.ytxu.androidbackflow.R;

/**
 * Created by ytxu on 2017/1/8.
 */
public class LaunchModeActivity extends BaseBackFlowActivity implements View.OnClickListener {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.launch_mode_activity);

        setTitle(this.getClass().getSimpleName());

        $(R.id.launch_mode_finish_task).setOnClickListener(this);

        $(R.id.launch_mode_standard).setOnClickListener(this);
        $(R.id.launch_mode_single_task).setOnClickListener(this);
        $(R.id.launch_mode_single_top).setOnClickListener(this);
        $(R.id.launch_mode_single_instance).setOnClickListener(this);
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        BackFlow.Logger.log("onNewIntent", this.getClass().getSimpleName());
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.launch_mode_finish_task: {
                BackFlow.builder(BackFlowType.finish_task, this).create().request();
            }
            break;
            case R.id.launch_mode_standard: {
                startActivity(new Intent(this, LaunchModeActivity.class));
            }
            break;
            case R.id.launch_mode_single_task: {
                startActivity(new Intent(this, SingleTaskActivity.class));
            }
            break;
            case R.id.launch_mode_single_top: {
                startActivity(new Intent(this, SingleTopActivity.class));
            }
            break;
            case R.id.launch_mode_single_instance: {
                startActivity(new Intent(this, SingleInstanceActivity.class));
            }
            break;
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">

    <!--rap start-->
    <appender name="rapAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>${logger.root}/rap.log</File>
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <charset>UTF-8</charset>
            <Pattern>%date %-5level [%file:%line] %msg%n%ex</Pattern>
        </encoder>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>${logger.root}/rap.log.%d{yyyy-MM-dd}</FileNamePattern>
            <maxHistory>15</maxHistory>
            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <MaxFileSize>50MB</MaxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
        </rollingPolicy>
    </appender>

    <appender name="webAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>${logger.root}/rap-web.log</File>
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <charset>UTF-8</charset>
            <Pattern>%date %-5level [%file:%line] %msg%n%ex</Pattern>
        </encoder>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>${logger.root}/rap-web.log.%d{yyyy-MM-dd}</FileNamePattern>
            <maxHistory>15</maxHistory>
            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <MaxFileSize>50MB</MaxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
        </rollingPolicy>
    </appender>

    <appender name="errorAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>${logger.root}/rap-error.log</File>
        <encoder>
            <charset>UTF-8</charset>
            <Pattern>%date %-5level [%file:%line] %msg%n%ex</Pattern>
        </encoder>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>${logger.root}/rap-error.log.%d{yyyy-MM-dd}</FileNamePattern>
            <maxHistory>15</maxHistory>
            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <MaxFileSize>50MB</MaxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
        </rollingPolicy>
    </appender>

    <!--profile-->
    <appender name="PROFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>${logger.root}/profile.log</File>
        <encoder>
            <charset>UTF-8</charset>
            <Pattern>%date %-5level [%file:%line] %msg%n%ex</Pattern>
        </encoder>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>${logger.root}/profile.log.%d{yyyy-MM-dd}</FileNamePattern>
            <maxHistory>15</maxHistory>
            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <MaxFileSize>50MB</MaxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
        </rollingPolicy>
    </appender>
    <!--rap end-->

    <!--rap start-->
    <logger name="rap" additivity="false">
        <level value="${logger.level}"/>
        <appender-ref ref="rapAppender"/>
    </logger>

    <!--rap end-->

    <root>
        <level value="${logger.level}"/>
        <appender-ref ref="rapAppender"/>
    </root>

</configuration>


text:
/*	$NetBSD: hpc.c,v 1.1 2000/06/14 16:51:07 soren Exp $	*/

/*
 * Copyright (c) 2000 Soren S. Jorvang
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *          This product includes software developed for the
 *          NetBSD Project.  See http://www.netbsd.org/ for
 *          information about NetBSD.
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>

#include <sgimips/gio/gioreg.h>
#include <sgimips/gio/giovar.h>

struct hpc_softc {
	struct	device sc_dev;
};

static int	hpc_match(struct device *, struct cfdata *, void *);
static void	hpc_attach(struct device *, struct device *, void *);
static int	hpc_print(void *, const char *);

struct cfattach hpc_ca = {
        sizeof(struct hpc_softc), hpc_match, hpc_attach
};

static int
hpc_match(parent, match, aux)
	struct device *parent;
	struct cfdata *match;
	void *aux;
{
        return 1;
}

static void
hpc_attach(parent, self, aux)
	struct device *parent;
	struct device *self;
	void *aux;
{
#if 0
	struct hpc_softc *sc = (struct hpc_softc *)self;
#endif
	struct hpc_attach_args *ga = aux;

	printf("\n");

	/*
	 * XXX
	 */

	config_found(self, &ga, hpc_print);
}

static int
hpc_print(aux, pnp)
	void *aux;
	const char *pnp;
{
#if 0
	struct hpc_attach_args *ga = aux;
#endif

	if (pnp != 0)
		return QUIET;

	return UNCONF;
}


text:
import fgInput from './components/Inputs/formGroupInput.vue'
import DropDown from './components/Dropdown.vue'
import Spinner from './components/Spinner.vue'

/**
 * You can register global components here and use them as a plugin in your main Vue instance
 */
const GlobalComponents = {
  install (Vue) {
    Vue.component('fg-input', fgInput)
    Vue.component('drop-down', DropDown)
    Vue.component('spinner', Spinner)
  }
}

export default GlobalComponents


text:
.jimu-widget-draw{
  width: 100%;
  height: 100%;
  min-width: 250px;
  min-height: 192px;
}

.jimu-widget-draw .measure-section{
  display: none;
  width: 100%;
  overflow: hidden;
  margin-top: 12px;
}

.jimu-widget-draw .location-units-tip,
.jimu-widget-draw .area-units-tip,
.jimu-widget-draw .distance-units-tip{
  width: 120px;
  height: 30px;
  line-height: 30px;
  text-align: right;
  padding-right: 10px;
  font-size: 13px;
  font-family: 'Avenir Medium', Verdana, Geneva, sans-serif;
}

.jimu-rtl .jimu-widget-draw .location-units-tip,
.jimu-rtl .jimu-widget-draw .area-units-tip,
.jimu-rtl .jimu-widget-draw .distance-units-tip{
  text-align: left;
  padding-right: 0;
  padding-left: 10px;
}

/* .jimu-rtl .jimu-widget-draw .area-units-tip{
  padding-left: 0;
  padding-right: 17px;
}

.jimu-rtl .jimu-widget-draw .distance-units-tip{
  padding-left: 0;
  padding-right: 17px;
} */

.jimu-widget-draw .dijitArrowButtonContainer{
  width: 40px;
}

.jimu-widget-draw .dijitSelect{
  height: 30px;
  width: 100%;
}

.jimu-widget-draw .dijitReset.dijitLeft.dijitButtonNode.dijitArrowButton.dijitDownArrowButton{
  width: 100%;
}

.jimu-widget-draw .dijitReset.dijitLeft.dijitButtonNode.dijitArrowButton.dijitUpArrowButton{
  width: 100%;
}

.jimu-widget-draw .dijitReset.dijitLeft.dijitButtonNode.dijitArrowButton.dijitDownArrowButton .dijitArrowButtonInner{
  width: 100%;
}

.jimu-widget-draw .dijitReset.dijitLeft.dijitButtonNode.dijitArrowButton.dijitUpArrowButton .dijitArrowButtonInner{
  width: 100%;
}

.jimu-widget-draw .operations{
  margin-top: 20px;
  text-align: center;
}

.jimu-widget-draw .operations .jimu-btn{
  padding: 0 18px;
  height: 32px;
  line-height: 33px;
  margin-right: 10px;
  margin-bottom: 10px;
  min-width: 10px;
}

.jimu-rtl .jimu-widget-draw .operations .jimu-btn{
  margin-right: 0;
  margin-left: 10px;
}

.jimu-widget-draw .operations .jimu-btn.last-btn{
  margin-right: 0;
}

.jimu-rtl .jimu-widget-draw .operations .jimu-btn.last-btn{
  margin-left: 0;
}

.jimu-widget-draw .draw-item.jimu-symbol-chooser .symbol-set-table > tbody > tr > td{
  /* word-break: break-all; */ /*it can't break line when one word is too long.*/
  text-align: right;
  padding-right: 10px;
}

.jimu-rtl .jimu-widget-draw .draw-item.jimu-symbol-chooser .symbol-set-table > tbody > tr > td{
  text-align: left;
  padding-right: 0;
  padding-left: 10px;
}

.jimu-widget-draw .draw-item.jimu-symbol-chooser .symbol-set-table{
  font-size: 12px;
}
.jimu-widget-draw .draw-item{
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
  overflow: hidden;
  display: none;
}

.jimu-widget-draw .draw-item .header{
  vertical-align: middle;
  padding: 12px 0;
  min-height: 40px;
  cursor: pointer;
  position: relative;
}

.jimu-widget-draw .draw-item .header>*{
  display: inline-block;
  vertical-align: middle;
  word-break: break-word;
}

.jimu-widget-draw .draw-item .header .toggle-draw{
  position: absolute;
  top: 14px;
  right: -12px;
}

.jimu-rtl .jimu-widget-draw .draw-item .header .toggle-draw{
  left: -12px;
  right: auto;
}

.jimu-widget-draw .draw-item .header .icon{
  width: 16px;
  height: 16px;
  margin-right: 10px;
}

.jimu-widget-draw .draw-item .header>.icon{
  vertical-align: top;
}

.jimu-widget-draw .draw-item .header .icon img{
  width: 100%;
  height: 100%;
}

.jimu-widget-draw .draw-item .header .arrow{
  content: '';
  border-radius: 50%;
  width: 16px;
  height: 16px;
  top: 12px;
  text-indent: -9999em;
  background: url(images/arrow_normal.svg) no-repeat center;
  z-index: 10;
}

.jimu-widget-draw .draw-item .header .arrow:hover{
  background: url(images/arrow_hover.svg) no-repeat center;
}

.jimu-widget-draw .draw-item .header.applied .arrow{
  transform: rotate(90deg);
}

.jimu-widget-draw .draw-item .header .item-title{
  font-size: 14px;
  font-family: 'Avenir Medium', Verdana, Geneva, sans-serif;
}

.jimu-widget-draw .symbol-chooser{
  width: auto!important;
}


text:
/**
 * \file
 * \brief tracectrl application
 *
 * Starts and stops the tracing.
 */
/*
 * Copyright (c) 2013, ETH Zurich.
 * All rights reserved.
 *
 * This file is distributed under the terms in the attached LICENSE file.
 * If you do not find this file, copies can be found by writing to:
 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
 */

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>

#include <barrelfish/barrelfish.h>
#include <trace/trace.h>

static volatile bool finished;

static void after_prepare(void *arg)
{
    finished = true;
}

static errval_t init_tracing(void)
{
    printf("%s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__);
    trace_reset_all();
    // Tell the trace system when to start and stop.  We can also
    // provide an overriding maximum duration (in cycles) as the last parameter.
    return trace_control(TRACE_EVENT(TRACE_SUBSYS_BENCH,
                                     TRACE_EVENT_BENCH_START, 0),
                         TRACE_EVENT(TRACE_SUBSYS_BENCH,
                                     TRACE_EVENT_BENCH_STOP, 0),
                         0);
}

static void start_tracing(void)
{
    // start the trace going by providing the start event
    TRACE(BENCH, START, 0);
}

static void stop_tracing(void)
{
    // stop the trace by providing the stop event
    TRACE(BENCH, STOP, 0);
}

static void callback(void *arg)
{
    printf("%s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__);
    finished = true;
}

static void trace_setup(void)
{
    finished = false;

    errval_t err = init_tracing();
    if (err_is_fail(err)) {
        USER_PANIC_ERR(err, "initialising tracing");
    }

    // Make sure all subsystems get logged.
    trace_set_all_subsys_enabled(true);
    // Prepare the tracing framework. This is optional.
    trace_prepare(MKCLOSURE(after_prepare, NULL));

    while(!finished) {
        // Make sure this program is not exited before everything
        // is completed.
        event_dispatch_non_block(get_default_waitset());
        thread_yield_dispatcher(NULL_CAP);
    }
}

static void trace_flush_sync(void) {

    finished = false;
    trace_flush(MKCLOSURE(callback, NULL));
    while(!finished) {
        // Make sure this program is not exited before everything
        // is completed.
        event_dispatch_non_block(get_default_waitset());
        thread_yield_dispatcher(NULL_CAP);
    }
}

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

    if (argc < 2) {
        printf("Usage: %s start|stop\n", argv[0]);
        return 1;
    }

    if (strcmp(argv[1], "start") == 0) {
        trace_setup();
        start_tracing();
    } else if (strcmp(argv[1], "stop") == 0) {
        stop_tracing();
        trace_flush_sync();
    } else {
        printf("%s:%s:%d: Unknown command: %s\n",
               __FILE__, __FUNCTION__, __LINE__, argv[1]);
    }

    return 0;
}


text:
package org.apache.carbondata.core.scan.complextypes;

import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Map;

import org.apache.carbondata.core.datastore.chunk.impl.DimensionRawColumnChunk;
import org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension;
import org.apache.carbondata.core.scan.filter.GenericQueryType;
import org.apache.carbondata.core.scan.processor.RawBlockletColumnChunks;
import org.apache.carbondata.core.util.DataTypeUtil;

public class ArrayQueryType extends ComplexQueryType implements GenericQueryType {

  private GenericQueryType children;

  public ArrayQueryType(String name, String parentname, int blockIndex) {
    super(name, parentname, blockIndex);
  }

  @Override public void addChildren(GenericQueryType children) {
    if (this.getName().equals(children.getParentname())) {
      this.children = children;
    } else {
      this.children.addChildren(children);
    }
  }

  @Override public String getName() {
    return name;
  }

  @Override public void setName(String name) {
    this.name = name;
  }

  @Override public String getParentname() {
    return parentname;
  }

  @Override public void setParentname(String parentname) {
    this.parentname = parentname;

  }

  public void parseBlocksAndReturnComplexColumnByteArray(DimensionRawColumnChunk[] rawColumnChunks,
      int rowNumber, int pageNumber, DataOutputStream dataOutputStream) throws IOException {
    byte[] input = copyBlockDataChunk(rawColumnChunks, rowNumber, pageNumber);
    ByteBuffer byteArray = ByteBuffer.wrap(input);
    int dataLength = byteArray.getInt();
    dataOutputStream.writeInt(dataLength);
    if (dataLength > 0) {
      int dataOffset = byteArray.getInt();
      for (int i = 0; i < dataLength; i++) {
        children
            .parseBlocksAndReturnComplexColumnByteArray(rawColumnChunks, dataOffset++, pageNumber,
                dataOutputStream);
      }
    }
  }

  @Override public int getColsCount() {
    return children.getColsCount() + 1;
  }

  @Override public void fillRequiredBlockData(RawBlockletColumnChunks blockChunkHolder)
      throws IOException {
    readBlockDataChunk(blockChunkHolder);
    children.fillRequiredBlockData(blockChunkHolder);
  }

  @Override public Object getDataBasedOnDataType(ByteBuffer dataBuffer) {
    Object[] data = fillData(dataBuffer);
    if (data == null) {
      return null;
    }
    return DataTypeUtil.getDataTypeConverter().wrapWithGenericArrayData(data);
  }

  protected Object[] fillData(ByteBuffer dataBuffer) {
    int dataLength = dataBuffer.getInt();
    if (dataLength == -1) {
      return null;
    }
    Object[] data = new Object[dataLength];
    for (int i = 0; i < dataLength; i++) {
      data[i] = children.getDataBasedOnDataType(dataBuffer);
    }
    return data;
  }

  @Override public Object getDataBasedOnColumn(ByteBuffer dataBuffer, CarbonDimension parent,
      CarbonDimension child) {
    throw new UnsupportedOperationException("Operation Unsupported for ArrayType");
  }

  @Override public Object getDataBasedOnColumnList(Map<CarbonDimension, ByteBuffer> childBuffer,
      CarbonDimension presentColumn) {
    throw new UnsupportedOperationException("Operation Unsupported for ArrayType");
  }

}


text:
/*
** tabs.css
*/

/* add colour to tab if running
**
** class name is derived from tab title
** with:
**    letter/digit                     -> same, case preserved
**    space, comma, underscore, period -> "_" underscore
**    other punctuation                -> "-" dash(minus)
*/

.TAB-Project_1.item_button,
.TAB-Project_1.running {
  color: brown;
}
.TAB-Project_2.item_button,
.TAB-Project_2.running {
  color: red;
}
.TAB-Project_3.item_button,
.TAB-Project_3.running {
  color: orange;
}
.TAB-Project_4.item_button,
.TAB-Project_4.running {
  color: gold;
}
.TAB-Project_5.item_button,
.TAB-Project_5.running {
  color: green;
}
.TAB-shell.item_button,
.TAB-shell.running {
  color: blue;
}
.TAB-EMACS.item_button,
.TAB-EMACS.running {
  color: purple;
}
.TAB-Work.item_button,
.TAB-Work.running {
  color: ForestGreen;
}
.TAB-xterm-etc.item_button,
.TAB-xterm-etc.running {
  color: orange;
}
.TAB-Vi_IMproved.item_button,
.TAB-Vi_IMproved.running {
  color: coral;
}


text:
FactoryBot.define do

  # idea factory without associated comments
  factory :idea do
    title { Faker::Dessert.variety }
    description { Faker::Lorem.paragraph }
    data { Rack::Test::UploadedFile.new(Rails.root.join('spec/support/uploads/idea1.jpg'), 'image/jpeg') }

    # idea_with_comments will create comment data after the idea has been created
    factory :idea_with_comments do
      # comments_count is declared as a transient attribute and available in
      # attributes on the factory, as well as the callback via the evaluator
      transient do
        comments_count { 2 }
      end

      # the after(:create) yields two values; the idea instance itself and the
      # evaluator, which stores all values from the factory, including transient
      # attributes; `create_list`'s second argument is the number of records
      # to create and we make sure the idea is associated properly to the comment
      after(:create) do |idea, evaluator|
        create_list(:comment, evaluator.comments_count, idea: idea)
      end
    end

  end
end


text:
require File.dirname(__FILE__) + '/spec_helper.rb'

describe "Pat" do
  before do
    @postcode = Pat.get("W12 7RJ")
  end
  it "should get a UK postcode" do
    @postcode.should_not be_blank
    STDERR.puts "<p>#{@postcode.inspect}</p>"
  end
  it "should get the postcode back in the response" do
    @postcode["postcode"].should_not be_blank
  end
  it "should get Geo data" do
    @postcode["geo"]["lat"].should_not be_blank
    @postcode["geo"]["lng"].should_not be_blank
    @postcode["geo"]["easting"].should_not be_blank
    @postcode["geo"]["northing"].should_not be_blank
    @postcode["geo"]["geohash"].should_not be_blank
  end
  it "should get administrative info" do
    @postcode["administrative"].should_not be_blank
    @postcode["administrative"]["district"].should_not be_blank
    @postcode["administrative"]["district"]["title"].should_not be_blank
    @postcode["administrative"]["district"]["uri"].should_not be_blank
    @postcode["administrative"]["ward"].should_not be_blank
    @postcode["administrative"]["ward"]["title"].should_not be_blank
    @postcode["administrative"]["ward"]["uri"].should_not be_blank
  end
end


text:
package kg.apc.jmeter.functions;

import kg.apc.jmeter.modifiers.FifoMap;
import org.apache.jmeter.engine.util.CompoundVariable;
import org.apache.jmeter.functions.AbstractFunction;
import org.apache.jmeter.functions.InvalidVariableException;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.samplers.Sampler;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

public class FifoPut extends AbstractFunction {
    private static final Logger log = LoggingManager.getLoggerForClass();

    private static final List<String> desc = new LinkedList<String>();
    private static final String KEY = "__fifoPut";

    static {
        desc.add("Queue name to put value");
        desc.add("String value to put into FIFO queue");
    }

    private Object[] values;

    public FifoPut() {
        FifoMap.getInstance().clear();
    }

    @Override
    public synchronized String execute(SampleResult previousResult, Sampler currentSampler)
            throws InvalidVariableException {
        String fifoName = ((CompoundVariable) values[0]).execute();
        String value = ((CompoundVariable) values[1]).execute();
        try {
            FifoMap.getInstance().put(fifoName, value);
        } catch (InterruptedException ex) {
            log.warn("Interrupted put into queue " + fifoName);
            value = "INTERRUPTED";
        }

        return value;
    }

    @Override
    public synchronized void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException {
        checkMinParameterCount(parameters, 2);
        values = parameters.toArray();
    }

    @Override
    public String getReferenceKey() {
        return KEY;
    }

    @Override
    public List<String> getArgumentDesc() {
        return desc;
    }
}


text:
"""
homeassistant.components.switch.rpi_gpio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows to control the GPIO pins of a Raspberry Pi.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.rpi_gpio/
"""
import logging
try:
    import RPi.GPIO as GPIO
except ImportError:
    GPIO = None
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.const import (DEVICE_DEFAULT_NAME,
                                 EVENT_HOMEASSISTANT_START,
                                 EVENT_HOMEASSISTANT_STOP)

DEFAULT_INVERT_LOGIC = False

REQUIREMENTS = ['RPi.GPIO==0.5.11']
_LOGGER = logging.getLogger(__name__)

# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the Raspberry PI GPIO ports. """
    if GPIO is None:
        _LOGGER.error('RPi.GPIO not available. rpi_gpio ports ignored.')
        return
    # pylint: disable=no-member
    GPIO.setmode(GPIO.BCM)

    switches = []
    invert_logic = config.get('invert_logic', DEFAULT_INVERT_LOGIC)
    ports = config.get('ports')
    for port_num, port_name in ports.items():
        switches.append(RPiGPIOSwitch(port_name, port_num, invert_logic))
    add_devices(switches)

    def cleanup_gpio(event):
        """ Stuff to do before stop home assistant. """
        # pylint: disable=no-member
        GPIO.cleanup()

    def prepare_gpio(event):
        """ Stuff to do when home assistant starts. """
        hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, cleanup_gpio)

    hass.bus.listen_once(EVENT_HOMEASSISTANT_START, prepare_gpio)

class RPiGPIOSwitch(ToggleEntity):
    """ Represents a port that can be toggled using Raspberry Pi GPIO. """

    def __init__(self, name, gpio, invert_logic):
        self._name = name or DEVICE_DEFAULT_NAME
        self._gpio = gpio
        self._active_state = not invert_logic
        self._state = not self._active_state
        # pylint: disable=no-member
        GPIO.setup(gpio, GPIO.OUT)

    @property
    def name(self):
        """ The name of the port. """
        return self._name

    @property
    def should_poll(self):
        """ No polling needed. """
        return False

    @property
    def is_on(self):
        """ True if device is on. """
        return self._state

    def turn_on(self, **kwargs):
        """ Turn the device on. """
        if self._switch(self._active_state):
            self._state = True
        self.update_ha_state()

    def turn_off(self, **kwargs):
        """ Turn the device off. """
        if self._switch(not self._active_state):
            self._state = False
        self.update_ha_state()

    def _switch(self, new_state):
        """ Change the output value to Raspberry Pi GPIO port. """
        _LOGGER.info('Setting GPIO %s to %s', self._gpio, new_state)
        # pylint: disable=bare-except
        try:
            # pylint: disable=no-member
            GPIO.output(self._gpio, 1 if new_state else 0)
        except:
            _LOGGER.error('GPIO "%s" output failed', self._gpio)
            return False
        return True

    # pylint: disable=no-self-use
    @property
    def device_state_attributes(self):
        """ Returns device specific state attributes. """
        return None

    @property
    def state_attributes(self):
        """ Returns optional state attributes. """
        data = {}
        device_attr = self.device_state_attributes
        if device_attr is not None:
            data.update(device_attr)
        return data


text:
#ifndef _RTL_PCI_H
#define _RTL_PCI_H

#include <linux/types.h>
#include <linux/pci.h>

struct net_device;
bool rtl92e_check_adapter(struct pci_dev *pdev, struct net_device *dev);

#endif


text:
.. _doc-tools:

=========================
Using documentation tools
=========================

The OpenStack documentation toolkit includes a number of scripts used
for performing automated tasks to maintain the OpenStack documentation
project. For example, there are tools that generate a sitemap, check niceness,
synchronize files used across multiple repositories, and others.

This section provides an overview of the documentation tools and their
location, explains how to install, configure, use, and contribute to them.

.. toctree::
   :maxdepth: 2

   doc-tools/scripts.rst
   doc-tools/template-generator.rst
   doc-tools/installation.rst
   doc-tools/contributing.rst


text:
Azure Event Hub is included as a [Rider](/usage/riders/), and supports consuming and producing messages from/to Azure event hubs.

> Uses [MassTransit.Azure.ServiceBus.Core](https://nuget.org/packages/MassTransit.Azure.ServiceBus.Core/), [MassTransit.EventHub](https://nuget.org/packages/MassTransit.EventHub/), [MassTransit.Extensions.DependencyInjection](https://www.nuget.org/packages/MassTransit.Extensions.DependencyInjection/)

To consume messages from an event hub, configure a Rider within the bus configuration as shown.

<<< @/docs/code/riders/EventHubConsumer.cs

The familiar _ReceiveEndpoint_ syntax is used to configure an event hub. The consumer group specified should be unique to the application, and shared by a cluster of service instances for load balancing. Consumers and sagas can be configured on the receive endpoint, which should be registered in the rider configuration. While the configuration for event hubs is the same as a receive endpoint, there is no implicit binding of consumer message types to event hubs (there is no pub-sub using event hub).

### Producers

Producing messages to event hubs uses a producer. In the example below, a messages is produced to the event hub.

<<< @/docs/code/riders/EventHubProducer.cs


text:
const Phase = require('./phase.js');
const SimpleStep = require('./simplestep.js');
const ActionWindow = require('./actionwindow.js');

class DominancePhase extends Phase {
    constructor(game) {
        super(game, 'dominance');
        this.initialise([
            new SimpleStep(game, () => this.determineWinner()),
            new ActionWindow(this.game, 'After dominance determined', 'dominance')
        ]);
    }

    determineWinner() {
        var highestDominance = 0;
        var lowestDominance = 0;
        var dominanceWinner = undefined;

        for(let player of this.game.getPlayers()) {
            var dominance = player.getDominance();

            lowestDominance = dominance;

            if(dominance === highestDominance) {
                dominanceWinner = undefined;
            }

            if(dominance > highestDominance) {
                lowestDominance = highestDominance;
                highestDominance = dominance;
                dominanceWinner = player;
            } else {
                lowestDominance = dominance;
            }
        }

        if(dominanceWinner) {
            //save the winner of dominance on the game object in order to use this information in determining the winner of the game after the time limit has expired
            this.game.winnerOfDominanceInLastRound = dominanceWinner;
            if(dominanceWinner.canGainFactionPower()) {
                this.game.addMessage('{0} wins dominance ({1} vs {2})', dominanceWinner, highestDominance, lowestDominance);
                this.game.addPower(dominanceWinner, 1);
            } else {
                this.game.addMessage('{0} wins dominance, but cannot gain power for their faction', dominanceWinner);
            }
        } else {
            this.game.addMessage('There was a tie for dominance');
            this.game.addMessage('No one wins dominance');
        }

        this.game.raiseEvent('onDominanceDetermined', { winner: dominanceWinner });
    }
}

module.exports = DominancePhase;


text:
using System;
using NUnit.Framework;
using Moq;
using OnTheRoad.Logic.Contracts;
using OnTheRoad.Logic.Utils;
using OnTheRoad.Domain.Enumerations;

namespace OnTheRoad.Logic.Tests.Utils
{
    [TestFixture]
    class ReviewAddHelperTests
    {
        [Test]
        public void ReviewAddHelper_WhenInitializedWithNullForUserGetService_ShouldThrowNewArgumentNullException()
        {
            var ratingServiceMock = new Mock<IRatingService>();

            Assert.Throws<ArgumentNullException>(() => new ReviewAddHelper(null, ratingServiceMock.Object));
        }

        [Test]
        public void ReviewAddHelper_WhenInitializedWithNullForUserGetService_ShouldThrowNewArgumentNullExceptionWithProperException()
        {
            var ratingServiceMock = new Mock<IRatingService>();

            var exc = Assert.Throws<ArgumentNullException>(() => new ReviewAddHelper(null, ratingServiceMock.Object));
            StringAssert.Contains("userService cannot be null!", exc.Message);
        }

        [Test]
        public void ReviewAddHelper_WhenInitializedWithNullForRatingService_ShouldThrowNewArgumentNullException()
        {
            var userServiceMock = new Mock<IUserGetService>();

            Assert.Throws<ArgumentNullException>(() => new ReviewAddHelper(userServiceMock.Object, null));
        }

        [Test]
        public void ReviewAddHelper_WhenInitializedWithNullForRatingService_ShouldThrowNewArgumentNullExceptionWithProperException()
        {
            var userServiceMock = new Mock<IUserGetService>();

            var exc = Assert.Throws<ArgumentNullException>(() => new ReviewAddHelper(userServiceMock.Object, null));
            StringAssert.Contains("ratingService cannot be null!", exc.Message);
        }

        [Test]
        public void RatingService_WhenGetRatingByValueIsCalled_ShouldCallGetRatingByValueExactlyOnce()
        {
            var userServiceMock = new Mock<IUserGetService>();
            var ratingServiceMock = new Mock<IRatingService>();

            var helper = new ReviewAddHelper(userServiceMock.Object, ratingServiceMock.Object);
            helper.GetRatingByValue(RatingEnum.Negative);

            ratingServiceMock.Verify(x => x.GetRatingByValue(It.IsAny<RatingEnum>()), Times.Once);
        }

        [Test]
        public void RatingService_WhenGetRatingByValueIsCalled_ShouldCallGetRatingByValueWithThePassedValue()
        {
            var passedValue = RatingEnum.Negative;
            var userServiceMock = new Mock<IUserGetService>();
            var ratingServiceMock = new Mock<IRatingService>();

            var helper = new ReviewAddHelper(userServiceMock.Object, ratingServiceMock.Object);
            helper.GetRatingByValue(passedValue);

            ratingServiceMock.Verify(x => x.GetRatingByValue(passedValue), Times.Once);
        }

        [Test]
        public void UserService_WhenGetUserByUsernameIsCalled_ShouldCallGetUserInfoExactlyOnce()
        {
            var userServiceMock = new Mock<IUserGetService>();
            var ratingServiceMock = new Mock<IRatingService>();
            var helper = new ReviewAddHelper(userServiceMock.Object, ratingServiceMock.Object);
            helper.GetUserByUsername("someName");

            userServiceMock.Verify(x => x.GetUserInfo(It.IsAny<string>()), Times.Once);
        }

        [Test]
        public void UserService_WhenGetUserByUsernameIsCalled_ShouldCallGetUserInfoWithThePassedValue()
        {
            var passedValue = "someUser";
            var userServiceMock = new Mock<IUserGetService>();
            var ratingServiceMock = new Mock<IRatingService>();
            var helper = new ReviewAddHelper(userServiceMock.Object, ratingServiceMock.Object);
            helper.GetUserByUsername(passedValue);

            userServiceMock.Verify(x => x.GetUserInfo(passedValue), Times.Once);
        }
    }
}


text:
package com.sun.corba.se.spi.activation;

/**
* com/sun/corba/se/spi/activation/ServerManager.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /HUDSON3/workspace/8-2-build-linux-amd64/jdk8u121/8372/corba/src/share/classes/com/sun/corba/se/spi/activation/activation.idl
* Monday, December 12, 2016 4:37:46 PM PST
*/

public interface ServerManager extends ServerManagerOperations, Activator, Locator
{
} // interface ServerManager


text:
package com.lesofn.appengine.common.encrypt;

import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.Hex;

import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;

/**
 * AES工具类,提供加密解密、生成Key等方法
 *
 * @author sofn
 */
public class AESEncrypter {

    private static final String AESKEYSTR = "ZTZjZGVjZDcxNmMwMWQzZTIzOWE4ZjNkZjk3ZTJiZTM=";

    private SecretKey aesKey;

    private AESEncrypter() {
        aesKey = loadAesKey();
    }

    private AESEncrypter(String aes) {
        aesKey = loadAesKey(aes);
    }

    private static AESEncrypter INSTANCE;

    private static Map<String, AESEncrypter> INSTANCES = new HashMap<>();

    public static AESEncrypter getInstance() {
        if (INSTANCE == null) {
            synchronized (AESKEYSTR) {
                if (INSTANCE == null) {
                    INSTANCE = new AESEncrypter();
                }
            }
        }
        return INSTANCE;
    }

    public static AESEncrypter getInstance(String aes) {
        if (INSTANCES.get(aes) == null) {
            synchronized (AESKEYSTR) {
                if (INSTANCES.get(aes) == null) {
                    INSTANCES.put(aes, new AESEncrypter(aes));
                }
            }
        }
        return INSTANCES.get(aes);
    }

    public String encrypt(String msg) {
        try {
            Cipher ecipher = Cipher.getInstance("AES");
            ecipher.init(Cipher.ENCRYPT_MODE, aesKey);
            return Hex.encodeHexString(ecipher.doFinal(msg.getBytes()));
        } catch (Exception e) {
            String errMsg = "decrypt error, data:" + msg;
            throw new EncrypterException(errMsg, e);
        }
    }

    public byte[] decrypt(String msg) {
        try {
            Cipher dcipher = Cipher.getInstance("AES");
            dcipher.init(Cipher.DECRYPT_MODE, aesKey);
            return dcipher.doFinal(Hex.decodeHex(msg.toCharArray()));
        } catch (Exception e) {
            String errMsg = "decrypt error, data:" + msg;
            throw new EncrypterException(errMsg, e);
        }
    }

    public String decryptAsString(String msg) {
        return new String(this.decrypt(msg));
    }

    private static SecretKey loadAesKey() {
        return loadAesKey(AESKEYSTR);
    }

    private static SecretKey loadAesKey(String aesKeyStr) {
        String buffer = new String(Base64.decodeBase64(aesKeyStr));
        byte[] keyStr;
        try {
            keyStr = Hex.decodeHex(buffer.toCharArray());
        } catch (DecoderException e) {
            throw new EncrypterException(e);
        }
        return new SecretKeySpec(keyStr, "AES");
    }

    private static String generateAesKey() {
        try {
            KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
            keyGenerator.init(128);
            // 产生密钥
            SecretKey secretKey = keyGenerator.generateKey();
            // 获取密钥
            byte[] keyBytes = secretKey.getEncoded();
            return Base64.encodeBase64String(Hex.encodeHexString(keyBytes).getBytes());
        } catch (NoSuchAlgorithmException e) {
            throw new EncrypterException(e);
        }
    }
}


text:
"""
Copyright 2016 Jorge Santos

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.
"""
import os
import string

import numpy as np
import pandas as pd
from ..utils import LanternException

def scattergeo():
    """ Returns """
    path = os.path.join(os.path.dirname(__file__), '../data/scattergeo.csv')
    df = pd.read_csv(path)
    del df['Unnamed: 0']
    df['text'] = df['airport'] + ' ' + df['city'] + ', ' + df['state'] + ' ' + 'Arrivals: ' + df['cnt'].astype(str)
    df = df.rename(columns={'cnt': 'z', 'long': 'lon'})
    return df

def choropleth():
    """ Returns """
    path = os.path.join(os.path.dirname(__file__), '../data/choropleth.csv')
    df = pd.read_csv(path)
    del df['Unnamed: 0']
    df['z'] = [np.random.randint(0, 100) for _ in range(len(df))]
    return df

def scatter3d(n_categories=5, n=10, prefix='category', mode=None):
    """Returns a DataFrame with the required format for
    a scatter3d plot

    Parameters:
    -----------
        n_categories : int
            Number of categories
        n : int
            Number of points for each trace
        prefix : string
            Name for each trace
        mode : string
            Format for each item
                'abc' for alphabet columns
                'stocks' for random stock names
    """
    categories = []
    for i in range(n_categories):
        categories.extend([prefix + str(i + 1)] * n)
    return pd.DataFrame({'x': np.random.randn(n * n_categories),
                         'y': np.random.randn(n * n_categories),
                         'z': np.random.randn(n * n_categories),
                         'text': getName(n * n_categories, mode=mode),
                         'categories': categories})

def bubble3d(n_categories=5, n=10, prefix='category', mode=None):
    """Returns a DataFrame with the required format for
    a bubble3d plot

    Parameters:
    -----------
        n_categories : int
            Number of categories
        n : int
            Number of points for each trace
        prefix : string
            Name for each trace
        mode : string
            Format for each item
                'abc' for alphabet columns
                'stocks' for random stock names
    """
    categories = []
    for i in range(n_categories):
        categories.extend([prefix + str(i + 1)] * n)
    return pd.DataFrame({'x': np.random.randn(n * n_categories),
                         'y': np.random.randn(n * n_categories),
                         'z': np.random.randn(n * n_categories),
                         'size': np.random.randint(1, 100, n * n_categories),
                         'text': getName(n * n_categories, mode=mode),
                         'categories': categories})

def bubble(n_categories=5, n=10, prefix='category', mode=None):
    """
    Returns a DataFrame with the required format for
    a bubble plot

    Parameters:
    -----------
        n_categories : int
            Number of categories
        n : int
            Number of points for each category
        prefix : string
            Name for each category
        mode : string
            Format for each item
                'abc' for alphabet columns
                'stocks' for random stock names
    """
    categories = []
    for i in range(n_categories):
        categories.extend([prefix + str(i + 1)] * n)
    return pd.DataFrame({'x': np.random.randn(n * n_categories),
                         'y': np.random.randn(n * n_categories),
                         'size': np.random.randint(1, 100, n * n_categories),
                         'text': getName(n * n_categories, mode=mode),
                         'categories': categories})

def pie(n_labels=5, mode=None):
    """
    Returns a DataFrame with the required format for
    a pie plot

    Parameters:
    -----------
        n_labels : int
            Number of labels
        mode : string
            Format for each item
                'abc' for alphabet columns
                'stocks' for random stock names
    """
    return pd.DataFrame({'values': np.random.randint(1, 100, n_labels),
                         'labels': getName(n_labels, mode=mode)})

def scatter(n_categories=5, n=10, prefix='category', mode=None):
    """
    Returns a DataFrame with the required format for
    a scatter plot

    Parameters:
    -----------
        n_categories : int
            Number of categories
        n : int
            Number of points for each category
        prefix : string
            Name for each category
        mode : string
            Format for each item
                'abc' for alphabet columns
                'stocks' for random stock names
    """
    categories = []
    for i in range(n_categories):
        categories.extend([prefix + str(i + 1)] * n)
    return pd.DataFrame({'x': np.random.randn(n * n_categories),
                         'y': np.random.randn(n * n_categories),
                         'text': getName(n * n_categories, mode=mode),
                         'categories': categories})

def heatmap(n_x=5, n_y=10):
    """
    Returns a DataFrame with the required format for
    a heatmap plot

    Parameters:
    -----------
        n_x : int
            Number of x categories
        n_y : int
            Number of y categories
    """
    x = ['x_' + str(_) for _ in range(n_x)]
    y = ['y_' + str(_) for _ in range(n_y)]
    return pd.DataFrame(surface(n_x - 1, n_y - 1).values, index=x, columns=y)

def lines(n_traces=5, n=100, columns=None, dateIndex=True, mode=None):
    """
    Returns a DataFrame with the required format for
    a scatter (lines) plot

    Parameters:
    -----------
        n_traces : int
            Number of traces
        n : int
            Number of points for each trace
        columns : [str]
            List of column names
        dateIndex : bool
            If True it will return a datetime index
            if False it will return a enumerated index
        mode : string
            Format for each item
                'abc' for alphabet columns
                'stocks' for random stock names
    """
    index = pd.date_range('1/1/15', periods=n) if dateIndex else list(range(n))
    df = pd.DataFrame(np.random.randn(n, n_traces), index=index,
                      columns=getName(n_traces, columns=columns, mode=mode))
    return df.cumsum()

def bars(n=3, n_categories=3, prefix='category', columns=None, mode='abc'):
    """
    Returns a DataFrame with the required format for
    a bar plot

    Parameters:
    -----------
        n : int
            Number of points for each trace
        n_categories : int
            Number of categories for each point
        prefix : string
            Name for each category
        columns : [str]
            List of column names
        mode : string
            Format for each item
                'abc' for alphabet columns
                'stocks' for random stock names
    """
    categories = []
    if not columns:
        columns = getName(n, mode=mode)
    for i in range(n_categories):
        categories.extend([prefix + str(i + 1)])
    data = dict([(x, np.random.randint(1, 100, n_categories)) for x in columns])
    return pd.DataFrame(data, index=categories)

def ohlc(n=100):
    """
    Returns a DataFrame with the required format for
    a candlestick or ohlc plot
    df[['open','high','low','close']]

    Parameters:
    -----------
        n : int
            Number of ohlc points
    """
    index = pd.date_range('1/1/15', periods=n * 288, freq='5min', tz='utc')
    data = np.random.randn(n * 288)
    data[0] = np.array([100])
    df = pd.DataFrame(data, index=index, columns=['a'])
    df = df.cumsum()
    df = df.resample('1d').ohlc()
    df.index = df.index.date
    df.index = pd.to_datetime(df.index)
    return df['a']

def ohlcv(n=100):
    """
    Returns a DataFrame with the required format for
    a candlestick or ohlc plot
    df[['open','high','low','close','volume']

    Parameters:
    -----------
        n : int
            Number of ohlc points
    """
    df = ohlc()
    df['volume'] = [np.random.randint(1000, 10000) for _ in range(len(df))]
    return df

def box(n_traces=5, n=100, mode=None):
    """
    Returns a DataFrame with the required format for
    a box plot

    Parameters:
    -----------
        n_traces : int
            Number of traces
        n : int
            Number of points for each trace
        mode : string
            Format for each item
                'abc' for alphabet columns
                'stocks' for random stock names
    """
    df = pd.DataFrame([np.random.chisquare(np.random.randint(2, 10), n_traces) for _ in range(n)], columns=getName(n_traces, mode=mode))
    return df

def histogram(n_traces=1, n=500, dispersion=2, mode=None):
    """
    Returns a DataFrame with the required format for
    a histogram plot

    Parameters:
    -----------
        n_traces : int
            Number of traces
        n : int
            Number of points for each trace
        mode : string
            Format for each item
                'abc' for alphabet columns
                'stocks' for random stock names
    """
    df = pd.DataFrame(np.transpose([np.random.randn(n) + np.random.randint(-1 * dispersion, dispersion) for _ in range(n_traces)]), columns=getName(n_traces, mode=mode))
    return df

def distplot(n_traces=1, n=500, dispersion=3, mode=None):
    """
    Returns a DataFrame with the required format for
    a distribution plot (distplot)

    Parameters:
    -----------
        n_traces : int
            Number of traces
        n : int
            Number of points for each trace
        mode : string
            Format for each item
                'abc' for alphabet columns
                'stocks' for random stock names
    """
    return histogram(n_traces, n, dispersion, mode)

def violin(n=500, dispersion=3, categories=True, n_categories=5):
    """
    Returns a DataFrame with the required format for
    a distribution plot (distplot)

    Parameters:
    -----------
        n : int
            Number of points
        categories : bool or int
            If True,  then a column with categories is added
        n_categories : int
            Number of categories
    """
    df = histogram(1, n, dispersion, 'abc')
    df = df.rename(columns={'a': 'data'})
    if categories:
        df['categories'] = ['category_{0}'.format(np.random.randint(n_categories)) for _ in range(n)]
    return df

def surface(n_x=20, n_y=20):
    """
    Returns a DataFrame with the required format for
    a surface plot

    Parameters:
    -----------
        n_x : int
            Number of points along the X axis
        n_y : int
            Number of points along the Y axis
    """
    x = [float(np.random.randint(0, 100))]
    for i in range(n_x):
        x.append(x[:1][0] + np.random.randn() * np.random.randint(1, 10))
    df = pd.DataFrame(x)
    for i in range(n_y):
        df[i + 1] = df[i].map(lambda x: x + np.random.randn() * np.random.randint(1, 10))
    return df

def sinwave(n=4, inc=.25):
    """
    Returns a DataFrame with the required format for
    a surface (sine wave) plot

    Parameters:
    -----------
        n : int
            Ranges for X and Y axis (-n, n)
        n_y : int
            Size of increment along the axis
    """
    x = np.arange(-n, n, inc)
    y = np.arange(-n, n, inc)
    X, Y = np.meshgrid(x, y)
    R = np.sqrt(X**2 + Y**2)
    Z = np.sin(R) / (.5 * R)
    return pd.DataFrame(Z, index=x, columns=y)

def getName(n=1, name=3, exchange=2, columns=None, mode='abc'):
    if columns:
        if isinstance(columns, str):
            columns = [columns]
        if n != len(columns):
            raise LanternException("Length of column names needs to be the \n same length of traces")
    else:
        columns = [''.join(np.random.choice(list(string.ascii_uppercase), name)) + '.' + ''.join(np.random.choice(list(string.ascii_uppercase), exchange)) for _ in range(n)]
    return columns


text:
package com.vr.ticketapp.service;

public class TicketServiceException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    public TicketServiceException() { super(); }

    public TicketServiceException(String errMsg) { super(errMsg); }

    public TicketServiceException(String errMsg, Throwable cause) { super(errMsg,cause); }

    public TicketServiceException(Throwable cause) { super(cause); }
}


text:
package eval_test

import (
	"syscall"
)

func exitWaitStatus(exit uint32) syscall.WaitStatus {
	// There doesn't seem to be a portable way to construct a WaitStatus, but
	// all Unix platforms Elvish supports have 0 in the lower 8 bits for normal
	// exits, and put exit codes in the higher bits.
	//
	// https://cs.opensource.google/go/go/+/refs/tags/go1.19.3:src/syscall/syscall_linux.go;l=404-411;drc=946b4baaf6521d521928500b2b57429c149854e7
	// https://cs.opensource.google/go/go/+/master:src/syscall/syscall_bsd.go;l=89-93;drc=51297dd6df713b988b5c587e448b27d18ca1bd8a
	return syscall.WaitStatus(exit << 8)
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
N. Amer. Fl. (New York) 7(4-5): 340 (1920)

#### Original name
Puccinia melanopsis P. Syd. & Syd.

### Remarks
null


text:
/**
 * Copyright 2011, Big Switch Networks, Inc.
 * Originally created by David Erickson, Stanford University
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may obtain
 * a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 **/

package net.onrc.openvirtex.packet;

/**
 *
 * @author David Erickson (daviderickson@cs.stanford.edu)
 */
public interface IPacket {
	/**
	 *
	 * @return
	 */
	public IPacket getPayload();

	/**
	 *
	 * @param packet
	 * @return
	 */
	public IPacket setPayload(IPacket packet);

	/**
	 *
	 * @return
	 */
	public IPacket getParent();

	/**
	 *
	 * @param packet
	 * @return
	 */
	public IPacket setParent(IPacket packet);

	/**
	 * Reset any checksums as needed, and call resetChecksum on all parents
	 */
	public void resetChecksum();

	/**
	 * Sets all payloads parent packet if applicable, then serializes this
	 * packet and all payloads
	 *
	 * @return a byte[] containing this packet and payloads
	 */
	public byte[] serialize();

	/**
	 * Deserializes this packet layer and all possible payloads
	 *
	 * @param data
	 * @param offset
	 *            offset to start deserializing from
	 * @param length
	 *            length of the data to deserialize
	 * @return the deserialized data
	 */
	public IPacket deserialize(byte[] data, int offset, int length);

	/**
	 * Clone this packet and its payload packet but not its parent.
	 *
	 * @return
	 */
	public Object clone();
}


text:
package edu.byu.suite.features.addDrop.model.addDropMetas;

import com.google.gson.annotations.SerializedName;

import java.util.List;

import edu.byu.suite.features.addDrop.model.AddDropGenericValue;

/**
 * Created by poolguy on 3/17/17
 */

public class CreditHoursResponseWrapper {
	@SerializedName("values")
	private List<CreditHourWrapper> creditHourWrappers;

	public List<CreditHourWrapper> getCreditHourWrappers() {
		return creditHourWrappers;
	}

	private class CreditHourWrapper extends AddDropMeta {
		private AddDropGenericValue<String> creditHours;

		@Override
		public String getText() {
			return creditHours.getValue();
		}

		@Override
		public String getDetailText() {
			return null;
		}

		@Override
		public String getShortTitle() {
			return creditHours.getValue();
		}

		@Override
		public String getQueryParam() {
			return creditHours.getValue();
		}
	}
}


text:
@interface CustomCamera () <DBCameraViewControllerDelegate, UINavigationControllerDelegate>
@property (nonatomic, strong) CALayer *focusBox, *exposeBox;
@property (nonatomic, strong) UIView *bottomContainerBar, *topContainerBar;
@end

@implementation CustomCamera

-(void) dealloc{
    [[NSNotificationCenter defaultCenter] removeObserver: self];
    [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
}

- (void)deviceOrientationDidChange:(NSNotification *)notification {
    //Obtain current device orientation
    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
    CGFloat newY = CGRectGetMaxY(previewFrame);
    CGFloat newX = CGRectGetMaxX(previewFrame);
    CGRect lblFrame;
    CGFloat portraitlabelWidth = newX * 0.8;
    CGFloat portraitlabelHeight = newY * 0.2;
    CGFloat landscapelabelWidth = newY * 0.8;
    CGFloat landscapelabelHeight = newX * 0.2;
    if (orientation == UIInterfaceOrientationPortrait) {
        //[self.sceneText setText:@"Portrait"];
        lblFrame = CGRectMake(newX/2-portraitlabelWidth/2, newY-portraitlabelHeight, portraitlabelWidth, portraitlabelHeight);

        self.sceneText.transform=CGAffineTransformMakeRotation( DEGREES_TO_RADIANS(0) );
        self.sceneText.frame = lblFrame;
    } else if ( orientation == UIInterfaceOrientationLandscapeLeft){
        //[self.sceneText setText:@"Landscape Left"];
        lblFrame = CGRectMake(newX-landscapelabelHeight, newY/2-landscapelabelWidth*0.425, landscapelabelHeight, landscapelabelWidth);
        self.sceneText.transform=CGAffineTransformMakeRotation( DEGREES_TO_RADIANS(-90) );
        self.sceneText.frame = lblFrame;
    }  else if (orientation == UIInterfaceOrientationLandscapeRight){
       // [self.sceneText setText:@"Landscape Right"];
        lblFrame = CGRectMake(0, newY/2-landscapelabelWidth*0.425, landscapelabelHeight, landscapelabelWidth);
        self.sceneText.transform=CGAffineTransformMakeRotation( DEGREES_TO_RADIANS(90) );
        self.sceneText.frame = lblFrame;
    }else if (orientation == UIInterfaceOrientationPortraitUpsideDown){
        lblFrame = CGRectMake(newX/2-portraitlabelWidth/2, 65, portraitlabelWidth, portraitlabelHeight);
       // [self.sceneText setText:@"Upside Down"];
        self.sceneText.transform=CGAffineTransformMakeRotation( DEGREES_TO_RADIANS(180) );
       self.sceneText.frame = lblFrame;
    }

}

- (void) buildInterface
{
      [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];

     [[NSNotificationCenter defaultCenter] addObserver: self selector:   @selector(deviceOrientationDidChange:) name: UIDeviceOrientationDidChangeNotification object: nil];
    [self addSubview: self.sceneText];

    [self.previewLayer addSublayer:self.focusBox];
    [self.previewLayer addSublayer:self.exposeBox];
    [self.flashButton setSelected:true];

    [self addSubview:self.topContainerBar];
    [self addSubview:self.bottomContainerBar];

    [self.topContainerBar addSubview:self.cameraButton];
    [self.topContainerBar addSubview:self.flashButton];

    [self.bottomContainerBar addSubview:self.triggerButton];
    [self.bottomContainerBar addSubview:self.closeButton];

}

#pragma mark - Containers

- (UIView *) topContainerBar
{
    if ( !_topContainerBar ) {
        _topContainerBar = [[UIView alloc] initWithFrame:(CGRect){ 0, 0, CGRectGetWidth(self.bounds), CGRectGetMinY(previewFrame) }];
        [_topContainerBar setBackgroundColor:RGBColor(0x000000, 1)];
    }
    return _topContainerBar;
}

- (UIView *) bottomContainerBar
{
    if ( !_bottomContainerBar ) {
        CGFloat newY = CGRectGetMaxY(previewFrame);
        _bottomContainerBar = [[UIView alloc] initWithFrame:(CGRect){ 0, newY, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds) - newY }];
        [_bottomContainerBar setUserInteractionEnabled:YES];
        [_bottomContainerBar setBackgroundColor:RGBColor(0x000000, 1)];
    }
    return _bottomContainerBar;
}

- (UILabel *) sceneText
{
    if( !_sceneText) {
        CGFloat newY = CGRectGetMaxY(previewFrame);
        CGFloat newX = CGRectGetMaxX(previewFrame);

        CGFloat labelWidth = newX * 0.8;
        CGFloat labelHeight = newY * 0.2;

        _sceneText = [[UILabel alloc] initWithFrame:CGRectMake(newX/2-labelWidth/2, newY-labelHeight, labelWidth, labelHeight)];

        CGFloat pointSize =  15 * (newX/320);
        _sceneText.textAlignment= NSTextAlignmentCenter;
        _sceneText.numberOfLines = 0;
        [_sceneText setBackgroundColor:[UIColor clearColor]];
        [_sceneText setTextColor: [UIColor whiteColor]];
        [_sceneText setShadowColor:[UIColor blackColor]];
        [_sceneText setFont: [UIFont fontWithName:@"Verdana-Bold" size:pointSize]];

        }
    return _sceneText;

}

#pragma mark - Focus / Expose Box

- (CALayer *) focusBox
{
    if ( !_focusBox ) {
        _focusBox = [[CALayer alloc] init];
        [_focusBox setCornerRadius:45.0f];
        [_focusBox setBounds:CGRectMake(0.0f, 0.0f, 90, 90)];
        [_focusBox setBorderWidth:5.f];
        [_focusBox setBorderColor:[[UIColor whiteColor] CGColor]];
        [_focusBox setOpacity:0];
    }

    return _focusBox;
}

- (CALayer *) exposeBox
{
    if ( !_exposeBox ) {
        _exposeBox = [[CALayer alloc] init];
        [_exposeBox setCornerRadius:55.0f];
        [_exposeBox setBounds:CGRectMake(0.0f, 0.0f, 110, 110)];
        [_exposeBox setBorderWidth:5.f];
        [_exposeBox setBorderColor:[[UIColor redColor] CGColor]];
        [_exposeBox setOpacity:0];
    }

    return _exposeBox;
}

- (void) drawFocusBoxAtPointOfInterest:(CGPoint)point andRemove:(BOOL)remove
{
    [super draw:_focusBox atPointOfInterest:point andRemove:remove];
}

- (void) drawExposeBoxAtPointOfInterest:(CGPoint)point andRemove:(BOOL)remove
{
    [super draw:_exposeBox atPointOfInterest:point andRemove:remove];
}

@end