text:
/**
 * CreativeSetServiceInterface.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.dfp.axis.v201308;

public interface CreativeSetServiceInterface extends java.rmi.Remote {

    /**
     * Creates a new {@link CreativeSet}.
     *
     *
     * @param creativeSet the creative set to create
     *
     * @return the creative set with its ID filled in
     */
    public com.google.api.ads.dfp.axis.v201308.CreativeSet createCreativeSet(com.google.api.ads.dfp.axis.v201308.CreativeSet creativeSet) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201308.ApiException;

    /**
     * Returns the {@link CreativeSet} uniquely identified by the
     * given ID.
     *
     *
     * @param creativeSetId the ID of the creative set, which must already
     * exist
     *
     * @return the {@code CreativeSet} uniquely identified by the given ID
     */
    public com.google.api.ads.dfp.axis.v201308.CreativeSet getCreativeSet(java.lang.Long creativeSetId) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201308.ApiException;

    /**
     * Gets a {@link CreativeSetPage} of {@link CreativeSet} objects
     * that satisfy the
     *         given {@link Statement#query}. The following fields are supported
     * for
     *         filtering:
     *
     *

     *

     *         PQL Property	 Object Property
     *

     *

     *         {@code id}
     *         {@link CreativeSet#id}
     *

     *

     *         {@code name}
     *         {@link CreativeSet#name}
     *

     *

     *         {@code masterCreativeId}
     *         {@link CreativeSet#masterCreativeId}
     *

     *

     *         {@code lastModifiedDateTime}
     *         {@link CreativeSet#lastModifiedDateTime}
     *

     *

     *
     *
     * @param filterStatement a Publisher Query Language statement used to
     * filter
     *         a set of creative sets
     *
     * @return the creative sets that match the given filter
     */
    public com.google.api.ads.dfp.axis.v201308.CreativeSetPage getCreativeSetsByStatement(com.google.api.ads.dfp.axis.v201308.Statement statement) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201308.ApiException;

    /**
     * Updates the specified {@link CreativeSet}.
     *
     *
     * @param creativeSet the creative set to update
     *
     * @return the updated creative set
     */
    public com.google.api.ads.dfp.axis.v201308.CreativeSet updateCreativeSet(com.google.api.ads.dfp.axis.v201308.CreativeSet creativeSet) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201308.ApiException;
}


text:
.pagination {
  zoom: 1;
  padding: 2px;
}
.pagination table {
  float: left;
  height: 30px;
}
.pagination td {
  border: 0;
}
.pagination-btn-separator {
  float: left;
  height: 24px;
  border-left: 1px solid #ccc;
  border-right: 1px solid #fff;
  margin: 3px 1px;
}
.pagination .pagination-num {
  border-width: 1px;
  border-style: solid;
  margin: 0 2px;
  padding: 2px;
  width: 3em;
  height: auto;
  text-align: center;
  font-size: 12px;
}
.pagination-page-list {
  margin: 0px 6px;
  padding: 1px 2px;
  width: auto;
  height: auto;
  border-width: 1px;
  border-style: solid;
}
.pagination-info {
  float: right;
  margin: 0 6px;
  padding: 0;
  height: 30px;
  line-height: 30px;
  font-size: 12px;
}
.pagination span {
  font-size: 12px;
}
.pagination-link .l-btn-text {
  box-sizing: border-box;
  text-align: center;
  margin: 0;
  padding: 0 .5em;
  width: auto;
  min-width: 28px;
}
.pagination-first {
  background: url('images/pagination_icons.png') no-repeat 0 center;
}
.pagination-prev {
  background: url('images/pagination_icons.png') no-repeat -16px center;
}
.pagination-next {
  background: url('images/pagination_icons.png') no-repeat -32px center;
}
.pagination-last {
  background: url('images/pagination_icons.png') no-repeat -48px center;
}
.pagination-load {
  background: url('images/pagination_icons.png') no-repeat -64px center;
}
.pagination-loading {
  background: url('images/loading.gif') no-repeat center center;
}
.pagination-page-list,
.pagination .pagination-num {
  border-color: #D4D4D4;
}

redpajama_set_name: RedPajamaGithub


text:
namespace outer {
    namespace inner {
        class base {
            public:
                int value() const { return 1; }
                static int value(long x) { return static_cast<int>(x); }
        };
    }

    template <class T>
    class derived : public inner::base {
        public:
            typedef T value_type;
            using inner::base::value;
            static value_type example;
            value_type value(value_type i) const { return i * example; }
    };

    template <class T>
    typename derived<T>::value_type derived<T>::example = 2;
}

template <class T>
class more_derived : public outer::derived<T> {
    public:
        typedef outer::derived<T> base_type;
        typedef typename base_type::value_type value_type;

        more_derived(value_type v) : value_{this->value(v)} {}
        value_type get_value() const { return value_; }

    private:
        value_type value_;
};

int main() {
    std::chrono::system_clock::time_point
        now{ std::chrono::system_clock::now() };
    std::cout << now.time_since_epoch().count() << '\n';

    outer::derived<int> d;
    std::cout << d.value() << '\n';
    std::cout << d.value(42L) << '\n';
    std::cout << outer::inner::base::value(2) << '\n';

    more_derived<int> md{2};
    std::cout << md.get_value() << '\n';

    return 0;
}


text:
Java based 2d tile rpg game.

