text:
package io.debezium.connector.mysql;

import static org.assertj.core.api.Assertions.assertThat;

import java.nio.file.Path;
import java.util.Collections;

import org.apache.kafka.connect.data.Schema;
import org.apache.kafka.connect.source.SourceRecord;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import io.debezium.config.Configuration;
import io.debezium.doc.FixFor;
import io.debezium.embedded.AbstractConnectorTest;
import io.debezium.util.Testing;

/**
 * @author luobo on 2018/6/8 14:16
 */
public class MysqlDefaultValueAllZeroTimeIT extends AbstractConnectorTest {

    private static final Path SCHEMA_HISTORY_PATH = Testing.Files.createTestingPath("file-schema-history-connect.txt").toAbsolutePath();
    private final UniqueDatabase DATABASE = new UniqueDatabase("myServer1", "default_value_all_zero_time")
            .withDbHistoryPath(SCHEMA_HISTORY_PATH);

    private Configuration config;

    @Before
    public void beforeEach() {
        stopConnector();
        DATABASE.createAndInitialize(Collections.singletonMap("sessionVariables", "sql_mode=''"));
        initializeConnectorTestFramework();
        Testing.Files.delete(SCHEMA_HISTORY_PATH);
    }

    @After
    public void afterEach() {
        try {
            stopConnector();
        }
        finally {
            Testing.Files.delete(SCHEMA_HISTORY_PATH);
        }
    }

    @Test
    public void allZeroDateAndTimeTypeTest() throws InterruptedException {
        config = DATABASE.defaultConfig()
                .with(MySqlConnectorConfig.SNAPSHOT_MODE, MySqlConnectorConfig.SnapshotMode.INITIAL)
                .with(MySqlConnectorConfig.TABLE_INCLUDE_LIST, DATABASE.qualifiedTableName("all_zero_date_and_time_table"))
                .build();
        start(MySqlConnector.class, config);

        // Testing.Print.enable();

        AbstractConnectorTest.SourceRecords records = consumeRecordsByTopic(9);
        final SourceRecord record = records.recordsForTopic(DATABASE.topicForTable("all_zero_date_and_time_table")).get(0);

        Schema schemaA = record.valueSchema().fields().get(1).schema().fields().get(0).schema();
        Schema schemaB = record.valueSchema().fields().get(1).schema().fields().get(1).schema();
        Schema schemaC = record.valueSchema().fields().get(1).schema().fields().get(2).schema();
        Schema schemaD = record.valueSchema().fields().get(1).schema().fields().get(3).schema();
        Schema schemaE = record.valueSchema().fields().get(1).schema().fields().get(4).schema();
        Schema schemaF = record.valueSchema().fields().get(1).schema().fields().get(5).schema();
        Schema schemaG = record.valueSchema().fields().get(1).schema().fields().get(6).schema();
        Schema schemaH = record.valueSchema().fields().get(1).schema().fields().get(7).schema();
        Schema schemaI = record.valueSchema().fields().get(1).schema().fields().get(8).schema();
        Schema schemaJ = record.valueSchema().fields().get(1).schema().fields().get(9).schema();
        Schema schemaK = record.valueSchema().fields().get(1).schema().fields().get(10).schema();
        Schema schemaL = record.valueSchema().fields().get(1).schema().fields().get(11).schema();

        // column A, 0000-00-00 00:00:00 => 1970-01-01 00:00:00
        assertThat(schemaA.defaultValue()).isEqualTo("1970-01-01T00:00:00Z");

        // column B allows null, default value should be null
        assertThat(schemaB.isOptional()).isEqualTo(true);
        assertThat(schemaB.defaultValue()).isEqualTo(null);

        // column C, 0000-00-00 00:00:00 => 1970-01-01 00:00:00
        assertThat(schemaC.defaultValue()).isEqualTo("1970-01-01T00:00:00Z");

        // column D allows null, default value should be null
        assertThat(schemaD.isOptional()).isEqualTo(true);
        assertThat(schemaD.defaultValue()).isEqualTo(null);

        // column E, 0000-00-00 => 1970-01-01
        assertThat(schemaE.defaultValue()).isEqualTo(0);

        // column F allows null, default value should be null
        assertThat(schemaF.isOptional()).isEqualTo(true);
        assertThat(schemaF.defaultValue()).isEqualTo(null);

        // column G, 0000-00-00 => 1970-01-01
        assertThat(schemaG.defaultValue()).isEqualTo(0);

        // column H allows null, default value should be null
        assertThat(schemaH.isOptional()).isEqualTo(true);
        assertThat(schemaH.defaultValue()).isEqualTo(null);

        // column I, DATETIME: 0000-00-00 00:00:00 => 1970-01-01 00:00:00
        assertThat(schemaI.defaultValue()).isEqualTo(0L);

        // column J allows null, default value should be null
        assertThat(schemaJ.isOptional()).isEqualTo(true);
        assertThat(schemaJ.defaultValue()).isEqualTo(null);

        // column K, DATETIME: 0000-00-00 00:00:00 => 1970-01-01 00:00:00
        assertThat(schemaK.defaultValue()).isEqualTo(0L);

        // column L allows null, default value should be null
        assertThat(schemaL.isOptional()).isEqualTo(true);
        assertThat(schemaL.defaultValue()).isEqualTo(null);

    }

    @Test
    @FixFor("DBZ-4334")
    public void partZeroDateAndTimeTypeTest() throws InterruptedException {
        config = DATABASE.defaultConfig()
                .with(MySqlConnectorConfig.SNAPSHOT_MODE, MySqlConnectorConfig.SnapshotMode.INITIAL)
                .with(MySqlConnectorConfig.TABLE_INCLUDE_LIST, DATABASE.qualifiedTableName("part_zero_date_and_time_table"))
                .build();
        start(MySqlConnector.class, config);

        // Testing.Print.enable();

        AbstractConnectorTest.SourceRecords records = consumeRecordsByTopic(9);
        final SourceRecord record = records.recordsForTopic(DATABASE.topicForTable("part_zero_date_and_time_table")).get(0);

        Schema schemaA = record.valueSchema().fields().get(1).schema().fields().get(0).schema();
        Schema schemaB = record.valueSchema().fields().get(1).schema().fields().get(1).schema();
        Schema schemaC = record.valueSchema().fields().get(1).schema().fields().get(2).schema();
        Schema schemaD = record.valueSchema().fields().get(1).schema().fields().get(3).schema();
        Schema schemaE = record.valueSchema().fields().get(1).schema().fields().get(4).schema();
        Schema schemaF = record.valueSchema().fields().get(1).schema().fields().get(5).schema();
        Schema schemaG = record.valueSchema().fields().get(1).schema().fields().get(6).schema();
        Schema schemaH = record.valueSchema().fields().get(1).schema().fields().get(7).schema();

        // column A, 0000-00-00 00:00:00 => 1970-01-01 00:00:00
        assertThat(schemaA.defaultValue()).isEqualTo("1970-01-01T00:00:00Z");

        // column B allows null, default value should be null
        assertThat(schemaB.isOptional()).isEqualTo(true);
        assertThat(schemaB.defaultValue()).isEqualTo(null);

        // column C, 0000-00-00 01:00:00.000 => 1970-01-01 00:00:00
        assertThat(schemaC.defaultValue()).isEqualTo(0L);

        // column D allows null, default value should be null
        assertThat(schemaD.isOptional()).isEqualTo(true);
        assertThat(schemaD.defaultValue()).isEqualTo(null);

        // column E, 1000-00-00 01:00:00.000 => 1970-01-01
        assertThat(schemaE.defaultValue()).isEqualTo(0);

        // column F allows null, default value should be null
        assertThat(schemaF.isOptional()).isEqualTo(true);
        assertThat(schemaF.defaultValue()).isEqualTo(null);

        // column G, 01:00:00.000 => 0
        assertThat(schemaG.defaultValue()).isEqualTo(3600000000L);

        // column H allows null
        assertThat(schemaH.isOptional()).isEqualTo(true);
        assertThat(schemaH.defaultValue()).isEqualTo(3600000000L);
    }
}


text:
package org.oxymores.chronix.core.network;

import org.oxymores.chronix.core.ChronixObject;

public class ExecutionNodeConnection extends ChronixObject
{
    private static final long serialVersionUID = 1753334279891809715L;
}

redpajama_set_name: RedPajamaGithub


text:
layout: page
title: Todd 35th Anniversary
date: 2016-05-24
author: Rose Cortez
tags: weekly links, java
status: published
summary: Mauris in orci a nisl.
banner: images/banner/leisure-04.jpg
booking:
  startDate: 01/05/2018
  endDate: 01/10/2018
  ctyhocn: LEXEHHX
  groupCode: T3A
published: true
---
Nunc vel elementum lorem, vitae vehicula ex. Donec tempor metus ac erat auctor, quis tincidunt leo semper. Fusce in lectus consequat, dictum augue quis, aliquam metus. Praesent rhoncus quam ac iaculis cursus. Phasellus nunc mi, efficitur nec interdum eu, condimentum ac orci. Suspendisse congue orci in lorem euismod, id accumsan massa efficitur. Aliquam vel risus tortor. Integer vel justo eget libero pharetra mattis vitae interdum nulla. Fusce porttitor sed lectus vitae pretium. Duis gravida lectus orci, et sollicitudin odio lobortis et. Suspendisse eleifend arcu nulla, a placerat felis varius id. Ut faucibus lorem felis, non accumsan tortor semper in.
Vivamus sit amet blandit mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut eu erat nibh. Nulla in augue id diam dictum vehicula. Integer dignissim congue efficitur. Sed et ligula quis est blandit rhoncus. Curabitur ligula mi, tempus sit amet libero eget, sodales sagittis ex. Curabitur ut nibh purus.

* Proin ut erat id felis feugiat vehicula
* Maecenas vulputate odio a nisl ullamcorper lacinia
* Fusce ornare augue sit amet lorem feugiat, vel convallis turpis eleifend
* Nullam condimentum enim at purus sagittis, ut tincidunt ligula consequat
* Nam id tellus condimentum, malesuada neque in, vestibulum augue.

Aliquam hendrerit quam id nulla fringilla, a fringilla turpis molestie. Etiam vel aliquet nisl. Integer vitae leo eget neque tempus facilisis. Nunc et cursus libero, sit amet euismod sem. Nunc vitae ipsum eu erat efficitur vehicula. In eu diam justo. Morbi in tellus ut lacus commodo pharetra. Nulla tincidunt sapien felis, nec imperdiet turpis tempus id. Cras rutrum odio ultrices nulla dictum, in suscipit lectus pretium. In a ante nec velit tincidunt lobortis. Integer iaculis nibh felis, vitae tristique tortor molestie quis. Nullam laoreet ut felis sit amet ultrices. Quisque eu urna sed augue venenatis varius.


text:
<?php
/**
 * Created by PhpStorm.
 * User: sz
 * Date: 26.05.15
 * Time: 12:22
 */

