text:
/* from 0.6.1 */
ALTER TABLE
    `queries`
    CONVERT TO CHARACTER SET utf8mb4
    COLLATE utf8mb4_unicode_ci;

ALTER TABLE
    `playlists`
    CONVERT TO CHARACTER SET utf8mb4
    COLLATE utf8mb4_unicode_ci;

ALTER TABLE
    `querydetails`
    CONVERT TO CHARACTER SET utf8mb4
    COLLATE utf8mb4_unicode_ci;

ALTER TABLE
    `files`
    CONVERT TO CHARACTER SET utf8mb4
    COLLATE utf8mb4_unicode_ci;

ALTER TABLE
    `queryerror`
    CONVERT TO CHARACTER SET utf8mb4
    COLLATE utf8mb4_unicode_ci;

ALTER TABLE
    `subqueries`
    CONVERT TO CHARACTER SET utf8mb4
    COLLATE utf8mb4_unicode_ci;

ALTER TABLE
    `query_files`
    CONVERT TO CHARACTER SET utf8mb4
    COLLATE utf8mb4_unicode_ci;

/* from 0.6.4 */
ALTER TABLE queries KEY_BLOCK_SIZE=0;
ALTER TABLE playlists KEY_BLOCK_SIZE=0;
ALTER TABLE files KEY_BLOCK_SIZE=0;
ALTER TABLE queryerror KEY_BLOCK_SIZE=0;
ALTER TABLE subqueries KEY_BLOCK_SIZE=0;


text:
gem 'json'
gem 'git', github: 'RISCfuture/ruby-git'
gem 'user-agent'

gem 'safe_yaml'

redpajama_set_name: RedPajamaGithub


text:
package org.androidtransfuse.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Defines a class to be a Transfuse Activity component.  For classes that do not extend the android.app.Activity
 * class this annotation activates the event systems, dependency injection features and manifest management.
 * Additionally, a `@Layout` may be defined which will be incorporated into the generated onCreate method.
 *
 * For classes that do extend the android.app.Activity class, defining a class as a Transfuse Activity will simply
 * activate manifest management of the Activity.
 *
 * Under both cases you may define additional manifest metadata which will be associated with the Activity manifest
 * entry.
 *
 * @author John Ericksen
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Activity {

    String name() default "";

    String label() default "";

    boolean allowTaskReparenting() default false;

    boolean alwaysRetainTaskState() default false;

    boolean clearTaskOnLaunch() default false;

    ConfigChanges[] configChanges() default {};

    boolean enabled() default true;

    boolean excludeFromRecents() default false;

    Exported exported() default Exported.UNSPECIFIED;

    boolean finishOnTaskLaunch() default false;

    boolean hardwareAccelerated() default false;

    String icon() default "";

    LaunchMode launchMode() default LaunchMode.STANDARD;

    boolean multiprocess() default false;

    boolean noHistory() default false;

    String permission() default "";

    String process() default "";

    ScreenOrientation screenOrientation() default ScreenOrientation.UNSPECIFIED;

    boolean stateNotNeeded() default false;

    String taskAffinity() default "";

    String theme() default "";

    UIOptions uiOptions() default UIOptions.NONE;

    WindowSoftInputMode windowSoftInputMode() default WindowSoftInputMode.STATE_UNSPECIFIED;

    Class<?> type() default Object.class;
}


text:
<title>Access Denied</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

TextColor" link="$this->LinkColor" vlink="$this->VlinkColor" alink="$this->LinkColor">

<LINK href="javascript/style$this->browser.css" rel="stylesheet" type="text/css">

Authentication Error

Access Denied - Your SessionID could not be validated in the database

Verify the correct username and password.

Check your browser supports cookies and enable in the browser settings

Check that two sessions of your account are not active - only one user per login is accepted

If you are still unsuccessful accessing your account

Use the Password Retrieval Utility to remember lost passwords

Contact the Administrator $this->admin_email for assistance

Create a new account


text:
RE-Mote IP64 README file
========================

This example shows how to deploy an IP64 ethernet-based router using Zolertia's `eth-gw` Ethernet gateway, based on the Zoul and ENC28J60 modules, with active POE support.

IP64 router
-----------------
The router packs a built-in webserver and optionally can run on 2.4GHz or with the Sub-1GHz radio interface.  In the `project-conf.h` file you can alternatively enable one or another as follows:

* RF 2.4GHz (cc2538 built-in)

````
#define NETSTACK_CONF_RADIO         cc2538_rf_driver
#define ANTENNA_SW_SELECT_DEF_CONF  ANTENNA_SW_SELECT_2_4GHZ
````

* RF Sub-1GHz (CC1200)

````
#define NETSTACK_CONF_RADIO         cc1200_driver
#define ANTENNA_SW_SELECT_DEF_CONF  ANTENNA_SW_SELECT_SUBGHZ
````

To compile and flash run:

````
cd ip64-eth-gw
make TARGET=zoul BOARD=eth-gw ip64-router.upload
````

As default we enable the `DHCP` support for autoconfiguration.  Just connect to a DHCP-enabled device to obtain an IPv4 IP address and that's it!.

HTTP client examples
-----------------

There are available 2 examples ready to use using the `http-socket` library:

* The `client` example just makes a HTTP `GET` request to a know page and retrieves
  the result.