[![Build Status](https://travis-ci.org/tankucukoglu/ReignOfGods.svg?branch=master)](https://travis-ci.org/tankucukoglu/ReignOfGods)


text:
package org.incode.module.docfragment.dom.types;

/**
 * The name of a fragment, with respect to some object type name.
 */
public class DocFragmentNameType {

    private DocFragmentNameType() {}

    public static class Meta {

        public static final int MAX_LEN = 120;

        private Meta() {}

    }

}


text:
package aQute.bnd.main;

import java.io.File;

import aQute.bnd.build.Project;
import aQute.service.reporter.Messages;

public interface BndMessages extends Messages {

	ERROR Failed__(Throwable t, String string);

	ERROR UnrecognizedFileType_(String path);

	ERROR MoreArgumentsThanNeeded_(Iterable<String> args);

	ERROR NoCommandForProject(Project p);

	ERROR NoProject();

	ERROR InvalidBumpMask_(String mask);

	ERROR Project_RunFailed_(Project project, Exception e);

	ERROR ForProject_File_FailedToCreateExecutableException_(Project project, String path, Exception e);

	ERROR NoSuchRepository_(String newer);

	ERROR InvalidGlobPattern_(String pattern);

	ERROR NoRunFile(File f);

	void NoValidWorkspace(File f);

}


text:
import setpath
import unittest
import os
from bike import testdata
from bike.testutils import *
from bike.query.getReferencesToModule import *
from bike.parsing.fastparserast import Module

class TestGetReferencesToModule(BRMTestCase):

    def test_returnsEmptyListIfNoReferences(self):
        src = trimLines("""
        class MyClass:
            pass
        a = TheClass()
        """)
        root = createSourceNodeAt(src,"mymodule")
        self.assertEqual([x for x in getReferencesToModule(root,"myothermodule")],[])

    def test_findsReferencesInModuleWhichImportsModule(self):
        src = trimLines("""
        import b.bah
        def foo():
            a = b.bah.TheClass()
            a.theMethod()
        """)

        root = createSourceNodeAt( src, "a.foo")
        root = createSourceNodeAt( testdata.TheClass, "a.b.bah")
        refs = [x for x in getReferencesToModule(root,"a.b.bah")]

        self.assertEqual(refs[0].filename,os.path.abspath(os.path.join("a","foo.py")))
        self.assertEqual(refs[0].lineno,1)
        self.assertEqual(refs[0].colno,9)
        self.assertEqual(refs[0].confidence,100)

        self.assertEqual(refs[1].filename,os.path.abspath(os.path.join("a","foo.py")))
        self.assertEqual(refs[1].lineno,3)
        self.assertEqual(refs[1].colno,10)
        self.assertEqual(refs[0].confidence,100)

    def test_findsReferenceInModuleWhichImportsModuleWithFrom(self):
        src = trimLines("""
        from b import bah
        def foo():
            a = bah.TheClass()
            a.theMethod()
        """)

        root = createSourceNodeAt( src, "a.foo")
        root = createSourceNodeAt( testdata.TheClass, "a.b.bah")
        refs = [x for x in getReferencesToModule(root,"a.b.bah")]

        self.assertEqual(refs[0].filename,os.path.abspath(os.path.join("a","foo.py")))
        self.assertEqual(refs[0].lineno,1)
        self.assertEqual(refs[0].colno,14)
        self.assertEqual(refs[0].confidence,100)

        self.assertEqual(refs[1].filename,os.path.abspath(os.path.join("a/foo.py")))
        self.assertEqual(refs[1].lineno,3)
        self.assertEqual(refs[1].colno,8)
        self.assertEqual(refs[0].confidence,100)

    def test_findsReferenceInModuleWhichImportsModuleWithFromAndAlias(self):
        src = trimLines("""
        from b import bah as mymodule
        def foo():
            a = mymodule.MyTheClass()
            a.theMethod()
        """)

        root = createSourceNodeAt( src, "a.foo")
        root = createSourceNodeAt( testdata.TheClass, "a.b.bah")
        refs = [x for x in getReferencesToModule(root,"a.b.bah")]

        self.assertEqual(refs[0].filename,os.path.abspath(os.path.join("a","foo.py")))
        self.assertEqual(refs[0].lineno,1)
        self.assertEqual(refs[0].colno,14)
        self.assertEqual(refs[0].confidence,100)

        """ # mymodule.MyTheClass
        self.assertEqual(refs[1].filename,os.path.abspath(os.path.join("a","foo.py")))
        self.assertEqual(refs[1].lineno,3)
        self.assertEqual(refs[1].colno,10)
        self.assertEqual(refs[1].confidence,100)
        """

    def test_findsReferenceInModuleWhichImportsModuleWithFromImportStar(self):
        src = trimLines("""
        from b.bah import *
        a = TheClass()
        a.theMethod()
        """)

        root = createSourceNodeAt( src, "a.foo")
        root = createSourceNodeAt( testdata.TheClass, "a.b.bah")
        refs = [x for x in getReferencesToModule(root,"a.b.bah")]

        self.assertEqual(refs[0].filename,os.path.abspath(os.path.join("a","foo.py")))
        self.assertEqual(refs[0].lineno,1)
        self.assertEqual(refs[0].colno,7)
        self.assertEqual(refs[0].confidence,100)

    ''' Dont think this is a valid test, since cant import a module with
        from package import *
    def test_findsReferenceInModuleWhichImportsClassWithFromImportStar2(self):
        src = trimLines("""
        from a.b import *
        a = bah.TheClass()
        """)

        root = createSourceNodeAt( src, "a.foo")
        root = createSourceNodeAt( testdata.TheClass, "a.b.bah")
        refs = [x for x in getReferencesToModule(root,"a.b.bah")]

        self.assertEqual(refs[0].filename,os.path.abspath(os.path.join("a","foo.py")))
        self.assertEqual(refs[0].lineno,2)
        self.assertEqual(refs[0].colno,4)
        self.assertEqual(refs[0].confidence,100)
    '''

    def test_findsReferenceInClassBases(self):
        src =trimLines("""
        from b import bah
        class DerivedClass(bah.TheClass):
            pass
        """)

        root = createSourceNodeAt(src, "a.foo")
        root = createSourceNodeAt(testdata.TheClass, "a.b.bah")
        refs = [x for x in getReferencesToModule(root,"a.b.bah")]

        self.assertEqual(refs[1].filename,os.path.abspath(os.path.join("a","foo.py")))
        self.assertEqual(refs[1].lineno,2)
        self.assertEqual(refs[1].colno,19)
        self.assertEqual(refs[1].confidence,100)

    def test_findsReferenceInMultiLineImportStatement(self):
        src =trimLines("""
        from b import foo, \\
                  TheFooBah, TheClass, TheBastard, SomethingElse, bah
        """)

        root = createSourceNodeAt( src, "a.foo")
        root = createSourceNodeAt( testdata.TheClass, "a.b.bah")
        refs = [x for x in getReferencesToModule(root,"a.b.bah")]
        self.assertEqual(refs[0].filename,os.path.abspath(os.path.join("a","foo.py")))
        self.assertEqual(refs[0].lineno,2)
        self.assertEqual(refs[0].colno,58)
        self.assertEqual(refs[0].confidence,100)

    def test_findsReferenceWhenModulenameSameAsClassMethodName(self):
        # asserts that brm doesnt search class scope after not finding name
        # in method scope (since class scope is invisible unless called on 'self'
        src =trimLines("""
        from a.b import bah
        class baz:
            def bah(self):
                print bah.TheClass
        """)

        root = createSourceNodeAt( src, "a.foo")
        root = createSourceNodeAt( testdata.TheClass, "a.b.bah")
        refs = [x for x in getReferencesToModule(root,"a.b.bah")]

        self.assertEqual(refs[0].filename,os.path.abspath(os.path.join("a","foo.py")))
        self.assertEqual(refs[0].lineno,1)
        self.assertEqual(refs[0].colno,16)
        self.assertEqual(refs[0].confidence,100)

        assert (len(refs))==2

if __name__ == "__main__":
    unittest.main()


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>Meteoor | AVD</title>
    <link rel="stylesheet" href="../css/main.css">

				Home

				Diensten

				Portfolio

				Contact

				Over Ons

Promotie video voor:
"Ethias Autoverzekeringen"

De autoverzekering begrijpen, niet duidelijk ? Natuurlijk wel ! Ontdek het in deze video, u
	voorgesteld door Ethias en Peter Peters, uw verzekeringsexpert. De verzekeringen met Peter, zijn gene zever.
	Hij helpt u te begrijpen waarom het zo belangrijk is om uw voertuig te verzekeren, waarom deze verzekering verplicht
	 is en welke de belangrijkste waarborgen zijn voor de autoverzekering.

De samenwerking met Ethias verliep perfect. De iet-wat humoristische video beviel ons wel om te maken.
	Het was een volledige andere manier van werken dan normaal. Het resultaat mag dan ook zeker gezien worden!

© 2017 Arteveldehogeschool


text:
package edu.uniandes.testrecommenders101.util;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;

import org.recommender101.data.DataModel;
import org.recommender101.data.DefaultDataLoader;
import org.recommender101.data.Rating;
import org.recommender101.tools.Utilities101;

/**
 * Loads the information about items from the Movielens100k dataset
 * @author AndresM
 *
 */
public class ItemInfoLoader {

	private final static Logger LOG = Logger.getLogger(ItemInfoLoader.class
		      .getName());

	private static String[] genres={"unknown","Action","Adventure","Animation","Children's","Comedy","Crime","Documentary","Drama","Fantasy",
			"Film-Noir","Horror","Musical","Mystery","Romance","Sci-Fi","Thriller","War","Western"};

	/**
	 * Returns a map of ItemInformation, where the key is the itemId
	 * @param fileName - The file to be loaded
	 * @param m - The loaded DataModel to obtain the item popularity and average.
	 * @throws FileNotFoundException  if the file is not found
	 */
	public static HashMap<Integer, ItemInformation> load(DataModel m,String fileName) throws FileNotFoundException {
		HashMap<Integer, ItemInformation> itemInformationMap= new HashMap<>();
		Map<Integer, Float> itemAverages=Utilities101.getItemAverageRatings(m.getRatings());
		Map<Integer, Integer> itemPopularity=getItemCount(m.getRatings());

		BufferedReader reader = null;
		String line=null;
		String[] tokens =null;
		try {
			reader=new BufferedReader(new FileReader(fileName));
			while((line=reader.readLine())!=null){
				if (line.trim().startsWith("//")) {
					continue;
				}
				tokens = line.split("\\|");
				String itemId=tokens[0];
				String itemName=(tokens[1]);
				String itemURL=(tokens[4]);
				LinkedList<String> itemGenres= new LinkedList<>();
				for(int i=0;i<genres.length;i++){
					String genreIs= tokens[5+i];
					if(genreIs.equals("1")){
						itemGenres.add(genres[i]);
					}
				}
				int idNum = Integer.parseInt(itemId);

				ItemInformation itemInformation = new ItemInformation(idNum,itemName,itemURL,itemGenres,itemPopularity.get(idNum),itemAverages.get(idNum));
				itemInformationMap.put(idNum, itemInformation);

			}
		} catch (FileNotFoundException e) {

			throw e;
		} catch (IOException e) {

			LOG.severe("Error reading file "+fileName);

		}
		finally{
			if(reader!=null){
				try {
					reader.close();
				} catch (IOException e) {}
			}

		}
		return itemInformationMap;

	}

	private static Map<Integer, Integer> getItemCount(Set<Rating> ratings) {
		Map<Integer, Integer> counters = new HashMap<Integer, Integer>();

		for (Rating r : ratings) {
			Integer count = counters.get(r.item);
			if (count == null) {

				counters.put(r.item, 1);
			} else {
				counters.put(r.item, counters.get(r.item) + 1);

			}
		}
		return counters;
	}

	public static void main(String[] args) {
		try {

			DataModel model= new DataModel();
			DefaultDataLoader loader= new DefaultDataLoader();
			loader.setFilename("data/ml-100k/u.data");
			loader.loadData(model);
			String itemFileName = "data/ml-100k/u.item";
			ItemInformation[] array= getItemsSortedByPopularity(model,itemFileName);
			System.out.println("Most popular items sorted by number of ratings are: ");
			int count = 30;
			for(int i =0; i< count ;i++){
				System.out.println(array[i]);
			}
			System.out.println("Least popular items sorted by number of ratings are: ");
			for(int i =array.length-1; i> array.length-1-count;i--){
				System.out.println(array[i]);
			}

		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public static ItemInformation[]  getItemsSortedByPopularity(DataModel model,String itemFileName)
			throws FileNotFoundException {

		HashMap<Integer, ItemInformation> itemInfo=ItemInfoLoader.load(model,itemFileName);
		ItemInformation[] array= null;

		array=new ItemInformation[itemInfo.keySet().size()];
		int index=0;
		for (Integer itemId : itemInfo.keySet()) {
			array[index++]=itemInfo.get(itemId);
		}

		Arrays.sort(array,new Comparator<ItemInformation>() {

			@Override
			public int compare(ItemInformation o1, ItemInformation o2) {
				// * -1 for reverse order
				return Long.compare(o1.getNumRatings(), o2.getNumRatings())*-1;
			}
		});
		return array;
	}

	public static ItemInformation[]  getItemsSortedByAverage(DataModel model,String itemFileName)
			throws FileNotFoundException {

		HashMap<Integer, ItemInformation> itemInfo=ItemInfoLoader.load(model,itemFileName);
		ItemInformation[] array= null;

		array=new ItemInformation[itemInfo.keySet().size()];
		int index=0;
		for (Integer itemId : itemInfo.keySet()) {
			array[index++]=itemInfo.get(itemId);
		}

		Arrays.sort(array,new Comparator<ItemInformation>() {

			@Override
			public int compare(ItemInformation o1, ItemInformation o2) {
				// * -1 for reverse order
				return Double.compare(o1.getItemAverage(), o2.getItemAverage())*-1;
			}
		});
		return array;
	}

}


text:
package com.att.cadi;

public interface Permission {
	public String permType();
	public String getKey();
	public boolean match(Permission p);
}


text:
package com.taro.backspring;

import java.text.ParseException;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

import javax.annotation.Resource;

import org.quartz.CronExpression;
import org.quartz.CronTrigger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component("backupScheduler")
public class DefaultBackupScheduler implements BackupScheduler {
	private BlockingQueue<RunState> runStateQueue = new LinkedBlockingQueue<RunState>();

	private Logger logger = LoggerFactory
			.getLogger(DefaultBackupScheduler.class);

	@Resource
	private BackupStrategyFactory backupStrategyFactory;

	@Override
	public void executeScheduledBackup(Configuration config)
			throws BackupException, ParseException {

		Scheduler scheduler = null;
		try {
			BackupStrategy backupStrategy = backupStrategyFactory
					.getBackupStrategy(config);

			String schedule = config.getSchedule();

			SchedulerFactory schedulerFactory = new StdSchedulerFactory();

			// Retrieve a scheduler from schedule factory
			scheduler = schedulerFactory.getScheduler();

			// Initiate JobDetail with job name, job group, and executable job
			// class
			JobDetail jobDetail = new JobDetail("jobDetail", "jobDetailGroup",
					backupStrategy.getClass());

			// Initiate CronTrigger with its name and group name CronTrigger
			CronTrigger cronTrigger = new CronTrigger("cronTrigger",
					"triggerGroup2");

			// setup CronExpression CronExpression
			CronExpression cexp = new CronExpression(schedule);

			// Assign the CronExpression to CronTrigger
			cronTrigger.setCronExpression(cexp);

			// schedule a job with JobDetail and Trigger
			scheduler.scheduleJob(jobDetail, cronTrigger);

			// start the scheduler
			logger.debug("Starting scheduled backup");

			scheduler.start();

			RunState runState = runStateQueue.take();
			if (runState == RunState.SHUTDOWN) {
				logger.debug("Stopping scheduled backup");
				scheduler.shutdown(true);

			}
		} catch (ParseException p) {
			throw p;
		} catch (Exception e) {
			throw new BackupException(e);
		} finally {
			try {
				if (!scheduler.isShutdown()) {
					scheduler.shutdown(true);
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

	}

	public void stop() {
		try {
			logger.debug("Stopping schedueld backup");
			runStateQueue.put(RunState.SHUTDOWN);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}


text:
import os
import sys
import codecs

DISTNAME = "contactpp"
DESCRIPTION = "Pseudopotential generator for the contact interaction"
MAINTAINER = "Pascal Bugnion"
MAINTAINER_EMAIL = "pascal@bugnion.org"
URL = "https://pypi.python.org/pypi/contactpp"
LICENSE = "new BSD"

LONG_DESCRIPTION = u"""

contactpp
=========

contactpp is a package for the generation of pseudopotentials for the
contact interaction. The theory is outlined in [BLNC]_.

.. [BLNC] P.O. Bugnion, P. L\u00F3pez R\u00EDos, R.J. Needs, and G.J. Conduit,
         High-fidelity pseudopotentials for the contact interaction.

Links
-----

* Home page: https://pypi.python.org/pypi/contactpp
* Documentation: http://contactpp.readthedocs.org/en/latest/
* Source code: https://github.com/pbugnion/contactpp
* Issues: https://github.com/pbugnion/contactpp/issues

Installation
------------

contactpp requires python2.7, numpy and scipy. On Ubuntu, for instance,
these can be installed with:

    $ sudo apt-get install python-numpy python-scipy

The easiest way to download and install ``contactpp`` is from the Python
package index. Run::

    $ easy_install contactpp

This requires root access (unless you are running in a virtual environment).
To install without root access, run::

    $ easy_install --user contactpp

To install from github, clone the git repository using::

    $ git clone https://github.com/pbugnion/contactpp.git

Navigate to the source's root directory (``contactpp``) and run::

    $ python setup.py install

If you have a zip or a tar.gz archive of the source, unpack the compressed archive into a directory, navigate to this directory and run::

    $ python setup.py install

You may need to run this as root, unless you are running in a virtual environment.

Issue reporting and contributing
--------------------------------

Report issues using the `github issue tracker <https://github.com/pbugnion/contactpp/issues>`_.

Read the CONTRIBUTING guide to learn how to contribute.
"""

if sys.version_info[0] < 3:
    import __builtin__ as builtins
else:
    import builtins

# This is a bit hackish: we are setting a global variable so that the main
# skmonaco __init__ can detect if it is being loaded by the setup routine, to
# avoid attempting to load components that aren't built yet. While ugly, it's
# a lot more robust than what was previously being used.
# Copied from scipy setup file.
builtins.__CONTACTPP_SETUP__ = True

def write_readme():
    """
    Create README file from LONG_DESCRIPTION, replacing non-standard
    bits of re-structured text.
    """
    with codecs.open("README.rst","w",encoding="utf-8") as f:
        f.write("""\
.. Automatically generated from LONG_DESCRIPTION keyword in
.. setup.py. Do not edit directly.\
""")
        f.write(LONG_DESCRIPTION)

import contactpp

VERSION = contactpp.__version__

# For some commands, use setuptools.
if len(set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
           'bdist_wininst', 'install_egg_info', 'build_sphinx',
           'egg_info', 'easy_install', 'upload',
           '--single-version-externally-managed',
            )).intersection(sys.argv)) > 0:
    import setuptools
    extra_setuptools_args = dict(
        zip_safe=False, # the package can run out of an .egg file
        include_package_data=True,
    )
else:
    extra_setuptools_args = dict()

def configuration(parent_package="",top_path=None):
    if os.path.exists("MANIFEST"):
        os.remove("MANIFEST")
    write_readme()
    from numpy.distutils.misc_util import Configuration
    config = Configuration(None,parent_package,top_path)

    # Avoid non-useful msg:
    # "Ignoring attempt to set 'name' (from ... "
    config.set_options(ignore_setup_xxx_py=True,
                       assume_default_configuration=True,
                       delegate_options_to_subpackages=True,
                       quiet=True)

    config.add_subpackage('contactpp')

    return config

def setup_package():
    metadata = dict(
            name=DISTNAME,
            maintainer=MAINTAINER,
            maintainer_email=MAINTAINER_EMAIL,
            description=DESCRIPTION,
            license=LICENSE,
            url=URL,
            version=VERSION,
            long_description=LONG_DESCRIPTION,
            scripts=["bin/gen_pseudo",
                "bin/gen_pseudo_troullier",
                "bin/gen_pseudo_utp",
                "bin/gen_pseudo_swell"],
            classifiers=[
                'Intended Audience :: Science/Research',
                'Intended Audience :: Developers',
                'License :: OSI Approved :: BSD License',
                'Programming Language :: Python',
                'Topic :: Software Development',
                'Topic :: Scientific/Engineering',
                'Operating System :: POSIX',
                'Operating System :: Unix',
                'Operating System :: MacOS',
                'Programming Language :: Python :: 2',
                'Programming Language :: Python :: 2.7',
                ],
            **extra_setuptools_args)

    if (len(sys.argv) >= 2 and
            ("--help" in sys.argv[1:] or
             sys.argv[1] in ("--help-commands","egg_info","--version","clean"))):
        try:
            from setuptools import setup
        except ImportError:
            from distutils.core import setup

    else:
        from numpy.distutils.core import setup
        metadata["configuration"] = configuration
    setup(**metadata)

if __name__ == '__main__':
    from numpy.distutils.core import setup
    setup_package()


text:
#ifndef PaintInfo_h
#define PaintInfo_h

#include "core/layout/PaintPhase.h"
#include "platform/geometry/IntRect.h"
#include "platform/geometry/LayoutRect.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/GraphicsContextStateSaver.h"
#include "platform/graphics/paint/DisplayItem.h"
#include "platform/transforms/AffineTransform.h"
#include "wtf/HashMap.h"
#include "wtf/ListHashSet.h"

#include <limits>

namespace blink {

class RenderInline;
class LayoutLayerModelObject;
class LayoutObject;

struct PaintInfo {
    PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase newPhase, PaintBehavior newPaintBehavior,
        LayoutObject* newPaintingRoot = 0, ListHashSet<RenderInline*>* newOutlineObjects = 0,
        const LayoutLayerModelObject* newPaintContainer = 0)
        : context(newContext)
        , rect(newRect)
        , phase(newPhase)
        , paintBehavior(newPaintBehavior)
        , paintingRoot(newPaintingRoot)
        , m_paintContainer(newPaintContainer)
        , m_outlineObjects(newOutlineObjects)
    {
    }

    void updatePaintingRootForChildren(const LayoutObject* renderer)
    {
        if (!paintingRoot)
            return;

        // If we're the painting root, kids draw normally, and see root of 0.
        if (paintingRoot == renderer) {
            paintingRoot = 0;
            return;
        }
    }

    bool shouldPaintWithinRoot(const LayoutObject* renderer) const
    {
        return !paintingRoot || paintingRoot == renderer;
    }

    bool forceBlackText() const { return paintBehavior & PaintBehaviorForceBlackText; }
    bool isRenderingClipPathAsMaskImage() const { return paintBehavior & PaintBehaviorRenderingClipPathAsMask; }

    bool skipRootBackground() const { return paintBehavior & PaintBehaviorSkipRootBackground; }
    bool paintRootBackgroundOnly() const { return paintBehavior & PaintBehaviorRootBackgroundOnly; }

    DisplayItem::Type displayItemTypeForClipping() const { return DisplayItem::paintPhaseToClipBoxType(phase); }

    const LayoutLayerModelObject* paintContainer() const { return m_paintContainer; }

    ListHashSet<RenderInline*>* outlineObjects() const { return m_outlineObjects; }
    void setOutlineObjects(ListHashSet<RenderInline*>* objects) { m_outlineObjects = objects; }

    // FIXME: Introduce setters/getters at some point. Requires a lot of changes throughout rendering/.
    GraphicsContext* context;
    IntRect rect; // dirty rect used for culling non-intersecting renderers
    PaintPhase phase;
    PaintBehavior paintBehavior;
    LayoutObject* paintingRoot; // used to draw just one element and its visual kids

private:
    const LayoutLayerModelObject* m_paintContainer; // the layer object that originates the current painting
    ListHashSet<RenderInline*>* m_outlineObjects; // used to list outlines that should be painted by a block with inline children
};

} // namespace blink

#endif // PaintInfo_h


text:
FROM alpine:latest

MAINTAINER Yoshihiro Tanaka <contact@cordea.jp>

RUN apk update && \
        apk add curl python

RUN curl -kL https://bootstrap.pypa.io/get-pip.py | python


text:
<?php

namespace PH7\Framework\Analytics;

defined('PH7') or exit('Restricted access');

use PH7\Framework\Cache\IOException;

class StoreStats
{
    const DIR = 'stats/';
    const EXT = '.txt';

    /**
     * Read cache.
     *
     * @param string $sFileName
     *
     * @return array Cache data.
     *
     * @throws IOException If the file cannot be gotten.
     */
    protected function read($sFileName)
    {
        $sFullPath = PH7_PATH_TMP . static::DIR . $sFileName . static::EXT;

        if (!$aGetData = @file_get_contents($sFullPath)) {
            throw new IOException('Cannot get cache file: ' . $sFullPath);
        }

        $aData = !empty($aGetData) ? unserialize($aGetData) : [];

        return $aData;
    }

    /**
     * Save cache.
     *
     * @param string $sFileName
     * @param string $sContents
     *
     * @return void
     *
     * @throws IOException If the file cannot be written.
     */
    protected function save($sFileName, $sContents)
    {
        $sFullPath = PH7_PATH_TMP . static::DIR . $sFileName . static::EXT;
        $aData = [];
        $iFlag = FILE_TEXT;

        if (is_file($sFullPath)) {
            $aLine = file($sFullPath);
            $aData = unserialize($aLine[0]);
            $sContents = strtolower($sContents); // Case-insensitive

            !empty($aData[$sContents]) ? $aData[$sContents]++ : $aData[$sContents] = 1;
            $iFlag = FILE_APPEND;
        }

        if (!@file_put_contents($sFullPath, serialize($aData), $iFlag)) {
            throw new IOException('Cannot write cache file: ' . $sFullPath);
        }
    }
}


text:
layout: post
title: "Can't Get No Satisfaction"
excerpt: "Local"
categories: local
comments: false
share: true
---

![](https://cdn.meme.am/instances/500x/66216291.jpg)

This is Seattle Beer Week!!! What does that exactly mean? I really don't know, I feel like it's beer week every week around here.

But here is a list of the week's festivities:

[Click me to see Seattle's Beer Week's list](http://www.seattlebeerweek.com/)

The first thing that is suspicious is that this 'week' spans from May 12th to May 22nd. According to my calculations........carry the 4.........divide by 1............this is 11 days. From my Google search, a week is 7 days. 11>7.

The second thing is there are a ton of events. So I picked one to go to yesterday: 'Can You Handel My Randall?' at my local haunt, the Pine Box.

So what the hell is a 'Randall' styled beer? [This bests explains it.](http://www.hoppytrailsbeernews.com/beer-trivia/what-is-a-randall/) Long story short, they filter the beer through various scraps of tasty things, like orange peels or nutmeg, and that enhances the overall flavor. Some of the best beer's I've ever had are via this Randall process, so needless to say I was looking forward to this day. So I put on my favorite beer-drinking shirt, Sauron's Dark Ale black shirt, and headed up the hill to the Box.

Now before you go to an event like this, you have certain expectations; a large crowd, people clinking steins and singing old Irish songs, and of course excellent beer. I mean I am sure word has spread about this event, right? Everyone who is anyone will be there.

However this was not the case.

I got there at 4 (opening time) and there were about 15 people in the entire place. I was clumsily directed to the back room where the Randall beers were being served. Around the front of the line, there were about 8 'dudes', all in black hoodies, tatted up, and long beards, representing various microbrews who had zero interest in selling their product to people like me and just wanted to chat about how stupid everyone in the world is but themselves.

Eh, so what. Welcome to Cap Hill; Hipsters Paradise. I can deal with that. But what I could not deal with was the beer.

Twelve samplers, all Randall style, but 7, count 'em, **7** beers were pale ales or pilsners. What the hell?!?!?! The most bland, generic style of beer you can find is represented by over half? BOOOOOO!!!!

I just don't get this idea that when it's spring or summer, dark beers are not on tap. Granted, the PNW loves their hops and their IPAs, but c'mon. There needs to be diversity. This lineup was as homogeneous as the Republican National Convention. It's like all these hipster brewers did was peed in a vat, threw a few orange peels in there, and served it up to me.

So disappointed. I felt it was 1997 all over again; all geeked up to see Phantom Menace only to have Jar Jar fart in my face while George Lucas stole my money.

But I'll probably go back next year, I mean I did see Phantom Menace twice in the theaters and bought it (never said I was a smart man). However let this be a lesson to all; temper your expectations. Just assume all things are garbage....then you may find some satisfaction when you least expect it.


text:
def index():
	return {}


text:
module AASM
  class Base

    attr_reader :state_machine

    def initialize(klass, options={}, &block)
      @klass = klass
      @state_machine = AASM::StateMachine[@klass]
      @state_machine.config.column ||= (options[:column] || :aasm_state).to_sym # aasm4
      # @state_machine.config.column = options[:column].to_sym if options[:column] # master
      @options = options

      # let's cry if the transition is invalid
      configure :whiny_transitions, true

      # create named scopes for each state
      configure :create_scopes, true

      # don't store any new state if the model is invalid (in ActiveRecord)
      configure :skip_validation_on_save, false

      # use requires_new for nested transactions (in ActiveRecord)
      configure :requires_new_transaction, true

      # set to true to forbid direct assignment of aasm_state column (in ActiveRecord)
      configure :no_direct_assignment, false

      configure :enum, nil

      # make sure to raise an error if no_direct_assignment is enabled
      # and attribute is directly assigned though
      @klass.class_eval %Q(
        def #{@state_machine.config.column}=(state_name)
          if self.class.aasm.state_machine.config.no_direct_assignment
            raise AASM::NoDirectAssignmentError.new(
              'direct assignment of AASM column has been disabled (see AASM configuration for this class)'
            )
          else
            super
          end
        end
      )
    end

    # This method is both a getter and a setter
    def attribute_name(column_name=nil)
      if column_name
        @state_machine.config.column = column_name.to_sym
      else
        @state_machine.config.column ||= :aasm_state
      end
      @state_machine.config.column
    end

    def initial_state(new_initial_state=nil)
      if new_initial_state
        @state_machine.initial_state = new_initial_state
      else
        @state_machine.initial_state
      end
    end

    # define a state
    def state(name, options={})
      @state_machine.add_state(name, @klass, options)

      @klass.send(:define_method, "#{name}?") do
        aasm.current_state == name
      end

      unless @klass.const_defined?("STATE_#{name.upcase}")
        @klass.const_set("STATE_#{name.upcase}", name)
      end
    end

    # define an event
    def event(name, options={}, &block)
      @state_machine.events[name] = AASM::Core::Event.new(name, options, &block)

      # an addition over standard aasm so that, before firing an event, you can ask
      # may_event? and get back a boolean that tells you whether the guard method
      # on the transition will let this happen.
      @klass.send(:define_method, "may_#{name}?") do |*args|
        aasm.may_fire_event?(name, *args)
      end

      @klass.send(:define_method, "#{name}!") do |*args, &block|
        aasm.current_event = "#{name}!".to_sym
        aasm_fire_event(name, {:persist => true}, *args, &block)
      end

      @klass.send(:define_method, "#{name}") do |*args, &block|
        aasm.current_event = name.to_sym
        aasm_fire_event(name, {:persist => false}, *args, &block)
      end
    end

    def states
      @state_machine.states
    end

    def events
      @state_machine.events.values
    end

    # aasm.event(:event_name).human?
    def human_event_name(event) # event_name?
      AASM::Localizer.new.human_event_name(@klass, event)
    end

    def states_for_select
      states.map { |state| state.for_select }
    end

    def from_states_for_state(state, options={})
      if options[:transition]
        @state_machine.events[options[:transition]].transitions_to_state(state).flatten.map(&:from).flatten
      else
        events.map {|e| e.transitions_to_state(state)}.flatten.map(&:from).flatten
      end
    end

    private

    def configure(key, default_value)
      if @options.key?(key)
        @state_machine.config.send("#{key}=", @options[key])
      elsif @state_machine.config.send(key).nil?
        @state_machine.config.send("#{key}=", default_value)
      end
    end

  end
end


text:
// *****************************************************************************
//
//  © Component Factory Pty Ltd 2012. All rights reserved.
//	The software and associated documentation supplied hereunder are the
//  proprietary information of Component Factory Pty Ltd, 17/267 Nepean Hwy,
//  Seaford, Vic 3198, Australia and are supplied subject to licence terms.
//
//  Version 4.4.1.0 	www.ComponentFactory.com
// *****************************************************************************

using System;
using System.Text;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections.Generic;

namespace ComponentFactory.Krypton.Toolkit
{
	/// <summary>
	/// Storage for button entries of the professional color table.
	/// </summary>
    public class KryptonPaletteTMSButton : KryptonPaletteTMSBase
    {
        #region Identity
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteKCTButton class.
		/// </summary>
        /// <param name="internalKCT">Reference to inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteTMSButton(KryptonInternalKCT internalKCT,
                                         NeedPaintHandler needPaint)
            : base(internalKCT, needPaint)
		{
		}
        #endregion

		#region IsDefault
		/// <summary>
		/// Gets a value indicating if all values are default.
		/// </summary>
		[Browsable(false)]
		public override bool IsDefault
		{
			get
			{
                return (InternalKCT.InternalButtonCheckedGradientBegin == Color.Empty) &&
                       (InternalKCT.InternalButtonCheckedGradientEnd == Color.Empty) &&
                       (InternalKCT.InternalButtonCheckedGradientMiddle == Color.Empty) &&
                       (InternalKCT.InternalButtonCheckedHighlight == Color.Empty) &&
                       (InternalKCT.InternalButtonCheckedHighlightBorder == Color.Empty) &&
                       (InternalKCT.InternalButtonPressedBorder == Color.Empty) &&
                       (InternalKCT.InternalButtonPressedGradientBegin == Color.Empty) &&
                       (InternalKCT.InternalButtonPressedGradientEnd == Color.Empty) &&
                       (InternalKCT.InternalButtonPressedGradientMiddle == Color.Empty) &&
                       (InternalKCT.InternalButtonPressedHighlight == Color.Empty) &&
                       (InternalKCT.InternalButtonPressedHighlightBorder == Color.Empty) &&
                       (InternalKCT.InternalButtonSelectedBorder == Color.Empty) &&
                       (InternalKCT.InternalButtonSelectedGradientBegin == Color.Empty) &&
                       (InternalKCT.InternalButtonSelectedGradientEnd == Color.Empty) &&
                       (InternalKCT.InternalButtonSelectedGradientMiddle == Color.Empty) &&
                       (InternalKCT.InternalButtonSelectedHighlight == Color.Empty) &&
                       (InternalKCT.InternalButtonSelectedHighlightBorder == Color.Empty) &&
                       (InternalKCT.InternalCheckBackground == Color.Empty) &&
                       (InternalKCT.InternalCheckPressedBackground == Color.Empty) &&
                       (InternalKCT.InternalCheckSelectedBackground == Color.Empty) &&
                       (InternalKCT.InternalOverflowButtonGradientBegin == Color.Empty) &&
                       (InternalKCT.InternalOverflowButtonGradientEnd == Color.Empty) &&
                       (InternalKCT.InternalOverflowButtonGradientMiddle == Color.Empty);
			}
		}
		#endregion

        #region PopulateFromBase
        /// <summary>
        /// Populate values from the base palette.
        /// </summary>
        public void PopulateFromBase()
        {
            ButtonCheckedGradientBegin = InternalKCT.ButtonCheckedGradientBegin;
            ButtonCheckedGradientEnd = InternalKCT.ButtonCheckedGradientEnd;
            ButtonCheckedGradientMiddle = InternalKCT.ButtonCheckedGradientMiddle;
            ButtonCheckedHighlight = InternalKCT.ButtonCheckedHighlight;
            ButtonCheckedHighlightBorder = InternalKCT.ButtonCheckedHighlightBorder;
            ButtonPressedBorder = InternalKCT.ButtonPressedBorder;
            ButtonPressedGradientBegin = InternalKCT.ButtonPressedGradientBegin;
            ButtonPressedGradientEnd = InternalKCT.ButtonPressedGradientEnd;
            ButtonPressedGradientMiddle = InternalKCT.ButtonPressedGradientMiddle;
            ButtonPressedHighlight = InternalKCT.ButtonPressedHighlight;
            ButtonPressedHighlightBorder = InternalKCT.ButtonPressedHighlightBorder;
            ButtonSelectedBorder = InternalKCT.ButtonSelectedBorder;
            ButtonSelectedGradientBegin = InternalKCT.ButtonSelectedGradientBegin;
            ButtonSelectedGradientEnd = InternalKCT.ButtonSelectedGradientEnd;
            ButtonSelectedGradientMiddle = InternalKCT.ButtonSelectedGradientMiddle;
            ButtonSelectedHighlight = InternalKCT.ButtonSelectedHighlight;
            ButtonSelectedHighlightBorder = InternalKCT.ButtonSelectedHighlightBorder;
            CheckBackground = InternalKCT.CheckBackground;
            CheckPressedBackground = InternalKCT.CheckPressedBackground;
            CheckSelectedBackground = InternalKCT.CheckSelectedBackground;
            OverflowButtonGradientBegin = InternalKCT.OverflowButtonGradientBegin;
            OverflowButtonGradientEnd = InternalKCT.OverflowButtonGradientEnd;
            OverflowButtonGradientMiddle = InternalKCT.OverflowButtonGradientMiddle;
        }
        #endregion

        #region ButtonCheckedGradientBegin
        /// <summary>
        /// Gets and sets the starting color of the gradient used when the button is checked.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Starting color of the gradient used when the button is checked.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonCheckedGradientBegin
        {
            get { return InternalKCT.InternalButtonCheckedGradientBegin; }

            set
            {
                InternalKCT.InternalButtonCheckedGradientBegin = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonCheckedGradientBegin property to its default value.
        /// </summary>
        public void ResetButtonCheckedGradientBegin()
        {
            ButtonCheckedGradientBegin = Color.Empty;
        }
        #endregion

        #region ButtonCheckedGradientEnd
        /// <summary>
        /// Gets and sets the ending color of the gradient used when the button is checked.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Ending color of the gradient used when the button is checked.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonCheckedGradientEnd
        {
            get { return InternalKCT.InternalButtonCheckedGradientEnd; }

            set
            {
                InternalKCT.InternalButtonCheckedGradientEnd = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonCheckedGradientEnd property to its default value.
        /// </summary>
        public void ResetButtonCheckedGradientEnd()
        {
            ButtonCheckedGradientEnd = Color.Empty;
        }
        #endregion

        #region ButtonCheckedGradientMiddle
        /// <summary>
        /// Gets and sets the middle color of the gradient used when the button is checked.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Middle color of the gradient used when the button is checked.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonCheckedGradientMiddle
        {
            get { return InternalKCT.InternalButtonCheckedGradientMiddle; }

            set
            {
                InternalKCT.InternalButtonCheckedGradientMiddle = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonCheckedGradientMiddle property to its default value.
        /// </summary>
        public void ResetButtonCheckedGradientMiddle()
        {
            ButtonCheckedGradientMiddle = Color.Empty;
        }
        #endregion

        #region ButtonCheckedHighlight
        /// <summary>
        /// Gets and sets the highlight color used when the button is checked.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Highlight color used when the button is checked.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonCheckedHighlight
        {
            get { return InternalKCT.InternalButtonCheckedHighlight; }

            set
            {
                InternalKCT.InternalButtonCheckedHighlight = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonCheckedHighlight property to its default value.
        /// </summary>
        public void ResetButtonCheckedHighlight()
        {
            ButtonCheckedHighlight = Color.Empty;
        }
        #endregion

        #region ButtonCheckedHighlightBorder
        /// <summary>
        /// Gets and sets the border color to use with ButtonCheckedHighlight.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Border color to use with ButtonCheckedHighlight.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonCheckedHighlightBorder
        {
            get { return InternalKCT.InternalButtonCheckedHighlightBorder; }

            set
            {
                InternalKCT.InternalButtonCheckedHighlightBorder = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonCheckedHighlightBorder property to its default value.
        /// </summary>
        public void ResetButtonCheckedHighlightBorder()
        {
            ButtonCheckedHighlightBorder = Color.Empty;
        }
        #endregion

        #region ButtonPressedBorder
        /// <summary>
        /// Gets and sets the border color to use with the ButtonPressedGradientBegin, ButtonPressedGradientMiddle, and ButtonPressedGradientEnd colors.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Border color to use with the ButtonPressedGradientBegin, ButtonPressedGradientMiddle, and ButtonPressedGradientEnd colors.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonPressedBorder
        {
            get { return InternalKCT.InternalButtonPressedBorder; }

            set
            {
                InternalKCT.InternalButtonPressedBorder = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonPressedBorder property to its default value.
        /// </summary>
        public void ResetButtonPressedBorder()
        {
            ButtonPressedBorder = Color.Empty;
        }
        #endregion

        #region ButtonPressedGradientBegin
        /// <summary>
        /// Gets and sets the starting color of the gradient used when the button is pressed.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Starting color of the gradient used when the button is pressed.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonPressedGradientBegin
        {
            get { return InternalKCT.InternalButtonPressedGradientBegin; }

            set
            {
                InternalKCT.InternalButtonPressedGradientBegin = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonPressedGradientBegin property to its default value.
        /// </summary>
        public void ResetButtonPressedGradientBegin()
        {
            ButtonPressedGradientBegin = Color.Empty;
        }
        #endregion

        #region ButtonPressedGradientEnd
        /// <summary>
        /// Gets and sets the ending color of the gradient used when the button is pressed.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Ending color of the gradient used when the button is pressed.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonPressedGradientEnd
        {
            get { return InternalKCT.InternalButtonPressedGradientEnd; }

            set
            {
                InternalKCT.InternalButtonPressedGradientEnd = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonPressedGradientEnd property to its default value.
        /// </summary>
        public void ResetButtonPressedGradientEnd()
        {
            ButtonPressedGradientEnd = Color.Empty;
        }
        #endregion

        #region ButtonPressedGradientMiddle
        /// <summary>
        /// Gets and sets the middle color of the gradient used when the button is pressed.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Middle olor of the gradient used when the button is pressed.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonPressedGradientMiddle
        {
            get { return InternalKCT.InternalButtonPressedGradientMiddle; }

            set
            {
                InternalKCT.InternalButtonPressedGradientMiddle = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonPressedGradientMiddle property to its default value.
        /// </summary>
        public void ResetButtonPressedGradientMiddle()
        {
            ButtonPressedGradientMiddle = Color.Empty;
        }
        #endregion

        #region ButtonPressedHighlight
        /// <summary>
        /// Gets and sets the solid color used when the button is pressed.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Solid color used when the button is pressed.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonPressedHighlight
        {
            get { return InternalKCT.InternalButtonPressedHighlight; }

            set
            {
                InternalKCT.InternalButtonPressedHighlight = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonPressedHighlight property to its default value.
        /// </summary>
        public void ResetButtonPressedHighlight()
        {
            ButtonPressedHighlight = Color.Empty;
        }
        #endregion

        #region ButtonPressedHighlightBorder
        /// <summary>
        /// Gets and sets the border color to use with ButtonPressedHighlight.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Border color to use with ButtonPressedHighlight.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonPressedHighlightBorder
        {
            get { return InternalKCT.InternalButtonPressedHighlightBorder; }

            set
            {
                InternalKCT.InternalButtonPressedHighlightBorder = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonPressedHighlightBorder property to its default value.
        /// </summary>
        public void ResetButtonPressedHighlightBorder()
        {
            ButtonPressedHighlightBorder = Color.Empty;
        }
        #endregion

        #region ButtonSelectedBorder
        /// <summary>
        /// Gets and sets the border color to use with the ButtonSelectedGradientBegin, ButtonSelectedGradientMiddle, and ButtonSelectedGradientEnd colors.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Border color to use with the ButtonSelectedGradientBegin, ButtonSelectedGradientMiddle, and ButtonSelectedGradientEnd colors.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonSelectedBorder
        {
            get { return InternalKCT.InternalButtonSelectedBorder; }

            set
            {
                InternalKCT.InternalButtonSelectedBorder = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonSelectedBorder property to its default value.
        /// </summary>
        public void ResetButtonSelectedBorder()
        {
            ButtonSelectedBorder = Color.Empty;
        }
        #endregion

        #region ButtonSelectedGradientBegin
        /// <summary>
        /// Gets and sets the starting color of the gradient used when the button is selected.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Starting color of the gradient used when the button is selected.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonSelectedGradientBegin
        {
            get { return InternalKCT.InternalButtonSelectedGradientBegin; }

            set
            {
                InternalKCT.InternalButtonSelectedGradientBegin = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonSelectedGradientBegin property to its default value.
        /// </summary>
        public void ResetButtonSelectedGradientBegin()
        {
            ButtonSelectedGradientBegin = Color.Empty;
        }
        #endregion

        #region ButtonSelectedGradientEnd
        /// <summary>
        /// Gets and sets the ending color of the gradient used when the button is selected.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Ending color of the gradient used when the button is selected.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonSelectedGradientEnd
        {
            get { return InternalKCT.InternalButtonSelectedGradientEnd; }

            set
            {
                InternalKCT.InternalButtonSelectedGradientEnd = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonSelectedGradientEnd property to its default value.
        /// </summary>
        public void ResetButtonSelectedGradientEnd()
        {
            ButtonSelectedGradientEnd = Color.Empty;
        }
        #endregion

        #region ButtonSelectedGradientMiddle
        /// <summary>
        /// Gets and sets the middle color of the gradient used when the button is selected.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Middle olor of the gradient used when the button is selected.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonSelectedGradientMiddle
        {
            get { return InternalKCT.InternalButtonSelectedGradientMiddle; }

            set
            {
                InternalKCT.InternalButtonSelectedGradientMiddle = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonSelectedGradientMiddle property to its default value.
        /// </summary>
        public void ResetButtonSelectedGradientMiddle()
        {
            ButtonSelectedGradientMiddle = Color.Empty;
        }
        #endregion

        #region ButtonSelectedHighlight
        /// <summary>
        /// Gets and sets the solid color used when the button is selected.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Solid color used when the button is selected.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonSelectedHighlight
        {
            get { return InternalKCT.InternalButtonSelectedHighlight; }

            set
            {
                InternalKCT.InternalButtonSelectedHighlight = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonSelectedHighlight property to its default value.
        /// </summary>
        public void ResetButtonSelectedHighlight()
        {
            ButtonSelectedHighlight = Color.Empty;
        }
        #endregion

        #region ButtonSelectedHighlightBorder
        /// <summary>
        /// Gets and sets the border color to use with ButtonSelectedHighlight.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Border color to use with ButtonSelectedHighlight.")]
        [KryptonDefaultColorAttribute()]
        public Color ButtonSelectedHighlightBorder
        {
            get { return InternalKCT.InternalButtonSelectedHighlightBorder; }

            set
            {
                InternalKCT.InternalButtonSelectedHighlightBorder = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// Resets the ButtonSelectedHighlightBorder property to its default value.
        /// </summary>
        public void ResetButtonSelectedHighlightBorder()
        {
            ButtonSelectedHighlightBorder = Color.Empty;
        }
        #endregion

        #region CheckBackground
        /// <summary>
        /// Gets and sets the solid color to use when the button is checked and gradients are being used.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Solid color to use when the button is checked and gradients are being used.")]
        [KryptonDefaultColorAttribute()]
        public Color CheckBackground
        {
            get { return InternalKCT.InternalCheckBackground; }

            set
            {
                InternalKCT.InternalCheckBackground = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// esets the CheckBackground property to its default value.
        /// </summary>
        public void ResetCheckBackground()
        {
            CheckBackground = Color.Empty;
        }
        #endregion

        #region CheckPressedBackground
        /// <summary>
        /// Gets and sets the solid color to use when the button is checked and selected and gradients are being used.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Solid color to use when the button is checked and selected and gradients are being used.")]
        [KryptonDefaultColorAttribute()]
        public Color CheckPressedBackground
        {
            get { return InternalKCT.InternalCheckPressedBackground; }

            set
            {
                InternalKCT.InternalCheckPressedBackground = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// esets the CheckPressedBackground property to its default value.
        /// </summary>
        public void ResetCheckPressedBackground()
        {
            CheckPressedBackground = Color.Empty;
        }
        #endregion

        #region CheckSelectedBackground
        /// <summary>
        /// Gets and sets the solid color to use when the button is checked and selected and gradients are being used.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Solid color to use when the button is checked and selected and gradients are being used.")]
        [KryptonDefaultColorAttribute()]
        public Color CheckSelectedBackground
        {
            get { return InternalKCT.InternalCheckSelectedBackground; }

            set
            {
                InternalKCT.InternalCheckSelectedBackground = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// esets the CheckSelectedBackground property to its default value.
        /// </summary>
        public void ResetCheckSelectedBackground()
        {
            CheckSelectedBackground = Color.Empty;
        }
        #endregion

        #region OverflowButtonGradientBegin
        /// <summary>
        /// Gets and sets the starting color of the gradient used in the ToolStripOverflowButton.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Starting color of the gradient used in the ToolStripOverflowButton.")]
        [KryptonDefaultColorAttribute()]
        public Color OverflowButtonGradientBegin
        {
            get { return InternalKCT.InternalOverflowButtonGradientBegin; }

            set
            {
                InternalKCT.InternalOverflowButtonGradientBegin = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// esets the OverflowButtonGradientBegin property to its default value.
        /// </summary>
        public void ResetOverflowButtonGradientBegin()
        {
            OverflowButtonGradientBegin = Color.Empty;
        }
        #endregion

        #region OverflowButtonGradientEnd
        /// <summary>
        /// Gets and sets the ending color of the gradient used in the ToolStripOverflowButton.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Ending color of the gradient used in the ToolStripOverflowButton.")]
        [KryptonDefaultColorAttribute()]
        public Color OverflowButtonGradientEnd
        {
            get { return InternalKCT.InternalOverflowButtonGradientEnd; }

            set
            {
                InternalKCT.InternalOverflowButtonGradientEnd = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// esets the OverflowButtonGradientEnd property to its default value.
        /// </summary>
        public void ResetOverflowButtonGradientEnd()
        {
            OverflowButtonGradientEnd = Color.Empty;
        }
        #endregion

        #region OverflowButtonGradientMiddle
        /// <summary>
        /// Gets and sets the middle color of the gradient used in the ToolStripOverflowButton.
        /// </summary>
        [KryptonPersist(false)]
        [Category("ToolMenuStatus")]
        [Description("Middle color of the gradient used in the ToolStripOverflowButton.")]
        [KryptonDefaultColorAttribute()]
        public Color OverflowButtonGradientMiddle
        {
            get { return InternalKCT.InternalOverflowButtonGradientMiddle; }

            set
            {
                InternalKCT.InternalOverflowButtonGradientMiddle = value;
                PerformNeedPaint(false);
            }
        }

        /// <summary>
        /// esets the OverflowButtonGradientMiddle property to its default value.
        /// </summary>
        public void ResetOverflowButtonGradientMiddle()
        {
            OverflowButtonGradientMiddle = Color.Empty;
        }
        #endregion
    }
}


text:
{% extends base_template %}
{% load i18n %}
{% load mainreport_tags %}
{% block javascripts %}

    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/graphing/superfish/superfish.css" media="screen">

    {{ form.media }}
{% endblock %}
{% block page_stylesheets %}
    <link type="text/css" rel="stylesheet" href="{{MEDIA_URL}}/graphing/stylesheets/charts.css" />
{% endblock %}
{% block content %}

		{% include "graphing/inline_graphgroup.html" %}

	{% if thegraph.has_errors %}

Sorry, something went wrong displaying that chart.  Please tell your administrator about this!

    {% else %}
        {% if thegraph.time_bound  %}

{% get_daterange_links_basic "" thegraph.date_range_list %}

        {% endif %}
        Printable View
        Data View
        Download Data

        {% with thegraph as chart %}
		   {% include "graphing/inline_rawgraph.html" %}
	    {% endwith %}

-- show/hide data --

{% include "graphing/partials/graph_data_table.html" %}

    {% endif %}
{%endblock%}


text:
<?php

namespace Magento\Braintree\Block\Adminhtml\Form\Field;

class Cctypes extends \Magento\Framework\View\Element\Html\Select
{
    /**
     * All possible credit card types
     *
     * @var array
     */
    protected $ccTypes = [];

    /**
     * @var \Magento\Braintree\Model\Source\CcType
     */
    protected $ccTypeSource;

    /**
     * Constructor
     *
     * @param \Magento\Framework\View\Element\Context $context
     * @param \Magento\Braintree\Model\Source\CcType $ccTypeSource
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\View\Element\Context $context,
        \Magento\Braintree\Model\Source\CcType $ccTypeSource,
        array $data = []
    ) {
        parent::__construct($context, $data);
        $this->ccTypeSource = $ccTypeSource;
    }

    /**
     * Render block HTML
     *
     * @return string
     */
    public function _toHtml()
    {
        if (!$this->getOptions()) {
            foreach ($this->_getCcTypes() as $country) {
                if (isset($country['value']) && $country['value'] && isset($country['label']) && $country['label']) {
                    $this->addOption($country['value'], $country['label']);
                }
            }
        }
        $this->setClass('cc-type-select');
        $this->setExtraParams('multiple="multiple"');
        return parent::_toHtml();
    }

    /**
     * All possible credit card types
     *
     * @return array
     */
    protected function _getCcTypes()
    {
        if (!$this->ccTypes) {
            $this->ccTypes = $this->ccTypeSource->toOptionArray();
        }
        return $this->ccTypes;
    }

    /**
     * Sets name for input element
     *
     * @param string $value
     * @return $this
     */
    public function setInputName($value)
    {
        return $this->setName($value . '[]');
    }
}


text:
'use strict';

var path = require('path');
var pluginError = require('plugin-error');
var log = require('plugin-log');
var through = require('through2');
var bump = require('bump-regex');
var semver = require('semver');

var PLUGIN_NAME = 'gulp-bump';

module.exports = function(opts) {

  opts = opts || {};
  if (!opts.type || !semver.inc('0.0.1', opts.type)) {
    opts.type = 'patch';
  }

  return through.obj(function(file, enc, cb) {

    if (file.isNull()) {
      return cb(null, file);
    }
    if (file.isStream()) {
      return cb(new pluginError(PLUGIN_NAME, 'Streaming not supported'));
    }

    opts.str = String(file.contents);
    bump(opts, function(err, res) {
      if (err) {
        return cb(new pluginError(PLUGIN_NAME, err));
      }
      file.contents = new Buffer(res.str);

      if (!opts.quiet) {
      log('Bumped', log.colors.cyan(res.prev),
        'to', log.colors.magenta(res.new),
        'with type:', log.colors.cyan(res.type));
      }
      file.bumpData = res;
      cb(null, file);
    });
  });
};


text:
package org.elasticsearch.index.reindex;

import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
import org.elasticsearch.action.bulk.BackoffPolicy;
import org.elasticsearch.action.bulk.BulkItemResponse;
import org.elasticsearch.action.bulk.BulkItemResponse.Failure;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.bulk.Retry;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.ClearScrollRequest;
import org.elasticsearch.action.search.ClearScrollResponse;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchScrollRequest;
import org.elasticsearch.action.search.ShardSearchFailure;
import org.elasticsearch.client.ParentTaskAssigningClient;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.threadpool.ThreadPool;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;

import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.util.Collections.emptyList;
import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.action.bulk.BackoffPolicy.exponentialBackoff;
import static org.elasticsearch.common.unit.TimeValue.timeValueNanos;
import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;
import static org.elasticsearch.index.reindex.AbstractBulkByScrollRequest.SIZE_ALL_MATCHES;
import static org.elasticsearch.rest.RestStatus.CONFLICT;
import static org.elasticsearch.search.sort.SortBuilders.fieldSort;

/**
 * Abstract base for scrolling across a search and executing bulk actions on all results. All package private methods are package private so
 * their tests can use them. Most methods run in the listener thread pool because the are meant to be fast and don't expect to block.
 */
public abstract class AbstractAsyncBulkByScrollAction<Request extends AbstractBulkByScrollRequest<Request>> {
    /**
     * The request for this action. Named mainRequest because we create lots of request variables all representing child
     * requests of this mainRequest.
     */
    protected final Request mainRequest;
    protected final BulkByScrollTask task;

    private final AtomicLong startTime = new AtomicLong(-1);
    private final AtomicReference<String> scroll = new AtomicReference<>();
    private final AtomicLong lastBatchStartTime = new AtomicLong(-1);
    private final Set<String> destinationIndices = Collections.newSetFromMap(new ConcurrentHashMap<>());

    private final ESLogger logger;
    private final ParentTaskAssigningClient client;
    private final ThreadPool threadPool;
    private final SearchRequest firstSearchRequest;
    private final ActionListener<BulkIndexByScrollResponse> listener;
    private final BackoffPolicy backoffPolicy;
    private final Retry bulkRetry;

    public AbstractAsyncBulkByScrollAction(BulkByScrollTask task, ESLogger logger, ParentTaskAssigningClient client,
                                           ThreadPool threadPool, Request mainRequest, SearchRequest firstSearchRequest,
                                           ActionListener<BulkIndexByScrollResponse> listener) {
        this.task = task;
        this.logger = logger;
        this.client = client;
        this.threadPool = threadPool;
        this.mainRequest = mainRequest;
        this.firstSearchRequest = firstSearchRequest;
        this.listener = listener;
        backoffPolicy = buildBackoffPolicy();
        bulkRetry = Retry.on(EsRejectedExecutionException.class).policy(wrapBackoffPolicy(backoffPolicy));
    }

    protected abstract BulkRequest buildBulk(Iterable<SearchHit> docs);

    /**
     * Build the response for reindex actions.
     */
    protected BulkIndexByScrollResponse buildResponse(TimeValue took, List<BulkItemResponse.Failure> indexingFailures,
                                                      List<ShardSearchFailure> searchFailures, boolean timedOut) {
        return new BulkIndexByScrollResponse(took, task.getStatus(), indexingFailures, searchFailures, timedOut);
    }

    /**
     * Start the action by firing the initial search request.
     */
    public void start() {
        if (task.isCancelled()) {
            finishHim(null);
            return;
        }
        try {
            // Default to sorting by _doc if it hasn't been changed.
            if (firstSearchRequest.source().sorts() == null) {
                firstSearchRequest.source().sort(fieldSort("_doc"));
            }
            startTime.set(System.nanoTime());
            if (logger.isDebugEnabled()) {
                logger.debug("executing initial scroll against {}{}",
                        firstSearchRequest.indices() == null || firstSearchRequest.indices().length == 0 ? "all indices"
                                : firstSearchRequest.indices(),
                        firstSearchRequest.types() == null || firstSearchRequest.types().length == 0 ? ""
                                : firstSearchRequest.types());
            }
        } catch (Throwable t) {
            finishHim(t);
            return;
        }
        searchWithRetry(listener -> client.search(firstSearchRequest, listener), (SearchResponse response) -> {
            logger.debug("[{}] documents match query", response.getHits().getTotalHits());
            onScrollResponse(timeValueSeconds(0), response);
        });
    }

    /**
     * Process a scroll response.
     * @param delay how long to delay processesing the response. This delay is how throttling is applied to the action.
     * @param searchResponse the scroll response to process
     */
    void onScrollResponse(TimeValue delay, SearchResponse searchResponse) {
        if (task.isCancelled()) {
            finishHim(null);
            return;
        }
        setScroll(searchResponse.getScrollId());
        if (    // If any of the shards failed that should abort the request.
                (searchResponse.getShardFailures() != null && searchResponse.getShardFailures().length > 0)
                // Timeouts aren't shard failures but we still need to pass them back to the user.
                || searchResponse.isTimedOut()
                ) {
            startNormalTermination(emptyList(), unmodifiableList(Arrays.asList(searchResponse.getShardFailures())),
                    searchResponse.isTimedOut());
            return;
        }
        long total = searchResponse.getHits().totalHits();
        if (mainRequest.getSize() > 0) {
            total = min(total, mainRequest.getSize());
        }
        task.setTotal(total);
        AbstractRunnable prepareBulkRequestRunnable = new AbstractRunnable() {
            @Override
            protected void doRun() throws Exception {
                prepareBulkRequest(searchResponse);
            }

            @Override
            public void onFailure(Throwable t) {
                finishHim(t);
            }
        };
        prepareBulkRequestRunnable = (AbstractRunnable) threadPool.getThreadContext().preserveContext(prepareBulkRequestRunnable);
        task.delayPrepareBulkRequest(threadPool, delay, prepareBulkRequestRunnable);
    }

    /**
     * Prepare the bulk request. Called on the generic thread pool after some preflight checks have been done one the SearchResponse and any
     * delay has been slept. Uses the generic thread pool because reindex is rare enough not to need its own thread pool and because the
     * thread may be blocked by the user script.
     */
    void prepareBulkRequest(SearchResponse searchResponse) {
        if (task.isCancelled()) {
            finishHim(null);
            return;
        }
        lastBatchStartTime.set(System.nanoTime());
        SearchHit[] docs = searchResponse.getHits().getHits();
        logger.debug("scroll returned [{}] documents with a scroll id of [{}]", docs.length, searchResponse.getScrollId());
        if (docs.length == 0) {
            startNormalTermination(emptyList(), emptyList(), false);
            return;
        }
        task.countBatch();
        List<SearchHit> docsIterable = Arrays.asList(docs);
        if (mainRequest.getSize() != SIZE_ALL_MATCHES) {
            // Truncate the docs if we have more than the request size
            long remaining = max(0, mainRequest.getSize() - task.getSuccessfullyProcessed());
            if (remaining < docs.length) {
                docsIterable = docsIterable.subList(0, (int) remaining);
            }
        }
        BulkRequest request = buildBulk(docsIterable);
        if (request.requests().isEmpty()) {
            /*
             * If we noop-ed the entire batch then just skip to the next batch or the BulkRequest would fail validation.
             */
            startNextScroll(0);
            return;
        }
        request.timeout(mainRequest.getTimeout());
        request.consistencyLevel(mainRequest.getConsistency());
        if (logger.isDebugEnabled()) {
            logger.debug("sending [{}] entry, [{}] bulk request", request.requests().size(),
                    new ByteSizeValue(request.estimatedSizeInBytes()));
        }
        sendBulkRequest(request);
    }

    /**
     * Send a bulk request, handling retries.
     */
    void sendBulkRequest(BulkRequest request) {
        if (task.isCancelled()) {
            finishHim(null);
            return;
        }
        bulkRetry.withAsyncBackoff(client, request, new ActionListener<BulkResponse>() {
            @Override
            public void onResponse(BulkResponse response) {
                onBulkResponse(response);
            }

            @Override
            public void onFailure(Throwable e) {
                finishHim(e);
            }
        });
    }

    /**
     * Processes bulk responses, accounting for failures.
     */
    void onBulkResponse(BulkResponse response) {
        try {
            List<Failure> failures = new ArrayList<Failure>();
            Set<String> destinationIndicesThisBatch = new HashSet<>();
            for (BulkItemResponse item : response) {
                if (item.isFailed()) {
                    recordFailure(item.getFailure(), failures);
                    continue;
                }

                switch (item.getOpType()) {
                case "index":
                case "create":
                    IndexResponse ir = item.getResponse();
                    if (ir.isCreated()) {
                        task.countCreated();
                    } else {
                        task.countUpdated();
                    }
                    break;
                case "delete":
                    task.countDeleted();
                    break;
                default:
                    throw new IllegalArgumentException("Unknown op type:  " + item.getOpType());
                }
                // Track the indexes we've seen so we can refresh them if requested
                destinationIndicesThisBatch.add(item.getIndex());
            }

            if (task.isCancelled()) {
                finishHim(null);
                return;
            }

            addDestinationIndices(destinationIndicesThisBatch);

            if (false == failures.isEmpty()) {
                startNormalTermination(unmodifiableList(failures), emptyList(), false);
                return;
            }

            if (mainRequest.getSize() != SIZE_ALL_MATCHES && task.getSuccessfullyProcessed() >= mainRequest.getSize()) {
                // We've processed all the requested docs.
                startNormalTermination(emptyList(), emptyList(), false);
                return;
            }

            startNextScroll(response.getItems().length);
        } catch (Throwable t) {
            finishHim(t);
        }
    }

    /**
     * Start the next scroll request.
     *
     * @param lastBatchSize the number of requests sent in the last batch. This is used to calculate the throttling values which are applied
     *        when the scroll returns
     */
    void startNextScroll(int lastBatchSize) {
        if (task.isCancelled()) {
            finishHim(null);
            return;
        }
        long earliestNextBatchStartTime = lastBatchStartTime.get() + (long) perfectlyThrottledBatchTime(lastBatchSize);
        long waitTime = max(0, earliestNextBatchStartTime - System.nanoTime());
        SearchScrollRequest request = new SearchScrollRequest();
        // Add the wait time into the scroll timeout so it won't timeout while we wait for throttling
        request.scrollId(scroll.get()).scroll(timeValueNanos(firstSearchRequest.scroll().keepAlive().nanos() + waitTime));
        searchWithRetry(listener -> client.searchScroll(request, listener), (SearchResponse response) -> {
            onScrollResponse(timeValueNanos(max(0, earliestNextBatchStartTime - System.nanoTime())), response);
        });
    }

    /**
     * How many nanoseconds should a batch of lastBatchSize have taken if it were perfectly throttled? Package private for testing.
     */
    float perfectlyThrottledBatchTime(int lastBatchSize) {
        if (task.getRequestsPerSecond() == Float.POSITIVE_INFINITY) {
            return 0;
        }
        //       requests
        // ------------------- == seconds
        // request per seconds
        float targetBatchTimeInSeconds = lastBatchSize / task.getRequestsPerSecond();
        // nanoseconds per seconds * seconds == nanoseconds
        return TimeUnit.SECONDS.toNanos(1) * targetBatchTimeInSeconds;
    }

    private void recordFailure(Failure failure, List<Failure> failures) {
        if (failure.getStatus() == CONFLICT) {
            task.countVersionConflict();
            if (false == mainRequest.isAbortOnVersionConflict()) {
                return;
            }
        }
        failures.add(failure);
    }

    /**
     * Start terminating a request that finished non-catastrophically.
     */
    void startNormalTermination(List<Failure> indexingFailures, List<ShardSearchFailure> searchFailures, boolean timedOut) {
        if (task.isCancelled() || false == mainRequest.isRefresh() || destinationIndices.isEmpty()) {
            finishHim(null, indexingFailures, searchFailures, timedOut);
            return;
        }
        RefreshRequest refresh = new RefreshRequest();
        refresh.indices(destinationIndices.toArray(new String[destinationIndices.size()]));
        client.admin().indices().refresh(refresh, new ActionListener<RefreshResponse>() {
            @Override
            public void onResponse(RefreshResponse response) {
                finishHim(null, indexingFailures, searchFailures, timedOut);
            }

            @Override
            public void onFailure(Throwable e) {
                finishHim(e);
            }
        });
    }

    /**
     * Finish the request.
     *
     * @param failure if non null then the request failed catastrophically with this exception
     */
    void finishHim(Throwable failure) {
        finishHim(failure, emptyList(), emptyList(), false);
    }

    /**
     * Finish the request.
     *
     * @param failure if non null then the request failed catastrophically with this exception
     * @param indexingFailures any indexing failures accumulated during the request
     * @param searchFailures any search failures accumulated during the request
     * @param timedOut have any of the sub-requests timed out?
     */
    void finishHim(Throwable failure, List<Failure> indexingFailures, List<ShardSearchFailure> searchFailures, boolean timedOut) {
        String scrollId = scroll.get();
        if (Strings.hasLength(scrollId)) {
            /*
             * Fire off the clear scroll but don't wait for it it return before
             * we send the use their response.
             */
            ClearScrollRequest clearScrollRequest = new ClearScrollRequest();
            clearScrollRequest.addScrollId(scrollId);
            /*
             * Unwrap the client so we don't set our task as the parent. If we *did* set our ID then the clear scroll would be cancelled as
             * if this task is cancelled. But we want to clear the scroll regardless of whether or not the main request was cancelled.
             */
            client.unwrap().clearScroll(clearScrollRequest, new ActionListener<ClearScrollResponse>() {
                @Override
                public void onResponse(ClearScrollResponse response) {
                    logger.debug("Freed [{}] contexts", response.getNumFreed());
                }

                @Override
                public void onFailure(Throwable e) {
                    logger.warn("Failed to clear scroll [" + scrollId + ']', e);
                }
            });
        }
        if (failure == null) {
            listener.onResponse(
                    buildResponse(timeValueNanos(System.nanoTime() - startTime.get()), indexingFailures, searchFailures, timedOut));
        } else {
            listener.onFailure(failure);
        }
    }

    /**
     * Get the backoff policy for use with retries.
     */
    BackoffPolicy buildBackoffPolicy() {
        return exponentialBackoff(mainRequest.getRetryBackoffInitialTime(), mainRequest.getMaxRetries());
    }

    /**
     * Add to the list of indices that were modified by this request. This is the list of indices refreshed at the end of the request if the
     * request asks for a refresh.
     */
    void addDestinationIndices(Collection<String> indices) {
        destinationIndices.addAll(indices);
    }

    /**
     * Set the last returned scrollId. Exists entirely for testing.
     */
    void setScroll(String scroll) {
        this.scroll.set(scroll);
    }

    /**
     * Set the last batch's start time. Exists entirely for testing.
     */
    void setLastBatchStartTime(long newValue) {
        lastBatchStartTime.set(newValue);
    }

    /**
     * Get the last batch's start time. Exists entirely for testing.
     */
    long getLastBatchStartTime() {
        return lastBatchStartTime.get();
    }

    /**
     * Wraps a backoffPolicy in another policy that counts the number of backoffs acquired. Used to count bulk backoffs.
     */
    private BackoffPolicy wrapBackoffPolicy(BackoffPolicy backoffPolicy) {
        return new BackoffPolicy() {
            @Override
            public Iterator<TimeValue> iterator() {
                return new Iterator<TimeValue>() {
                    private final Iterator<TimeValue> delegate = backoffPolicy.iterator();
                    @Override
                    public boolean hasNext() {
                        return delegate.hasNext();
                    }

                    @Override
                    public TimeValue next() {
                        if (false == delegate.hasNext()) {
                            return null;
                        }
                        task.countBulkRetry();
                        return delegate.next();
                    }
                };
            }
        };
    }

    /**
     * Run a search action and call onResponse when a the response comes in, retrying if the action fails with an exception caused by
     * rejected execution.
     *
     * @param action consumes a listener and starts the action. The listener it consumes is rigged to retry on failure.
     * @param onResponse consumes the response from the action
     */
    private <T> void searchWithRetry(Consumer<ActionListener<T>> action, Consumer<T> onResponse) {
        class RetryHelper extends AbstractRunnable implements ActionListener<T> {
            private final Iterator<TimeValue> retries = backoffPolicy.iterator();

            @Override
            public void onResponse(T response) {
                onResponse.accept(response);
            }

            @Override
            protected void doRun() throws Exception {
                action.accept(this);
            }

            @Override
            public void onFailure(Throwable e) {
                if (ExceptionsHelper.unwrap(e, EsRejectedExecutionException.class) != null) {
                    if (retries.hasNext()) {
                        TimeValue delay = retries.next();
                        logger.trace("retrying rejected search after [{}]", e, delay);
                        threadPool.schedule(delay, ThreadPool.Names.SAME, this);
                        task.countSearchRetry();
                    } else {
                        logger.warn("giving up on search because we retried {} times without success", e, retries);
                        finishHim(e);
                    }
                } else {
                    logger.warn("giving up on search because it failed with a non-retryable exception", e);
                    finishHim(e);
                }
            }
        }
        new RetryHelper().run();
    }
}


text:
#ifndef CORNERRULE_H
#define CORNERRULE_H

#include "rule.h"

class CornerRule : public Rule
{
    Q_OBJECT
public:
    explicit CornerRule(QObject *parent = 0);
    virtual bool applicable(Gameboard board, int player);
    virtual void doTurn(Gameboard board, int player);
    virtual QString name();

private:
    int _x;
    int _y;
    bool _asked;
};

#endif // CORNERRULE_H


text:
using BaselineSolution.Bo.Internal;
using BaselineSolution.Framework.Infrastructure;
using BaselineSolution.Framework.Infrastructure.Contracts;

namespace BaselineSolution.WebApi.Infrastructure.Filters
{
    /// <summary>
    /// Transform the API filter to a <see cref="IEntityFilter{TEntity}"/>
    /// </summary>
    /// <typeparam name="TBo">Business object</typeparam>
    /// <typeparam name="TFilter">Business object filter</typeparam>
    public interface IFilterHandler<TBo, in TFilter>
        where TBo : BaseBo
    {
        /// <summary>
        /// Create a <see cref="IEntityFilter{TEntity}"/> from the given API filter
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        IEntityFilter<TBo> CreateFilter(TFilter filter);
    }
}


text:
@implementation SectionArray

- initWithSections:(NSUInteger)s rows:(NSUInteger)r
{
	if ((self = [self init]))
	{
		sections = [[NSMutableArray alloc] initWithCapacity:s];
		for (int i=0; i<s; i++)
		{
			rows = [[NSMutableArray alloc] initWithCapacity:r];
			for (int j=0; j<r; j++)
			{
				[rows insertObject:[NSNull null] atIndex:j];
			}
			[sections addObject:rows];
		}
	}
	return self;
}

+ sectionArrayWithSections:(NSUInteger)s rows:(NSUInteger)r
{
	return [[[self alloc] initWithSections:s rows:r] autorelease];
}

- objectInSection:(NSUInteger)s row:(NSUInteger)r
{
	return [[sections objectAtIndex:s] objectAtIndex:r];
}

- (void)insertObject:o inSection:(NSUInteger)s row:(NSUInteger)r
{
	[[sections objectAtIndex:s] replaceObjectAtIndex:r withObject:o];
}

- (void)replaceRow:(NSMutableArray*)row atIndex:(NSUInteger)index
{
	[sections replaceObjectAtIndex:index withObject:row];
}

- (NSMutableArray*)getRow:(NSUInteger)row
{
	return [sections objectAtIndex:row];
}

- (NSUInteger)sectionsCount
{
	return [sections count];
}

- (NSUInteger)rowsCount
{
	return [rows count];
}

- (void)dealloc
{
	[sections release];
	[rows release];
	[super dealloc];
}

@end