namespace modules\contract\widgets\actionButtons\performers;

use modules\contract\Module as ContractModule;
use modules\contract\widgets\actionButtons\Button;
use yii\helpers\Html;
use yii\helpers\Url;

class OfferOrderButton extends Button
{

    public function init()
    {
        if(\Yii::$app->getUser()->isGuest){
            $onlyReg = 'Просмотр информации возможен только зарегистрированными пользователями';
            $this->button = Html::a(ContractModule::t('CUSTOMER_INTERFACE', 'VIEW_ELEMENT_PERFORMER_TO_OFFER_THE_ORDER_BUTTON'), Url::toRoute(['/signup/']), [
                'data-confirm' => $onlyReg
            ]);
        }
        else{
            $this->button = Html::a(ContractModule::t('CUSTOMER_INTERFACE', 'VIEW_ELEMENT_PERFORMER_TO_OFFER_THE_ORDER_BUTTON'), "javascript:void(0)", [
                'class' => 'offer_order_link'
            ]);

            $this->jsHandler = '
                $(".offer_order_link").click(function() {
                    var url = "'.Url::toRoute(['/contract/performer/offer-order']).'";
                    $.pjax({url: url, container: "#'.$this->pjaxContainerId.'", data:{contractId: $(this).closest("tr").data("contract")}, push:false, replace:false});
                });

                $("#'.$this->pjaxContainerId.'").on("pjax:end", function() {
                    initPopup();
                    $("#offer-order-modal").modal();
                });
            ';
        }

        parent::init();
    }
}


text:
//
//  StopViewController.m
//  MU Bus Tracking
//
//  Created by Jake Gregg on 5/6/14.
//  Copyright (c) 2014 Jake Gregg. All rights reserved.
//

#import "StopViewController.h"

@interface StopViewController ()

@end

@implementation StopViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

