text:
"""
    Wavefront REST API Documentation

The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.

When you make REST API calls outside the Wavefront REST API documentation you must add the header \"Authorization: Bearer <<API-TOKEN>>\" to your HTTP requests.
  # noqa: E501

    OpenAPI spec version: v2
    Contact: chitimba@wavefront.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from wavefront_api_client.api_client import ApiClient

class MetricsPolicyApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def get_metrics_policy(self, **kwargs):  # noqa: E501
        """Get the metrics policy  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_metrics_policy(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: ResponseContainerMetricsPolicyReadModel
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_metrics_policy_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_metrics_policy_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_metrics_policy_with_http_info(self, **kwargs):  # noqa: E501
        """Get the metrics policy  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_metrics_policy_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: ResponseContainerMetricsPolicyReadModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_metrics_policy" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/metricspolicy', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ResponseContainerMetricsPolicyReadModel',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_metrics_policy_by_version(self, version, **kwargs):  # noqa: E501
        """Get a specific historical version of a metrics policy  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_metrics_policy_by_version(version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int version: (required)
        :return: ResponseContainerMetricsPolicyReadModel
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_metrics_policy_by_version_with_http_info(version, **kwargs)  # noqa: E501
        else:
            (data) = self.get_metrics_policy_by_version_with_http_info(version, **kwargs)  # noqa: E501
            return data

    def get_metrics_policy_by_version_with_http_info(self, version, **kwargs):  # noqa: E501
        """Get a specific historical version of a metrics policy  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_metrics_policy_by_version_with_http_info(version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int version: (required)
        :return: ResponseContainerMetricsPolicyReadModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['version']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_metrics_policy_by_version" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'version' is set
        if self.api_client.client_side_validation and ('version' not in params or
                                                       params['version'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `version` when calling `get_metrics_policy_by_version`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'version' in params:
            path_params['version'] = params['version']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/metricspolicy/history/{version}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ResponseContainerMetricsPolicyReadModel',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_metrics_policy_history(self, **kwargs):  # noqa: E501
        """Get the version history of metrics policy  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_metrics_policy_history(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int offset:
        :param int limit:
        :return: ResponseContainerHistoryResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_metrics_policy_history_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_metrics_policy_history_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_metrics_policy_history_with_http_info(self, **kwargs):  # noqa: E501
        """Get the version history of metrics policy  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_metrics_policy_history_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int offset:
        :param int limit:
        :return: ResponseContainerHistoryResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['offset', 'limit']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_metrics_policy_history" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/metricspolicy/history', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ResponseContainerHistoryResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def revert_metrics_policy_by_version(self, version, **kwargs):  # noqa: E501
        """Revert to a specific historical version of a metrics policy  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.revert_metrics_policy_by_version(version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int version: (required)
        :return: ResponseContainerMetricsPolicyReadModel
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.revert_metrics_policy_by_version_with_http_info(version, **kwargs)  # noqa: E501
        else:
            (data) = self.revert_metrics_policy_by_version_with_http_info(version, **kwargs)  # noqa: E501
            return data

    def revert_metrics_policy_by_version_with_http_info(self, version, **kwargs):  # noqa: E501
        """Revert to a specific historical version of a metrics policy  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.revert_metrics_policy_by_version_with_http_info(version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int version: (required)
        :return: ResponseContainerMetricsPolicyReadModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['version']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method revert_metrics_policy_by_version" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'version' is set
        if self.api_client.client_side_validation and ('version' not in params or
                                                       params['version'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `version` when calling `revert_metrics_policy_by_version`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'version' in params:
            path_params['version'] = params['version']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/metricspolicy/revert/{version}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ResponseContainerMetricsPolicyReadModel',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_metrics_policy(self, **kwargs):  # noqa: E501
        """Update the metrics policy  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_metrics_policy(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param MetricsPolicyWriteModel body: Example Body:
{ \"policyRules\": [{   \"name\": \"Policy rule1 name\",   \"description\": \"Policy rule1 description\",   \"prefixes\": [\"revenue.*\"],   \"tags\": [{\"key\":\"sensitive\",  \"value\":\"false\"},              {\"key\":\"source\",  \"value\":\"app1\"}],   \"tagsAnded\": \"true\",   \"accessType\": \"ALLOW\",   \"accounts\": [\"accountId1\", \"accountId2\"],   \"userGroups\": [\"userGroupId1\"],   \"roles\": [\"roleId\"] }, {   \"name\": \"Policy rule2 name\",   \"description\": \"Policy rule2 description\",   \"prefixes\": [\"revenue.*\"],   \"accessType\": \"BLOCK\",   \"accounts\": [\"accountId3\"],   \"userGroups\": [\"userGroupId1\"] }] }

        :return: ResponseContainerMetricsPolicyReadModel
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_metrics_policy_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.update_metrics_policy_with_http_info(**kwargs)  # noqa: E501
            return data

    def update_metrics_policy_with_http_info(self, **kwargs):  # noqa: E501
        """Update the metrics policy  # noqa: E501

          # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_metrics_policy_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param MetricsPolicyWriteModel body: Example Body:
{ \"policyRules\": [{   \"name\": \"Policy rule1 name\",   \"description\": \"Policy rule1 description\",   \"prefixes\": [\"revenue.*\"],   \"tags\": [{\"key\":\"sensitive\",  \"value\":\"false\"},              {\"key\":\"source\",  \"value\":\"app1\"}],   \"tagsAnded\": \"true\",   \"accessType\": \"ALLOW\",   \"accounts\": [\"accountId1\", \"accountId2\"],   \"userGroups\": [\"userGroupId1\"],   \"roles\": [\"roleId\"] }, {   \"name\": \"Policy rule2 name\",   \"description\": \"Policy rule2 description\",   \"prefixes\": [\"revenue.*\"],   \"accessType\": \"BLOCK\",   \"accounts\": [\"accountId3\"],   \"userGroups\": [\"userGroupId1\"] }] }

        :return: ResponseContainerMetricsPolicyReadModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method update_metrics_policy" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/metricspolicy', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ResponseContainerMetricsPolicyReadModel',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)


text:
package com.sleroux.bank.model.extract;

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

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@SuppressWarnings("serial")
@Entity
@Table(name = "extract")
public class ExtractHistory  implements Serializable{

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private long	id;

	@Column(name = "extract_date")
	private Date	extractDate;

	public long getId() {
		return id;
	}

	public void setId(long _id) {
		id = _id;
	}

	public Date getExtractDate() {
		return extractDate;
	}

	public void setExtractDate(Date _extractDate) {
		extractDate = _extractDate;
	}

}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.ignite.testsuites;

import junit.framework.TestSuite;
import org.apache.ignite.internal.managers.GridManagerLocalMessageListenerSelfTest;
import org.apache.ignite.internal.managers.GridNoopManagerSelfTest;

/**
 * Grid SPI test suite.
 */
public class IgniteSpiTestSuite extends TestSuite {
    /**
     * @return All SPI tests suite.
     * @throws Exception If failed.
     */
    public static TestSuite suite() throws Exception {
        TestSuite suite = new TestSuite("Ignite SPIs Test Suite");

        // Failover.
        suite.addTest(IgniteSpiFailoverSelfTestSuite.suite());

        // Collision.
        suite.addTest(IgniteSpiCollisionSelfTestSuite.suite());

        // Event storage.
        suite.addTest(IgniteSpiEventStorageSelfTestSuite.suite());

        // Load Balancing.
        suite.addTest(IgniteSpiLoadBalancingSelfTestSuite.suite());

        // Checkpoints.
        suite.addTest(IgniteSpiCheckpointSelfTestSuite.suite());

        // Deployment
        suite.addTest(IgniteSpiDeploymentSelfTestSuite.suite());

        // Discovery.
        suite.addTest(IgniteSpiDiscoverySelfTestSuite.suite());

        // Communication.
        suite.addTest(IgniteSpiCommunicationSelfTestSuite.suite());

        // Indexing.
        suite.addTest(IgniteSpiIndexingSelfTestSuite.suite());

        // All other tests.
        suite.addTestSuite(GridNoopManagerSelfTest.class);

        // Local Message Listener tests.
        suite.addTestSuite(GridManagerLocalMessageListenerSelfTest.class);

        return suite;
    }
}


text:
<?php

namespace OPNsense\Telegraf;

class InputController extends \OPNsense\Base\IndexController
{
    public function indexAction()
    {
        $this->view->inputForm = $this->getForm("input");
        $this->view->pick('OPNsense/Telegraf/input');
    }
}


text:
@interface MZViewController ()

@property (nonatomic, assign) BOOL isEnd;

@property (nonatomic, strong) MZScene *scene;
@property (nonatomic, strong) MZCurrentUser *currenctUser;

@end

@implementation MZViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    _paused = NO;
    _isEnd = NO;

    _currenctUser = [MZCurrentUser sharedInstance];

    [self updateState];

    _bestView.scoreLabel.text = [NSString stringWithFormat:@"%ld", (long)_currenctUser.bestScore];

    _pauseButton.layer.cornerRadius = 5;
    _pauseButton.layer.masksToBounds = YES;

    _rankingButton.layer.cornerRadius = 5;
    _rankingButton.layer.masksToBounds = YES;

    _overlay.hidden = YES;
    _overlayBackground.hidden = YES;

    SKView *skView = (SKView *)self.view;
    MZScene *scene = [MZScene sceneWithSize:skView.bounds.size];
    scene.scaleMode = SKSceneScaleModeAspectFill;

    [skView presentScene:scene];
    [self updateScore:0];
    [scene startNewGame];

    _scene = scene;
    _scene.delegate = self;
}

- (void)updateState
{
    [_scoreView refreshSubviews];
    [_bestView refreshSubviews];

    _pauseButton.backgroundColor = [MZGameUtils colorOfButton];
    _pauseButton.titleLabel.font = [MZGameUtils boldFontWithSize:14];

    _rankingButton.backgroundColor = [MZGameUtils colorOfButton];
    _rankingButton.titleLabel.font = [MZGameUtils boldFontWithSize:14];

    _targetScore.textColor = [MZGameUtils colorOfButton];
    _targetScore.font = [MZGameUtils boldFontWithSize:32];

    _subtitle.textColor = [MZGameUtils colorOfButton];
    _subtitle.font = [MZGameUtils regularFontWithSize:14];

    _overlay.message.font = [MZGameUtils boldFontWithSize:36];
    _overlay.keepPlaying.titleLabel.font = [MZGameUtils boldFontWithSize:17];
    _overlay.restartGame.titleLabel.font = [MZGameUtils boldFontWithSize:17];
    _overlay.shareFacebook.titleLabel.font = [MZGameUtils boldFontWithSize:17];

    _overlay.message.textColor = [MZGameUtils colorOfButton];
    [_overlay.keepPlaying setTitleColor:[MZGameUtils colorOfButton] forState:UIControlStateNormal];
    [_overlay.restartGame setTitleColor:[MZGameUtils colorOfButton] forState:UIControlStateNormal];
    [_overlay.shareFacebook setTitleColor:[MZGameUtils colorOfButton] forState:UIControlStateNormal];
}

- (void)updateScore:(NSInteger)score
{
    _scoreView.scoreLabel.text = [NSString stringWithFormat:@"%ld", (long)score];

    if (_currenctUser.bestScore < score) {
        [MZGameCenterUtils sendScoreToGameCenter:score];
        _currenctUser.bestScore = score;
        [_currenctUser saveState];
        _bestView.scoreLabel.text = [NSString stringWithFormat:@"%ld", (long)score];
    }
}

- (IBAction)showLeaderboard:(id)sender
{
    GKGameCenterViewController *gameCenterViewController = [[GKGameCenterViewController alloc] init];
    if (gameCenterViewController != nil) {
        gameCenterViewController.gameCenterDelegate = self;
        [self presentViewController:gameCenterViewController animated:YES completion:nil];
    }
}

- (IBAction)restart:(id)sender
{
    [self hideOverlay];
    [self updateScore:0];
    [_scene startNewGame];
    _isEnd = NO;
    _paused = NO;
}

- (IBAction)keepPlaying:(id)sender
{
    [self hideOverlay];
    _paused = NO;
}

- (IBAction)share:(id)sender
{
    if (_paused) {
        [self presentViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"MZDetailViewController"] animated:YES completion:nil];
    } else {
        [self shareText:[NSString stringWithFormat:@"I scored %@ points at Isotopic256!\nhttps://itunes.apple.com/app/isotopic-256/id909720805", _scoreView.scoreLabel.text] andImage:[MZGridView screenshotForShare]];
    }
}

- (IBAction)pause:(id)sender
{
    if (!_paused && !_isEnd) {
        _paused = YES;
        _overlay.hidden = NO;
        _overlay.alpha = 0;
        _overlayBackground.hidden = NO;
        _overlayBackground.alpha = 0;

        _overlay.keepPlaying.hidden = NO;
        _overlay.message.text = @"Paused";

        _overlay.shareFacebook.hidden = NO;
        [_overlay.shareFacebook setTitle:@"About" forState:UIControlStateNormal];

        // Fake the overlay background as a mask on the board.
        _overlayBackground.image = [MZGridView gridImageWithOverlay];

        // Center the overlay in the board.
        CGFloat verticalOffset = [[UIScreen mainScreen] bounds].size.height - [MZGameUtils marginOfVertical];
        NSInteger side = 3 * ([MZGameUtils cellSize] + [MZGameUtils borderWidth]) + [MZGameUtils borderWidth];
        _overlay.center = CGPointMake([MZGameUtils marginOfHorizontal] + side / 2, verticalOffset - side / 2);
        [UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
            _overlay.alpha = 1;
            _overlayBackground.alpha = 1;
        } completion:^(BOOL finished) {
            ((SKView *)self.view).paused = YES;
        }];
    }
}

- (void)shareText:(NSString *)text andImage:(UIImage *)image
{
    NSMutableArray *sharingItems = [NSMutableArray new];

    if (text) {
        [sharingItems addObject:text];
    }
    if (image) {
        [sharingItems addObject:image];
    }

    UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil];
    [self presentViewController:activityController animated:YES completion:nil];
}

- (void)endGame:(BOOL)won
{
    _currenctUser.playCount += 1;
    if ([MZCurrentUser isNotContainingIdentifier:Play10]) [MZGameCenterUtils sendAchievementWithIdentifier:Play10 percentComplete:(_currenctUser.playCount/10.0f)*100.0f];
    if ([MZCurrentUser isNotContainingIdentifier:Play50]) [MZGameCenterUtils sendAchievementWithIdentifier:Play50 percentComplete:(_currenctUser.playCount/50.0f)*100.0f];
    if ([MZCurrentUser isNotContainingIdentifier:Play100]) [MZGameCenterUtils sendAchievementWithIdentifier:Play100 percentComplete:(_currenctUser.playCount/100.0f)*100.0f];
    [_currenctUser saveState];
    _overlay.hidden = NO;
    _overlay.alpha = 0;
    _overlayBackground.hidden = NO;
    _overlayBackground.alpha = 0;

    if (!won) {
        _overlay.keepPlaying.hidden = YES;
        _overlay.message.text = @"Game Over";
    } else {
        _overlay.keepPlaying.hidden = NO;
        _overlay.message.text = @"You Win!";
    }

    [_overlay.shareFacebook setTitle:@"Share" forState:UIControlStateNormal];

    // Fake the overlay background as a mask on the board.
    _overlayBackground.image = [MZGridView gridImageWithOverlay];

    // Center the overlay in the board.
    CGFloat verticalOffset = [[UIScreen mainScreen] bounds].size.height - [MZGameUtils marginOfVertical];
    NSInteger side = 3 * ([MZGameUtils cellSize] + [MZGameUtils borderWidth]) + [MZGameUtils borderWidth];
    _overlay.center = CGPointMake([MZGameUtils marginOfHorizontal] + side / 2, verticalOffset - side / 2);

    [UIView animateWithDuration:0.5 delay:1.5 options:UIViewAnimationOptionCurveEaseInOut animations:^{
        _overlay.alpha = 1;
        _overlayBackground.alpha = 1;
    } completion:^(BOOL finished) {
        _isEnd = YES;
        ((SKView *)self.view).paused = YES;
    }];
}

- (void)hideOverlay
{
    ((SKView *)self.view).paused = NO;
    if (!_overlay.hidden) {
        [UIView animateWithDuration:0.5 animations:^{
            _overlay.alpha = 0;
            _overlayBackground.alpha = 0;
        } completion:^(BOOL finished) {
            _overlay.hidden = YES;
            _overlayBackground.hidden = YES;
        }];
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

#pragma mark - Game Center Delegate

- (void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController
{
    [gameCenterViewController dismissViewControllerAnimated:YES completion:nil];
}

@end


text:
"""
jobber.conf
~~~~~~~~~~~

Exposes a `_Settings_` instance with applied overrides from local.py.

"""
from jobber.conf import default as default_settings

try:
    from jobber.conf import local as local_settings
except ImportError:
    local_settings = None

def _make_dict(module):
    """Transforms a module into a `dict` containing all the names that the
    module defines.

    """
    if not module:
        return {}
    return {name: getattr(module, name) for name in dir(module)}

_default = _make_dict(default_settings)
_local = _make_dict(local_settings)

class _Settings(object):
    """Placeholder class for settings."""
    def __init__(self, *args):
        for setting in args:
            if setting: self.apply(setting)

    def apply(self, settings):
        for key, value in settings.iteritems():
            if key == key.upper():
                setattr(self, key, value)

# Expose a global `settings` property.
settings = _Settings(_default, _local)


text:
package me.stevenkin.boomvc.mvc.annotation;

import java.lang.annotation.*;

@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface BodyParam {

}


text:
var config = module.exports;

/* Test in browser with no AMD */
config["Browser tests"] = {
	rootPath: "../",
	libs: ["node_modules/wheels-pubsub/node_modules/wheels-class/wheels-class.js", "node_modules/wheels-pubsub/wheels-pubsub.js"],
	sources: ["wheels-loud-accessors.js"],
	tests: ["spec/*.spec.js"]
};


text:
package com.episode6.hackit.chop;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;

import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/**
 * Tests usage of Chop.withTag()
 */
@RunWith(ChopTestTestRunner.class)
public class SettableTaggerTest {

  @Mock Chop.Tree mTree;

  @Before
  public void setUp() {
    when(mTree.supportsLevel(any(Chop.Level.class)))
        .thenReturn(true);

    Chop.plantTree(mTree);
  }

  @After
  public void cleanUp() {
    ChopInternals.TREE_FARM.digUpTree(mTree);
  }

  @Test
  public void testSettableTagger() {
    String expectedTag = "MYTESTTAG";

    Chop.withTag(expectedTag).d("Test message");

    verify(mTree).chopLog(
        any(Chop.Level.class),
        eq(expectedTag),
        anyString());
  }

  @Test
  public void testSettableTaggerClass() {
    Class<?> tag = SettableTaggerTest.class;
    String expectedTag = tag.getSimpleName();

    Chop.withTag(tag).d("Test message");

    verify(mTree).chopLog(
        any(Chop.Level.class),
        eq(expectedTag),
        anyString());
  }

  @Test(expected = ClassCastException.class)
  public void testImpossibleDefault() {
    Chop.ChoppingToolsAdapter adapter = Chop.withTag("testTag");

    Chop.DefaultableChoppingToolsAdapter defaultableAdapter = (Chop.DefaultableChoppingToolsAdapter)adapter;
    defaultableAdapter.byDefault();
  }

  @Test(expected = ClassCastException.class)
  public void testImpossibleDefaultClass() {
    Class<?> tag = SettableTaggerTest.class;
    Chop.ChoppingToolsAdapter adapter = Chop.withTag(tag);

    Chop.DefaultableChoppingToolsAdapter defaultableAdapter = (Chop.DefaultableChoppingToolsAdapter)adapter;
    defaultableAdapter.byDefault();
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Hymenomyc. eur. (Upsaliae) 449 (1874)

#### Original name
Russula fallax var. fallax

### Remarks
null


text:
(function (env) {
    "use strict";
    env.ddg_spice_twitch_featured = function(api_result){

        if (!api_result || !api_result.featured || api_result.featured.length === 0 ||api_result.error) {
            return Spice.failed('twitch_featured');
        }

        Spice.add({
            minItemsForModeSwitch: 3,
            id: "twitch_featured",
            name: "Gaming",
            data: api_result.featured,
            meta: {
                sourceName: "Twitch",
                sourceUrl: "http://www.twitch.tv/",
                itemType: "Featured Streams"
            },
            templates: {
                group: 'videos',
                detail: false,
                item_detail: false,
                moreAt: true,
            },
            normalize: function(item) {
                var title = "Untitled Broadcast";
                if(DDG.getProperty(item, 'stream.channel.status')){
                    var display_name = DDG.getProperty(item, 'stream.channel.display_name');
                    var status = DDG.getProperty(item,'stream.channel.status');
                    title = display_name + ": " + status;
                }

                return {
                    url: DDG.getProperty(item, 'stream.channel.url'),
                    viewCount: DDG.getProperty(item, 'stream.viewers'),
                    images: DDG.getProperty(item, 'stream.preview'),
                    title: title,
                    duration: DDG.getProperty(item, 'stream.game')
                };
            }
        });
    };
}(this));


text:
@implementation HNException

NSString *const HNDatabaseException = @"HN database exception";
NSString *const HNFilesystemException = @"HN filesystem exception";
NSString *const HNInvalidClassException = @"HN invalid class exception";

@end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SquareRoot
{
    class SquareRoot
    {
        static void Main(string[] args)
        {

            try
            {
                double squareNumber = double.Parse(Console.ReadLine());
                var sqrt = Math.Sqrt(squareNumber).ToString("F3");
                if (sqrt=="NaN")
                {
                    throw new FormatException();
                }
                else
                {
                    Console.WriteLine(sqrt);
                }
            }
            catch (FormatException)
            {

                Console.WriteLine("Invalid number");
            }
            finally
            {

                Console.WriteLine("Good bye");
            }
        }
    }
}


text:
#include <math.h>

#include "ecma-alloc.h"
#include "ecma-bigint.h"
#include "ecma-builtins.h"
#include "ecma-conversion.h"
#include "ecma-exceptions.h"
#include "ecma-gc.h"
#include "ecma-globals.h"
#include "ecma-helpers.h"
#include "ecma-number-object.h"
#include "ecma-objects.h"
#include "jrt.h"

#if ENABLED (JERRY_BUILTIN_NUMBER)

#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"

#if ENABLED (JERRY_ESNEXT)
/**
 * This object has a custom dispatch function.
 */
#define BUILTIN_CUSTOM_DISPATCH

/**
 * List of built-in routine identifiers.
 */
enum
{
  ECMA_NUMBER_OBJECT_ROUTINE_START = 0,
  ECMA_NUMBER_OBJECT_ROUTINE_IS_FINITE,
  ECMA_NUMBER_OBJECT_ROUTINE_IS_NAN,
  ECMA_NUMBER_OBJECT_ROUTINE_IS_INTEGER,
  ECMA_NUMBER_OBJECT_ROUTINE_IS_SAFE_INTEGER
};
#endif /* ENABLED (JERRY_ESNEXT) */

#define BUILTIN_INC_HEADER_NAME "ecma-builtin-number.inc.h"
#define BUILTIN_UNDERSCORED_ID number
#include "ecma-builtin-internal-routines-template.inc.h"

/** \addtogroup ecma ECMA
 * @{
 *
 * \addtogroup ecmabuiltins
 * @{
 *
 * \addtogroup number ECMA Number object built-in
 * @{
 */

/**
 * Handle calling [[Call]] of built-in Number object
 *
 * @return ecma value
 */
ecma_value_t
ecma_builtin_number_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
                                   uint32_t arguments_list_len) /**< number of arguments */
{
  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);

  ecma_value_t ret_value = ECMA_VALUE_EMPTY;

  if (arguments_list_len == 0)
  {
    ret_value = ecma_make_integer_value (0);
  }
  else
  {
    ecma_number_t num;
    ret_value = ecma_op_to_numeric (arguments_list_p[0], &num, ECMA_TO_NUMERIC_ALLOW_BIGINT);

    if (ECMA_IS_VALUE_ERROR (ret_value))
    {
      return ret_value;
    }

#if ENABLED (JERRY_BUILTIN_BIGINT)
    if (ecma_is_value_bigint (ret_value))
    {
      ecma_value_t bigint = ret_value;
      ret_value = ecma_bigint_to_number (bigint);
      ecma_free_value (bigint);
    }
    else
#endif /* ENABLED (JERRY_BUILTIN_BIGINT) */
    {
      ret_value = ecma_make_number_value (num);
    }
  }

  return ret_value;
} /* ecma_builtin_number_dispatch_call */

/**
 * Handle calling [[Construct]] of built-in Number object
 *
 * @return ecma value
 */
ecma_value_t
ecma_builtin_number_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
                                        uint32_t arguments_list_len) /**< number of arguments */
{
  JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);

  if (arguments_list_len == 0)
  {
    return ecma_op_create_number_object (ecma_make_integer_value (0));
  }

#if ENABLED (JERRY_BUILTIN_BIGINT)
  ecma_number_t num;
  ecma_value_t value = ecma_op_to_numeric (arguments_list_p[0], &num, ECMA_TO_NUMERIC_ALLOW_BIGINT);

  if (ECMA_IS_VALUE_ERROR (value))
  {
    return value;
  }

  if (ecma_is_value_bigint (value))
  {
    ecma_value_t bigint = value;
    value = ecma_bigint_to_number (bigint);
    ecma_free_value (bigint);
  }
  else
  {
    value = ecma_make_number_value (num);
  }

  ecma_value_t result = ecma_op_create_number_object (value);
  ecma_free_value (value);
  return result;
#else /* !ENABLED (JERRY_BUILTIN_BIGINT) */
  return ecma_op_create_number_object (arguments_list_p[0]);
#endif /* ENABLED (JERRY_BUILTIN_BIGINT) */
} /* ecma_builtin_number_dispatch_construct */

#if ENABLED (JERRY_ESNEXT)
/**
 * The Number object 'isInteger' and 'isSafeInteger' routine
 *
 * See also:
 *          ECMA-262 v6, 20.1.2.3
 *          ECMA-262 v6, 20.1.2.3
 *
 * @return ecma value
 *         Returned value must be freed with ecma_free_value.
 */
static ecma_value_t
ecma_builtin_number_object_is_integer_helper (ecma_value_t arg, /**< routine's argument */
                                              ecma_number_t num, /**< this number */
                                              bool is_safe) /**< is the number safe */
{
  if (ecma_number_is_nan (num) || ecma_number_is_infinity (num))
  {
    return ECMA_VALUE_FALSE;
  }

  ecma_number_t int_num;

  if (is_safe)
  {
    int_num = ecma_number_trunc (num);

    if (fabs (int_num) > ECMA_NUMBER_MAX_SAFE_INTEGER)
    {
      return ECMA_VALUE_FALSE;
    }
  }
  else
  {
    ecma_op_to_integer (arg, &int_num);
  }

  return (int_num == num) ? ECMA_VALUE_TRUE : ECMA_VALUE_FALSE;
} /* ecma_builtin_number_object_is_integer_helper */

/**
 * Dispatcher of the built-in's routines
 *
 * @return ecma value
 *         Returned value must be freed with ecma_free_value.
 */
ecma_value_t
ecma_builtin_number_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide routine identifier */
                                      ecma_value_t this_arg, /**< 'this' argument value */
                                      const ecma_value_t arguments_list_p[], /**< list of arguments
                                                                              *   passed to routine */
                                      uint32_t arguments_number) /**< length of arguments' list */
{
  JERRY_UNUSED (this_arg);
  JERRY_UNUSED (arguments_number);

  if (!ecma_is_value_number (arguments_list_p[0]))
  {
    return ECMA_VALUE_FALSE;
  }

  ecma_number_t num = ecma_get_number_from_value (arguments_list_p[0]);

  switch (builtin_routine_id)
  {
    case ECMA_NUMBER_OBJECT_ROUTINE_IS_FINITE:
    {
      return ecma_make_boolean_value (!(ecma_number_is_nan (num) || ecma_number_is_infinity (num)));
    }
    case ECMA_NUMBER_OBJECT_ROUTINE_IS_NAN:
    {
      return ecma_make_boolean_value (ecma_number_is_nan (num));
    }
    case ECMA_NUMBER_OBJECT_ROUTINE_IS_INTEGER:
    case ECMA_NUMBER_OBJECT_ROUTINE_IS_SAFE_INTEGER:
    {
      bool is_safe = (builtin_routine_id == ECMA_NUMBER_OBJECT_ROUTINE_IS_SAFE_INTEGER);
      return ecma_builtin_number_object_is_integer_helper (arguments_list_p[0], num, is_safe);
    }
    default:
    {
      JERRY_UNREACHABLE ();
    }
  }
} /* ecma_builtin_number_dispatch_routine */

#endif /* ENABLED (JERRY_ESNEXT) */

/**
 * @}
 * @}
 * @}
 */

#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */


text:
<?php

namespace RcmAdmin\Controller;

use Rcm\View\Model\ApiJsonModel;
use Zend\Http\Response;

class RpcAdminKeepAlive extends ApiAdminBaseController
{

    /**
     * create
     *
     * @return mixed|JsonModel
     */
    public function create($data)
    {
        $dateTime = new \DateTime();

        $result = [
                'responseTime' => $dateTime->getTimestamp(),
                'requestTime' => (float) $data['requestTime']
        ];

        return new ApiJsonModel($result);
    }
}


text:
from fabric.api import *
import pytest
from common import *
from common_setup import *
from common_docker import *
from mendertesting import MenderTesting
from common_update import common_update_procedure
from MenderAPI import auth, adm, deploy, inv, deviceauth
import subprocess
import time
import conftest
import shutil
import filelock
import re

def setup_docker_volumes():
    docker_volumes = ["mender-artifacts",
                      "mender-deployments-db",
                      "mender-deviceadm-db",
                      "mender-deviceauth-db",
                      "mender-redis-db",
                      "mender-elasticsearch-db",
                      "mender-inventory-db",
                      "mender-useradm-db"]

    for volume in docker_volumes:
        ret = subprocess.call(["docker", "volume", "create", "--name=%s" % volume])
        assert ret == 0, "failed to create docker volumes"

def setup_upgrade_source(upgrade_from):
    if os.path.exists("upgrade-from"):
        shutil.rmtree("upgrade-from")

    ret = subprocess.call(["git", "clone", "https://github.com/mendersoftware/integration", "-b", upgrade_from, "upgrade-from"])
    assert ret == 0, "failed to git clone old source version"

    # start upgrade source and bring up it's production environment
    ret = subprocess.call(["bash", "run.sh", "--get-requirements"],
                          cwd="upgrade-from/tests")
    assert ret == 0, "failed running 'run.sh --get-requirements' on upgrade source"

    ret = subprocess.call(["python", "production_test_env.py", "--start"],
                          cwd="upgrade-from/tests")
    assert ret == 0, "failed running 'production_test_env.py start' on upgrade source"

def perform_upgrade():
    ret = subprocess.call(["cp", "-r", "tests/upgrade-from/keys-generated", "."], cwd="..")
    assert ret == 0, "faled to copy keys from original environment"

    subprocess.check_call(["./production_test_env.py", "--start"])

    # give time for all microservices to come online
    time.sleep(60 * 5)

def setup_fake_clients(device_count, fail_count):
    p = subprocess.Popen(["mender-stress-test-client",
                         "-count=%s" % str(device_count),
                         "-invfreq=5",
                         "-pollfreq=5",
                         "-wait=10",
                         "-failcount=%s" % str(fail_count)])
    return p

def provision_upgrade_server():
    # deploy update to 10 devices
    ret = subprocess.Popen(["python", "production_test_env.py", "--test-deployment"], cwd="upgrade-from/tests", stdout=subprocess.PIPE)
    time.sleep(120)

    # extract deployment_id and artifact_id from piped output
    output = ret.stdout.read()
    devices = re.search("devices=(.*)", output).group(1)
    deployment_id = re.search("deployment_id=(.*)", output).group(1)
    artifact_id = re.search("artifact_id=(.*)", output).group(1)

    return devices, deployment_id, artifact_id

class BackendUpdating():
    fake_client_process = None
    provisioned_devices = None
    provisioned_deployment_id = None
    provisioned_artifact_id = None

    def __init__(self, upgrade_from):
        conftest.docker_compose_instance = "testprod"
        setup_docker_volumes()
        setup_upgrade_source(upgrade_from)
        self.fake_client_process = setup_fake_clients(10, 3)
        self.provisioned_devices, self.provisioned_deployment_id, self.provisioned_artifact_id = provision_upgrade_server()
        perform_upgrade()

    def teardown(self):
        self.fake_client_process.kill()

    def test_original_deployments_persisted(self):
        auth.reset_auth_token()
        auth.get_auth_token()

        # wait for 10 devices to be available
        devices = adm.get_devices_status("accepted", 10)
        provisioned_devices = eval(self.provisioned_devices)

        # check that devices and provisioned_devices are the same
        assert len(devices) == provisioned_devices
        # not sure what else I can do here, the device admission changed from 1.0 to master

        assert deploy.get_statistics(self.provisioned_deployment_id)["success"] == 7
        assert deploy.get_statistics(self.provisioned_deployment_id)["failure"] == 3

        # check failures still contain logs
        for device_deployment in deploy.get_deployment_overview(self.provisioned_deployment_id):
            if device_deployment["status"] == "failure":
                assert "damn" in deploy.get_logs(device_deployment["id"], self.provisioned_deployment_id)

        deployments_in_progress = deploy.get_status("inprogress")
        deployments_pending = deploy.get_status("pending")
        deployments_finished = deploy.get_status("finished")

        assert len(deployments_in_progress) == 0
        assert len(deployments_pending) == 0
        assert len(deployments_finished) == 1

        assert self.provisioned_artifact_id in str(deployments_finished)

    def test_inventory_post_upgrade(self):
        inventory = inv.get_devices()
        for inventory_item in inventory:
            for inventory_pair in inventory_item["attributes"]:

                # make sure time was updated recently
                if inventory_pair["name"] == "time":
                    assert int(time.time()) - int(inventory_pair["value"]) <= 10

                # and other invetory items are still present
                elif inventory_pair["name"] == "device_type":
                    assert inventory_pair["value"] == "test"
                elif inventory_pair["name"] == "image_id":
                    assert inventory_pair["value"] == "test"

    def test_deployments_post_upgrade(self):
        adm.get_devices_status("accepted", 10)

        # perform upgrade
        devices_to_update = list(set([device["device_id"] for device in adm.get_devices_status("accepted", expected_devices=10)]))
        deployment_id, artifact_id = common_update_procedure("core-image-full-cmdline-vexpress-qemu.ext4",
                                                             device_type="test",
                                                             devices=devices_to_update)

        deploy.check_expected_status("finished", deployment_id)
        assert deploy.get_statistics(deployment_id)["success"] == 7
        assert deploy.get_statistics(deployment_id)["failure"] == 3

        deploy.get_status("finished")

    def test_artifacts_persisted(self):
        devices_to_update = list(set([device["device_id"] for device in adm.get_devices_status("accepted", expected_devices=10)]))
        deployment_id = deploy.trigger_deployment(name="artifact survived backed upgrade",
                                                  artifact_name=self.provisioned_artifact_id,
                                                  devices=devices_to_update)
        deploy.check_expected_status("finished", deployment_id)

    def test_decommissioning_post_upgrade(self):
        # assertion error occurs here on decommissioning fail
        for device in adm.get_devices(10):
            deviceauth.decommission(device["device_id"])

@MenderTesting.upgrade_from
@pytest.mark.usefixtures("running_custom_production_setup")
@pytest.mark.parametrize("upgrade_from", [s.strip() for s in pytest.config.getoption("--upgrade-from").split(",")])
def test_run_upgrade_test(upgrade_from):
    # run these tests sequentially since they expose the storage proxy and the api gateports to the host
    with filelock.FileLock(".update_test_lock"):
        t = None
        try:
            t = BackendUpdating(upgrade_from)
            t.test_original_deployments_persisted()
            t.test_inventory_post_upgrade()
            t.test_deployments_post_upgrade()
            t.test_artifacts_persisted()
            t.test_decommissioning_post_upgrade()
        except Exception, e:
            # exception is handled by pytest
            raise e
        finally:
           if isinstance(t, BackendUpdating):
               t.teardown()


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Window size="100,80" bktrans="true">
    <VerticalLayout>
    	<TipsAnchor name="topanchor" height="6" linecolor="#FFFFFFFF" fillcolor="#FFFFFFFF" dir="1">
      </TipsAnchor>
    	 <HorizontalLayout>
    	 	 <TipsAnchor name="leftanchor" width="6" linecolor="#FFFFFFFF" fillcolor="#FFFFFFFF" dir="0" >
      	 </TipsAnchor>
         <HorizontalLayout  borderround="5,5" bkcolor="#FFFFFFFF" bkimage="pt_bk.png">
         	 <Text name="content" padding="8,6,8,6" textcolor="#FFFFFFFF" multiline="true" readonly="true" >
         	 	</Text>
      	 </HorizontalLayout>
      	 <TipsAnchor name="rightanchor"  width="6" linecolor="#FFFFFFFF" fillcolor="#FFFFFFFF" dir="2" >
      	 </TipsAnchor>
      </HorizontalLayout>
        <TipsAnchor name="bottomanchor" height="6" linecolor="#FFFFFFFF" fillcolor="#FFFFFFFF" dir="3" >
      </TipsAnchor>
    </VerticalLayout>
</Window>


text:
package com.opengamma.engine.view.worker;

import java.util.Set;

import com.opengamma.engine.depgraph.DependencyNode;
import com.opengamma.engine.depgraph.impl.RootDiscardingSubgrapher;
import com.opengamma.engine.target.ComputationTargetType;
import com.opengamma.id.UniqueId;

/**
 * Filters a dependency graph to exclude any nodes with a PORTFOLIO or PORTFOLIO_NODE target.
 */
/* package */final class InvalidPortfolioDependencyNodeFilter extends RootDiscardingSubgrapher {

  private final Set<UniqueId> _badNodes;

  InvalidPortfolioDependencyNodeFilter(final Set<UniqueId> badNodes) {
    _badNodes = badNodes;
  }

  // RootDiscardingSubgrapher

  @Override
  public boolean acceptNode(final DependencyNode node) {
    final ComputationTargetType nodeType = node.getTarget().getType();
    if (nodeType.isTargetType(ComputationTargetType.PORTFOLIO_NODE)) {
      return !_badNodes.contains(node.getTarget().getUniqueId());
    }
    return !nodeType.isTargetType(ComputationTargetType.PORTFOLIO);
  }

}


text:
This is mewtocol command client written by Go.

This library support communication to Panasonic PLC from Go application.

* Panasonic: <http://panasonic.jp>
* Panasonic PLC: <http://www3.panasonic.biz/ac/j/fasys/plc/>

##Install

```
$ go get github.com/hiroeorz/mewtocol-go/mewtocol
```

## Usage

See [main.go](https://github.com/hiroeorz/mewtocol-go/blob/master/main.go)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace InteractiveSpace.EngineController.NativeWrappers
{
    public static class NativeConstants
    {
        /// <summary>
        /// <remarks>FingerSelector.h, MAX_FINGER_NUM</remarks>
        /// </summary>
        public const int MAX_FINGER_NUM = 10;

        /// <summary>
        /// <remarks>HandTracker.h, MAX_HAND_NUM</remarks>
        /// </summary>
        public const int MAX_HAND_NUM = 2;
    }

    /// <summary>
    /// <remarks>ImageProcessingFactory.h, ImageProductType</remarks>
    /// </summary>
    public enum ImageProductType
    {
        RGBSourceProduct,
        DepthSourceProduct,	//this depth data is from the Kinect thread
        DepthSynchronizedProduct,	//this depth data is synchronized with the engine thread

        DepthSobeledProduct,

        DebugDepthHistogramedProduct,
        DebugOmniOutputProduct,

        RectifiedTabletopProduct,

        ImageProductsCount
    }

    /// <summary>
    /// <remarks>HandTracker.h, HandType</remarks>
    /// </summary>
    public enum HandType
    {
	    NewHandHint = 0,	//new added hand hint, track not requested
	    TrackRequestedHandHint,	//track requested, but OpenNI have not detect yet
	    TrackingHand	//OpenNI is tracking this hand
    }

    /// <summary>
    /// <remarks>FingerSelector.h, FingerType</remarks>
    /// </summary>
    public enum FingerType
    {
        OmniFinger,
        ThresholdFinger
    }

    public enum FingerState
    {
	    FingerHovering,
	    FingerOnSurface
    }

    /// <summary>
    /// <remarks>Calibrator.h, CalibratedCoordinateSystem</remarks>
    /// </summary>
    public enum CalibratedCoordinateSystem
    {
	    Table2D = 0,
	    Table3D,
	    RGB2D,
	    Depth2D,
	    Depth3D,
	    Motion2D
    };

    /// <summary>
    /// <remarks>ThreadUtils.h, ReadLockedWrapperPtr</remarks>
    /// </summary>
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    unsafe public struct ReadLockedWrapperPtr
    {
        private IntPtr obj;
        private IntPtr readLock;

        public byte* BytePtr { get { return (byte*)obj; } }
        public ushort* UShortPtr { get { return (ushort*)obj; } }
        public IntPtr IntPtr { get { return (IntPtr)obj; } }
    }

    /// <summary>
    /// <remarks>InteractiveSpaceTypes.h, IntPoint3D</remarks>
    /// </summary>
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    unsafe public struct IntPoint3D
    {
        public int x, y, z;
    }

    /// <summary>
    /// <remarks>InteractiveSpaceTypes.h, FloatPoint3D</remarks>
    /// </summary>
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    unsafe public struct FloatPoint3D
    {
        public float x, y, z;
        public FloatPoint3D(double x, double y, double z)
        {
            this.x = (float)x;
            this.y = (float)y;
            this.z = (float)z;
        }
        public override string ToString()
        {
            return string.Format("{0:0.00},{1:0.00},{2:0.00}", x, y, z);
        }
    }

    /// <summary>
    /// <remarks>FingerSelector.h, Finger</remarks>
    /// </summary>
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    unsafe public struct Finger
    {
        private int id;
        private FloatPoint3D positionInRealWorld;
        private IntPoint3D positionInKinectProj;
        private FingerType fingerType;
        private FingerState fingerState;

        public Finger(int id, FloatPoint3D positionInRealWorld, IntPoint3D positionInKinectPersp, FingerType fingerType, FingerState fingerState)
        {
            this.id = id;
            this.positionInKinectProj = positionInKinectPersp;
            this.positionInRealWorld = positionInRealWorld;
            this.fingerType = fingerType;
            this.fingerState = fingerState;
        }

        public int ID { get { return id; } }
        public FloatPoint3D PositionInRealWorld { get { return positionInRealWorld; } }
        public IntPoint3D PositionInKinectPersp { get { return positionInKinectProj; } }
        public FingerType FingerType { get { return fingerType; } }
        public FingerState FingerState { get { return fingerState; } }
    }

    /// <summary>
    /// <remarks>HandTracker.h, Hand</remarks>
    /// </summary>
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    unsafe public struct Hand
    {
        private HandType handType;
	    private UInt32 id;
	    private FloatPoint3D positionInRealWorld;
	    private IntPoint3D positionInKinectProj;
	    private double confidence;
        private int captured;

        public HandType HandType { get { return handType; } }
        public UInt32 ID { get { return id; } }
        public FloatPoint3D PositionInRealWorld { get { return positionInRealWorld; } }
        public IntPoint3D PositionInKinectProj { get { return positionInKinectProj; } }
        public double Confidence { get { return confidence; } }
        public int Captured { get { return captured; } }
    }

    /// <summary>
    /// <remarks>FingerEventsGenerator.h, FingerEventType</remarks>
    /// </summary>
    public enum FingerEventType
    {
	    FingerMove,
	    FingerDown,
	    FingerUp,

	    FingerCaptured,
	    FingerLost
    };

    /// <summary>
    /// <remarks>FingerEventsGenerator.h, FingerEvent</remarks>
    /// </summary>
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    unsafe public struct FingerEvent
    {
	    private int id;
	    private FloatPoint3D position;
        private FloatPoint3D positionTable2D;
	    private FingerEventType eventType;
        private FingerState fingerState;

        public int ID { get { return id; } }
        public FloatPoint3D Position { get { return position; } }
        public FloatPoint3D PositionTable2D { get { return positionTable2D; } }
        public FingerEventType EventType { get { return eventType; } }
        public FingerState FingerState { get { return fingerState; } }
    };

    /// <summary>
    /// <remarks>HandTracker.h, HandEventType</remarks>
    /// </summary>
    public enum HandEventType
    {
	    HandMove,
	    HandCaptured,
	    HandLost
    };

    /// <summary>
    /// <remarks>HandTracker.h, HandEvent</remarks>
    /// </summary>
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    public struct HandEvent
    {
	    private int id;
	    private FloatPoint3D position;
	    private FloatPoint3D positionTable2D;
	    private HandEventType eventType;

        public int ID { get { return id; } }
        public FloatPoint3D Position { get { return position; } }
        public FloatPoint3D PositionTable2D { get { return positionTable2D; } }
        public HandEventType EventType { get { return eventType; } }
    };

    /// <summary>
    /// <remarks>InteractiveSpaceTypes.h, Quadrilateral</remarks>
    /// </summary>
    [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
    public struct Quadrilateral
    {
        private FloatPoint3D p1, p2, p3, p4;

        public FloatPoint3D P1 { get { return p1; } }
        public FloatPoint3D P2 { get { return p2; } }
        public FloatPoint3D P3 { get { return p3; } }
        public FloatPoint3D P4 { get { return p4; } }
    }

    [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
    public struct Matrix33
    {
        private double m11, m12, m13, m21, m22, m23, m31, m32, m33;

        public double M11 { get { return m11; } }
        public double M12 { get { return m12; } }
        public double M13 { get { return m13; } }
        public double M21 { get { return m21; } }
        public double M22 { get { return m22; } }
        public double M23 { get { return m23; } }
        public double M31 { get { return m31; } }
        public double M32 { get { return m32; } }
        public double M33 { get { return m33; } }
    }

    public unsafe delegate void ViscaCommandDelegate(bool isCommandCompleted, IntPtr callbackState);
    public unsafe delegate void RGBCalibrationFinishedDelegate(FloatPoint3D* checkPoints, int checkPointNum, FloatPoint3D* depthRefCorners, int depthRefCornerNum);

    /// <summary>
    /// <remarks>HandTracker.h, HandEventCallback</remarks>
    /// </summary>
    /// <param name="e"></param>
    public unsafe delegate void HandEventCallback(HandEvent e);
}


text:
require 'spec_helper'
describe Gisele do

  it "has a version number" do
    Gisele.const_defined?(:VERSION).should be_true
  end

end


text:
function Pipe() {
	this.index = -1;
	this.up = null;
	this.down = null;
	this.up_start_pos = null;
	this.down_start_pos = null;
	this.y = 0;
	this.move = 0.0;
}

var GameState = {
	None: 0,
	Ready: 1,
	Play: 2,
	Over: 3,
	OverOut: 4,
	ReadyIn: 5,
};

var m_ui_camera;
var m_ui_obj;
var m_ui_scale;
var m_bird_frame_anim_speed;
var m_bird;
var m_bird_type;
var m_bird_frame;
var m_bird_ready_move;
var m_lands = new Array();
var m_land_move;
var m_lands_start_pos = new Array();
var m_pipes = new Array();
var m_pipe_base = new Pipe();
var m_score;
var m_score_obj;
var m_score_sprites = new Array();
var m_score_best = 0;
var m_cover_sprite;
var m_over_score_sprites = new Array();
var m_over_score_best_sprites = new Array();
var m_over_obj;
var m_game_state = GameState.None;
var m_blink_timer;
var m_audio_source_point;
var m_audio_source_wing;
var m_audio_source_hit;
var m_audio_source_swooshing;
var m_audio_source_die;
var m_play_start_time;
var m_pipe_gen_time;
var m_bird_rot;
var m_pipe_count;
var m_bird_speed;
var land_move_speed = -120;
var pipe_y_distance = 130;

app_construct = function () {
}

app_destruct = function () {
}

app_on_resize = function () {
	if(m_ui_camera) {
		var scale_w = m_ui_camera.GetTargetWidth() / 288.0;
		var scale_h = m_ui_camera.GetTargetHeight() / 512.0;
		m_ui_scale = Mathf.Max(scale_w, scale_h);

		m_ui_camera.SetOrthographicSize(m_ui_camera.GetTargetHeight() / 2.0);
		m_ui_obj.GetTransform().SetScale(new Vector3(m_ui_scale, m_ui_scale, m_ui_scale));
	}
}

app_start = function () {
	var camera = GameObject.Create("camera").AddComponent("Camera");
	camera.SetOrthographic(true);
	camera.SetOrthographicSize(camera.GetTargetHeight() / 2.0);
	camera.SetNearClip(-1);
	camera.SetFarClip(1);
	m_ui_camera = camera;

	var bundle_path = "";

	if(Application.SupportDXT()) {
		bundle_path = "app_flappy_bird_dxt.viry";
	} else if(Application.SupportETC1()) {
		bundle_path = "app_flappy_bird_etc1.viry";
	}  else if(Application.SupportPVRTC()) {
		bundle_path = "app_flappy_bird_pvrtc.viry";
	} else {
		log("not support compressed texture");
		return;
	}

	Resource.LoadAssetBundleAsync(bundle_path, function (bundle) {
		Resource.SetGlobalAssetBundle(bundle);

		var obj = bundle.LoadGameObject("Assets/AppFlappyBird/Play.prefab");
		obj.GetTransform().SetPosition(new Vector3(0, 0, 0));

		m_ui_obj = obj;

		app_on_resize();

		InitBG();
		InitReady();
		InitBird();
		InitLand();
		InitPipe();
		InitScore();
		InitCover();
		InitOver();
		InitAudio();

		m_game_state = GameState.Ready;
	}, null);
}

app_update = function () {
	UpdateBirdAnim();
    UpdateBirdMove();
    UpdateBirdRot();
	UpdateLand();
	UpdatePipeGen();
	UpdatePipeMove();
	DetectCollision();
}

function InitBG() {
	var deactive = parseInt(Mathf.RandomRange(0, 2));
	m_ui_obj.GetTransform().Find("Canvas BG/Image " + deactive).GetGameObject().SetActive(false);

	var active = (deactive + 1) % 2;
	var bg = m_ui_obj.GetTransform().Find("Canvas BG/Image " + active).GetGameObject().GetComponent("UISprite");
	bg.GetGameObject().SetActive(true);
	bg.event_handler.enable = true;
	bg.event_handler.on_pointer_down = OnTouchDownBG;
}

function OnTouchDownBG() {
	if(m_game_state == GameState.Ready) {
		m_game_state = GameState.Play;
		m_play_start_time = Time.GetTime();
		m_pipe_gen_time = -1;
		m_bird_rot = 0;
		m_pipe_count = 0;

		var tc = m_ui_obj.GetTransform().Find("Canvas UI/Ready").GetGameObject().AddComponent("TweenUIColor");
		tc.duration = 0.2;
		tc.from = new Color(1, 1, 1, 1);
		tc.to = new Color(1, 1, 1, 0);
		tc.on_finish = function () {
			m_ui_obj.GetTransform().Find("Canvas UI/Ready").GetGameObject().SetActive(false);
		};

		Component.Destroy(m_bird_ready_move);
	}

	if(m_game_state == GameState.Ready || m_game_state == GameState.Play) {
		const fly_speed = 400;
		m_bird_speed = fly_speed;
		m_bird_frame_anim_speed = 14;

		m_audio_source_wing.Play();
	}
}

function InitReady() {
	var ready = m_ui_obj.GetTransform().Find("Canvas UI/Ready").GetGameObject();
	ready.SetActive(true);
	var vs = ready.GetComponentsInChildren("UIView");
	for(var i = 0; i < vs.length; i++) {
		vs[i].SetColor(new Color(1, 1, 1, 1));
	}
}

function InitBird() {
	m_bird_frame_anim_speed = 7;

	m_bird = m_ui_obj.GetTransform().Find("Canvas Dynamic/Image Bird").GetGameObject().GetComponent("UISprite");
	m_bird_type = parseInt(Mathf.RandomRange(0, 3));
	m_bird_frame = 0;
	m_bird.SetSpriteName("bird" + m_bird_type + "_" + m_bird_frame);

	m_bird.GetGameObject().GetTransform().SetLocalPosition(new Vector3(-56, -4, 0));
	m_bird.GetGameObject().GetTransform().SetLocalRotationEuler(new Vector3(0, 0, 0));

	var move = m_bird.GetGameObject().AddComponent("TweenPosition");
	move.duration = 0.37;
	move.play_style = TweenerPlayStyle.PingPong;
	move.from = m_bird.GetGameObject().GetTransform().GetLocalPosition();
	move.to = move.from.Add(new Vector3(0, 10, 0));
	m_bird_ready_move = move;
}

function UpdateBirdAnim() {
	if(	m_game_state == GameState.Ready ||
		m_game_state == GameState.Play ||
		m_game_state == GameState.ReadyIn) {
		var bird = m_bird;
		m_bird_frame += Time.GetDeltaTime() * m_bird_frame_anim_speed;
		if(parseInt(m_bird_frame) >= 3) {
			m_bird_frame = 0;
		}
		bird.SetSpriteName("bird" + m_bird_type + "_" + parseInt(m_bird_frame));
	}
}

function UpdateBirdMove() {
	if( m_game_state == GameState.Play ||
		m_game_state == GameState.Over) {
		const gravity = -1300;
		m_bird_speed += gravity * Time.GetDeltaTime();
		const speed_min = -450;
		m_bird_speed = Mathf.Max(m_bird_speed, speed_min);

		var birt_t = m_bird.GetTransform();
		var pos = birt_t.GetLocalPosition();
		pos.y += m_bird_speed * Time.GetDeltaTime();

		const bottom_y = -133;
		if(pos.y < bottom_y) {
			pos.y = bottom_y;

			if(m_game_state == GameState.Play) {
				GameOver();
			}
		}

		const top_y = 270;
		pos.y = Mathf.Min(pos.y, top_y);

		birt_t.SetLocalPosition(pos);
	}
}

function UpdateBirdRot() {
	if( m_game_state == GameState.Play ||
		m_game_state == GameState.Over)
	{
		var birt_t = m_bird.GetTransform();

		const minus_start_speed = -350;
		if(m_bird_speed > 0) {
			const rot_add_speed = 600;
			m_bird_rot += rot_add_speed * Time.GetDeltaTime();
			const rot_max = 25;
			m_bird_rot = Mathf.Min(m_bird_rot, rot_max);
		}
		else if(m_bird_speed < minus_start_speed) {
			const rot_minus_speed = -500;
			m_bird_rot += rot_minus_speed * Time.GetDeltaTime();
			const rot_min = -90;
			m_bird_rot = Mathf.Max(m_bird_rot, rot_min);

			m_bird_frame_anim_speed = 0;
		}

		birt_t.SetLocalRotationEuler(new Vector3(0, 0, m_bird_rot));
	}
}

function InitLand() {
	m_lands[0] = m_ui_obj.GetTransform().Find("Canvas Dynamic/Image Land 0").GetGameObject().GetComponent("UISprite");
	m_lands[1] = m_ui_obj.GetTransform().Find("Canvas Dynamic/Image Land 1").GetGameObject().GetComponent("UISprite");
	m_land_move = 0;
	m_lands_start_pos[0] = new Vector3(24, -200, 0);
	m_lands_start_pos[1] = new Vector3(360, -200, 0);
}

function UpdateLand() {
	if( m_game_state == GameState.Ready ||
		m_game_state == GameState.Play ||
		m_game_state == GameState.ReadyIn) {
		var move = Time.GetDeltaTime() * land_move_speed;
        m_land_move += move;

		const land_move_min = -336;
		if(m_land_move <= land_move_min) {
			m_land_move = 0;
		}

		var moved = Math.floor(m_land_move * m_ui_scale) / m_ui_scale;
		m_lands[0].GetTransform().SetLocalPosition(m_lands_start_pos[0].Add(new Vector3(moved, 0, 0)));
		m_lands[1].GetTransform().SetLocalPosition(m_lands_start_pos[1].Add(new Vector3(moved, 0, 0)));
	}
}

function InitPipe() {
	m_pipe_base.up = m_ui_obj.GetTransform().Find("Canvas Dynamic/Pipes/Up");
	m_pipe_base.down = m_ui_obj.GetTransform().Find("Canvas Dynamic/Pipes/Down");

	for(var i = 0; i < m_pipes.length; i++) {
		GameObject.Destroy(m_pipes[i].up.GetGameObject());
		GameObject.Destroy(m_pipes[i].down.GetGameObject());
	}
	m_pipes = new Array();
}

function UpdatePipeGen() {
    if(m_game_state == GameState.Play) {
        var time = Time.GetTime();

        const pipe_start_delay = 1;
        if(time - m_play_start_time < pipe_start_delay) {
            return;
        }

        const pipe_gen_delta = 1.4;
        if(m_pipe_gen_time < 0 || time - m_pipe_gen_time > pipe_gen_delta) {
            m_pipe_gen_time = time;

            GenPipe();
        }
    }
}

function GenPipe() {
    var base_up = m_pipe_base.up.GetGameObject();
    var up = GameObject.Instantiate(base_up);
    up.GetTransform().SetParent(base_up.GetTransform().GetParent());

    var base_down = m_pipe_base.down.GetGameObject();
    var down = GameObject.Instantiate(base_down);
    down.GetTransform().SetParent(base_down.GetTransform().GetParent());

    var new_pipe = new Pipe();
    new_pipe.index = m_pipe_count++;
    new_pipe.up = up.GetTransform();
    new_pipe.down = down.GetTransform();

    const pipe_y_max = 176;
    const pipe_y_min = -64;
    new_pipe.y = Mathf.RandomRange(pipe_y_min, pipe_y_max);

    new_pipe.up_start_pos = up.GetTransform().GetLocalPosition().Add(new Vector3(0, new_pipe.y - pipe_y_distance / 2, 0));
    new_pipe.down_start_pos = down.GetTransform().GetLocalPosition().Add(new Vector3(0, new_pipe.y + pipe_y_distance / 2, 0));
    new_pipe.move = 0;

    m_pipes.push(new_pipe);
}

function UpdatePipeMove() {
    if(m_game_state == GameState.Play) {
        var move = Time.GetDeltaTime() * land_move_speed;

        for(var i = 0; i < m_pipes.length;) {
            var pipe = m_pipes[i];

            pipe.move += move;

            const pipe_move_min = -470;
            if(pipe.move <= pipe_move_min) {
                GameObject.Destroy(pipe.up.GetGameObject());
                GameObject.Destroy(pipe.down.GetGameObject());
                m_pipes.splice(i, 1);
                continue;
            }

            var moved = Math.floor(pipe.move * m_ui_scale) / m_ui_scale;
            pipe.up.SetLocalPosition(pipe.up_start_pos.Add(new Vector3(moved, 0, 0)));
            pipe.down.SetLocalPosition(pipe.down_start_pos.Add(new Vector3(moved, 0, 0)));

            i++;
        }
    }
}

function InitScore() {
	m_score = 0;
	m_score_obj = m_ui_obj.GetTransform().Find("Canvas UI/Play/Score").GetGameObject();
	m_score_obj.SetActive(true);

	for(var i = 1; i < m_score_sprites.length; i++) {
		GameObject.Destroy(m_score_sprites[i].GetGameObject());
	}
	m_score_sprites = new Array();

	var score_sprite = m_ui_obj.GetTransform().Find("Canvas UI/Play/Score/Image Score").GetGameObject().GetComponent("UISprite");
	m_score_sprites.push(score_sprite);

	UpdateScore(m_score, m_score_sprites, 24, "font_0", 48, false);

	LoadScoreBest();
}

function LoadScoreBest() {
	var path = Application.SavePath() + "/AppFlappyBird/save.json";
	if(File.Exist(path)) {
		var root = JSON.parse(File.ReadAllText(path));
		m_score_best = root.score_best;
	}
}

function UpdateScore(score, sprites, sprite_width, sprite_name, sprite_base_num, align_right) {
	var score_str = score.toString();
	var number_count = score_str.length;
	for(var i = sprites.length; i < number_count; i++) {
		var new_sprite = GameObject.Instantiate(sprites[0].GetGameObject());
		new_sprite.GetTransform().SetParent(sprites[0].GetTransform().GetParent());
		sprites.push(new_sprite.GetComponent("UISprite"));
	}

	var start_x;
	if(align_right) {
		start_x = -(number_count - 1) * sprite_width;
	} else {
		// align center
		if(number_count % 2 == 1) {
			start_x = -parseInt(number_count / 2) * sprite_width;
		} else {
			start_x = parseInt((-parseInt(number_count / 2) + 0.5) * sprite_width);
		}
	}

	for(var i = 0; i < sprites.length; i++) {
		var sprite = sprites[i];
		var x = start_x + i * sprite_width;
		sprite.GetTransform().SetLocalPosition(new Vector3(x, 0, 0));

		var num = score_str[i] - '0';
		sprite.SetSpriteName(sprite_name + (sprite_base_num + num));
	}
}

function InitCover() {
	m_cover_sprite = m_ui_obj.GetTransform().Find("Canvas UI/Cover").GetGameObject().GetComponent("UISprite");
}

function InitOver() {
	var obj = m_ui_obj.GetTransform().Find("Canvas UI/Over").GetGameObject();
	obj.SetActive(false);
	obj.GetTransform().Find("Image Panel").SetLocalPosition(new Vector3(0, -320, 0));
	obj.GetTransform().Find("Button").GetGameObject().SetActive(false);
	obj.GetTransform().Find("Image Panel/New").GetGameObject().SetActive(false);
	obj.GetTransform().Find("Image Panel/Image Medal").GetGameObject().SetActive(false);

	for(var i = 1; i < m_over_score_sprites.length; i++) {
		GameObject.Destroy(m_over_score_sprites[i].GetGameObject());
	}
	m_over_score_sprites = new Array();

	m_over_score_sprites.push(obj.GetTransform().Find("Image Panel/Score/Image Score").GetGameObject().GetComponent("UISprite"));
	UpdateScore(0, m_over_score_sprites, 16, "number_score_0", 0, true);

	for(var i = 1; i < m_over_score_best_sprites.length; i++) {
		GameObject.Destroy(m_over_score_best_sprites[i].GetGameObject());
	}
	m_over_score_best_sprites = new Array();

	m_over_score_best_sprites.push(obj.GetTransform().Find("Image Panel/Best/Image Score").GetGameObject().GetComponent("UISprite"));
	UpdateScore(m_score_best, m_over_score_best_sprites, 16, "number_score_0", 0, true);

	m_over_obj = obj;

	var button_play = obj.GetTransform().Find("Button/Image Play").GetGameObject().GetComponent("UISprite");
	button_play.event_handler.enable = true;
	button_play.event_handler.on_pointer_down = function () {
		button_play.GetTransform().SetLocalPosition(new Vector3(-70, -3, 0));
	};
	button_play.event_handler.on_pointer_up = function () {
		button_play.GetTransform().SetLocalPosition(new Vector3(-70, 0, 0));
	};
	button_play.event_handler.on_pointer_click = function () {
		Restart();

		m_audio_source_swooshing.Play();
	};
}

function Restart() {
	if(m_game_state == GameState.Over) {
		m_game_state = GameState.OverOut;

		var sprite = m_cover_sprite;
		sprite.GetGameObject().SetActive(true);
		sprite.SetColor(new Color(0, 0, 0, 0));

		var tc = sprite.GetGameObject().AddComponent("TweenUIColor");
		tc.duration = 0.3;
		tc.from = new Color(0, 0, 0, 0);
		tc.to = new Color(0, 0, 0, 1);
        tc.on_finish = function() {
			var tc = m_cover_sprite.GetGameObject().AddComponent("TweenUIColor");
			tc.duration = 0.3;
			tc.from = new Color(0, 0, 0, 1);
			tc.to = new Color(0, 0, 0, 0);
			tc.on_finish = function () {
				m_cover_sprite.GetGameObject().SetActive(false);
				m_game_state = GameState.Ready;
			};

            InitBG();
            InitReady();
            InitBird();
            InitLand();
            InitPipe();
            InitScore();
            InitCover();
            InitOver();

			m_game_state = GameState.ReadyIn;

			if(m_blink_timer != null) {
				m_blink_timer.Stop();
				m_blink_timer = null;
            }
        };
	}
}

function InitAudio() {
	GameObject.Create("AudioListener").AddComponent("AudioListener");

	m_audio_source_point = GameObject.Create("").AddComponent("AudioSource");
	m_audio_source_point.SetClip(Application.DataPath() + "/AppFlappyBird/sfx_point.wav");

	m_audio_source_wing = GameObject.Create("").AddComponent("AudioSource");
	m_audio_source_wing.SetClip(Application.DataPath() + "/AppFlappyBird/sfx_wing.wav");

	m_audio_source_hit = GameObject.Create("").AddComponent("AudioSource");
	m_audio_source_hit.SetClip(Application.DataPath() + "/AppFlappyBird/sfx_hit.wav");

	m_audio_source_swooshing = GameObject.Create("").AddComponent("AudioSource");
	m_audio_source_swooshing.SetClip(Application.DataPath() + "/AppFlappyBird/sfx_swooshing.wav");

	m_audio_source_die = GameObject.Create("").AddComponent("AudioSource");
	m_audio_source_die.SetClip(Application.DataPath() + "/AppFlappyBird/sfx_die.wav");
}

function GameOver() {
	m_game_state = GameState.Over;

	CoverFlashWhite();

	m_audio_source_hit.Play();

	Timer.CreateTimer(0.5, false).on_tick = function () {
		m_score_obj.SetActive(false);

		// show game over
		{
			var over_obj = m_over_obj;
			over_obj.SetActive(true);

			var tp = over_obj.GetTransform().Find("Image Title").GetGameObject().AddComponent("TweenPosition");
			tp.duration = 0.2;
			tp.from = tp.GetTransform().GetLocalPosition();
			tp.to = tp.from.Add(new Vector3(0, 10, 0));
			tp.curve = [
				0, 0, 1, 1,
				0.5, 1, 1, -1,
				1, 0, -1, -1
			];

			var tc = over_obj.GetTransform().Find("Image Title").GetGameObject().AddComponent("TweenUIColor");
			tc.GetGameObject().GetComponent("UIView").SetColor(new Color(1, 1, 1, 0));
			tc.duration = 0.2;
			tc.from = new Color(1, 1, 1, 0);
			tc.to = new Color(1, 1, 1, 1);

			m_audio_source_swooshing.Play();

			tp = over_obj.GetTransform().Find("Image Panel").GetGameObject().AddComponent("TweenPosition");
			tp.duration = 0.3;
			tp.delay = 0.7;
			tp.from = tp.GetTransform().GetLocalPosition();
			tp.to = new Vector3(0, 0, 0);
			tp.curve = [
				0, 0, 2, 2,
				1, 1, 0, 0
			];

			Timer.CreateTimer(0.7, false).on_tick = function () {
				m_audio_source_swooshing.Play();
			};

			Timer.CreateTimer(1.2, false).on_tick = function () {
				if(m_score > 0) {
					var tick = 1.0 / m_score;

					var t = Timer.CreateTimer(tick, true);
					t.on_tick = function () {
						var score = t.tick_count;
						UpdateScore(score, m_over_score_sprites, 16, "number_score_0", 0, true);

						if(score == m_score) {
							t.Stop();

							if(m_score > m_score_best) {
								m_ui_obj.GetTransform().Find("Canvas UI/Over/Image Panel/New").GetGameObject().SetActive(true);
								UpdateScore(m_score, m_over_score_best_sprites, 16, "number_score_0", 0, true);
								SaveScoreBest(m_score);
							}

							if(m_score >= 10 && m_score < 20) {
								ShowMedal(3);
							}
							else if(m_score >= 20 && m_score < 40) {
								ShowMedal(2);
							}
							else if(m_score >= 40 && m_score < 80) {
								ShowMedal(1);
							}
							else if(m_score >= 80) {
								ShowMedal(0);
							}

							Timer.CreateTimer(0.3, false).on_tick = function () {
								over_obj.GetTransform().Find("Button").GetGameObject().SetActive(true);
							};
						}
					};
				} else {
					Timer.CreateTimer(0.3, false).on_tick = function () {
						over_obj.GetTransform().Find("Button").GetGameObject().SetActive(true);
					};
				}
			};
		}
	};
}

function CoverFlashWhite() {
	var sprite = m_cover_sprite;
	sprite.GetGameObject().SetActive(true);
	sprite.SetColor(new Color(1, 1, 1, 1));

	var tc = sprite.GetGameObject().AddComponent("TweenUIColor");
	tc.duration = 0.2;
	tc.from = new Color(1, 1, 1, 1);
	tc.to = new Color(1, 1, 1, 0);
	tc.on_finish = function () {
		m_cover_sprite.GetGameObject().SetActive(false);
	};
}

function SaveScoreBest(score) {
	m_score_best = score;
	var path = Application.SavePath() + "/AppFlappyBird/save.json";

	var root = {};
	root.score_best = m_score_best;

	File.WriteAllText(path, JSON.stringify(root));
}

function ShowMedal(index) {
	var obj = m_ui_obj.GetTransform().Find("Canvas UI/Over/Image Panel/Image Medal").GetGameObject();
	obj.SetActive(true);
	obj.GetComponent("UISprite").SetSpriteName("medals_" + index);
	obj.GetTransform().Find("Blink").GetGameObject().SetActive(false);

	m_blink_timer = Timer.CreateTimer(0.5, true);
	m_blink_timer.on_tick = function () {
		var blink_obj = obj.GetTransform().Find("Blink").GetGameObject();
		blink_obj.SetActive(true);
		var blink = blink_obj.GetComponent("UISprite");
		blink.SetSpriteName("blink_00");

		blink_obj.GetTransform().SetLocalPosition(new Vector3(Mathf.RandomRange(-22.0, 22.0), Mathf.RandomRange(-22.0, 22.0), 0));

		var t = Timer.CreateTimer(0.1, true);
		t.on_tick = function () {
			var tick_count = t.tick_count;
			if(tick_count == 3) {
				t.Stop();
				blink_obj.SetActive(false);
			} else {
				blink.SetSpriteName("blink_0" + tick_count);
			}
		};
	};
}

function DetectCollision() {
	if(m_game_state == GameState.Play) {
		var bird_y = m_bird.GetTransform().GetLocalPosition().y;

        for(var i = 0; i < m_pipes.length; i++) {
			var p = m_pipes[i];

			if(p.move < -314 && p.move > -400) {
				if(bird_y - 12 < p.y - pipe_y_distance / 2 || bird_y + 12 > p.y + pipe_y_distance / 2) {
					GameOver();

                    Timer.CreateTimer(0.3, false).on_tick = function () {
						m_audio_source_die.Play();
					};
					return;
				}
			} else if(p.move < -400) {
				var score = p.index + 1;

				if(score > m_score) {
					m_score = score;
					UpdateScore(m_score, m_score_sprites, 24, "font_0", 48, false);

					m_audio_source_point.Play();
				}
			}
		}
	}
}


text:
package support

import akka.actor.ActorSystem
import akka.event.{Logging, LoggingAdapter}
import com.typesafe.config.{Config, ConfigFactory}
import org.scalatest.{BeforeAndAfterAll, Suite}

import scala.concurrent.ExecutionContextExecutor

/**
 * Akka testing support class that manages the lifecycle of an ActorSystem.
 */
trait AkkaTest extends BeforeAndAfterAll { suite: Suite =>

  implicit var system: ActorSystem = _
  implicit var executor: ExecutionContextExecutor = _
  var config: Config = _
  var log: LoggingAdapter = _

  protected def systemName = "test-system"

  abstract override protected def beforeAll(): Unit = {
    super.beforeAll()
    system = ActorSystem(systemName)
    executor = system.dispatcher
    config = ConfigFactory.load()
    log = Logging(system, getClass)
  }

  abstract override protected def afterAll(): Unit = {
    log = null
    config = null
    executor = null
    system.shutdown()
    system.awaitTermination()
    super.afterAll()
  }

}


text:
type: doc
layout: reference
category: "Classes and Objects"
title: "Sealed Classes"
---

# Sealed Classes

Sealed classes are used for representing restricted class hierarchies, when a value can have one of the types from a
limited set, but cannot have any other type. They are, in a sense, an extension of enum classes: the set of values
for an enum type is also restricted, but each enum constant exists only as a single instance, whereas a subclass
of a sealed class can have multiple instances which can contain state.

To declare a sealed class, you put the `sealed` modifier before the name of the class. A sealed class can have
subclasses, but all of them must be declared in the same file as the sealed class itself. (Before Kotlin 1.1,
the rules were even more strict: classes had to be nested inside the declaration of the sealed class).

``` kotlin
sealed class Expr
data class Const(val number: Double) : Expr()
data class Sum(val e1: Expr, val e2: Expr) : Expr()
object NotANumber : Expr()

fun eval(expr: Expr): Double = when (expr) {
    is Const -> expr.number
    is Sum -> eval(expr.e1) + eval(expr.e2)
    NotANumber -> Double.NaN
}
```

(The example above uses one additional new feature of Kotlin 1.1: the possibility for data classes to extend other
classes, including sealed classes.)

Note that classes which extend subclasses of a sealed class (indirect inheritors) can be placed anywhere, not necessarily in
the same file.

The key benefit of using sealed classes comes into play when you use them in a [`when` expression](control-flow.html#when-expression). If it's possible
to verify that the statement covers all cases, you don't need to add an `else` clause to the statement.

``` kotlin
fun eval(expr: Expr): Double = when(expr) {
    is Expr.Const -> expr.number
    is Expr.Sum -> eval(expr.e1) + eval(expr.e2)
    Expr.NotANumber -> Double.NaN
    // the `else` clause is not required because we've covered all the cases
}
```


text:
module Doorkeeper
  module OAuth
    class ClientCredentialsRequest
      class Creator
        def call(client, scopes, attributes = {})
          AccessToken.create(attributes.merge(
            application_id: client.id,
            scopes: scopes.to_s
          ))
        end
      end
    end
  end
end


text:
$(function() {
    var client = new ZeroClipboard($('#btn_copy'));
    client.on( "ready", function( readyEvent ) {
        client.on( "aftercopy", function( event ) {
            var $this = $(event.target);
            $this
                .removeClass('btn-info')
                .addClass('btn-success')
                .html(' Copied!')
            ;
            $(document.body).click(function() {
                $this
                    .removeClass('btn-success')
                    .addClass('btn-info')
                    .html(' Copy')
                ;
            })
        } );
    } );

    $('.ellipsis').dotdotdot({});

    $('.casefile').click(function() {
        window.location.assign($(this).data('readpath'));
    });
});


text:
| Parameter | Type | Description |
| :--- | :--- | :--- |
|**`sys`**|`struct fins_sys_tp *`|A pointer to a structure with the FINS context|
|**`start`**|`const char *`|An ASCII string describing the first memory element to write|
|**`data`**|`const int32_t *`|Pointer to the buffer where the data to be written is located|
|**`num_sbcd32`**|`size_t`|The number of signed 32 bit BCD values to write|
|**`type`**|`int`|The type of signed BCD to be written|

### Return Value

| Type | Description |
| :--- | :--- |
|`int`|A return value from the list [`FINS_RETVAL_...`](fins_retval.md) indicating the result of the query|

### Description

The function `finslib_memory_area_write_sbcd32()` can be used to write a block of 32 bit signed BCD values to a memory area in a remote PLC. The connection with the PLC should already be present before this function is called.

Data is transferred unmodified from the caller supplied buffer to the FINS data stream.  Existence and filling of the dataspace is the responsibility of the calling function, but `finslib_memory_area_write_sbcd32()` will return an error if a NULL pointer is provided for data storage.

The start of the memory area is provided as an ASCII string which represents the starting address in human readable format. Example formats are **`CIO20`** and **`W100`**.

The number of signed BCD values to be written in one function call is not limited by the amount of data a PLC can send in one FINS packet because `finslib_memory_area_write_sbcd16()` will automatically use multiple request at the FINS layer if the dataset is too large.

The function supports the following four types of signed BCD formats. Please consult the Omron software manuals for more details about these formats.

|Type|Low|High|
|:---|---:|---:|
|`FINS_DATA_TYPE_SBCD32_0`|-9999999|9999999|
|`FINS_DATA_TYPE_SBCD32_1`|-79999999|79999999|
|`FINS_DATA_TYPE_SBCD32_2`|-9999999|99999999|
|`FINS_DATA_TYPE_SBCD32_3`|-19999999|99999999|

The return value is either **`FINS_RETVAL_SUCCESS`** when the function succeeded, or one of the other **`FINS_RETVAL_`** values if an error occurs. In the latter case depending on the error message it is not sure if none, some or all of the data has been written to the PLC and additional processing and communication with the PLC may be necessary to know or set the correct state of the memory contents of the PLC.

### See Also

* [`FINS_RETVAL...`](fins_retval.md) – Libfins function return code list
* [`FINS_DATA_TYPE...`](fins_data_type.md) – Libfins data types
* [`finslib_bcd_to_int();`](finslib_bcd_to_int.md)
* [`finslib_int_to_bcd();`](finslib_int_to_bcd.md)
* [`finslib_memory_area_read_bcd16();`](finslib_memory_area_read_bcd16.md)
* [`finslib_memory_area_read_bcd32();`](finslib_memory_area_read_bcd32.md)
* [`finslib_memory_area_read_sbcd16();`](finslib_memory_area_read_sbcd16.md)
* [`finslib_memory_area_read_sbcd32();`](finslib_memory_area_read_sbcd32.md)
* [`finslib_memory_area_write_bcd16();`](finslib_memory_area_write_bcd16.md)
* [`finslib_memory_area_write_bcd32();`](finslib_memory_area_write_bcd32.md)
* [`finslib_memory_area_write_sbcd16();`](finslib_memory_area_write_sbcd16.md)
* [`finslib_multiple_memory_area_read();`](finslib_multiple_memory_area_read.md)


text:
package apps.livingmaps;

import synergynetframework.appsystem.contentsystem.items.utils.Location;

/**
 * The Class ItemMapInfo.
 */
public class ItemMapInfo {

	/** The location. */
	private Location location;

	/** The zoom level. */
	private int zoomLevel;

	/**
	 * Instantiates a new item map info.
	 *
	 * @param location
	 *            the location
	 * @param zoomLevel
	 *            the zoom level
	 */
	public ItemMapInfo(Location location, int zoomLevel) {
		this.location = location;
		this.zoomLevel = zoomLevel;
	}

	/**
	 * Gets the location.
	 *
	 * @return the location
	 */
	public Location getLocation() {
		return location;
	}

	/**
	 * Gets the zoom level.
	 *
	 * @return the zoom level
	 */
	public int getZoomLevel() {
		return zoomLevel;
	}

	/**
	 * Sets the location.
	 *
	 * @param location
	 *            the new location
	 */
	public void setLocation(Location location) {
		this.location = location;
	}

	/**
	 * Sets the zoom level.
	 *
	 * @param zoomLevel
	 *            the new zoom level
	 */
	public void setZoomLevel(int zoomLevel) {
		this.zoomLevel = zoomLevel;
	}
}


text:
package edu.duke.cabig.c3pr.dao;

import edu.duke.cabig.c3pr.domain.OffReservingReason;
import edu.duke.cabig.c3pr.domain.OffScreeningReason;
import edu.duke.cabig.c3pr.domain.OffTreatmentReason;
import edu.duke.cabig.c3pr.utils.ContextDaoTestCase;

/**
 * JUnit Tests for ReasonDao
 *
 * @author Ramakrishna
 * @testType unit
 */
public class ReasonDaoTest extends ContextDaoTestCase<ReasonDao> {

    public void testGetReasonByCode() throws Exception{
    	assertEquals(1001, getDao().getReasonByCode("ABC").getId().intValue());
    	assertEquals(1000, getDao().getReasonByCode("ABCD").getId().intValue());
    	assertEquals(1002, getDao().getReasonByCode("EFG").getId().intValue());
    	assertEquals(1003, getDao().getReasonByCode("EFGH").getId().intValue());
    	assertEquals(1004, getDao().getReasonByCode("PQR").getId().intValue());
    }

    public void testGetReasonByCodeAndType() throws Exception{
    	OffTreatmentReason offTreatmentReason = new OffTreatmentReason();
    	offTreatmentReason.setCode("ABCD");
    	assertEquals(1000, getDao().getReasonByCodeAndType(offTreatmentReason.getCode(), offTreatmentReason.getClass().getName()).getId().intValue());

    	OffScreeningReason offScreeningReason = new OffScreeningReason();
    	offScreeningReason.setCode("EFG");
    	assertEquals(1002, getDao().getReasonByCodeAndType(offScreeningReason.getCode(), offScreeningReason.getClass().getName()).getId().intValue());

    	OffReservingReason offReservingReason = new OffReservingReason();
    	offReservingReason.setCode("EFGH");
    	assertEquals(1003, getDao().getReasonByCodeAndType(offReservingReason.getCode(), offReservingReason.getClass().getName()).getId().intValue());
    }

}


text:
all:cocytus_arch.png
.PHONY : clean

cocytus_arch.png: cocytus_arch.dot
	dot -T png cocytus_arch.dot -o cocytus_arch.png

clean:
	@rm -f *.png


text:
FROM centos:7
MAINTAINER Maxim Bashevoy m.bashevoy@soton.ac.uk

RUN yum -y update && yum install -y deltarpm

# TODO: check if we need all gcc
RUN yum install -y \
  bzip2 \
  curl \
  gcc* \
  krb5-devel \
  make \
  sudo \
  && rm -rf /var/cache/yum/* \
  && yum clean all

ENV user docker

RUN useradd -m -d /home/${user} ${user} \
 && chown -R ${user} /home/${user}
USER ${user}
WORKDIR /home/${user}

RUN curl https://install.meteor.com/ | sh
ENV PATH="/home/${user}/.meteor:${PATH}"
RUN meteor --version

CMD /startup.sh