* The `ifttt_client` example sends a HTTP `POST` request to [IFTTT](https://ifttt.com/recipes) whenever the user button is pressed, building an Internet button to connect to several channels and applications, such as `Drive`, `Evernote` and many others.

To configure the `IFTTT` demo just edit the `project-conf.h` file and change the name of the event and write your API key:

````
#define IFTTT_EVENT   "button"
#define IFTTT_KEY     "XXXXXX"
````

To compile and flash:

````
cd client
make TARGET=zoul ifttt_client.upload
````


text:
"use strict";

define(['app', '../services/fm-api', '../directives/fm-upload-form'], function (app) {
    app.controller('FmHeaderCtrl', ['$scope', '$filter', '$rootScope', '$uibModal', 'fmAPI', 'localStorageService',
        function ($scope, $filter, $rootScope, $uibModal, fmAPI, localStorageService) {

            $scope.newDir = {
                data: [],

                add: function (obj) {
                    this.data.unshift({
                        content: [],
                        date: $filter('date')(new Date(), "MM/dd/yyyy"),
                        time: $filter('date')(new Date(), "h:mm:ss' 'a"),
                        isDir: true,
                        name: "New Folder",
                        path: obj.path + "/",
                        size: 0
                    });
                },

                remove: function (index) {
                    this.data.splice(index, 1);
                },

                create: function (obj, index) {
                    fmAPI.checkSimilarNames(obj.content, this.data[index].name, function (exist) {
                        if (exist) {
                            alert('The folder "' + $scope.newDir.data[index].name + '" already exists');
                        } else {
                            var dir = $scope.newDir.data.splice(index, 1)[0];
                            dir.path += dir.name;
                            obj.content.push(dir);
                            $scope.$broadcast('runSetBoxWidth', true);
                        }
                    });
                }
            };

            var history = $scope.history = {
                step: 0,
                data: [],
                btnBackward: true,
                btnForward: true,

                goBackward: function () {
                    this.step--;

                    if (this.step > 0) {
                        this.step = (this.step == this.data.length - 1) ? this.step - 1 : this.step;
                        $scope.objClickEventAction(this.data[this.step], true);
                        this.btnForward = false;
                    } else {
                        this.step = 0;
                        this.btnBackward = true;
                        $scope.objClickEventAction(this.data[this.step], true);
                    }
                },

                goForward: function () {
                    this.step++;

                    if (this.step < this.data.length - 1) {
                        $scope.objClickEventAction(this.data[this.step], true);
                        this.btnBackward = false;
                    } else {
                        this.btnForward = true;
                        $scope.objClickEventAction(this.data[this.step], true);
                        this.step = this.data.length;
                    }
                }
            };

            $scope.objClickEventAction = function (obj, stateHistory) {
                if (obj.isDir) {

                    if (!stateHistory) {
                        history.data.push(obj);
                        history.btnBackward = false;
                        history.btnForward = true;
                        history.step = history.data.length;
                    }

                    fmAPI.cancelSelected($scope.currentDir.content, function () {
                        $scope.currentDir = obj;
                        $scope.newDir.data = [];
                    });

                    $scope.writeNewPathState = false;
                    $scope.breadcrumbArr = (obj.storage) ? [] : obj.path.split('/').slice(2);
                } else {

                }
            };

            $scope.breadcrumbWalker = function (index, last) {
                if (!last) {
                    var destArr = $scope.breadcrumbArr.slice(0, index + 1);
                    var obj = $scope.foldersTree;

                    for (var i = 0; i < index + 1; i++) {
                        obj = $filter('filter')(obj.content, { name: destArr[i] })[0];
                        if (i === index) $scope.objClickEventAction(obj);
                    }
                }
            };

            $scope.applyNewPath = function (obj) {
                $scope.writeNewPathState = !$scope.writeNewPathState;

                if ($scope.writeNewPathState) {
                    if ($scope.breadcrumbArr && $scope.breadcrumbArr.length > 0) {
                        obj.path = $scope.breadcrumbArr.join('/');
                    }
                } else if (obj.path) {
                    console.log(obj.path.split('/'));

                }
            };

            $scope.layoutSwitcher = function () {
                localStorageService.set('fm', $rootScope.fmSettings);
            };

            $scope.openSettingsMmodal = function (size) {
                $uibModal.open({
                    size: size,
                    templateUrl: '/partials/fm-settings-form.html',
                    controller: function ($rootScope, $scope, localStorageService) {

                        $scope.settings = {
                            sp: $rootScope.fmSettings,
                            showHideSidebar: function () {
                                this.sp.sidebar = !this.sp.sidebar;
                                this.sp.contentWidth = this.sp.sidebar ? 100 - this.sp.sidebarWidth : 100;
                            },
                            showHideFilesInSidebar: function () {
                                this.sp.showFiles = !this.sp.showFiles;
                            },
                            showHideFilesExtension: function () {
                                this.sp.showExt = !this.sp.showExt;
                            },
                            showHideTableColumn: function (col) {
                                switch (col) {
                                    case 'type': this.sp.showTypeCol = !this.sp.showTypeCol; break;
                                    case 'size': this.sp.showSizeCol = !this.sp.showSizeCol; break;
                                    case 'date': this.sp.showDateCol = !this.sp.showDateCol; break;
                                }
                            },
                            saveSettings: function () {
                                localStorageService.set('fm', $rootScope.fmSettings);
                                $scope.$close();
                            }
                        };

                    }
                });
            };

            $scope.openUploadFormModal = function (size) {
                $uibModal.open({
                    size: size,
                    templateUrl: '/partials/fm-upload-form.html'
                });
            };

        }]);
});


text:
namespace System.Drawing.Drawing2D
{
    /// <include file='doc\GraphicsState.uex' path='docs/doc[@for="GraphicsState"]/*' />
    /// <devdoc>
    ///    <para>[To be supplied.]</para>
    /// </devdoc>
    public sealed class GraphicsState : MarshalByRefObject
    {
        internal int nativeState;

        internal GraphicsState(int nativeState)
        {
            this.nativeState = nativeState;
        }
    }
}


text:
<?php

namespace Concrete\Core\Cookie;

use Concrete\Core\Http\Request;

/**
 * A class that holds operations performed on both request and response cookies.
 *
 * To work only on request cookies, use the Request class.
 * To work only on response cookies, use the ResponseCookieJar class.
 */
class CookieJar
{
    /**
     * The object containing the request cookies.
     *
     * @var \Concrete\Core\Http\Request
     */
    protected $request;

    /**
     * The object containing the response cookies.
     *
     * @var \Concrete\Core\Cookie\ResponseCookieJar
     */
    protected $responseCookies;

    /**
     * Initialize the instance.
     *
     * @param Request $request the object containing the request cookies
     * @param ResponseCookieJar $responseCookies the object containing the response cookies
     */
    public function __construct(Request $request, ResponseCookieJar $responseCookies)
    {
        $this->setRequest($request);
        $this->responseCookies = $responseCookies;
    }

    /**
     * Get the object containing the response cookies.
     *
     * @return \Concrete\Core\Cookie\ResponseCookieJar
     */
    public function getResponseCookies()
    {
        return $this->responseCookies;
    }

    /**
     * Does a cookie exist in the request or response cookies?
     *
     * @param string $name
     *
     * @return bool
     */
    public function has($name)
    {
        if (in_array($name, $this->responseCookies->getClearedCookies(), true)) {
            return false;
        }

        return $this->request->cookies->has($name) || $this->responseCookies->hasCookie($name);
    }

    /**
     * Get the value of a cookie (from response or from request) given its name.
     *
     * @param string $name The key the cookie
     * @param mixed $default The value to return if the cookie isn't set
     *
     * @return mixed
     */
    public function get($name, $default = null)
    {
        $responseCookie = $this->responseCookies->getCookieByName($name);
        if ($responseCookie !== null) {
            return $responseCookie->getValue();
        }
        if (in_array($name, $this->responseCookies->getClearedCookies(), true)) {
            return $default;
        }

        return $this->getRequest()->cookies->get($name, $default);
    }

    /**
     * Get a list of cookie names and values (both from response and from request).
     *
     * @return array array keys are the cookie names, array values are the cookie values
     */
    public function getAll()
    {
        $result = [];
        $clearedRequestCookies = $this->responseCookies->getClearedCookies();
        foreach ($this->request->cookies->all() as $name => $value) {
            if (!in_array($name, $clearedRequestCookies, true)) {
                $result[$name] = $value;
            }
        }
        foreach ($this->responseCookies->getCookies() as $cookie) {
            if ($cookie->getExpiresTime() !== 0 && $cookie->isCleared()) {
                unset($result[$cookie->getName()]);
            } else {
                $result[$cookie->getName()] = $cookie->getValue();
            }
        }

        return $result;
    }

    /**
     * Set the request for this cookie jar.
     *
     * @param \Concrete\Core\Http\Request $request
     */
    public function setRequest(Request $request)
    {
        $this->request = $request;
    }

    /**
     * @deprecated Use ->getResponseCookies()->addCookie() or $app->make(ResponseCookieJar::class)->addCookie()
     *
     * @param string $name
     * @param string|null $value
     * @param int $expire
     * @param string $path
     * @param null|string $domain
     * @param bool $secure
     * @param bool $httpOnly
     *
     * @return \Symfony\Component\HttpFoundation\Cookie
     */
    public function set($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = false, $httpOnly = true)
    {
        return $this->responseCookies->addCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
    }

    /**
     * @deprecated Use ->getResponseCookies()->addCookieObject() or $app->make(ResponseCookieJar::class)->addCookieObject()
     *
     * @param \Symfony\Component\HttpFoundation\Cookie $cookie
     */
    public function add($cookie)
    {
        $this->responseCookies->addCookieObject($cookie);
    }

    /**
     * @deprecated Use ->getResponseCookies()->clear() or $app->make(ResponseCookieJar::class)->clear()
     *
     * @param string $name
     */
    public function clear($name)
    {
        $this->responseCookies->clear($name);
    }

    /**
     * @deprecated Use ->getResponseCookies()->getCookies() or $app->make(ResponseCookieJar::class)->getCookies()
     *
     * @return \Symfony\Component\HttpFoundation\Cookie[]
     */
    public function getCookies()
    {
        return $this->responseCookies->getCookies();
    }

    /**
     * Get the request for this cookie jar.
     *
     * @return \Concrete\Core\Http\Request
     */
    protected function getRequest()
    {
        return $this->request;
    }
}


text:
Ext.define('Shopware.apps.PaymillLogging.store.List', {
    extend:   'Ext.data.Store',
    model:    'Shopware.apps.PaymillLogging.model.Main',
    autoLoad: true,
    pageSize: 32,
    proxy: {
        type: 'ajax',
        url : '{url action=loadStore}',
        reader: {
            type: 'json',
            root: 'data'
        }
    },
    remoteSort: true,
    remoteFilter: true

});


text:
'use strict';

const typesMap = {
    feat: 'Add a new feature',
    fix: 'A bug fix',
    refactor: 'A code change that neither fixes a bug nor adds a feature',
    docs: 'Documentation only changes',
    perf: 'A code change that improves performance',
    test: 'Adding missing tests',
    chore:
        'Changes to the build process or auxiliary tools\n' +
        '            and libraries such as documentation generation.'
};

const types = Object.keys(typesMap).map(key => ({
    value: key,
    name: `${key}:${' '.repeat(10 - key.length - 1)}${typesMap[key]}`
}));

const scopes = ['core', 'meta'];

module.exports = {
    types,
    scopes,
    scopeOverrides: {
        chore: [{ name: 'meta' }]
    },
    allowCustomScopes: false
};


text:
/**
* Connected Vision - https://github.com/ConnectedVision
* MIT License
*/

#ifndef ConnectedVision_Thread_def
#define ConnectedVision_Thread_def

#include <queue>
#include <map>
#include <stdexcept>
#include <boost/chrono.hpp>
#include <boost/chrono/duration.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>

#include <ILogging.h>
#include "ConnectedVision_Exceptions.h"

namespace ConnectedVision {

	/**
	* wrapper timeout exception
	*/
	class timeout_error : public ConnectedVision::runtime_error
	{
	public:
		timeout_error(const std::string& what_arg) : ConnectedVision::runtime_error(what_arg) {}
	};

	/**
	* wrapper exception for lock
	*/
	class mutex_error : public ConnectedVision::logic_error
	{
	public:
		mutex_error(const std::string& what_arg) : ConnectedVision::logic_error(what_arg) {}
	};

	/**
	* ordering error of a strict sequence
	*/
	class sequence_exception : public ConnectedVision::logic_error
	{
	public:
		sequence_exception(
			const std::string& what_arg	///< The string passed as what_arg has the same content as the value returned by member what().
		) : ConnectedVision::logic_error (what_arg) {}
	};

	// TODO: when changing to C++11 switched to std::mutex
	// for now, boost is used
	typedef boost::mutex std__mutex;
	typedef boost::unique_lock<boost::mutex> std__unique_lock;
	typedef boost::condition_variable std__condition_variable;

	typedef boost::timed_mutex mutex;
	class unique_lock
	{
	public:
		static const int mutexTimeout = 100;	// mutex timeout in miliseconds
		unique_lock(ConnectedVision::mutex &mutex) : lock(mutex, boost::chrono::milliseconds(mutexTimeout))
		{
			if ( !(lock) ) throw ConnectedVision::mutex_error("mutex cannot be locked (timeout?)");
		}
		inline bool owns_lock() { return lock.owns_lock(); }

	protected:
		boost::unique_lock<ConnectedVision::mutex> lock;
	};
	typedef unique_lock Lock;

	/**
	* thread-safe wrapper for a strictly increasing data element
	* @thread-safe
	*
	* @note The underlying data type has to have an copy consturctor: T(const T&)
	* @note The underlying data type has to have an assignment operator: =
	* @note The underlying data type has to be orderable with operator: <
	*/
	template<class T>
	class thread_safe_progress
	{
	public:
		/**
		* construct and initialize
		*
		* A thread safe variable must be initialized!
		*/
		thread_safe_progress<T>(
			const T& val	///< initial value
		) : value(val), reset_count(0) {
		}

		/**
		* copy constructor
		*/
		thread_safe_progress<T>(const thread_safe_progress<T>& other) : value(other.get()), reset_count(0) {
		}

		/**
		* assignment
		*/
		thread_safe_progress<T>& operator= (const thread_safe_progress<T>& other) throw(sequence_exception) { this->set( other.get() ); }

		/**
		* assignment is a setter shortcut
		*/
		thread_safe_progress<T>& operator= (const T& val) throw(sequence_exception) { this->set(val); return *this; }

		/**
		* typecast to raw data type is a getter shortcut
		*/
		operator T() const { return this->get(); }

		/**
		* compare value
		*/
		bool operator== (T const& val)
		{
			std__unique_lock lock(this->mutex);
			bool b = (this->value == val);
			return b;
		}

		/**
		* get value (thread safe)
		* @thread-safe
		*/
		T get() const
		{
			std__unique_lock lock(this->mutex);
			T value( this->value );
			return value;
		}

		/**
		* reset value (thread safe)
		* @thread-safe
		*/
		void reset(
			const T& newVal	///< new value
		) {
			std__unique_lock lock(this->mutex);
			if ( newVal < this->value )
				this->reset_count++;
			this->value = newVal;
			this->cond.notify_all();
		}

		/**
		* set value (thread safe)
		* @thread-safe
		*/
		void set(
			const T& newVal	///< new value
		) throw(sequence_exception)
		{
			std__unique_lock lock(this->mutex);
			// test if new value is greater than old one
			if ( newVal < this->value )
				throw sequence_exception("thread_safe_progress::set() progress has to be strictly growing, given value was less than stored value");

			if ( this->value < newVal )
			{
				// update value
				this->value = newVal;
				this->cond.notify_all();
			}
		}

		/**
		* wait for state to be reached (thread safe)
		* @thread-safe
		*
		* This function waits until the internal state has reached or is beond the spezified target state.
		*
		* @return true if state was reached / false on timeout
		*/
		bool wait_until(
			const T& target,			///< state to wait for
			const int64_t timeout = 0	///< timeout in milliseconds (default: wait for ever)
		) const throw(sequence_exception)
		{
			// avoid pitfalls of condition variables
			// see https://www.justsoftwaresolutions.co.uk/threading/condition-variable-spurious-wakes.html
			// for a lamda function introduction
			// see http://blog.smartbear.com/c-plus-plus/c11-tutorial-lambda-expressions-the-nuts-and-bolts-of-functional-programming/

			std__unique_lock lock(this->mutex);
			if ( this->value >= target )
			{
				return true;	// the state is reached already
			}
			auto _reset_count = this->reset_count;
			if ( timeout )
			{
				return this->cond.wait_for(lock, boost::chrono::milliseconds(timeout), [&]() throw(sequence_exception) -> bool
				{
					if ( this->reset_count != _reset_count )
						throw sequence_exception("thread_safe_progress::wait_until() progress was reset while waiting for a given value to be reached");

					return (this->value >= target);
				});
			}
			else
			{
				this->cond.wait(lock, [&]() throw(sequence_exception) -> bool
				{
					if ( this->reset_count != _reset_count )
						throw sequence_exception("thread_safe_progress::wait_until() progress was reset while waiting for a given value to be reached");

					return (this->value >= target);
				});

				return true;	// we have no timeout, so every return means that the state was reached
			}
		}

		/**
		* wait for state to change (thread safe)
		* @thread-safe
		*
		* This function waits while the internal state is equal to the given state.
		*
		* @return true if state was changed / false on timeout
		*/
		bool wait_while(
			const T& state,				///< state to be checked
			const int64_t timeout = 0	///< timeout in milliseconds (default: wait for ever)
		) const
		{
			boost::unique_lock<boost::mutex> lock(this->mutex);
			if ( this->value != state )
			{
				return true;	// the state is changed already
			}
			if ( timeout )
			{
				return this->cond.wait_for(lock, boost::chrono::milliseconds(timeout), [&](){ return (this->value != state); });
			}
			else
			{
				this->cond.wait(lock, [&](){ return (this->value != state); });

				return true;	// we have no timeout, so every return means that the state was changed
			}
		}

		/**
		* wait for state to become a given value (thread safe)
		* @thread-safe
		*
		* This function waits while the internal state is not equal to the given state.
		*
		* @return true if state was changed / false on timeout
		*/
		bool wait_equal(
			const T& state,				///< state to be checked
			const int64_t timeout = 0	///< timeout in milliseconds (default: wait for ever)
		) const
		{
			boost::unique_lock<boost::mutex> lock(this->mutex);
			if ( this->value == state )
			{

				return true;	// the state is already reached
			}
			if ( timeout )
			{
				return this->cond.wait_for(lock, boost::chrono::milliseconds(timeout), [&](){ return (this->value == state); });
			}
			else
			{
				this->cond.wait(lock, [&](){ return (this->value == state); });

				return true;	// we have no timeout, so every return means that the state has been reached
			}
		}

	protected:
		mutable std__condition_variable cond;
		mutable std__mutex mutex;
		T value;
		int reset_count;
	};

	/**
	* thread-safe wrapper for std::queue
	* @thread-safe
	*
	* @note The underlying data type has to have an copy consturctor: T(const T&)
	* @note The underlying data type has to have an assignment operator: =
	*/
	template<class T>
	class thread_safe_queue // : public ConnectedVision::thread_safe_progress<T>
	{
	public:
		typedef boost::unique_lock<boost::mutex> Lock;

		/**
		* default constructor
		*/
		thread_safe_queue()
		{}

		/**
		* size of queue (thread safe)
		* @thread-safe
		*
		* Returns the number of elements in the queue
		*
		* @return number of elements
		*/
		size_t size() const
		{
			std__unique_lock lock(this->mutex);
			return this->q.size();
		}

		/**
		* Test whether container is empty
		*
		* Returns whether the queue is empty: i.e. whether its size is zero.
		*/
		bool empty() const
		{
			std__unique_lock lock(this->mutex);
			return this->q.empty();
		}

		/**
		* Clear content (thread safe)
		* @thread-safe
		*
		* Removes all elements from the queue (which are destroyed), and leaving the queue with a size of 0.
		*/
		void clear()
		{
			std__unique_lock lock(this->mutex);
			while( !this->q.empty() )
			{
				this->q.pop();
			}
		}

		/**
		* Insert element (thread safe)
		* @thread-safe
		*
		* Inserts a new element at the end of the queue, after its current last element. The content of this new element is initialized to val.
		*/
		void push(
			const T& val	///< value to be pushed to queue
		)
		{
			{
				std__unique_lock lock(this->mutex);
				this->q.push(val);
			}

			cond.notify_one();
		}

		/**
		* fetch & pop element from queue (thread safe)
		* @thread-safe
		*
		* Fetches and removes the oldest element from the queue.
		* @throw exception on timeout
		*
		* @return popped value
		*/
		T pop_wait(
			const int64_t timeout = 0	///< timeout in milliseconds (default: wait for ever)
		)
		{
			std__unique_lock lock(this->mutex);

			if ( timeout )
			{
				bool filled = this->cond.wait_for(lock, boost::chrono::milliseconds(timeout), [this](){ return !this->q.empty(); });
				if ( !filled )
					throw timeout_error("pop_wait() timeout");
			}
			else
			{
				this->cond.wait(lock, [this](){ return !this->q.empty(); });
			}

			// fetch and remove element from queue
			T val = std::move(this->q.front());
			this->q.pop();

			return val;
		}

	protected:
		mutable std__mutex mutex;
		mutable std__condition_variable cond;
		std::queue<T> q;
	};

	/**
	* thread-safe wrapper for std::map
	* @thread-safe
	*
	* @note The underlying data type has to have an copy consturctor: T(const T&)
	* @note The underlying data type has to have an assignment operator: =
	*/
	template<class Key, class T>
	class thread_safe_map
	{
	public:
		/**
		* default constructor
		*/
		thread_safe_map()
		{}

		/**
		* size of map (thread safe)
		* @thread-safe
		*
		* Returns the number of elements in the map
		*
		* @return number of elements
		*/
		size_t size() const
		{
			std__unique_lock lock(this->mutex);
			return this->q.size();
		}

		/**
		* get element in map with key k (thread safe)
		* @thread-safe
		*
		* Returns the desired element in the map with key k
		*
		* @return a reference of the queried elements
		*/
		T& at (const Key& k)
		{
			std__unique_lock lock(this->mutex);
			return q.at(k);
		}

		/**
		* get element in map with key k (thread safe)
		* @thread-safe
		*
		* Returns the desired element in the map with key k
		*
		* @return a reference of the queried elements
		*/
		const T& at (const Key& k) const
		{
			std__unique_lock lock(this->mutex);
			return this->q.at(k);
		}

		/**
		* get (and create) element in map with key k and returns a REFERENCE to the element USE THIS FUNCTION WITH CARE!
		* @thread-safe
		*
		* If k matches the key of an element in the container, the function returns a reference to its mapped value.
		*
		* If k does not match the key of any element in the container, the function inserts a new element with that key
		* and returns a reference to its mapped value. Notice that this always increases the container size by one,
		* even if no mapped value is assigned to the element (the element is constructed using its default constructor).
		*
		* A similar member function, map::at, has the same behavior when an element with the key exists,
		* but throws an exception when it does not.
		*
		* @return a reference of the queried elements
		*/
		T operator[] (const Key& k) const
		{
			std__unique_lock lock(this->mutex);
			return this->q[k];
		}

		/**
		* insert element into map (thread safe)
		* @thread-safe
		*
		* insert element in the map with key k
		*
		* @param val Value to be copied to (or moved as) the inserted element. Member type T is the type of the elements in the container, defined in map as pair<const Key,T>
		*/
		void insert (const std::pair<Key,T>& val)
		{
			std__unique_lock lock(this->mutex);
			auto ret = this->q.insert(val);
			if ( !ret.second )
			{
				throw std::out_of_range("key already in use");
			}
		}

		/**
		* erases an element of map (thread safe)
		* @thread-safe
		*
		* erases an element of the map with key k
		*
		* @param Key of the element to be removed from the map. Member type Key is the type of the elements in the container, defined in map as an alias of its first template parameter (the key).
		*/
		void erase (const Key& k)
		{
			T item;
			{
				std__unique_lock lock(this->mutex);
				auto it = this->q.find(k);
				if ( it != this->q.end() )
				{
					// move element to local copy
					item = std::move(it->second);
					// delete element from map
					this->q.erase(it);
				}
				// exit scope -> unlock mutex
			}
			// clear local copy (item) when exiting scope
		}

		/**
		* erases an element of map if it is identical to the given item (thread safe)
		* @thread-safe
		*
		* erases an element of the map with key k
		*
		* @param k		Key of the element to be removed from the map. Member type Key is the type of the elements in the container,
		* defined in map as an alias of its first template parameter (the key).
		* @param target	actual item for comparison
		*/
		void erase (const Key& k, const T& target)
		{
			T item;
			{
				std__unique_lock lock(this->mutex);
				auto it = this->q.find(k);
				if ( it != this->q.end() && it->second == target )
				{
					// move element to local copy
					item = std::move(it->second);
					// delete element from map
					this->q.erase(it);
				}
				// exit scope -> unlock mutex
			}
			// clear local copy (item) when exiting scope
		}

		/**
		* Removes all elements from the map container (which are destroyed), leaving the container with a size of 0.
		* @thread-safe
		*/
		void clear ()
		{
			std::map<Key,T> localMap;
			{
				std__unique_lock lock(this->mutex);
				// move elements to local map to avoid potential problems with <T> destructor (e.g. shared pointers -> dead lock due to recursive mutex locking)
				localMap.swap( this->q );
				// exit scope -> unlock mutex
			}
			// clear local map after unlocking mutex
			localMap.clear();
		}

		/**
		* inserts or updates an element of map (thread safe) - insert if no element with key k is present, otherwise updates
		* @thread-safe
		*
		* inserts or updates an element of the map with key k
		*
		* @param val Value to be inserted or updated. Member type T is the type of the elements in the container, defined in map as pair<const Key,T>
		*/
		void insertUpdate (const std::pair<Key,T>& val)
		{
			std__unique_lock lock(this->mutex);
			typename std::map<Key,T>::iterator it = this->q.find(val.first);
			if (it != this->q.end()) // found
			{
				it->second = val.second;
			}
			else // not found
			{
				this->q.insert(val);
			}
		}

		/**
		* applies a filtering function to the whole map and returns a list of matched return values
		* @thread-safe
		*
		* @param filterFunction	function that is applied to each item of the map
		*							function signature: id_t filterFunction(T &item)
		* @param nullValue		if the filterFunction returns the nullValue, it will not be added to the list
		*
		* @return vector of matched return values
		*/
		std::vector<id_t> filter(std::function<id_t (const T&)> filterFunction, id_t nullValue = NULL) // TODO replace id_t with template type
		{
			std::vector<id_t>	results;
			std__unique_lock lock(this->mutex);
			typedef typename std::map<Key,T>::iterator MapIterator;
			for (MapIterator it = this->q.begin(); it != this->q.end(); ++it)
			{
				T& item = it->second;
				id_t value = filterFunction(item);
				if ( value != nullValue )
					results.push_back(value);
			}
			return results;
		}

	protected:
		mutable std__mutex mutex;
		mutable std__condition_variable cond;
		std::map<Key,T> q;
	};

} // namespace scope

#endif // ConnectedVision_Thread_def


text:
namespace ChilliSource
{
	namespace Rendering
	{
		//-----------------------------------------------------------------------
		/// A component for rendering a single instance of a particle effect.
		///
		/// @author Ian Copland
		//-----------------------------------------------------------------------
		class ParticleEffectComponent final : public RenderComponent
		{
		public:
			CS_DECLARE_NAMEDTYPE(ParticleEffectComponent);
			//----------------------------------------------------------------
			/// The different possible playback types used to play the particle
			/// effect.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			enum class PlaybackType
			{
				k_once,
				k_looping
			};
			//----------------------------------------------------------------
			/// A delegate used for particle related event such as the effect
			/// completed event.
			///
			/// @author Ian Copland
			///
			/// @param The particle effect component the event related to.
			//----------------------------------------------------------------
			using Delegate = std::function<void(ParticleEffectComponent*)>;
			//----------------------------------------------------------------
			/// Constructor.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			ParticleEffectComponent() = default;
			//----------------------------------------------------------------
			/// Constructor. Creates a particle effect component using the
			/// parameters described in the given particle effect.
			///
			/// @author Ian Copland
			///
			/// @param The particle effect.
			//----------------------------------------------------------------
			ParticleEffectComponent(const ParticleEffectCSPtr& in_particleEffect);
			//----------------------------------------------------------------
			/// Allows querying of whether or not this implements the interface
			/// described by the given Id.
			///
			/// @author Ian Copland
			///
			/// @param The interface Id.
			///
			/// @return Whether or not the interface is implemented.
			//----------------------------------------------------------------
			bool IsA(Core::InterfaceIDType in_interfaceId) const override;
			//----------------------------------------------------------------
			/// Returns the current particle effect.
			///
			/// This is not thread-safe and should only be called on the main
			/// thread.
			///
			/// @author Ian Copland
			///
			/// @return The particle effect.
			//----------------------------------------------------------------
			ParticleEffectCSPtr GetParticleEffect() const;
			//----------------------------------------------------------------
			/// Returns the current playback type.
			///
			/// This is not thread-safe and should only be called on the main
			/// thread.
			///
			/// @author Ian Copland
			///
			/// @return The playback type.
			//----------------------------------------------------------------
			PlaybackType GetPlaybackType() const;
			//----------------------------------------------------------------
			/// Returns whether or not the particle effect is currently playing.
			/// This will return true if the particle effect is no longer
			/// emitting but particles are still alive.
			///
			/// This is not thread-safe and should only be called on the main
			/// thread.
			///
			/// @author Ian Copland
			///
			/// @return Whether or not the particle effect is currently playing.
			//----------------------------------------------------------------
			bool IsPlaying() const;
			//----------------------------------------------------------------
			/// Returns whether or not the particle effect is currently
			/// emitting.
			///
			/// This is not thread-safe and should only be called on the main
			/// thread.
			///
			/// @author Ian Copland
			///
			/// @return whether or not the particle effect is currently
			/// emitting.
			//----------------------------------------------------------------
			bool IsEmitting() const;
			//----------------------------------------------------------------
			/// @author Ian Copland
			///
			/// @return The world space AABB of the effect.
			//----------------------------------------------------------------
			const Core::AABB& GetAABB() override;
			//----------------------------------------------------------------
			/// @author Ian Copland
			///
			/// @return The world space OBB of the effect.
			//----------------------------------------------------------------
			const Core::OOBB& GetOOBB() override;
			//----------------------------------------------------------------
			/// @author Ian Copland
			///
			/// @param The world space bounding sphere of the effect.
			//----------------------------------------------------------------
			const Core::Sphere& GetBoundingSphere() override;
			//----------------------------------------------------------------
			/// Sets a new particle effect for the component to play. If the
			/// component was playing, it will start playing the new effect
			/// from the beginning. Any existing particles will be removed from
			/// the scene.
			///
			/// This is not thread-safe and should only be called on the main
			/// thread.
			///
			/// @author Ian Copland
			///
			/// @param The particle effect that this should playback.
			//----------------------------------------------------------------
			void SetParticleEffect(const ParticleEffectCSPtr& in_particleEffect);
			//----------------------------------------------------------------
			/// Sets the playback mode that should be used when playing this
			/// particle effect.
			///
			/// This is not thread-safe and should only be called on the main
			/// thread.
			///
			/// @author Ian Copland
			///
			/// @param The playback type.
			//----------------------------------------------------------------
			void SetPlaybackType(PlaybackType in_playbackType);
			//----------------------------------------------------------------
			/// Starts the particle effect playing.
			///
			/// This is not thread-safe and should only be called on the main
			/// thread.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void Play();
			//----------------------------------------------------------------
			/// Stops the particle effect playing and removes all existing
			/// particles.
			///
			/// This is not thread-safe and should only be called on the main
			/// thread.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void Stop();
			//----------------------------------------------------------------
			/// Stops the particle effect emitting. Existing particles will
			/// continue their life cycle. The stopped event will be sent when
			/// all remaining particles are inactive.
			///
			/// This is not thread-safe and should only be called on the main
			/// thread.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void StopEmitting();
			//----------------------------------------------------------------
			/// Returns an event that will be fired when a particle effect
			/// fully completes, i.e the effect has finished emitting and
			/// there are no particles left alive.
			///
			/// This is not thread-safe and should only be called on the main
			/// thread.
			///
			/// @author Ian Copland
			///
			/// @return The event.
			//----------------------------------------------------------------
			Core::IConnectableEvent<Delegate>& GetFinishedEvent();
			//----------------------------------------------------------------
			/// Returns an event that will be fired when the particle effect
			/// finishes emitting. Particles may still be alive when this event
			/// is called.
			///
			/// This is not thread-safe and should only be called on the main
			/// thread.
			///
			/// @author Ian Copland
			///
			/// @return The event.
			//----------------------------------------------------------------
			Core::IConnectableEvent<Delegate>& GetFinishedEmittingEvent();
			//----------------------------------------------------------------
			/// Destructor
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			~ParticleEffectComponent() {};
		private:
			//----------------------------------------------------------------
			/// An enum describing the current playback state of the particle
			/// effect.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			enum class PlaybackState
			{
				k_notPlaying,
				k_starting,
				k_playing,
				k_stopping
			};
			//----------------------------------------------------------------
			/// Sets up the particle effect, ready to be played.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void PrepareParticleEffect();
			//----------------------------------------------------------------
			/// Cleans up the particle effect, deleting all particles.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void CleanupParticleEffect();
			//----------------------------------------------------------------
			/// Takes the calculated local bounds of the particle effect and
			/// stores them for later calculating the world bounds.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void StoreLocalBoundingShapes();
			//----------------------------------------------------------------
			/// Re-calculates the world space bounding shapes if the bounding
			/// shape cache has been invalidated.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void UpdateWorldBoundingShapes();
			//----------------------------------------------------------------
			/// Called when this is added to an entity.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void OnAddedToEntity() override;
			//----------------------------------------------------------------
			/// Called either when this is added to an entity that is already
			/// in the scene, or when the entity this is already added to is
			/// added to the scene. This will start the effect playing.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void OnAddedToScene() override;
			//----------------------------------------------------------------
			/// Called every frame the particle effect is in the scene. This
			/// will update depending on the current playback state of the
			/// effect.
			///
			/// @author Ian Copland
			///
			/// @param The delta time.
			//----------------------------------------------------------------
			void OnUpdate(f32 in_deltaTime) override;
			//----------------------------------------------------------------
			/// Updates while the particle effect is starting. This will wait
			/// until an appropriate time to send a background task to initialise
			/// the particles and start updating.
			///
			/// @author Ian Copland
			///
			/// @param The delta time.
			//----------------------------------------------------------------
			void UpdateStartingState(f32 in_deltaTime);
			//----------------------------------------------------------------
			/// This will fire off a new particle update background task.
			///
			/// @author Ian Copland
			///
			/// @param The delta time.
			//----------------------------------------------------------------
			void UpdatePlayingState(f32 in_deltaTime);
			//----------------------------------------------------------------
			/// This waits for all activate particles effects to finish then
			/// will end the effect.
			///
			/// @author Ian Copland
			///
			/// @param The delta time.
			//----------------------------------------------------------------
			void UpdateStoppingState(f32 in_deltaTime);
			//----------------------------------------------------------------
			/// Called when the component should render all particles.
			///
			/// @author Ian Copland
			///
			/// @param The render system.
			/// @param The active camera component.
			/// @param The current shader pass.
			//----------------------------------------------------------------
			void Render(RenderSystem* in_renderSystem, CameraComponent* in_camera, ShaderPass in_shaderPass) override;
			//----------------------------------------------------------------
			/// Called when the component should render to the shadow map.
			/// Particles will never render to the shadow map so this does
			/// nothing.
			///
			/// @author Ian Copland
			///
			/// @param The render system.
			/// @param The active camera component.
			/// @param The material to render static shadows with.
			/// @param The material to render skinned shadows with.
			//----------------------------------------------------------------
			void RenderShadowMap(RenderSystem* in_renderSystem, CameraComponent* in_camera, const MaterialCSPtr& in_staticShadowMat, const MaterialCSPtr& in_animShadowMat) override {};
			//----------------------------------------------------------------
			/// Called when the entities transform changes. This invalidates
			/// the bounding shape cache.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void OnEntityTransformChanged();
			//----------------------------------------------------------------
			/// Called either when this is removed from an entity that is
			/// attached to the scene or when an entity this is attached to is
			/// removed from the scene. This will stop the particle effect
			/// playing and reset all active particles.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void OnRemovedFromScene() override;
			//----------------------------------------------------------------
			/// Called when this is removed from an entity.
			///
			/// @author Ian Copland
			//----------------------------------------------------------------
			void OnRemovedFromEntity() override;

			ParticleEffectCSPtr m_particleEffect;
			ParticleDrawableUPtr m_drawable;
			ParticleEmitterSPtr m_emitter;
			std::vector<ParticleAffectorSPtr> m_affectors;
			std::shared_ptr<Core::dynamic_array<Particle>> m_particleArray;
			ConcurrentParticleDataSPtr m_concurrentParticleData;

			PlaybackType m_playbackType = PlaybackType::k_once;
			PlaybackState m_playbackState = PlaybackState::k_notPlaying;
			f32 m_playbackTimer = 0.0f;
			f32 m_accumulatedDeltaTime = 0.0f;
			Core::Event<Delegate> m_finishedEvent;
			Core::Event<Delegate> m_finishedEmittingEvent;
			bool m_firstFrame = false;

			Core::AABB m_localAABB;
			Core::Sphere m_localBoundingSphere;
			bool m_invalidateBoundingShapeCache = true;
			Core::EventConnectionUPtr m_entityTransformConnection;
		};
	}
}

#endif


text:
package com.mapswithme.util.sharing;

import android.app.Activity;

import com.mapswithme.maps.Framework;
import com.mapswithme.maps.R;
import com.mapswithme.maps.bookmarks.data.MapObject;
import com.mapswithme.util.statistics.Statistics;

public class MapObjectShareable extends BaseShareable
{
  protected final MapObject mMapObject;

  public MapObjectShareable(Activity context, MapObject mapObject)
  {
    super(context);
    mMapObject = mapObject;

    final Activity activity = getActivity();
    final String ge0Url = Framework.nativeGetGe0Url(mMapObject.getLat(), mMapObject.getLon(), mMapObject.getScale(), mMapObject.getName());
    final String httpUrl = Framework.getHttpGe0Url(mMapObject.getLat(), mMapObject.getLon(), mMapObject.getScale(), mMapObject.getName());
    final String address = Framework.nativeGetNameAndAddress4Point(mMapObject.getLat(), mMapObject.getLon());
    final int textId = mMapObject.getType() == MapObject.MapObjectType.MY_POSITION ?
        R.string.my_position_share_email : R.string.bookmark_share_email;
    final int subjectId = mMapObject.getType() == MapObject.MapObjectType.MY_POSITION ?
        R.string.my_position_share_email_subject : R.string.bookmark_share_email_subject;

    setText(activity.getString(textId, address, ge0Url, httpUrl));
    setSubject(activity.getString(subjectId));
  }

  @Override
  public void share(SharingTarget target)
  {
    super.share(target);
    Statistics.INSTANCE.trackPlaceShared(target.name);
  }

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


text:
<?php

namespace Magento\CatalogInventory\Observer;

use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Event\ObserverInterface;

class ReindexQuoteInventoryObserver implements ObserverInterface
{
    /**
     * @var \Magento\CatalogInventory\Model\Indexer\Stock\Processor
     */
    protected $stockIndexerProcessor;

    /**
     * @var \Magento\Catalog\Model\Indexer\Product\Price\Processor
     */
    protected $priceIndexer;

    /**
     * @var \Magento\CatalogInventory\Observer\ItemsForReindex
     */
    protected $itemsForReindex;

    /**
     * @param \Magento\CatalogInventory\Model\Indexer\Stock\Processor $stockIndexerProcessor
     * @param \Magento\Catalog\Model\Indexer\Product\Price\Processor $priceIndexer
     * @param ItemsForReindex $itemsForReindex
     */
    public function __construct(
        \Magento\CatalogInventory\Model\Indexer\Stock\Processor $stockIndexerProcessor,
        \Magento\Catalog\Model\Indexer\Product\Price\Processor $priceIndexer,
        ItemsForReindex $itemsForReindex
    ) {
        $this->stockIndexerProcessor = $stockIndexerProcessor;
        $this->priceIndexer = $priceIndexer;
        $this->itemsForReindex = $itemsForReindex;
    }

    /**
     * Refresh stock index for specific stock items after successful order placement
     *
     * @param EventObserver $observer
     * @return void
     */
    public function execute(EventObserver $observer)
    {
        // Reindex quote ids
        $quote = $observer->getEvent()->getQuote();
        $productIds = [];
        foreach ($quote->getAllItems() as $item) {
            $productIds[$item->getProductId()] = $item->getProductId();
            $children = $item->getChildrenItems();
            if ($children) {
                foreach ($children as $childItem) {
                    $productIds[$childItem->getProductId()] = $childItem->getProductId();
                }
            }
        }

        if ($productIds) {
            $this->stockIndexerProcessor->reindexList($productIds);
        }

        // Reindex previously remembered items
        $productIds = [];
        foreach ($this->itemsForReindex->getItems() as $item) {
            $item->save();
            $productIds[] = $item->getProductId();
        }

        if (!empty($productIds)) {
            $this->priceIndexer->reindexList($productIds);
        }

        $this->itemsForReindex ->clear();
        // Clear list of remembered items - we don't need it anymore
    }
}


text:
package nl.topicus.spanner.converter.data;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Logger;

import nl.topicus.spanner.converter.cfg.ConverterConfiguration;

public class UploadWorker extends AbstractTablePartWorker
{
	private static final Logger log = Logger.getLogger(UploadWorker.class.getName());

	private String selectFormat;

	private Columns selectCols;

	private long beginOffset;

	private int batchSize;

	private final long numberOfRecordsToCopy;

	UploadWorker(String name, ConverterConfiguration config, String selectFormat, String sourceTable,
			String destinationTable, Columns insertCols, Columns selectCols, long beginOffset,
			long numberOfRecordsToCopy, int batchSize)
	{
		super(config, sourceTable, destinationTable, insertCols);
		this.selectFormat = selectFormat;
		this.selectCols = selectCols;
		this.beginOffset = beginOffset;
		this.numberOfRecordsToCopy = numberOfRecordsToCopy;
		this.batchSize = batchSize;
	}

	@Override
	public void run() throws SQLException
	{
		try (Connection destination = DriverManager.getConnection(config.getUrlDestination());
				Connection source = DriverManager.getConnection(config.getUrlSource()))
		{
			log.fine(sourceTable + ": Starting copying " + numberOfRecordsToCopy + " records");
			destination.setAutoCommit(false);

			long lastRecord = beginOffset + numberOfRecordsToCopy;
			long currentOffset = beginOffset;
			PreparedStatement insertStatement = createInsertStatement(destination);
			while (true)
			{
				long limit = Math.min(batchSize, lastRecord - currentOffset);
				String select = selectFormat.replace("$COLUMNS", selectCols.getColumnNames());
				select = select.replace("$TABLE", sourceTable);
				select = select.replace("$PRIMARY_KEY", selectCols.getPrimaryKeyColumns());
				select = select.replace("$BATCH_SIZE", String.valueOf(limit));
				select = select.replace("$OFFSET", String.valueOf(currentOffset));
				try (ResultSet rs = source.createStatement().executeQuery(select))
				{
					copyResultSet(rs, insertStatement);
				}
				catch (SQLException e)
				{
					setException(e);
					throw e;
				}
				destination.commit();
				log.info(sourceTable + ": Records copied so far: " + getRecordCount() + " of " + numberOfRecordsToCopy);
				currentOffset = currentOffset + batchSize;
				if (getRecordCount() >= numberOfRecordsToCopy)
					break;
			}
		}
		catch (SQLException e)
		{
			setException(e);
			throw e;
		}
		log.fine(sourceTable + ": Finished copying " + getRecordCount() + " records");
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.coko.mdk3" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".SplashActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity"
            android:label="@string/title_main_activity" >
        </activity>
        <activity
            android:name=".LoginActivity"
            android:label="@string/title_activity_login" >
        </activity>
        <activity
            android:name=".SignUpActivity"
            android:label="@string/title_activity_sign_up" >
        </activity>
        <activity
            android:name=".ElectionScheduleActivity"
            android:label="@string/title_activity_election_schedule"
            android:parentActivityName=".MainActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity" />
        </activity>
        <activity
            android:name=".DetailPartaiActivity"
            android:label="@string/title_activity_detail_partai" >
        </activity>
        <activity
            android:name=".ScheduleDetailActivity"
            android:label="@string/title_activity_schedule_detail" >
        </activity>
    </application>

</manifest>


text:
//
//  IPIMasonryViewController.m
//  ZJSDemoProjection
//
//  Created by robert on 16/3/16.
//  Copyright © 2016年 zjs. All rights reserved.
//

#import "IPIMasonryViewController.h"
#import <Masonry/Masonry.h>
#import "UIColor+HexColor.h"

@interface IPIMasonryViewController ()

@property (nonatomic, strong) UIView *view1;
@property (nonatomic, strong) UIView *view2;

@end

@implementation IPIMasonryViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.view.backgroundColor = [UIColor colorWithHexString:@"ffffff"];

//  [self.view addSubview:self.view1];
    [self.view addSubview:self.view2];

}

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

#pragma mark setter and Getter

//普通的
-(UIView *)view1{

    if (!_view1) {

        _view1 = [[UIView alloc] init];
        _view1.translatesAutoresizingMaskIntoConstraints = NO;
        _view1.backgroundColor = [UIColor greenColor];
        [self.view addSubview:_view1];

        UIEdgeInsets padding = UIEdgeInsetsMake(10, 10, 10, 10);

        [self.view addConstraints:@[

                                    //view1 constraints
                                    [NSLayoutConstraint constraintWithItem:_view1
                                                                 attribute:NSLayoutAttributeTop
                                                                 relatedBy:NSLayoutRelationEqual
                                                                    toItem:self.view
                                                                 attribute:NSLayoutAttributeTop
                                                                multiplier:1.0
                                                                  constant:padding.top],

                                    [NSLayoutConstraint constraintWithItem:_view1
                                                                 attribute:NSLayoutAttributeLeft
                                                                 relatedBy:NSLayoutRelationEqual
                                                                    toItem:self.view
                                                                 attribute:NSLayoutAttributeLeft
                                                                multiplier:1.0
                                                                  constant:padding.left],

                                    [NSLayoutConstraint constraintWithItem:_view1
                                                                 attribute:NSLayoutAttributeBottom
                                                                 relatedBy:NSLayoutRelationEqual
                                                                    toItem:self.view
                                                                 attribute:NSLayoutAttributeBottom
                                                                multiplier:1.0
                                                                  constant:-padding.bottom],

                                    [NSLayoutConstraint constraintWithItem:_view1
                                                                 attribute:NSLayoutAttributeRight
                                                                 relatedBy:NSLayoutRelationEqual
                                                                    toItem:self.view
                                                                 attribute:NSLayoutAttributeRight
                                                                multiplier:1
                                                                  constant:-padding.right],

                                    ]];

    }

    return _view1;
}

- (UIView *)view2{

    if (!_view2) {
        //

        UIEdgeInsets padding = UIEdgeInsetsMake(20, 20, 20, 20);

        _view2 = [[UIView alloc] init];
        _view2.backgroundColor = [UIColor redColor];
        [self.view addSubview:_view2];

        [_view2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view).width.insets(padding);
        }];

    }

    return _view2;
}

/*
#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.b3log.symphony.service;

import javax.inject.Inject;
import org.b3log.latke.Keys;
import org.b3log.latke.logging.Level;
import org.b3log.latke.logging.Logger;
import org.b3log.latke.repository.FilterOperator;
import org.b3log.latke.repository.PropertyFilter;
import org.b3log.latke.repository.Query;
import org.b3log.latke.service.annotation.Service;
import org.b3log.symphony.model.Verifycode;
import org.b3log.symphony.repository.VerifycodeRepository;
import org.json.JSONArray;
import org.json.JSONObject;

/**
 * Verifycode query service.
 *
 * @author Liang Ding
 * @version 1.1.0.0, Jul 3, 2015
 * @since 1.3.0
 */
@Service
public class VerifycodeQueryService {

    /**
     * Logger.
     */
    private static final Logger LOGGER = Logger.getLogger(VerifycodeQueryService.class.getName());

    /**
     * Verifycode repository.
     */
    @Inject
    private VerifycodeRepository verifycodeRepository;

    /**
     * Gets a verifycode with the specified code.
     *
     * @param code the specified code
     * @return verifycode, returns {@code null} if not found
     */
    public JSONObject getVerifycode(final String code) {
        final Query query = new Query().setFilter(new PropertyFilter(Verifycode.CODE, FilterOperator.EQUAL, code));

        try {
            final JSONObject result = verifycodeRepository.get(query);
            final JSONArray codes = result.optJSONArray(Keys.RESULTS);
            if (0 == codes.length()) {
                return null;
            }

            return codes.optJSONObject(0);
        } catch (final Exception e) {
            LOGGER.log(Level.ERROR, "Gets verifycode error", e);

            return null;
        }
    }
}


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

package app.metatron.discovery.query.druid.funtions;

import org.apache.commons.lang3.StringUtils;

import app.metatron.discovery.util.PolarisUtils;

public class TimestampFunc {

  private static final String FUNC_NAME = "timestamp";

  String field;

  String format;

  String timezone;

  String locale;

  public TimestampFunc(String field, String format, String timezone, String locale) {

    this.field = field;

    this.format = StringUtils.isEmpty(format) ? "yyyy-MM-dd HH:mm:ss" : format;
    this.timezone = StringUtils.isEmpty(timezone) ? "UTC" : timezone;
    this.locale = StringUtils.isEmpty(locale) ? "en" : locale;
  }

  public String toExpression() {
    StringBuilder sb = new StringBuilder();
    sb.append(FUNC_NAME).append("(\"");
    sb.append(field);
    sb.append("\",").append("format=").append("'").append(PolarisUtils.escapeTimeFormatChars(format)).append("'");
    sb.append(",").append("locale=").append("'").append(locale).append("'");
    sb.append(",").append("timezone=").append("'").append(timezone).append("'");
    sb.append(")");
    return sb.toString();
  }
}


text:
namespace ash {

// Used for histograms. See tools/metrics/histograms/enums.xml
// BackGestureStartScenarioType.
enum class BackGestureStartScenarioType {
  kNonSnappedWindow = 0,
  kLeftSnappedWindow,
  kRightSnappedWindow,
  kTopSnappedWindow,
  kBottomSnappedWindow,
  kOverview,
  kLeftOverview,
  kRightOverview,
  kTopOverview,
  kBottomOverview,
  kMaxValue = kBottomOverview,
};

// Helper function to get the start scenario type for RecordStartScenarioType.
BackGestureStartScenarioType GetStartScenarioType(
    bool dragged_from_splitview_divider,
    const gfx::Point& start_screen_location);
void RecordStartScenarioType(BackGestureStartScenarioType type);

// Used for histograms. See tools/metrics/histograms/enums.xml
// BackGestureEndScenarioType.
enum class BackGestureEndScenarioType {
  kNonSnappedWindowAbort = 0,
  kNonSnappedWindowGoBack,
  kNonSnappedWindowMinimize,
  kLeftSnappedWindowAbort,
  kLeftSnappedWindowGoBack,
  kLeftSnappedWindowMinimize,
  kRightSnappedWindowAbort,
  kRightSnappedWindowGoBack,
  kRightSnappedWindowMinimize,
  kTopSnappedWindowAbort,
  kTopSnappedWindowGoBack,
  kTopSnappedWindowMinimize,
  kBottomSnappedWindowAbort,
  kBottomSnappedWindowGoBack,
  kBottomSnappedWindowMinimize,
  kOverviewAbort,
  kOverviewGoBack,
  kExitFullscreen,
  kShowShelfAndHotseat,
  kMaxValue = kShowShelfAndHotseat,
};

// The end type of back gesture. Used to get the end scenario type.
enum class BackGestureEndType { kBack = 0, kAbort, kMinimize };

// Helper function to get the end scenario type for RecordEndScenarioType.
BackGestureEndScenarioType GetEndScenarioType(
    BackGestureStartScenarioType start_type,
    BackGestureEndType end_type);
void RecordEndScenarioType(BackGestureEndScenarioType type);

// Used for histograms. See tools/metrics/histograms/enums.xml
// BackGestureUnderneathWindowType.
enum class BackGestureUnderneathWindowType {
  kBrowser = 0,
  kChromeApp,
  kArcApp,
  kOverview,
  kOthers,
  kMaxValue = kOthers,
};

// Helper function to get the underneath window type for
// RecordUnderneathWindowType.
BackGestureUnderneathWindowType GetUnderneathWindowType(
    BackGestureStartScenarioType start_type);
void RecordUnderneathWindowType(BackGestureUnderneathWindowType type);

}  // namespace ash

#endif  // ASH_WM_GESTURES_BACK_GESTURE_BACK_GESTURE_METRICS_H_


text:
package com.streamsets.pipeline.lib.kafka;

import com.streamsets.pipeline.api.Stage;
import com.streamsets.pipeline.lib.kafka.connection.KafkaSecurityConfig;
import com.streamsets.pipeline.lib.kafka.connection.KafkaSecurityOptions;
import com.streamsets.pipeline.lib.kafka.connection.KeystoreTypes;
import com.streamsets.pipeline.lib.kafka.connection.SaslMechanisms;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;

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

public class TestSecuriityUtil {

  private static final String KRB_SERVICE_NAME = "sasl.kerberos.service.name";
  private static final String KRB_SERVICE_NAME_TEST = "sasl.kerberos.service.name.test";
  private static final String TRUSTSTORE_LOCATION = "ssl.truststore.location";
  private static final String TRUSTSTORE_LOCATION_TEST = "ssl.truststore.location.test";
  private static final String TRUSTSTORE_PASSWORD = "ssl.truststore.password";
  private static final String TRUSTSTORE_PASSWORD_TEST = "ssl.truststore.password.test";
  private static final String TRUSTSTORE_TYPE = "ssl.truststore.type";
  private static final KeystoreTypes TRUSTSTORE_TYPE_TEST = KeystoreTypes.JKS;
  private static final String KEYSTORE_LOCATION = "ssl.keystore.location";
  private static final String KEYSTORE_LOCATION_TEST = "ssl.keystore.location.test";
  private static final String KEYSTORE_PASSWORD = "ssl.keystore.password";
  private static final String KEYSTORE_PASSWORD_TEST = "ssl.keystore.password.test";
  private static final String KEY_PASSWORD = "ssl.key.password";
  private static final String KEY_PASSWORD_TEST = "ssl.key.password.test";
  private static final String KEYSTORE_TYPE = "ssl.keystore.type";
  private static final KeystoreTypes KEYSTORE_TYPE_TEST = KeystoreTypes.JKS;
  private static final String ENABLED_PROTOCOLS = "ssl.enabled.protocols";
  private static final String ENABLED_PROTOCOLS_TEST = "ssl.enabled.protocols.test";
  private static final String SECURITY_PROTOCOL = "security.protocol";
  private static final String SECURITY_PROTOCOL_TEST = "security.protocol.test";
  private static final String SASL_MECHANISM = "sasl.mechanism";
  private static final String GSSAPI = "GSSAPI";

  private KafkaSecurityConfig securityConfig;
  private Map<String, String> configMap;
  private Map<String, String> additionalPropeties;
  private List<Stage.ConfigIssue> issues;
  private Stage.Context context;

  @Before
  public void setUp() {
    securityConfig = new KafkaSecurityConfig();
    securityConfig.kerberosServiceName = KRB_SERVICE_NAME_TEST;
    securityConfig.truststoreFile = TRUSTSTORE_LOCATION_TEST;
    securityConfig.truststorePassword = () -> TRUSTSTORE_PASSWORD_TEST;
    securityConfig.truststoreType = KeystoreTypes.JKS;
    securityConfig.keystoreFile = KEYSTORE_LOCATION_TEST;
    securityConfig.keystorePassword = () -> KEYSTORE_PASSWORD_TEST;
    securityConfig.keyPassword = () -> KEY_PASSWORD_TEST;
    securityConfig.keystoreType = KeystoreTypes.JKS;
    securityConfig.enabledProtocols = ENABLED_PROTOCOLS_TEST;
    configMap = new HashMap<>();
    additionalPropeties = new HashMap<>();
    issues = new ArrayList<>();
    context = Mockito.mock(Stage.Context.class);
  }

  @Test
  public void testAddSecurityConfigsPlaintext() {
    securityConfig.securityOption = KafkaSecurityOptions.PLAINTEXT;
    KafkaSecurityUtil.addSecurityConfigs(securityConfig, configMap, false);
    Assert.assertEquals(1, configMap.size());
    Assert.assertNotNull(configMap.get(SECURITY_PROTOCOL));
    Assert.assertEquals(KafkaSecurityOptions.PLAINTEXT.getProtocol(), configMap.get(SECURITY_PROTOCOL));
  }

  @Test
  public void testAddSecurityConfigsSsl() {
    securityConfig.securityOption = KafkaSecurityOptions.SSL;
    KafkaSecurityUtil.addSecurityConfigs(securityConfig, configMap, false);
    Assert.assertEquals(5, configMap.size());
    Assert.assertNotNull(configMap.get(SECURITY_PROTOCOL));
    Assert.assertEquals(KafkaSecurityOptions.SSL.getProtocol(), configMap.get(SECURITY_PROTOCOL));
    Assert.assertNotNull(configMap.get(ENABLED_PROTOCOLS));
    Assert.assertEquals(configMap.get(ENABLED_PROTOCOLS), ENABLED_PROTOCOLS_TEST);
    Assert.assertNotNull(configMap.get(TRUSTSTORE_LOCATION));
    Assert.assertEquals(configMap.get(TRUSTSTORE_LOCATION), TRUSTSTORE_LOCATION_TEST);
    Assert.assertNotNull(configMap.get(TRUSTSTORE_PASSWORD));
    Assert.assertEquals(configMap.get(TRUSTSTORE_PASSWORD), TRUSTSTORE_PASSWORD_TEST);
    Assert.assertNotNull(configMap.get(TRUSTSTORE_TYPE));
    Assert.assertEquals(configMap.get(TRUSTSTORE_TYPE), TRUSTSTORE_TYPE_TEST.name());
  }

  @Test
  public void testAddSecurityConfigsSslAuth() {
    securityConfig.securityOption = KafkaSecurityOptions.SSL_AUTH;
    KafkaSecurityUtil.addSecurityConfigs(securityConfig, configMap, false);
    Assert.assertEquals(9, configMap.size());
    Assert.assertNotNull(configMap.get(SECURITY_PROTOCOL));
    Assert.assertEquals(KafkaSecurityOptions.SSL_AUTH.getProtocol(), configMap.get(SECURITY_PROTOCOL));
    Assert.assertNotNull(configMap.get(ENABLED_PROTOCOLS));
    Assert.assertEquals(configMap.get(ENABLED_PROTOCOLS), ENABLED_PROTOCOLS_TEST);
    Assert.assertNotNull(configMap.get(TRUSTSTORE_LOCATION));
    Assert.assertEquals(configMap.get(TRUSTSTORE_LOCATION), TRUSTSTORE_LOCATION_TEST);
    Assert.assertNotNull(configMap.get(TRUSTSTORE_PASSWORD));
    Assert.assertEquals(configMap.get(TRUSTSTORE_PASSWORD), TRUSTSTORE_PASSWORD_TEST);
    Assert.assertNotNull(configMap.get(TRUSTSTORE_TYPE));
    Assert.assertEquals(configMap.get(TRUSTSTORE_TYPE), TRUSTSTORE_TYPE_TEST.name());
    Assert.assertNotNull(configMap.get(KEYSTORE_LOCATION));
    Assert.assertEquals(configMap.get(KEYSTORE_LOCATION), KEYSTORE_LOCATION_TEST);
    Assert.assertNotNull(configMap.get(KEYSTORE_PASSWORD));
    Assert.assertEquals(configMap.get(KEYSTORE_PASSWORD), KEYSTORE_PASSWORD_TEST);
    Assert.assertNotNull(configMap.get(KEY_PASSWORD));
    Assert.assertEquals(configMap.get(KEY_PASSWORD), KEY_PASSWORD_TEST);
    Assert.assertNotNull(configMap.get(KEYSTORE_TYPE));
    Assert.assertEquals(configMap.get(KEYSTORE_TYPE), KEYSTORE_TYPE_TEST.name());
  }

  @Test
  public void testAddSecurityConfigsSaslPlaintext() {
    securityConfig.securityOption = KafkaSecurityOptions.SASL_PLAINTEXT;
    securityConfig.saslMechanism = SaslMechanisms.GSSAPI;
    KafkaSecurityUtil.addSecurityConfigs(securityConfig, configMap, false);
    Assert.assertEquals(3, configMap.size());
    Assert.assertNotNull(configMap.get(SECURITY_PROTOCOL));
    Assert.assertEquals(KafkaSecurityOptions.SASL_PLAINTEXT.getProtocol(), configMap.get(SECURITY_PROTOCOL));
    Assert.assertNotNull(configMap.get(KRB_SERVICE_NAME));
    Assert.assertEquals(KRB_SERVICE_NAME_TEST, configMap.get(KRB_SERVICE_NAME));
    Assert.assertNotNull(configMap.get(SASL_MECHANISM));
    Assert.assertEquals(GSSAPI, configMap.get(SASL_MECHANISM));
  }

  @Test
  public void testAddSecurityConfigsSaslSsl() {
    securityConfig.securityOption = KafkaSecurityOptions.SASL_SSL;
    securityConfig.saslMechanism = SaslMechanisms.GSSAPI;
    KafkaSecurityUtil.addSecurityConfigs(securityConfig, configMap, false);
    Assert.assertEquals(7, configMap.size());
    Assert.assertNotNull(configMap.get(SECURITY_PROTOCOL));
    Assert.assertEquals(KafkaSecurityOptions.SASL_SSL.getProtocol(), configMap.get(SECURITY_PROTOCOL));
    Assert.assertNotNull(configMap.get(ENABLED_PROTOCOLS));
    Assert.assertEquals(configMap.get(ENABLED_PROTOCOLS), ENABLED_PROTOCOLS_TEST);
    Assert.assertNotNull(configMap.get(TRUSTSTORE_LOCATION));
    Assert.assertEquals(configMap.get(TRUSTSTORE_LOCATION), TRUSTSTORE_LOCATION_TEST);
    Assert.assertNotNull(configMap.get(TRUSTSTORE_PASSWORD));
    Assert.assertEquals(configMap.get(TRUSTSTORE_PASSWORD), TRUSTSTORE_PASSWORD_TEST);
    Assert.assertNotNull(configMap.get(TRUSTSTORE_TYPE));
    Assert.assertEquals(configMap.get(TRUSTSTORE_TYPE), TRUSTSTORE_TYPE_TEST.name());
    Assert.assertNotNull(configMap.get(KRB_SERVICE_NAME));
    Assert.assertEquals(configMap.get(KRB_SERVICE_NAME), KRB_SERVICE_NAME_TEST);
    Assert.assertNotNull(configMap.get(SASL_MECHANISM));
    Assert.assertEquals(GSSAPI, configMap.get(SASL_MECHANISM));
  }

  @Test
  public void testAddSecurityConfigsEmptyOptions() {
    securityConfig.securityOption = null;
    KafkaSecurityUtil.addSecurityConfigs(securityConfig, configMap, false);
    Assert.assertEquals(0, configMap.size());
  }

  @Test
  public void testValidateAdditionalPropertiesPlaintext() {
    securityConfig.securityOption = KafkaSecurityOptions.PLAINTEXT;
    additionalPropeties.put(SECURITY_PROTOCOL, SECURITY_PROTOCOL_TEST);
    KafkaSecurityUtil.validateAdditionalProperties(
        securityConfig,
        additionalPropeties,
        false,
        "testConfigGroupName",
        "testConfigName",
        issues,
        context
    );
    Assert.assertEquals(1, issues.size());
  }

  @Test
  public void testValidateAdditionalPropertiesSsl() {
    securityConfig.securityOption = KafkaSecurityOptions.SSL;
    additionalPropeties.put(SECURITY_PROTOCOL, SECURITY_PROTOCOL_TEST);
    additionalPropeties.put(ENABLED_PROTOCOLS, ENABLED_PROTOCOLS_TEST);
    additionalPropeties.put(TRUSTSTORE_PASSWORD, TRUSTSTORE_PASSWORD_TEST);
    additionalPropeties.put(TRUSTSTORE_TYPE, TRUSTSTORE_TYPE_TEST.name());
    additionalPropeties.put(TRUSTSTORE_LOCATION, TRUSTSTORE_LOCATION_TEST);
    KafkaSecurityUtil.validateAdditionalProperties(
        securityConfig,
        additionalPropeties,
        false,
        "testConfigGroupName",
        "testConfigName",
        issues,
        context
    );
    Assert.assertEquals(1, issues.size());
  }

  @Test
  public void testValidateAdditionalPropertiesSslAuth() {
    securityConfig.securityOption = KafkaSecurityOptions.SSL_AUTH;
    additionalPropeties.put(SECURITY_PROTOCOL, SECURITY_PROTOCOL_TEST);
    additionalPropeties.put(ENABLED_PROTOCOLS, ENABLED_PROTOCOLS_TEST);
    additionalPropeties.put(TRUSTSTORE_PASSWORD, TRUSTSTORE_PASSWORD_TEST);
    additionalPropeties.put(TRUSTSTORE_TYPE, TRUSTSTORE_TYPE_TEST.name());
    additionalPropeties.put(TRUSTSTORE_LOCATION, TRUSTSTORE_LOCATION_TEST);
    additionalPropeties.put(KEYSTORE_TYPE, KEYSTORE_TYPE_TEST.name());
    additionalPropeties.put(KEYSTORE_LOCATION, KEYSTORE_LOCATION_TEST);
    additionalPropeties.put(KEYSTORE_PASSWORD, KEYSTORE_PASSWORD_TEST);
    additionalPropeties.put(KEY_PASSWORD, KEY_PASSWORD_TEST);
    KafkaSecurityUtil.validateAdditionalProperties(
        securityConfig,
        additionalPropeties,
        false,
        "testConfigGroupName",
        "testConfigName",
        issues,
        context
    );
    Assert.assertEquals(1, issues.size());
  }

  @Test
  public void testValidateAdditionalPropertiesSaslPlaintext() {
    securityConfig.securityOption = KafkaSecurityOptions.SASL_PLAINTEXT;
    additionalPropeties.put(SECURITY_PROTOCOL, SECURITY_PROTOCOL_TEST);
    additionalPropeties.put(KRB_SERVICE_NAME, KRB_SERVICE_NAME_TEST);
    KafkaSecurityUtil.validateAdditionalProperties(
        securityConfig,
        additionalPropeties,
        false,
        "testConfigGroupName",
        "testConfigName",
        issues,
        context
    );
    Assert.assertEquals(1, issues.size());
  }

  @Test
  public void testValidateAdditionalPropertiesSaslSsl() {
    securityConfig.securityOption = KafkaSecurityOptions.SASL_SSL;
    additionalPropeties.put(SECURITY_PROTOCOL, SECURITY_PROTOCOL_TEST);
    additionalPropeties.put(ENABLED_PROTOCOLS, ENABLED_PROTOCOLS_TEST);
    additionalPropeties.put(TRUSTSTORE_PASSWORD, TRUSTSTORE_PASSWORD_TEST);
    additionalPropeties.put(TRUSTSTORE_TYPE, TRUSTSTORE_TYPE_TEST.name());
    additionalPropeties.put(TRUSTSTORE_LOCATION, TRUSTSTORE_LOCATION_TEST);
    KafkaSecurityUtil.validateAdditionalProperties(
        securityConfig,
        additionalPropeties,
        false,
        "testConfigGroupName",
        "testConfigName",
        issues,
        context
    );
    Assert.assertEquals(1, issues.size());
  }

  @Test
  public void testValidateAdditionalPropertiesEmptyOptions() {
    securityConfig.securityOption = null;
    additionalPropeties.put(SECURITY_PROTOCOL, SECURITY_PROTOCOL_TEST);
    KafkaSecurityUtil.validateAdditionalProperties(
        securityConfig,
        additionalPropeties,
        false,
        "testConfigGroupName",
        "testConfigName",
        issues,
        context
    );
    // Even if the additional properties are set, there are no security options to conflict with
    Assert.assertEquals(0, issues.size());
  }
}


text:
package org.sky.x.data.array;

/**
 * @author xieming
 * 2014年6月18日 下午9:53:16
 */
public interface StackI {
	public int pop();
	public void push(int ele);
	public int peek();
	public boolean isEmpty();
	public boolean isFull();
}


text:
import pickle
import re
import numpy

f = open ("2e.txt", "r")
g = open ("GeorgianWordlist.txt","r")

def median(lst):
    return numpy.median(numpy.array(lst))

myDict = {}
dateList = []
the_whole_file = f.read()
wordCount = 0
hitCount = 0
century1=0
century2=0
century3=0
century4=0
century5=0
century6=0
century7=0
century8=0
century9=0
century10=0
century11=0
century12=0
century13=0
century14=0
century15=0
century16=0
century17=0
century18=0
century19=0
century20=0

for line in g:
    line = line[:-1]
    myDict[line]=[]
print len (myDict)

for key in myDict:

    start_position = 0

    start_position = the_whole_file.find('<LF>'+key, start_position)
    #print start_position

    end_position = the_whole_file.find('</D>', start_position)
    #print start_position
    date =  the_whole_file[start_position:end_position]

    wordCount = wordCount + 1
    print wordCount

    if date !="":
        hitCount = hitCount + 1
        date = date [-7:]
        date = re.sub(r'[A..]', '', date)
        date = re.sub(r'[\.\.]', '00', date)
        print date
        date = re.sub(r'-\.*',' ',date)
        print date
        date = re.findall(r'\d+', date)
        date = date[0]
        date = int(date)
        print date
        print "****************"
        print "\n"

        if date >0 and  date <100:
            century1 = century1 + 1
            print "FIRST CENTURY"
            print date
            print key
        elif date >99 and date <200:
            century2 = century2 + 1
        elif date >199 and date <300:
            century3 = century3 + 1
        elif date >299 and date <400:
            century4 = century4 + 1
        elif date >399 and date <500:
            century5 = century5 + 1
        elif date >499 and date <600:
            century6 = century6 + 1
        elif date >599 and date <700:
            century7 = century7 + 1
        elif date >699 and date <800:
            century8 = century8 + 1
        elif date >799 and date <900:
            century9 = century9 + 1
        elif date >899 and date <1000:
            century10 = century10 + 1
        elif date >999 and date <1100:
            century11 = century11 + 1
        elif date >1099 and date <1200:
            century12 = century12 + 1
        elif date >1199 and date <1300:
            century13 = century13 + 1
        elif date >1299 and date <1400:
            century14 = century14 + 1
        elif date >1399 and date <1500:
            century15 = century15 + 1
        elif date >1499 and date <1600:
            century16 = century16 + 1
        elif date >1599 and date <1700:
            century17 = century17 + 1
        elif date >1699 and date <1800:
            century18 = century18 + 1
        elif date >1799 and date <1900:
            century19 = century19 + 1
        elif date >1899 and date <2000:
            century20 = century20 + 1

        #print key
        #print date # [-7:]
        #print "\n"
        myDict[key] = []
        myDict[key].append(date)
        dateList.append(date)
        #print dateList

pickle.dump(myDict, open("georgianpoetry_worddates.p","wb"))

dateTotal = sum(dateList)
print "total number of words: ", len (myDict)
print "total number of headword hits: ", hitCount
print "Average Word Date: ", dateTotal / len(dateList)
print "earliest word date: ", min(dateList)
print "latest word date: ", max (dateList)
print "mean word date: ", median(dateList)
print "1st century: ", century1
print "2nd century: ", century2
print "3rd century: ", century3
print "4th century: ", century4
print "5th century: ", century5
print "6th century: ", century6
print "7th century: ", century7
print "8th century: ", century8
print "9th century: ", century9
print "10th century: ", century10
print "11th century: ", century11
print "12th century: ", century12
print "13th century: ", century13
print "14th century: ", century14
print "14th century: ", century15
print "16th century: ", century16
print "17th century: ", century17
print "18th century: ", century18
print "19th century: ", century19
print "20th century: ", century20


text:
from __future__ import unicode_literals

import datetime
from django.db import migrations, models
from django.utils.timezone import utc

class Migration(migrations.Migration):

    dependencies = [
        ('job_board', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='job',
            name='created_at',
            field=models.DateTimeField(auto_now_add=True, default=datetime.datetime(2016, 5, 28, 21, 30, 26, 983912, tzinfo=utc)),
            preserve_default=False,
        ),
    ]


text:
import Feature from '../src/ol/Feature.js';
import Map from '../src/ol/Map.js';
import Point from '../src/ol/geom/Point.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {Fill, RegularShape, Stroke, Style} from '../src/ol/style.js';

const stroke = new Stroke({color: 'black', width: 2});
const fill = new Fill({color: 'red'});

const styles = {
  'square': new Style({
    image: new RegularShape({
      fill: fill,
      stroke: stroke,
      points: 4,
      radius: 10,
      angle: Math.PI / 4,
    }),
  }),
  'rectangle': new Style({
    image: new RegularShape({
      fill: fill,
      stroke: stroke,
      radius: 10 / Math.SQRT2,
      radius2: 10,
      points: 4,
      angle: 0,
      scale: [1, 0.5],
    }),
  }),
  'triangle': new Style({
    image: new RegularShape({
      fill: fill,
      stroke: stroke,
      points: 3,
      radius: 10,
      rotation: Math.PI / 4,
      angle: 0,
    }),
  }),
  'star': new Style({
    image: new RegularShape({
      fill: fill,
      stroke: stroke,
      points: 5,
      radius: 10,
      radius2: 4,
      angle: 0,
    }),
  }),
  'cross': new Style({
    image: new RegularShape({
      fill: fill,
      stroke: stroke,
      points: 4,
      radius: 10,
      radius2: 0,
      angle: 0,
    }),
  }),
  'x': new Style({
    image: new RegularShape({
      fill: fill,
      stroke: stroke,
      points: 4,
      radius: 10,
      radius2: 0,
      angle: Math.PI / 4,
    }),
  }),
  'stacked': [
    new Style({
      image: new RegularShape({
        fill: fill,
        stroke: stroke,
        points: 4,
        radius: 5,
        angle: Math.PI / 4,
        displacement: [0, 10],
      }),
    }),
    new Style({
      image: new RegularShape({
        fill: fill,
        stroke: stroke,
        points: 4,
        radius: 10,
        angle: Math.PI / 4,
      }),
    }),
  ],
};

const styleKeys = [
  'x',
  'cross',
  'star',
  'triangle',
  'square',
  'rectangle',
  'stacked',
];
const count = 250;
const features = new Array(count);
const e = 4500000;
for (let i = 0; i < count; ++i) {
  const coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
  features[i] = new Feature(new Point(coordinates));
  features[i].setStyle(
    styles[styleKeys[Math.floor(Math.random() * styleKeys.length)]]
  );
}

const source = new VectorSource({
  features: features,
});

const vectorLayer = new VectorLayer({
  source: source,
});

const map = new Map({
  layers: [vectorLayer],
  target: 'map',
  view: new View({
    center: [0, 0],
    zoom: 2,
  }),
});

const colors = ['blue', 'green', 'yellow', 'aqua', 'red'];
let currentColor = 0;

document.getElementById('color-changer').addEventListener('click', function () {
  styles.square
    .getImage()
    .setFill(new Fill({color: colors[currentColor % colors.length]}));
  vectorLayer.changed();
  currentColor++;
});