-(id) initWithStop:(Stop *)stop {
    self = [super init];
    _stop = stop;
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = _stop.name;
    CGRect bounds = [[UIScreen mainScreen]bounds];
    StopView *sv = [[StopView alloc]initWithFrame:CGRectMake(0, 0, bounds.size.width, bounds.size.height) andStop:_stop];
    sv.navController = self.navController;
    self.view = sv;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
package org.apache.drill.exec.store;

import org.apache.calcite.plan.RelOptRule;
import org.apache.calcite.plan.RelOptRuleOperand;
import org.apache.drill.exec.planner.logical.DrillRelFactories;

public abstract class StoragePluginOptimizerRule extends RelOptRule {

  public StoragePluginOptimizerRule(RelOptRuleOperand operand, String description) {
    super(operand, DrillRelFactories.LOGICAL_BUILDER, description);
  }

}


text:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Epiviz 5</title>

  <link rel="shortcut icon" href="res/img/epiviz_icon.png"/>

  <link href="bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
  <link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
  <link href="lib/vis.js/vis.min.css" rel="stylesheet" />
  <link href="lib/ng-bootstrap-controls/ngb-controls.min.css" rel="stylesheet" />

  <link href="res/css/data-context-nav.css" rel="stylesheet" />

  <script src="bower_components/jquery/dist/jquery.js"></script>
  <script src="bower_components/angular/angular.js"></script>
  <script src="bower_components/d3/d3.js"></script>
  <script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
  <script src="bower_components/angular-bootstrap/ui-bootstrap.min.js"></script>
  <script src="bower_components/angular-animate/angular-animate.js"></script>
  <script src="bower_components/google-closure-library/closure/goog/base.js"></script>

  <!-- Custom libraries -->
  <script src="lib/utils.js/utils.js"></script>
  <script src="lib/ng-utils/ng-utils.js"></script>
  <script src="lib/ng-bootstrap-controls/ngb-controls.js"></script>
  <script src="lib/bigwig.js/bower_components/zlib.js/bin/zlib.min.js"></script>
  <script src="lib/bigwig.js/bigwig.js"></script>
  <script src="lib/threadpool.js/parallel.js"></script>
  <script src="lib/vis.js/vis.js"></script>
  <script src="lib/vs.ui.plugins.js/vs.ui.plugins.js"></script>
  <script src="lib/vs.models.plugins.js/vs.models.plugins.js"></script>

  <script src="deps.js"></script>
  <script src="src/epiviz/epiviz.js"></script>

</head>
<body ng-app="epiviz" ng-include="'res/templates/_master.html'">
</body>
</html>


text:
GorillaBot is an IRC bot framework written in Python. The bot is initiated from the command line. Once it is connected, it receives its commands through IRC. Because I'm writing the framework mainly for use in a channel frequented by Wikipedia editors, there are a number of Wikipedia-specific commands.

__Author:__ Molly White

__License:__ [MIT](http://opensource.org/licenses/MIT)

__Status:__ Unstable

__Version:__ 2.0

## Installation
_Download code from the `master` branch. Code in the `rewrite` branch is often incomplete and non-functional._

1. Run `python3 bot.py` from the source directory. This will step you through configuring the bot. If you already have already configured the bot, you can use that configuration or create a new one.
2. Enter any information when prompted.
3. Once the bot has successfully connected, command the bot from IRC. There are also a number of admin commands available to bot operators.

# Commanding the bot

The bot receives commands in one of three ways:

1. Detecting a word preceded by an exclamation point: `!command`

2. Receiving a message addressed to it directly: `GorillaBot: command` or `GorillaBot: !command`

3. Receiving a command in a private message: `/msg GorillaBot command`

In the examples below, I use the `!command` syntax, but the other two would work equally well.

## All-user commands

{commands}

## Admin-only commands

{admincommands}


text:
package de.techdev.trackr.domain.employee.expenses.report;

import de.techdev.test.oauth.OAuthRequest;
import de.techdev.test.rest.AbstractDomainResourceSecurityTest;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.jdbc.Sql;

import static de.techdev.test.rest.DomainResourceTestMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;

@Sql("resourceTest.sql")
@Sql(value = AbstractDomainResourceSecurityTest.EMPTY_DATABASE_FILE, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
@OAuthRequest
public class ReportResourceSecurityTest extends AbstractDomainResourceSecurityTest {

    private ReportJsonGenerator jsonGenerator = new ReportJsonGenerator();

    @Override
    protected String getResourceName() {
        return "travelExpenseReports";
    }

    @Test
    @OAuthRequest("ROLE_ADMIN")
    public void rootNotExported() throws Exception {
        assertThat(root(), isMethodNotAllowed());
    }

    @Test
    @OAuthRequest("ROLE_SUPERVISOR")
    public void oneAllowedForSupervisor() throws Exception {
        assertThat(one(0L), isAccessible());
    }

    @Test
    @OAuthRequest(username = "someone.else@techdev.de")
    public void oneNotAllowedForOther() throws Exception {
        assertThat(one(0L), isForbidden());
    }

    @Test
    public void oneAllowedForSelf() throws Exception {
        assertThat(one(0L), isAccessible());
    }

    @Test
    public void createAllowed() throws Exception {
        String json = jsonGenerator.start().withDebitorId(0L).withEmployeeId(0L).build();
        assertThat(create(json), isCreated());
    }

    @Test
    public void updateNotAllowedForSelf() throws Exception {
        String json = jsonGenerator.start().withDebitorId(0L).withEmployeeId(0L).apply(r -> r.setId(0L)).build();
        assertThat(update(0L, json), isForbidden());
    }

    @Test
    @Ignore("yields 400 instead of 403 ?")
    @OAuthRequest(username = "someone.else@techdev.de")
    public void updateForbiddenForOther() throws Exception {
        String json = jsonGenerator.start().withDebitorId(0L).withEmployeeId(0L).apply(r -> r.setId(0L)).build();
        assertThat(update(0L, json), isForbidden());
    }

    @Test
    public void deleteAllowedForOwnerIfPending() throws Exception {
        assertThat(remove(0L), isNoContent());
    }

    @Test
    public void deleteForbiddenForOwnerIfSubmitted() throws Exception {
        assertThat(remove(1L), isForbidden());
    }

    @Test
    @OAuthRequest("ROLE_ADMIN")
    public void deleteAllowedForAdmin() throws Exception {
        assertThat(remove(0L), isNoContent());
    }

    @Test
    @OAuthRequest(username = "someone.else@techdev.de")
    public void deleteForbiddenForOtherEvenIfPending() throws Exception {
        assertThat(remove(0L), isForbidden());
    }

    @Test
    @OAuthRequest("ROLE_SUPERVISOR")
    public void pdfExport() throws Exception {
        ResponseEntity<byte[]> response = restTemplate.getForEntity(host + "/travelExpenseReports/0/pdf", byte[].class);
        assertThat(response, isAccessible());
    }

    @Test
    public void pdfExportAsEmployee() throws Exception {
        ResponseEntity<byte[]> response = restTemplate.getForEntity(host + "/travelExpenseReports/0/pdf", byte[].class);
        assertThat(response, isAccessible());
    }

    @Test
    @OAuthRequest("ROLE_SUPERVISOR")
    public void updateEmployeeNotAllowedForSupervisor() throws Exception {
        assertThat(updateLink(0L, "employee", "/employees/0"), isForbidden());
    }

    @Test
    // TODO: Not a really useful test as expenses are never added this way (they need to have the report first...)
    public void addTravelExpenseAllowedForSelf() throws Exception {
        assertThat(updateLink(0L, "expenses", "/travelExpenses/0"), isNoContent());
    }

    @Test
    @OAuthRequest(username = "someone.else@techdev.de")
    public void addTravelExpenseNotAllowedForOther() throws Exception {
        assertThat(updateLink(0L, "expenses", "/travelExpenses/0"), isForbidden());
    }

    @Test
    @OAuthRequest(value = "ROLE_SUPERVISOR", username = "someone.else@techdev.de")
    public void submitNotAllowedForOtherSupervisor() throws Exception {
        ResponseEntity<String> response = restTemplate.exchange(host + "/travelExpenseReports/0/submit", HttpMethod.PUT, HttpEntity.EMPTY, String.class);
        assertThat(response, isForbidden());
    }

    @Test
    @OAuthRequest(value = "ROLE_SUPERVISOR")
    public void approveNotAllowedForOwningSupervisor() throws Exception {
        ResponseEntity<String> response = restTemplate.exchange(host + "/travelExpenseReports/0/approve", HttpMethod.PUT, HttpEntity.EMPTY, String.class);
        assertThat(response, isForbidden());
    }

    @Test
    @OAuthRequest(value = "ROLE_SUPERVISOR", username = "someone.else@techdev.de")
    public void approveAllowedForSupervisor() throws Exception {
        ResponseEntity<String> response = restTemplate.exchange(host + "/travelExpenseReports/0/approve", HttpMethod.PUT, HttpEntity.EMPTY, String.class);
        assertThat(response, isNoContent());
    }

    @Test
    @OAuthRequest(value = "ROLE_SUPERVISOR", username = "someone.else@techdev.de")
    public void rejectAllowedForSupervisor() throws Exception {
        ResponseEntity<String> response = restTemplate.exchange(host + "/travelExpenseReports/0/reject", HttpMethod.PUT, HttpEntity.EMPTY, String.class);
        assertThat(response, isNoContent());
    }

    @Test
    @OAuthRequest("ROLE_SUPERVISOR")
    public void findByStatusAllowedForSupervisor() throws Exception {
        ResponseEntity<String> response = restTemplate.getForEntity(host + "/travelExpenseReports/search/findByStatus?status=SUBMITTED", String.class);
        assertThat(response, isAccessible());
    }

    @Test
    public void findByStatusNotAllowedForEmployee() throws Exception {
        ResponseEntity<String> response = restTemplate.getForEntity(host + "/travelExpenseReports/search/findByStatus?status=SUBMITTED", String.class);
        assertThat(response, isForbidden());
    }

}


text:
from unittest import TestCase
from mock import Mock
from ddsc.core.userutil import UserUtil
from ddsc.exceptions import DDSUserException

class UserUtilTestCase(TestCase):
    def setUp(self):
        self.data_service = Mock()
        self.logging_func = Mock()
        self.user_util = UserUtil(self.data_service, self.logging_func)

    def test_constructor(self):
        self.assertEqual(self.user_util.auth_provider_id,
                         self.data_service.get_default_auth_provider_id.return_value)

    def test_find_user_by_username(self):
        self.data_service.get_users.return_value.json.return_value = {"results": [{"id": "123"}]}
        result = self.user_util.find_user_by_username("fakeuser")
        self.assertEqual(result, {"id": "123"})
        self.data_service.get_users.assert_called_with(username="fakeuser")

    def test_register_user_by_username(self):
        self.data_service.auth_provider_add_user.return_value.json.return_value = {"id": "123"}
        result = self.user_util.register_user_by_username("fakeuser")
        self.assertEqual(result, {"id": "123"})
        self.data_service.auth_provider_add_user.assert_called_with(self.user_util.auth_provider_id, "fakeuser")

    def test_find_user_by_email(self):
        self.data_service.get_users.return_value.json.return_value = {"results": [{"id": "123"}]}
        result = self.user_util.find_user_by_email("fakeuser@duke.edu")
        self.assertEqual(result, {"id": "123"})
        self.data_service.get_users.assert_called_with(email="fakeuser@duke.edu")

    def test_find_affiliate_by_email(self):
        self.data_service.get_auth_provider_affiliates.return_value.json.return_value = {"results": [{"id": "123"}]}
        result = self.user_util.find_affiliate_by_email("fakeuser@duke.edu")
        self.assertEqual(result, {"id": "123"})
        self.data_service.get_auth_provider_affiliates.assert_called_with(self.user_util.auth_provider_id,
                                                                          email="fakeuser@duke.edu")

    def test_find_affiliate_by_username(self):
        self.data_service.get_auth_provider_affiliates.return_value.json.return_value = {"results": [{"id": "123"}]}
        result = self.user_util.find_affiliate_by_username("fakeuser")
        self.assertEqual(result, {"id": "123"})
        self.data_service.get_auth_provider_affiliates.assert_called_with(self.user_util.auth_provider_id,
                                                                          username="fakeuser")

    def test_user_or_affiliate_exists_for_email__dds_user_exists(self):
        self.user_util.find_user_by_email = Mock()
        self.user_util.find_user_by_email.return_value = {"id": "123"}

        self.assertTrue(self.user_util.user_or_affiliate_exists_for_email("fakeuser@duke.edu"))
        self.user_util.find_user_by_email.assert_called_with("fakeuser@duke.edu")
        self.logging_func.assert_called_with(
            "Found DukeDS user for email address fakeuser@duke.edu.")

    def test_user_or_affiliate_exists_for_email__valid_affiliate_exists(self):
        self.user_util.find_user_by_email = Mock()
        self.user_util.find_user_by_email.return_value = None
        self.user_util.find_affiliate_by_email = Mock()
        self.user_util.find_affiliate_by_email.return_value = {"uid": "123"}

        self.assertTrue(self.user_util.user_or_affiliate_exists_for_email("fakeuser@duke.edu"))
        self.user_util.find_user_by_email.assert_called_with("fakeuser@duke.edu")
        self.user_util.find_affiliate_by_email.assert_called_with("fakeuser@duke.edu")
        self.logging_func.assert_called_with(
            "Found affiliate for email address fakeuser@duke.edu.")

    def test_valid_dds_user_or_affiliate_exists_for_email__no_user_found(self):
        self.user_util.find_user_by_email = Mock()
        self.user_util.find_user_by_email.return_value = None
        self.user_util.find_affiliate_by_email = Mock()
        self.user_util.find_affiliate_by_email.return_value = None

        self.assertFalse(self.user_util.user_or_affiliate_exists_for_email("fakeuser@duke.edu"))
        self.user_util.find_user_by_email.assert_called_with("fakeuser@duke.edu")
        self.user_util.find_affiliate_by_email.assert_called_with("fakeuser@duke.edu")
        self.logging_func.assert_called_with(
            "No valid DukeDS user or affiliate found for email address fakeuser@duke.edu.")

    def test_user_or_affiliate_exists_for_username__dds_user_exists(self):
        self.user_util.find_user_by_username = Mock()
        self.user_util.find_user_by_username.return_value = {"id": "123"}

        self.assertTrue(self.user_util.user_or_affiliate_exists_for_username("fakeuser"))
        self.user_util.find_user_by_username.assert_called_with("fakeuser")
        self.logging_func.assert_called_with(
            "Found DukeDS user for username fakeuser.")

    def test_user_or_affiliate_exists_for_username__valid_affiliate_exists(self):
        self.user_util.find_user_by_username = Mock()
        self.user_util.find_user_by_username.return_value = None
        self.user_util.find_affiliate_by_username = Mock()
        self.user_util.find_affiliate_by_username.return_value = {"uid": "123"}

        self.assertTrue(self.user_util.user_or_affiliate_exists_for_username("fakeuser"))
        self.user_util.find_user_by_username.assert_called_with("fakeuser")
        self.user_util.find_affiliate_by_username.assert_called_with("fakeuser")
        self.logging_func.assert_called_with(
            "Found affiliate for username fakeuser.")

    def test_valid_dds_user_or_affiliate_exists_for_username__no_user_found(self):
        self.user_util.find_user_by_username = Mock()
        self.user_util.find_user_by_username.return_value = None
        self.user_util.find_affiliate_by_username = Mock()
        self.user_util.find_affiliate_by_username.return_value = None

        self.assertFalse(self.user_util.user_or_affiliate_exists_for_username("fakeuser"))
        self.user_util.find_user_by_username.assert_called_with("fakeuser")
        self.user_util.find_affiliate_by_username.assert_called_with("fakeuser")
        self.logging_func.assert_called_with(
            "No valid DukeDS user or affiliate found for username fakeuser.")

    def test__get_single_user_or_none(self):
        response = Mock()

        # When no items found should return None
        response.json.return_value = {"results": []}
        result = self.user_util._get_single_user_or_none(response, lookup_value="fakeuser@duke.edu")
        self.assertEqual(result, None)

        # When one item found should return first (only) item
        response.json.return_value = {"results": [{"id": "123"}]}
        result = self.user_util._get_single_user_or_none(response, lookup_value="fakeuser@duke.edu")
        self.assertEqual(result, {"id": "123"})

        # When multiple found raise exception
        response.json.return_value = {"results": [{"id": "123"}, {"id": "456"}]}
        with self.assertRaises(DDSUserException) as raised_exception:
            self.user_util._get_single_user_or_none(response, lookup_value="fakeuser@duke.edu")
        self.assertEqual(str(raised_exception.exception), 'Found multiple users for fakeuser@duke.edu.')


text:
package tzatziki.analysis.java;

/**
 * @author @aloyer
 */
public class Describable {
    private String comment;

    public void describeWith(String comment) {
        this.comment = comment;
    }

    public String comment() {
        return comment;
    }
}


text:
<md-dialog>
    <md-toolbar>

Share

        <md-button class="md-icon-button" ng-click="closeDialog()">
          <md-icon md-svg-src="close" style="fill:white;" aria-label="Close dialog"></md-icon>
        </md-button>

    </md-toolbar>
    <md-dialog-content hide-xs show-gt-xs style="min-width: 470px;padding-bottom: 0px;" layout="row" class="md-padding">
            <md-button flex="15" class="md-icon-button" ng-click="closeDialog()" socialshare socialshare-provider="facebook" socialshare-hashtags="campusbox" socialshare-url="{{shareUrl}}" aria-label="facebook ">
                <md-icon ng-class=""  md-svg-icon="facebook"></md-icon>
            </md-button>
            <md-button flex="15" class="md-icon-button" ng-click="closeDialog()" socialshare socialshare-provider="twitter" socialshare-url="{{shareUrl}}" aria-label="twitter ">
                <md-icon ng-class=""  md-svg-icon="twitter"></md-icon>
            </md-button>
    </md-dialog-content>
    <md-dialog-content show-xs hide-gt-xs layout="row" class="md-padding" style="padding-bottom: 0px;">
            <md-button flex="15" class="md-icon-button" ng-click="closeDialog()" socialshare socialshare-provider="facebook" socialshare-hashtags="campusbox" socialshare-url="{{shareUrl}}" aria-label="facebook ">
                <md-icon ng-class=""  md-svg-icon="facebook"></md-icon>
            </md-button>
            <md-button flex="15" class="md-icon-button" ng-click="closeDialog()" socialshare socialshare-provider="twitter" socialshare-url="{{shareUrl}}" aria-label="twitter ">
                <md-icon ng-class=""  md-svg-icon="twitter"></md-icon>
            </md-button>

            <md-button class="md-icon-button" >
            <md-icon ng-class="" md-svg-icon="whatsapp"></md-icon>
            </md-button>

    </md-dialog-content>
    <md-dialog-content layout="row" layout-align="center center" style="background-color: white;margin: 16px;">
            <md-input-container flex="85" layout="coloum" layout-align="center" md-no-float style="margin:0px;">

                  <input ng-model="shareUrl" placeholder="URL to share" style="border:1px solid #ccc;border-radius: 3px;">
            </md-input-container>
            <md-button flex="15" style="background-color: #ccc;" ngclipboard data-clipboard-text="{{shareUrl}}">Copy</md-button>
    </md-dialog-content>

</md-dialog>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:custom="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.fzxm.customview.activity.MainActivity">

    <com.fzxm.customview.view.TipProgressBar
        android:id="@+id/pb"
        android:padding="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/ProgressBar_Default"
        />
    <com.fzxm.customview.view.TipProgressBar
        android:id="@+id/pb2"
        android:padding="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/ProgressBar_Green"
        custom:current="0"
        />
    <com.fzxm.customview.view.TipProgressBar
        android:id="@+id/pb3"
        android:padding="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/ProgressBar_Red1"
        custom:current="20"
        />
    <com.fzxm.customview.view.TipProgressBar
        android:id="@+id/pb4"
        android:padding="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/ProgressBar_Yellow"
        custom:current="40"
        />
    <com.fzxm.customview.view.TipProgressBar
        android:id="@+id/pb5"
        android:padding="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/ProgressBar_Blue"
        custom:current="60"
        />
    <com.fzxm.customview.view.TipProgressBar
        android:id="@+id/pb6"
        android:padding="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/ProgressBar_Orange"
        custom:current="80"
        />
    <com.fzxm.customview.view.TipProgressBar
        android:id="@+id/pb7"
        android:padding="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/ProgressBar_Red2"
        custom:current="100"
        />
    <com.fzxm.customview.view.TipProgressBar
        android:id="@+id/pb8"
        android:padding="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/ProgressBar_reached"
        custom:current="50"
        />
    <com.fzxm.customview.view.TipProgressBar
        android:id="@+id/pb9"
        android:padding="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/ProgressBar_unreached"
        custom:current="50"
        />
    <com.fzxm.customview.view.TipProgressBar
        android:id="@+id/pb10"
        android:padding="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/ProgressBar_round"
        custom:current="50"
        />

</LinearLayout>


text:
package framework

import (
	"fmt"
	"sync"

	v1 "k8s.io/api/core/v1"
	policyv1beta1 "k8s.io/api/policy/v1beta1"
	rbacv1 "k8s.io/api/rbac/v1"
	apierrs "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"k8s.io/apiserver/pkg/authentication/serviceaccount"
	clientset "k8s.io/client-go/kubernetes"
	"k8s.io/kubernetes/pkg/security/podsecuritypolicy/seccomp"
	"k8s.io/kubernetes/test/e2e/framework/auth"
	e2elog "k8s.io/kubernetes/test/e2e/framework/log"

	"github.com/onsi/ginkgo"
	"github.com/onsi/gomega"
)

const (
	podSecurityPolicyPrivileged = "e2e-test-privileged-psp"
)

var (
	isPSPEnabledOnce sync.Once
	isPSPEnabled     bool
)

// privilegedPSP creates a PodSecurityPolicy that allows everything.
func privilegedPSP(name string) *policyv1beta1.PodSecurityPolicy {
	allowPrivilegeEscalation := true
	return &policyv1beta1.PodSecurityPolicy{
		ObjectMeta: metav1.ObjectMeta{
			Name:        name,
			Annotations: map[string]string{seccomp.AllowedProfilesAnnotationKey: seccomp.AllowAny},
		},
		Spec: policyv1beta1.PodSecurityPolicySpec{
			Privileged:               true,
			AllowPrivilegeEscalation: &allowPrivilegeEscalation,
			AllowedCapabilities:      []v1.Capability{"*"},
			Volumes:                  []policyv1beta1.FSType{policyv1beta1.All},
			HostNetwork:              true,
			HostPorts:                []policyv1beta1.HostPortRange{{Min: 0, Max: 65535}},
			HostIPC:                  true,
			HostPID:                  true,
			RunAsUser: policyv1beta1.RunAsUserStrategyOptions{
				Rule: policyv1beta1.RunAsUserStrategyRunAsAny,
			},
			SELinux: policyv1beta1.SELinuxStrategyOptions{
				Rule: policyv1beta1.SELinuxStrategyRunAsAny,
			},
			SupplementalGroups: policyv1beta1.SupplementalGroupsStrategyOptions{
				Rule: policyv1beta1.SupplementalGroupsStrategyRunAsAny,
			},
			FSGroup: policyv1beta1.FSGroupStrategyOptions{
				Rule: policyv1beta1.FSGroupStrategyRunAsAny,
			},
			ReadOnlyRootFilesystem: false,
			AllowedUnsafeSysctls:   []string{"*"},
		},
	}
}

// IsPodSecurityPolicyEnabled returns true if PodSecurityPolicy is enabled. Otherwise false.
func IsPodSecurityPolicyEnabled(kubeClient clientset.Interface) bool {
	isPSPEnabledOnce.Do(func() {
		psps, err := kubeClient.PolicyV1beta1().PodSecurityPolicies().List(metav1.ListOptions{})
		if err != nil {
			e2elog.Logf("Error listing PodSecurityPolicies; assuming PodSecurityPolicy is disabled: %v", err)
			isPSPEnabled = false
		} else if psps == nil || len(psps.Items) == 0 {
			e2elog.Logf("No PodSecurityPolicies found; assuming PodSecurityPolicy is disabled.")
			isPSPEnabled = false
		} else {
			e2elog.Logf("Found PodSecurityPolicies; assuming PodSecurityPolicy is enabled.")
			isPSPEnabled = true
		}
	})
	return isPSPEnabled
}

var (
	privilegedPSPOnce sync.Once
)

// CreatePrivilegedPSPBinding creates the privileged PSP & role
func CreatePrivilegedPSPBinding(kubeClient clientset.Interface, namespace string) {
	if !IsPodSecurityPolicyEnabled(kubeClient) {
		return
	}
	// Create the privileged PSP & role
	privilegedPSPOnce.Do(func() {
		_, err := kubeClient.PolicyV1beta1().PodSecurityPolicies().Get(
			podSecurityPolicyPrivileged, metav1.GetOptions{})
		if !apierrs.IsNotFound(err) {
			// Privileged PSP was already created.
			ExpectNoError(err, "Failed to get PodSecurityPolicy %s", podSecurityPolicyPrivileged)
			return
		}

		psp := privilegedPSP(podSecurityPolicyPrivileged)
		_, err = kubeClient.PolicyV1beta1().PodSecurityPolicies().Create(psp)
		if !apierrs.IsAlreadyExists(err) {
			ExpectNoError(err, "Failed to create PSP %s", podSecurityPolicyPrivileged)
		}

		if auth.IsRBACEnabled(kubeClient.RbacV1()) {
			// Create the Role to bind it to the namespace.
			_, err = kubeClient.RbacV1().ClusterRoles().Create(&rbacv1.ClusterRole{
				ObjectMeta: metav1.ObjectMeta{Name: podSecurityPolicyPrivileged},
				Rules: []rbacv1.PolicyRule{{
					APIGroups:     []string{"extensions"},
					Resources:     []string{"podsecuritypolicies"},
					ResourceNames: []string{podSecurityPolicyPrivileged},
					Verbs:         []string{"use"},
				}},
			})
			if !apierrs.IsAlreadyExists(err) {
				ExpectNoError(err, "Failed to create PSP role")
			}
		}
	})

	if auth.IsRBACEnabled(kubeClient.RbacV1()) {
		ginkgo.By(fmt.Sprintf("Binding the %s PodSecurityPolicy to the default service account in %s",
			podSecurityPolicyPrivileged, namespace))
		err := auth.BindClusterRoleInNamespace(kubeClient.RbacV1(),
			podSecurityPolicyPrivileged,
			namespace,
			rbacv1.Subject{
				Kind:      rbacv1.ServiceAccountKind,
				Namespace: namespace,
				Name:      "default",
			})
		ExpectNoError(err)
		ExpectNoError(auth.WaitForNamedAuthorizationUpdate(kubeClient.AuthorizationV1(),
			serviceaccount.MakeUsername(namespace, "default"), namespace, "use", podSecurityPolicyPrivileged,
			schema.GroupResource{Group: "extensions", Resource: "podsecuritypolicies"}, true))
	}
}

// ExpectNoError is a copy from the same name function in file test/e2e/framework.go
func ExpectNoError(err error, explain ...interface{}) {
	if err != nil {
		e2elog.Logf("Unexpected error occurred: %v", err)
	}
	gomega.ExpectWithOffset(2, err).NotTo(gomega.HaveOccurred(), explain...)
}


text:
package com.chopping.utils;

/**
 * Definition all public constants for the bootstrap.
 */
public enum Consts {
	UNKNOWN, ANDROID, ldpi, mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi, tv;
}


text:
package dot.junit;

public class DxAbstractMain {

    static public void assertEquals(int expected, int actual) {
        if (expected != actual) throw new RuntimeException("AssertionFailedError: not equals. Expected " + expected + " actual " + actual);
    }

    static public void assertEquals(String message, int expected, int actual) {
        if (expected != actual) throw new RuntimeException("AssertionFailedError: not equals: " + message + " Expected " + expected + " actual " + actual);
    }

    static public void assertEquals(long expected, long actual) {
        if (expected != actual) throw new RuntimeException("AssertionFailedError: not equals. Expected " + expected + " actual " + actual);
    }

    static public void assertEquals(double expected, double actual, double delta) {
        if(!(Math.abs(expected-actual) <= delta)) throw new RuntimeException("AssertionFailedError: not within delta");
    }

    static public void assertEquals(Object expected, Object actual) {
        if (expected == null && actual == null)
            return;
        if (expected != null && expected.equals(actual))
            return;
        throw new RuntimeException("AssertionFailedError: not the same");
    }

    static public void assertTrue(boolean condition) {
        if (!condition) throw new RuntimeException("AssertionFailedError: condition was false");
    }

    static public void assertFalse(boolean condition) {
        if (condition) throw new RuntimeException("AssertionFailedError: condition was true");
    }

    static public void assertNotNull(Object object) {
        if (object == null) throw new RuntimeException("AssertionFailedError: object was null");
    }

    static public void assertNull(Object object) {
        if (object != null) throw new RuntimeException("AssertionFailedError: object was not null");
    }

    static public void fail(String message) {
        throw new RuntimeException("AssertionFailedError msg:"+message);
    }

}


text:
<?php

namespace Drupal\comment\Plugin\migrate\source\d7;

use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;

/**
 * Drupal 7 comment type source from database.
 *
 * @MigrateSource(
 *   id = "d7_comment_type",
 *   source_provider = "comment"
 * )
 */
class CommentType extends DrupalSqlBase {

  /**
   * A map of D7 node types to their labels.
   *
   * @var string[]
   */
  protected $nodeTypes = array();

  /**
   * {@inheritdoc}
   */
  public function query() {
    return $this->select('field_config_instance', 'fci')
      ->distinct()
      ->fields('fci', array('bundle'))
      ->condition('fci.entity_type', 'comment');
  }

  /**
   * {@inheritdoc}
   */
  protected function initializeIterator() {
    $this->nodeTypes = $this->select('node_type', 'nt')
      ->fields('nt', array('type', 'name'))
      ->execute()
      ->fetchAllKeyed();

    return parent::initializeIterator();
  }

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    $node_type = substr($row->getSourceProperty('bundle'), 13);
    $row->setSourceProperty('node_type', $node_type);

    $row->setSourceProperty('default_mode', $this->variableGet("comment_default_mode_$node_type", 1));
    $row->setSourceProperty('per_page', $this->variableGet("comment_default_per_page_$node_type", 50));
    $row->setSourceProperty('anonymous', $this->variableGet("comment_anonymous_$node_type", FALSE));
    $row->setSourceProperty('form_location', $this->variableGet("comment_form_location_$node_type", CommentItemInterface::FORM_BELOW));
    $row->setSourceProperty('preview', $this->variableGet("comment_preview_$node_type", TRUE));
    $row->setSourceProperty('subject', $this->variableGet("comment_subject_field_$node_type", TRUE));

    $label = $this->t('@node_type comment', [
      '@node_type' => $this->nodeTypes[$node_type],
    ]);
    $row->setSourceProperty('label', $label);

    return parent::prepareRow($row);
  }

  /**
   * {@inheritdoc}
   */
  public function fields() {
    return array(
      'label' => $this->t('The label of the comment type.'),
      'bundle' => $this->t('Bundle ID of the comment type.'),
      'node_type' => $this->t('The node type to which this comment type is attached.'),
      'default_mode' => $this->t('Default comment mode.'),
      'per_page' => $this->t('Number of comments visible per page.'),
      'anonymous' => $this->t('Whether anonymous comments are allowed.'),
      'form_location' => $this->t('Location of the comment form.'),
      'preview' => $this->t('Whether previews are enabled for the comment type.'),
      'subject' => $this->t('Whether a subject field is enabled for the comment type.'),
    );
  }

  /**
   * {@inheritdoc}
   */
  public function getIds() {
    return array(
      'bundle' => array(
        'type' => 'string',
      ),
    );
  }

}


text:
@interface RFBMessageHandler : RFBHandler

@end


text:
/**
 *
 * Process Editor - BPMN Package
 *
 * (C) 2008,2009 Frank Puhlmann
 *
 * http://frapu.net
 *
 */
package net.frapu.code.visualization.bpmn;

import net.frapu.code.visualization.editors.BooleanPropertyEditor;
import net.frapu.code.visualization.editors.ColorPropertyEditor;
import net.frapu.code.visualization.editors.ListSelectionPropertyEditor;

import java.awt.*;
import java.awt.geom.RoundRectangle2D;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author fpu
 */
public class Task extends Activity {

    //** The property for compensation (0=FALSE;1=TRUE) */
    public final static String PROP_COMPENSATION = "compensation";
    public final static String PROP_IMPLEMENTATION = "implementation";
    public final static String PROP_GLOBAL = "global";
    //public final static String PROP_INPUT_SET = "input sets";

    public Task() {
        super();
        initializeProperties();
    }

    public Task(int x, int y, String label) {
        super();
        int w = 100;
        int h = 60;
        setSize(w, h);
        setPos(x, y);
        setText(label);
        initializeProperties();
    }

    protected void initializeProperties() {
        setProperty(PROP_LOOP_TYPE, LOOP_NONE);
        String[] type = { Activity.LOOP_NONE, Activity.LOOP_STANDARD, Activity.LOOP_MULTI_SEQUENCE, Activity.LOOP_MULTI_PARALLEL };
        setPropertyEditor(PROP_LOOP_TYPE, new ListSelectionPropertyEditor(type));

        String[] atype = { "", Activity.TYPE_SEND, Activity.TYPE_RECEIVE, Activity.TYPE_SERVICE,
            Activity.TYPE_USER, Activity.TYPE_MANUAL, Activity.TYPE_RULE, Activity.TYPE_SCRIPT
        };
        setPropertyEditor(PROP_STEREOTYPE, new ListSelectionPropertyEditor(atype));

        setProperty(PROP_COMPENSATION, FALSE);
        setPropertyEditor(PROP_COMPENSATION, new BooleanPropertyEditor());

        setProperty(PROP_BACKGROUND, ""+Color.WHITE.getRGB());
        setPropertyEditor(PROP_BACKGROUND, new ColorPropertyEditor());

        setProperty(PROP_IMPLEMENTATION, "");

        setProperty(PROP_GLOBAL, FALSE);
        setPropertyEditor(PROP_GLOBAL, new BooleanPropertyEditor());

        /*setProperty(PROP_INPUT_SET, "");
        setPropertyEditor(PROP_INPUT_SET, new DataSetPropertyEditor());*/
    }

    @Override
    public void setProperty(String key, String value) {
        if (key.equals(PROP_HEIGHT)) {
            try {
                int height = Integer.parseInt(value);
                if (height<30) value = "30";
            } catch (Exception e) {
                value = "60";
            }
        }
        if (key.equals(PROP_WIDTH)) {
            try {
                int width = Integer.parseInt(value);
                if (width<50) value = "50";
            } catch (Exception e) {
                value = "100";
            }
        }
        super.setProperty(key, value);
    }

    @Override
    public Set<Point> getDefaultConnectionPoints() {
        HashSet<Point> cp = new HashSet<Point>();
        // Set default connection points
        int spacing = 30;
        if ((getSize().width/2)<30) spacing = getSize().width/2;

        cp.add(new Point(0 - (getSize().width / 2), 0));
        cp.add(new Point(0, 0 - (getSize().height / 2)));
        cp.add(new Point(0 - (getSize().width / 2) + spacing, 0 - (getSize().height / 2)));
        cp.add(new Point((getSize().width / 2) - spacing, 0 - (getSize().height / 2)));
        cp.add(new Point(0 - (getSize().width / 2) + spacing, (getSize().height / 2)));
        cp.add(new Point((getSize().width / 2) - spacing, (getSize().height / 2)));
        cp.add(new Point((getSize().width / 2), 0));
        cp.add(new Point(0, (getSize().height / 2)));
        return cp;
    }

    @Override
    public void paintInternal(Graphics g) {
        drawTask(g);
    }

    @Override
    protected Shape getOutlineShape() {
        RoundRectangle2D outline = new RoundRectangle2D.Float(getPos().x - (getSize().width / 2),
                getPos().y - (getSize().height / 2), getSize().width, getSize().height, 15, 15);
        return outline;
    }

    private void drawTask(Graphics g) {
        Graphics2D g2 = (Graphics2D) g;

        Shape outline = getOutlineShape();
        g2.setStroke(BPMNUtils.defaultStroke);
        g2.setPaint(getBackground());
        if (!getProperty(PROP_GLOBAL).equals(FALSE)) {
            g2.setStroke(new BasicStroke(3.0f,
                    BasicStroke.CAP_ROUND,
                    BasicStroke.JOIN_ROUND,
                    10.0f, null, 0.0f));
        }
        g2.fill(outline);

        g2.setPaint(Color.BLACK);
        g2.draw(outline);

        // Draw Stereotype
        Activity.drawStereotype(g2, this);

        // @todo: Break text lines automatically to match
        // Count text lines
        g2.setFont(BPMNUtils.defaultFont);
        g2.setPaint(Color.BLACK);
        BPMNUtils.drawText(g2, getPos().x, getPos().y, getSize().width - 8, getText(), BPMNUtils.Orientation.CENTER);
        int lowerY = getPos().y + getSize().height / 2;
        int markerPos = getPos().x;

        if(getProperty(PROP_LOOP_TYPE) != null) {
	        // Draw Standard Loop-Marker
	        if (LOOP_STANDARD.toLowerCase().equals(getProperty(PROP_LOOP_TYPE).toLowerCase())) {
	            Activity.drawStandardLoop(g2, markerPos, lowerY - Activity.MARKER_ICON_SIZE);
	            markerPos += Activity.MARKER_ICON_SIZE * 2;
	        }

	        // Draw Multi Instance Loop-Marker (Parallel)
	        if (LOOP_MULTI_PARALLEL.toLowerCase().equals(getProperty(PROP_LOOP_TYPE).toLowerCase())) {
	            Activity.drawParallelMultiInstance(g2, markerPos, lowerY - Activity.MARKER_ICON_SIZE);
	            markerPos += Activity.MARKER_ICON_SIZE * 2;
	        }

	        // Draw Multi Instance Loop-Marker (Sequence)
	        if (LOOP_MULTI_SEQUENCE.toLowerCase().equals(getProperty(PROP_LOOP_TYPE).toLowerCase())) {
	            Activity.drawSequentialMultiInstance(g2, markerPos, lowerY - Activity.MARKER_ICON_SIZE);
	            markerPos += Activity.MARKER_ICON_SIZE * 2;
	        }
        }
        // Draw Compensation-Marker
        if (TRUE.equals(getProperty(PROP_COMPENSATION))) {
            Activity.drawCompensation(g2, markerPos, lowerY - Activity.MARKER_ICON_SIZE);
            markerPos += Activity.MARKER_ICON_SIZE * 2;
        }

    }
}


text:
/**
 * @(#) Game.java - Main game class
 */

import java.awt.*;
import javax.swing.*;

public class Game implements Runnable
{
        public enum Message{
            LOAD_MAP,     // send this with filename to load a new map
            SIMULATE,     // send this with no parameters to start game sim
            TOGGLE_GRAPH, // change graph drawing mode
            TOGGLE_PLAYER,// insert/remove player
            TOGGLE_PATHS, // show/hide path drawing
            TOGGLE_INFO,  // show/hide aditional info (state info, FOV)
            TOGGLE_RATIO, // show/hide players' kills/deaths ratio
            BOT_COUNT,    // change bot count, pass a number through params
            KEY_EVENT,    // signals that a key was pressed, event type & keycode in params
            MOUSE_MOVE,   // send a new pair of x,y coords of the mouse pos on the window
            MOUSE_CLICK,  // mouse was clicked event, no params
            RESET,        // resets the starting game position
            BAKE_CAKE     // not used ;)
        };

        static int updateInterval = 30; // thread sleep time in ms

	private boolean     m_done = false;
        private boolean     m_running = false;
	private Thread      m_thread = null;
	private GameState   m_currState = null;
        private long        m_prevTime = 0;
        private JComponent  m_canvas = null;
        private long        m_stepSize = -1; // not stepping
        private long        m_launchTime = 0;

        public Game(){ }

	// initializes game
	public void initialize(JComponent canvas)
	{
            m_canvas = canvas;

            // we dont have more states (like: meniu state)
            // so just go to gameplay directly
            this.changeState( new PlayState() );
	}

        //  starts the game (pass stepSize = -1 to run normally, or >0 to step by this size)
        public void launch(long stepSize)
        {
            if(m_running) return; // already launched, need to stop first

            // reset simulation start offset
            m_launchTime = System.currentTimeMillis();
            m_prevTime = m_launchTime;
            m_stepSize = stepSize;

            m_done = false;
            m_thread = new Thread(this);
            m_thread.start();

            // start the game simulation
            m_currState.onMessage(Message.SIMULATE, null);
        }

        // signal state to repaint graphics this is called from a panel component
        public void repaint(Graphics2D painter)
        {
            if(m_currState != null)
                m_currState.onRepaint(painter);
        }

	// this method is run in a thread so that it wont block the main app
        // DONT CALL DIRECTLY - by using a thread it paints the screen in fixed fps
	public void run( )
	{
            m_running = true;
            System.out.println("Game runing...");

            while(!m_done)
            {
                try{
                    Thread.sleep(updateInterval);
                }catch(InterruptedException e ){ }

                long t = System.currentTimeMillis();
                if(m_prevTime == 0) m_prevTime = t; // first time init
                float delta = (t - m_prevTime) * 0.001f;

                m_currState.onExecute(delta);
                m_prevTime = t;

                // stop the game if this is a step!
                if(m_stepSize > 0 && t - m_launchTime >= m_stepSize){
                    m_running = false;
                    m_done = true;
                }
            }

            System.out.println("Game done.");
	}

        // returns the game state
        boolean isRunning(){
            return m_running;
        }

	// stops the thread from running, ends everything
	public void finalize( )
	{
            m_running = false;
            m_done = true; // stop the thread
	}

        // send a message to the game state
        public void postMessage(Message message, String params[])
        {
            if(m_currState != null) m_currState.onMessage(message, params);
        }

	// let's you change the game state like: meniu state, playing state, etc.
	public void changeState( GameState newState )
	{
            System.out.println("[!] ChangeState to: "+newState.toString());
            if(m_currState != null) m_currState.onExit();
            newState.onEnter( m_canvas );
            m_currState = newState;
	}
}


text:
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Ufixed;

/**
 *
Auto generated code.

 * Do not modifiy!

 * Please use {@link org.web3j.codegen.AbiTypesGenerator} to update.

 */
public class Ufixed96x160 extends Ufixed {
    public static final Ufixed96x160 DEFAULT = new Ufixed96x160(BigInteger.ZERO);

    public Ufixed96x160(BigInteger value) {
        super(96, 160, value);
    }

    public Ufixed96x160(int mBitSize, int nBitSize, BigInteger m, BigInteger n) {
        super(96, 160, m, n);
    }
}


text:
<form name="input" action="/tinsearch" method="get">

	   <input class="form-control validate" id="term" name="term" type="search">

      </form>

</form>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE logback>
<configuration>
	<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
        <layout class="ch.qos.logback.classic.PatternLayout">
            <Pattern>%d %5p %50.50c{50}:%4L - %m%n</Pattern>
        </layout>
	</appender>

	<logger name="com.gmind7" level="debug" />

	<logger name="org.springframework" level="warn"/>

    <logger name="org.hibernate" level="warn"/>

    <logger name="org.infinispan" level="warn"/>

    <logger name="net.sf.ehcache" level="warn"/>

    <logger name="org.mybatis" level="warn"/>

    <logger name="org.mysema" level="warn"/>

    <logger name="org.thymeleaf" level="warn"/>

    <logger name="jdbc" level="warn"/>

    <logger name="jdbc.sqlonly" level="info"/>

    <logger name="jdbc.resultsettable" level="info"/>

	<root level="info">
        <appender-ref ref="Console" />
	</root>

</configuration>


text:
// <copyright file="Sites.cs" company="Automate The Planet Ltd.">
// Copyright 2016 Automate The Planet Ltd.
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// <author>Anton Angelov</author>
// <site>http://automatetheplanet.com/</site>
using System;
using System.Xml.Serialization;
using System.Collections.Generic;

namespace TestUrlRedirectsWebDriverHttpWebRequest.Redirects
{
    [XmlRoot(ElementName = "sites")]
    public class Sites
    {
        [XmlElement(ElementName = "site")]
        public List<Site> Site { get; set; }
    }
}


text:
<?php namespace TwoBrosTest\Report;

use TwoBros\Report\AmazonReportRequest;

/**
 * Generated by PHPUnit_SkeletonGenerator 1.2.0 on 2012-12-12 at 13:17:14.
 */
class AmazonReportRequestTest extends \PHPUnit_Framework_TestCase
{

    /**
     * @var AmazonReportRequest
     */
    protected $object;

    public function testSetReportType()
    {

        $this->assertFalse( $this->object->setReportType( null ) ); //can't be nothing
        $this->assertFalse( $this->object->setReportType( 5 ) ); //can't be an int
        $this->assertNull( $this->object->setReportType( 'Type' ) );
        $o = $this->object->getOptions();
        $this->assertArrayHasKey( 'ReportType', $o );
        $this->assertEquals( 'Type', $o[ 'ReportType' ] );
    }

    /**
     * @return array
     */
    public function timeProvider()
    {

        return [
            [ null, null, false, false ], //nothing given, so no change
            [ true, true, false, false ], //not strings or numbers
            [ '', '', false, false ], //strings, but empty
            [ '-1 min', null, true, false ], //one set
            [ null, '-1 min', false, true ], //other set
            [ '-1 min', '-1 min', true, true ], //both set
        ];
    }

    /**
     * @dataProvider timeProvider
     */
    public function testSetTimeLimits( $a, $b, $c, $d )
    {

        $this->object->setTimeLimits( $a, $b );
        $o = $this->object->getOptions();
        if ($c) {
            $this->assertArrayHasKey( 'StartDate', $o );
            $this->assertStringMatchesFormat( '%d-%d-%dT%d:%d:%d%i', $o[ 'StartDate' ] );
        } else {
            $this->assertArrayNotHasKey( 'StartDate', $o );
        }

        if ($d) {
            $this->assertArrayHasKey( 'EndDate', $o );
            $this->assertStringMatchesFormat( '%d-%d-%dT%d:%d:%d%i', $o[ 'EndDate' ] );
        } else {
            $this->assertArrayNotHasKey( 'EndDate', $o );
        }
    }

    public function testResetTimeLimit()
    {

        $this->object->setTimeLimits( '-1 min', '-1 min' );
        $o = $this->object->getOptions();
        $this->assertArrayHasKey( 'StartDate', $o );
        $this->assertArrayHasKey( 'EndDate', $o );

        $this->object->resetTimeLimits();
        $check = $this->object->getOptions();
        $this->assertArrayNotHasKey( 'StartDate', $check );
        $this->assertArrayNotHasKey( 'EndDate', $check );
    }

    public function testSetShowSalesChannel()
    {

        $this->assertFalse( $this->object->setShowSalesChannel( null ) ); //can't be nothing
        $this->assertFalse( $this->object->setShowSalesChannel( 5 ) ); //can't be an int
        $this->assertFalse( $this->object->setShowSalesChannel( 'banana' ) ); //can't be a random word
        $this->assertNull( $this->object->setShowSalesChannel( false ) );
        $this->assertNull( $this->object->setShowSalesChannel( true ) );
        $this->assertNull( $this->object->setShowSalesChannel( 'false' ) );
        $this->assertNull( $this->object->setShowSalesChannel( 'true' ) );
        $o = $this->object->getOptions();
        $this->assertArrayHasKey( 'ReportOptions=ShowSalesChannel', $o );
        $this->assertEquals( 'true', $o[ 'ReportOptions=ShowSalesChannel' ] );
    }

    public function testSetMarketplaces()
    {

        $this->assertFalse( $this->object->setMarketplaces( null ) ); //can't be nothing
        $this->assertFalse( $this->object->setMarketplaces( 5 ) ); //can't be an int

        $list = [ 'One', 'Two', 'Three' ];
        $this->assertNull( $this->object->setMarketplaces( $list ) );

        $o = $this->object->getOptions();
        $this->assertArrayHasKey( 'MarketplaceIdList.Id.1', $o );
        $this->assertEquals( 'One', $o[ 'MarketplaceIdList.Id.1' ] );
        $this->assertArrayHasKey( 'MarketplaceIdList.Id.2', $o );
        $this->assertEquals( 'Two', $o[ 'MarketplaceIdList.Id.2' ] );
        $this->assertArrayHasKey( 'MarketplaceIdList.Id.3', $o );
        $this->assertEquals( 'Three', $o[ 'MarketplaceIdList.Id.3' ] );

        $this->assertNull( $this->object->setMarketplaces( 'Four' ) ); //will cause reset
        $o2 = $this->object->getOptions();
        $this->assertArrayHasKey( 'MarketplaceIdList.Id.1', $o2 );
        $this->assertEquals( 'Four', $o2[ 'MarketplaceIdList.Id.1' ] );
        $this->assertArrayNotHasKey( 'MarketplaceIdList.Id.2', $o2 );
        $this->assertArrayNotHasKey( 'MarketplaceIdList.Id.3', $o2 );

        $this->object->resetMarketplaces();
        $o3 = $this->object->getOptions();
        $this->assertArrayNotHasKey( 'MarketplaceIdList.Id.1', $o3 );
    }

    public function testRequestReport()
    {

        resetLog();
        $this->object->setMock( true, 'requestReport.xml' );
        $this->assertFalse( $this->object->requestReport() );
        $this->object->setReportType( 'Type' );

        $this->assertNull( $this->object->requestReport() );

        $o = $this->object->getOptions();
        $this->assertEquals( 'RequestReport', $o[ 'Action' ] );

        $check = parseLog();
        $this->assertEquals( 'Single Mock File set: requestReport.xml', $check[ 1 ] );
        $this->assertEquals( 'Report Type must be set in order to request a report!', $check[ 2 ] );
        $this->assertEquals( 'Fetched Mock File: test/mock/requestReport.xml', $check[ 3 ] );

        return $this->object;
    }

    /**
     * @depends testRequestReport
     */
    public function testGetReportRequestId( $o )
    {

        $get = $o->getReportRequestId();
        $this->assertEquals( '2291326454', $get );

        $this->assertFalse( $this->object->getReportRequestId() ); //not fetched yet for this object
    }

    /**
     * @depends testRequestReport
     */
    public function testGetReportType( $o )
    {

        $get = $o->getReportType();
        $this->assertEquals( '_GET_MERCHANT_LISTINGS_DATA_', $get );

        $this->assertFalse( $this->object->getReportType() ); //not fetched yet for this object
    }

    /**
     * @depends testRequestReport
     */
    public function testGetStartDate( $o )
    {

        $get = $o->getStartDate();
        $this->assertEquals( '2009-01-21T02:10:39+00:00', $get );

        $this->assertFalse( $this->object->getStartDate() ); //not fetched yet for this object
    }

    /**
     * @depends testRequestReport
     */
    public function testGetEndDate( $o )
    {

        $get = $o->getEndDate();
        $this->assertEquals( '2009-02-13T02:10:39+00:00', $get );

        $this->assertFalse( $this->object->getEndDate() ); //not fetched yet for this object
    }

    /**
     * @depends testRequestReport
     */
    public function testGetIsScheduled( $o )
    {

        $get = $o->getIsScheduled();
        $this->assertEquals( 'false', $get );

        $this->assertFalse( $this->object->getIsScheduled() ); //not fetched yet for this object
    }

    /**
     * @depends testRequestReport
     */
    public function testGetSubmittedDate( $o )
    {

        $get = $o->getSubmittedDate();
        $this->assertEquals( '2009-02-20T02:10:39+00:00', $get );

        $this->assertFalse( $this->object->getSubmittedDate() ); //not fetched yet for this object
    }

    /**
     * @depends testRequestReport
     */
    public function testGetStatus( $o )
    {

        $get = $o->getStatus();
        $this->assertEquals( '_SUBMITTED_', $get );

        $this->assertFalse( $this->object->getStatus() ); //not fetched yet for this object
    }

    /**
     * @depends testRequestReport
     */
    public function testGetResponse( $o )
    {

        $x                             = [ ];
        $x[ 'ReportRequestId' ]        = '2291326454';
        $x[ 'ReportType' ]             = '_GET_MERCHANT_LISTINGS_DATA_';
        $x[ 'StartDate' ]              = '2009-01-21T02:10:39+00:00';
        $x[ 'EndDate' ]                = '2009-02-13T02:10:39+00:00';
        $x[ 'Scheduled' ]              = 'false';
        $x[ 'SubmittedDate' ]          = '2009-02-20T02:10:39+00:00';
        $x[ 'ReportProcessingStatus' ] = '_SUBMITTED_';

        $this->assertEquals( $x, $o->getResponse() );

        $this->assertFalse( $this->object->getResponse() ); //not fetched yet for this object
    }

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {

        setupDummyConfigFile();
        resetLog();
        $this->object = new AmazonReportRequest( 'testStore', true, null, __DIR__ . '/../test-config.php' );
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {

        removeDummyConfigFile();
    }

}

require_once( 'test/helperFunctions.php' );


text:
import codecs
import os

try:
    from setuptools import setup, find_packages
except ImportError:
    from ez_setup import use_setuptools
    use_setuptools()
    from setuptools import setup, find_packages

long_description = codecs.open("README.rst", "r", "utf-8").read()

def strip_comments(l):
    return l.split('#', 1)[0].strip()

def get_requirements(path):
    for line in open(os.path.join(os.getcwd(), path)).readlines():
        line = strip_comments(line)
        if line:
            yield line

setup(
    name="html-tree-diff",
    version="0.1.4",
    description="Structure-aware diff for html and xml documents",
    author="Christian Oudard",
    author_email="christian.oudard@gmail.com",
    url="http://github.com/christian-oudard/htmltreediff/",
    platforms=["any"],
    license="BSD",
    packages=find_packages(),
    scripts=[],
    zip_safe=False,
    install_requires=list(get_requirements('requirements/default.txt')),
    tests_require=list(get_requirements('requirements/testing.txt')),
    cmdclass={},
    classifiers=[
        "Development Status :: 3 - Alpha",
        "Programming Language :: Python",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: BSD License",
        "Operating System :: OS Independent",
        "Topic :: Text Processing :: Markup :: HTML",
        "Topic :: Text Processing :: Markup :: XML",
    ],
    long_description=long_description,
)


text:
package com.aviary.android.feather.effects;

import java.util.Locale;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;

import com.aviary.android.feather.R;
import com.aviary.android.feather.library.content.ToolEntry;
import com.aviary.android.feather.library.filters.FilterLoaderFactory;
import com.aviary.android.feather.library.filters.FilterLoaderFactory.Filters;
import com.aviary.android.feather.library.services.IAviaryController;
import com.aviary.android.feather.library.tracking.Tracker;
import com.aviary.android.feather.widget.AviarySeekBar;
import com.aviary.android.feather.widget.AviaryWheel;
import com.aviary.android.feather.widget.AviaryWheel.OnWheelChangeListener;

public abstract class SliderEffectPanel extends AbstractOptionPanel implements OnSeekBarChangeListener, OnClickListener, OnWheelChangeListener {

	enum SliderStyle {
		SeekBarStyle, WheelStyle
	};

	private SliderStyle mStyle;
	AviaryWheel mWheel;
	AviarySeekBar mSeekBar;
	String mResourceName;
	View mButtonMinus, mButtonPlus;

	public SliderEffectPanel ( IAviaryController context, ToolEntry entry, Filters type, String resourcesBaseName ) {
		super( context, entry );
		mStyle = SliderStyle.WheelStyle;

		mFilter = FilterLoaderFactory.get( type );
		mResourceName = resourcesBaseName;
	}

	@Override
	public void onCreate( Bitmap bitmap, Bundle options ) {
		super.onCreate( bitmap, options );

		mButtonMinus = getOptionView().findViewById( R.id.aviary_button_minus );
		mButtonPlus = getOptionView().findViewById( R.id.aviary_button_plus );

		if ( mStyle == SliderStyle.SeekBarStyle ) {
			mSeekBar = (AviarySeekBar) getOptionView().findViewById( R.id.aviary_seekbar );
			mSeekBar.setProgress( 50 );
		} else {
			mWheel = (AviaryWheel) getOptionView().findViewById( R.id.aviary_wheel );
			mWheel.setValue( 50 );
		}
	}

	@Override
	public void onActivate() {
		super.onActivate();
		mButtonMinus.setOnClickListener( this );
		mButtonPlus.setOnClickListener( this );

		if ( mStyle == SliderStyle.SeekBarStyle ) {
			mSeekBar.setOnSeekBarChangeListener( this );
		} else {
			mWheel.setOnWheelChangeListener( this );
			disableHapticIsNecessary( mWheel );
		}
	}

	@Override
	public void onDeactivate() {
		super.onDeactivate();
		mButtonMinus.setOnClickListener( null );
		mButtonPlus.setOnClickListener( null );

		if ( mStyle == SliderStyle.SeekBarStyle ) {
			mSeekBar.setOnSeekBarChangeListener( null );
		} else {
			mWheel.setOnWheelChangeListener( this );
		}
	}

	protected void setValue( int value ) {
		if ( mStyle == SliderStyle.SeekBarStyle ) {
			mSeekBar.setProgress( value );
		} else {
			mWheel.setValue( value );
		}
	}

	@Override
	public void onClick( View v ) {
		final int id = v.getId();
		if ( id == mButtonMinus.getId() ) {
			decreaseValue();
		} else if ( id == mButtonPlus.getId() ) {
			increaseValue();
		}
	}

	protected void decreaseValue() {
		if ( mStyle == SliderStyle.SeekBarStyle ) {
			mSeekBar.setProgress( mSeekBar.getProgress() - 1 );
		} else {
			mWheel.setValue( mWheel.getValue() - 1 );
		}
	}

	protected void increaseValue() {
		if ( mStyle == SliderStyle.SeekBarStyle ) {
			mSeekBar.setProgress( mSeekBar.getProgress() + 1 );
		} else {
			mWheel.setValue( mWheel.getValue() + 1 );
		}
	}

	@Override
	protected ViewGroup generateOptionView( LayoutInflater inflater, ViewGroup parent ) {
		if ( mStyle == SliderStyle.SeekBarStyle ) {
			return (ViewGroup) inflater.inflate( R.layout.aviary_panel_seekbar, parent, false );
		} else {
			return (ViewGroup) inflater.inflate( R.layout.aviary_panel_wheel, parent, false );
		}
	}

	@Override
	public final void onProgressChanged( SeekBar seekBar, int progress, boolean fromUser ) {
		onSliderChanged( progress, fromUser );
	}

	@Override
	public final void onStartTrackingTouch( SeekBar seekBar ) {
		Tracker.recordTag( getName().name().toLowerCase( Locale.US ) + ": SliderMoved" );
		onSliderStart( seekBar.getProgress() );
	}

	@Override
	public final void onStopTrackingTouch( SeekBar seekBar ) {
		onSliderEnd( seekBar.getProgress() );
	}

	@Override
	public final void onStartTrackingTouch( AviaryWheel view ) {
		Tracker.recordTag( getName().name().toLowerCase( Locale.US ) + ": WheelMoved" );
		onSliderStart( view.getValue() );
	}

	@Override
	public final void OnValueChanged( AviaryWheel view, int value ) {
		onSliderChanged( value, true );
	}

	@Override
	public void onStopTrackingTouch( AviaryWheel view ) {
		onSliderEnd( view.getValue() );
	}

	protected abstract void onSliderStart( int value );

	protected abstract void onSliderChanged( int value, boolean fromUser );

	protected abstract void onSliderEnd( int value );
}


text:
package com.amazonaws.services.ec2.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum ReservedInstanceState {

    PaymentPending("payment-pending"),
    Active("active"),
    PaymentFailed("payment-failed"),
    Retired("retired");

    private String value;

    private ReservedInstanceState(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return ReservedInstanceState corresponding to the value
     */
    public static ReservedInstanceState fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (ReservedInstanceState enumEntry : ReservedInstanceState.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 288721 $ -->

<chapter xml:id="ftp.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 &reftitle.setup;

 <!-- {{{ Requirements -->
 <section xml:id="ftp.requirements">
  &reftitle.required;
  &no.requirement;
 </section>
 <!-- }}} -->

 <!-- {{{ Installation -->
 &reference.ftp.configure;
 <!-- }}} -->

 <!-- {{{ Configuration -->
 <section xml:id="ftp.configuration">
  &reftitle.runtime;
  &no.config;
 </section>
 <!-- }}} -->

 <!-- {{{ Resources -->
 <section xml:id="ftp.resources">
  &reftitle.resources;
  <para>
   This extension uses one resource type, which is the link identifier
   of the FTP connection, returned by <function>ftp_connect</function>
   or <function>ftp_ssl_connect</function>.
  </para>
 </section>
 <!-- }}} -->

</chapter>

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


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of config
 *
 * @author ELTON
 */

namespace config;

use core\interfaces\AbstractConfiguration;

class Configuration extends AbstractConfiguration {

   protected function config() {
      parent::setNamespaceController("test\controller");
      parent::setNamespaceValidateAnnotation("test\validacao");
      //parent::setModeOptimized();
     // parent::setActionDefault("gravar", "pessoa");
      parent::setActionDefault('index', 'BoasVindasController');
      parent::setNamespaceAnnotation("test\attributes");
      parent::viewTimePerformace();
      //  parent::onCDI();
      parent::onCDI(new \test\cdi\MyClasseCDI());
      // parent::setGlobalFilter(new \test\filters\ExceptionFilter());
      //parent::setGlobalFilter(new \test\filters\ModelValidation());
      // parent::setGlobalFilter(new \test\filters\UserFilter());
      //parent::setGlobalFilter(new \test\filters\PermissionFilter());
      parent::setGlobalFilter(new \core\filters\AttributesRunTime());
      parent::setGlobalFilter(new \core\filters\FilterModelValidation());
   }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache.hive</groupId>
    <artifactId>hive-it</artifactId>
    <version>4.0.0-alpha-2-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <artifactId>hive-jmh</artifactId>
  <packaging>jar</packaging>
  <name>JMH benchmark: Hive</name>
  <properties>
    <hive.path.to.root>../..</hive.path.to.root>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jmh.version>1.21</jmh.version>
    <uberjar.name>benchmarks</uberjar.name>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <version>${jmh.version}</version>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-generator-annprocess</artifactId>
      <version>${jmh.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-serde</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.tez</groupId>
      <artifactId>tez-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.tez</groupId>
      <artifactId>tez-runtime-internals</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-storage-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-exec</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-exec</artifactId>
      <classifier>tests</classifier>
    </dependency>
    <dependency>
      <groupId>org.apache.tez</groupId>
      <artifactId>tez-runtime-library</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-mapreduce-client-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>${powermock.version}</version>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-mockito2</artifactId>
      <version>${powermock.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-exec</artifactId>
    </dependency>
  </dependencies>
  <profiles>
    <profile>
      <id>perf</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
                <configuration>
                  <finalName>${uberjar.name}</finalName>
                  <transformers>
                    <transformer implementation="com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer"/>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                      <mainClass>org.openjdk.jmh.Main</mainClass>
                    </transformer>
                  </transformers>
                  <filters>
                    <filter>
                      <!--
                      Shading signed JARs will fail without this.
                      http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
                      -->
                      <artifact>*:*</artifact>
                      <excludes>
                        <exclude>META-INF/*.SF</exclude>
                        <exclude>META-INF/*.DSA</exclude>
                        <exclude>META-INF/*.RSA</exclude>
                      </excludes>
                    </filter>
                  </filters>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>com.github.edwgiz</groupId>
                <artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
                <version>2.1</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>


text:
<?php

/**
 * Product collection that uses the ids taken from ff
 *
 * @category Mage
 * @package FACTFinder_Core
 * @author Flagbit Magento Team <magento@flagbit.de>
 * @copyright Copyright (c) 2017 Flagbit GmbH & Co. KG (http://www.flagbit.de)
 * @license https://opensource.org/licenses/MIT  The MIT License (MIT)
 * @link http://www.flagbit.de
 */
class FACTFinder_Core_Model_Resource_Search_Collection extends Mage_Catalog_Model_Resource_Product_Collection
{

    /**
     * Get collection size
     *
     * @return int
     */
    public function getSize()
    {
        return $this->_getSearchHandler()->getSearchResultCount();
    }

    /**
     * Get FACT-Finder Facade
     *
     * @return FACTFinder_Core_Model_Handler_Search
     */
    protected function _getSearchHandler()
    {
        return Mage::getSingleton('factfinder/handler_search');
    }

    /**
     * Add search query filter
     *
     * @param   Mage_CatalogSearch_Model_Query $query
     *
     * @return  FACTFinder_Core_Model_Resource_Search_Collection
     */
    public function addSearchFilter($query)
    {
        return $this;
    }

    /**
     * Set Order field
     *
     * @param string $attribute
     * @param string $dir
     *
     * @return FACTFinder_Core_Model_Resource_Search_Collection
     */
    public function setOrder($attribute, $dir = 'desc')
    {
        return $this;
    }

    /**
     * Load entities records into items
     *
     * @param bool $printQuery
     * @param bool $logQuery
     *
     * @throws Exception
     * @throws Mage_Core_Exception
     *
     * @return Mage_Eav_Model_Entity_Collection_Abstract
     */
    public function _loadEntities($printQuery = false, $logQuery = false)
    {
        // get product IDs from Fact-Finder
        $productIds = $this->_getSearchHandler()->getSearchResult();

        if (!empty($productIds)) {
            $idFieldName = Mage::helper('factfinder/search')->getIdFieldName();

            // add Filter to Query
            $this->addFieldToFilter(
                $idFieldName,
                array('in' => array_keys($productIds))
            );

            $this->_pageSize = null;

            $this->getSelect()->reset(Zend_Db_Select::LIMIT_COUNT);
            $this->getSelect()->reset(Zend_Db_Select::LIMIT_OFFSET);

            $this->printLogQuery($printQuery, $logQuery);
            Mage::helper('factfinder/debug')->log('Search SQL Query: ' . $this->getSelect()->__toString());

            try {
                $rows = $this->_fetchAll($this->getSelect());
            } catch (Exception $e) {
                Mage::printException($e, $this->getSelect());
                $this->printLogQuery(true, true, $this->getSelect());
                throw $e;
            }

            $items = array();
            foreach ($rows as $v) {
                $items[trim($v[$idFieldName])] = $v;
            }

            foreach ($productIds as $productId => $additionalData) {
                if (empty($items[$productId])) {
                    continue;
                }

                $v = array_merge($items[$productId], $additionalData->toArray());
                $object = $this->getNewEmptyItem()
                    ->setData($v);

                $this->addItem($object);
                if (isset($this->_itemsById[$object->getId()])) {
                    $this->_itemsById[$object->getId()][] = $object;
                } else {
                    $this->_itemsById[$object->getId()] = array($object);
                }
            }
        }

        return $this;
    }

}


text:
module Smshelper
  class Message
    attr_accessor :recipient, :text, :sender
    attr_reader :utf_8

    def initialize(attributes = {})
      @recipient = attributes[:recipient]
      @text = attributes[:text]
      @sender = attributes[:sender]
      is_gsm(@text) ? (@utf_8 = false) : (@utf_8 = true)
    end

    def is_gsm(text)
      dl = Smshelper::Languagetools::Charset.new
      lang = dl.is_gsm(text)
    end

    # def to_hex
    #   @text = @text.unpack('U*').collect {|x| sprintf '%02X', x}.join
    # end

    # convert text to UCS-2 BigEndian
    def to_hex_be
      @text = @text.unpack('U*').collect {|x| sprintf '%04X', x}.join
    end

  end
end


text:
/**
This module defines the footer view Class, which is attached to the footer tag of the HTML DOM. It handles the Footer of the App and all its behaviours.
@module FooterViewModule
@require jquery
@require underscore
@require backbone
@require ../state
@require ../eventCenter
@require ../undo
@require ../singletons
@require ../utils
@output FooterView
*/
define(['require','jquery','underscore','backbone','../singletons','../utils','../eventCenter','../state','../undo'], function(require,$,_,Backbone,singletons,utils,eventCenter,state,undo)
{
	/**
	The footer view is currenty empty.
	@type Class:FooterView
	@extend Backbone.View
	*/
	var FooterView = Backbone.View.extend({
		/**
		The class name
		@type String:className
		*/
		className: "footer bgLight",
		/**
		The log stack
		@type Array:logs
		*/
		logs: [],
		/**
		An object to define event handling
		@type Object:events
		*/
		events:
		{
		},
		/**
		Initialize the FooterView
		@type Function:initialize
		@return FooterView:Returns itself for chaining
		*/
		initialize: function()
		{
			this.listenTo(eventCenter,"log",this.addLog);
			this.listenTo(state,"change:channelActive",this.channelActive);
			return this;
		},
		/**
		Set channel connection icon
		@type Function:addPost
		@param Backbone.Model:The state model
		@param Bool:The value
		@return FooterView:Returns itself for chaining
		*/
		channelActive: function(model,value)
		{
			this.$el.find(".channel ." + ((value) ? "" : "no") + "connection").show();
			this.$el.find(".channel ." + ((!value) ? "" : "no") + "connection").hide();
			this.$el.find(".channel").css("backgroundColor",(value) ? "white" : "red");
			return this;
		},
		/**
		Add post
		@type Function:addPost
		@param Object:The log with .title and .description.
		@return FooterView:Returns itself for chaining
		*/
		addLog: function(log)
		{
			var d = new Date(Date.now());
			var h = d.getHours();
			var m = d.getMinutes();
			var s = d.getSeconds();
			var ms = d.getMilliseconds();
			log.timeString =
				((h.toString().length < 2) ? "0":"") + h + ":" +
				((m.toString().length < 2) ? "0":"") + m + ":" +
				((s.toString().length < 2) ? "0":"") + s + ":" +
				((ms.toString().length < 2) ? "00":((ms.toString().length < 3) ? "0":"")) + ms;
			this.logs.push(log);
			this.$el.find(".log a")
			.text(log.title)
			.fadeTo(utils.config.logFadeInDuration,utils.config.logFadeInOpacity)
			.delay(utils.config.logStayFadedIn)
			.fadeTo(utils.config.logFadeOutDuration,utils.config.logFadeOutOpacity);
			while (this.logs.length >= utils.config.maxLogs) this.logs.shift();
			return this;
		},
		/**
		Get the last posts
		@type Function:lastPosts
		@param Number:The amount of posts
		@return JQuery.Object:The list of the last logs
		*/
		lastLogs: function()
		{
			var v =  $("
").append(_.map(this.logs,function(log)
			{
				return "
" + log.timeString + "> " + ((log.description.length > utils.config.logMaxRange) ? log.description.substr(0,utils.config.logMaxRange) + "..." : log.description) + "
";
			},this));
			return v;
		},
		/**
		Render the view
		@type Function:render
		@return FooterView:Returns itself for chaining
		*/
		render: function()
		{
			var _this = this;
			this.$el.html(utils.templates["FooterView"](utils.merge(_.pick(utils.config,"baseURL"))));
			this.$el.find(".log").tooltip(
			{
				content: function(){return _this.lastLogs.call(_this)},
				tooltipClass: "logsTooltip",
				position: utils.config.logTooltipPosition,
				show: utils.config.logTooltipShow,
				hide: utils.config.logTooltipHide
			});
			this.$el.find(".shortcuts").tooltip(
			{
				content: function(){return utils.templates["ShortcutsListView"](utils.merge(_.pick(utils.config,"baseURL")))},
				tooltipClass: "shortcutsTooltip",
				position: utils.config.shortcutsTooltipPosition,
				show: utils.config.shortcutsTooltipShow,
				hide: utils.config.shortcutsTooltipHide
			});
			this.$el.find(".channel").tooltip(
			{
				content: function(){return utils.templates["ChannelView"](utils.merge(_.pick(utils.config,"baseURL"),singletons.channel.toJSON()))},
				tooltipClass: "channelTooltip",
				position: utils.config.channelTooltipPosition,
				show: utils.config.channelTooltipShow,
				hide: utils.config.channelTooltipHide
			});

			return this;
		}
	});

	return FooterView;
});


text:
package main

import (
	"net/http"
	"sync"
	"time"

	_ "gnd.la/blobstore/driver/gcs"  // enable Google Could Storage blobstore driver
	_ "gnd.la/cache/driver/memcache" // enable memcached cache driver
	_ "gnd.la/commands"              // required for make-assets command
	// Uncomment the following line to use Google Cloud SQL
	//_ "gnd.la/orm/driver/mysql"
)

var (
	wg sync.WaitGroup
)

func _app_engine_app_init() {
	// Make sure App is initialized before the rest
	// of this function runs.
	for App == nil {
		time.Sleep(5 * time.Millisecond)
	}
	if err := App.Prepare(); err != nil {
		panic(err)
	}
	http.Handle("/", App)
	wg.Done()
}

// Only executed on the development server. Required for
// precompiling assets.
func main() {
	wg.Wait()
}

func init() {
	wg.Add(1)
	go _app_engine_app_init()
}