text:
#ifndef	_BER_TLV_TAG_H_
#define	_BER_TLV_TAG_H_

#ifdef __cplusplus
extern "C" {
#endif

enum asn_tag_class {
	ASN_TAG_CLASS_UNIVERSAL		= 0,	/* 0b00 */
	ASN_TAG_CLASS_APPLICATION	= 1,	/* 0b01 */
	ASN_TAG_CLASS_CONTEXT		= 2,	/* 0b10 */
	ASN_TAG_CLASS_PRIVATE		= 3	/* 0b11 */
};
typedef unsigned ber_tlv_tag_t;	/* BER TAG from Tag-Length-Value */

/*
 * Tag class is encoded together with tag value for optimization purposes.
 */
#define	BER_TAG_CLASS(tag)	((tag) & 0x3)
#define	BER_TAG_VALUE(tag)	((tag) >> 2)
#define	BER_TLV_CONSTRUCTED(tagptr)	(((*(const uint8_t *)tagptr)&0x20)?1:0)

#define	BER_TAGS_EQUAL(tag1, tag2)	((tag1) == (tag2))

/*
 * Several functions for printing the TAG in the canonical form
 * (i.e. "[PRIVATE 0]").
 * Return values correspond to their libc counterparts (if any).
 */
ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen);
ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *);
char *ber_tlv_tag_string(ber_tlv_tag_t tag);

/*
 * This function tries to fetch the tag from the input stream.
 * RETURN VALUES:
 * 	 0:	More data expected than bufptr contains.
 * 	-1:	Fatal error deciphering tag.
 *	>0:	Number of bytes used from bufptr. tag_r will contain the tag.
 */
ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r);

/*
 * This function serializes the tag (T from TLV) in BER format.
 * It always returns number of bytes necessary to represent the tag,
 * it is a caller's responsibility to check the return value
 * against the supplied buffer's size.
 */
size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size);

#ifdef __cplusplus
}
#endif

#endif	/* _BER_TLV_TAG_H_ */


text:
require 'test/unit'
require "stringio"

require "GeometryManager"

##____________________________________________________________________________||
class TestGeometryManager < Test::Unit::TestCase

  class MockPartBuilder
    def build(sectionName, inDDL, geometryManager)
      inDDL
    end
  end

  class MockPartManager
    attr_reader :parts
    def initialize
      @parts = Array.new
    end
    def add part
      @parts << part
    end
  end

  def setup
    @geometryManager = GeometryManager.new

    @materialsManager = MockPartManager.new
    @rotationsManager = MockPartManager.new
    @solidsManager = MockPartManager.new
    @logicalPartsManager = MockPartManager.new
    @posPartsManager = MockPartManager.new

    @geometryManager.materialsManager = @materialsManager
    @geometryManager.rotationsManager = @rotationsManager
    @geometryManager.solidsManager = @solidsManager
    @geometryManager.logicalPartsManager = @logicalPartsManager
    @geometryManager.posPartsManager = @posPartsManager

    @partBuilder = MockPartBuilder.new
    @geometryManager.partBuilder = @partBuilder

  end

  def test_add_entry

    @geometryManager.add_entry(:MaterialSection, "GeometryExtended", "ElementaryMaterial", {"name"=>"materials:materialA"})
    @geometryManager.add_entry(:MaterialSection, "GeometryExtended", "ElementaryMaterial", {"name"=>"materials:materialB"})
    @geometryManager.add_entry(:MaterialSection, "GeometryExtended", "CompositeMaterial", {"name"=>"materials:materialC"})
    @geometryManager.add_entry(:RotationSection, "GeometryExtended", "Rotation", {"name"=>"rotations:rotationA"})
    @geometryManager.add_entry(:RotationSection, "GeometryExtended", "Rotation", {"name"=>"rotations:rotationB"})
    @geometryManager.add_entry(:RotationSection, "GeometryExtended", "ReflectionRotation", {"name"=>"rotations:rotationC"})
    @geometryManager.add_entry(:SolidSection, "GeometryExtended", "Polyhedra", {"name"=>"solids:polyhedraA"})
    @geometryManager.add_entry(:SolidSection, "GeometryExtended", "Tubs", {"name"=>"solids:tubsA"})
    @geometryManager.add_entry(:LogicalPartSection, "GeometryExtended", "LogicalPart", {"name"=>"tracker:Tracker"})
    @geometryManager.add_entry(:PosPartSection, "GeometryExtended", "PosPart", {"copyNumber"=>"1"})

    assert_equal([
                  {:sectionLabel=>:GeometryExtended, :partName=>:ElementaryMaterial, :args=>{"name"=>"materials:materialA"}},
                  {:sectionLabel=>:GeometryExtended, :partName=>:ElementaryMaterial, :args=>{"name"=>"materials:materialB"}},
                  {:sectionLabel=>:GeometryExtended, :partName=>:CompositeMaterial, :args=>{"name"=>"materials:materialC"}},
                 ], @materialsManager.parts)

    assert_equal([
                  {:sectionLabel=>:GeometryExtended, :partName=>:Rotation, :args=>{"name"=>"rotations:rotationA"}},
                  {:sectionLabel=>:GeometryExtended, :partName=>:Rotation, :args=>{"name"=>"rotations:rotationB"}},
                  {:sectionLabel=>:GeometryExtended, :partName=>:ReflectionRotation, :args=>{"name"=>"rotations:rotationC"}},
                 ], @rotationsManager.parts)

    assert_equal([
                  {:sectionLabel=>:GeometryExtended, :partName=>:Polyhedra, :args=>{"name"=>"solids:polyhedraA"}},
                  {:sectionLabel=>:GeometryExtended, :partName=>:Tubs, :args=>{"name"=>"solids:tubsA"}},
                 ], @solidsManager.parts)

    assert_equal([
                  {:sectionLabel=>:GeometryExtended, :partName=>:LogicalPart, :args=>{"name"=>"tracker:Tracker"}},
                 ], @logicalPartsManager.parts)

    assert_equal([
                  {:sectionLabel=>:GeometryExtended, :partName=>:PosPart, :args=>{"copyNumber"=>"1"}},
                 ], @posPartsManager.parts)

  end

  def test_wrong_section
    ioerr = StringIO.new
    $stderr = ioerr
    @geometryManager.add_entry(:NoSuchSection, "sectionLabelNoSuch", "partNameNoSuch", {"name"=>"nosuch:A"})
    $stderr = STDERR
    assert_equal("GeometryManager: Unknown section: \"NoSuchSection\"\n", ioerr.string)
  end

  def test_reload_from_cache

    @geometryManager.add_entry(:MaterialSection, "GeometryExtended", "ElementaryMaterial", {"name"=>"materials:materialA"})
    @geometryManager.add_entry(:MaterialSection, "GeometryExtended", "ElementaryMaterial", {"name"=>"materials:materialB"})
    @geometryManager.add_entry(:MaterialSection, "GeometryExtended", "CompositeMaterial", {"name"=>"materials:materialC"})
    @geometryManager.add_entry(:RotationSection, "GeometryExtended", "Rotation", {"name"=>"rotations:rotationA"})
    @geometryManager.add_entry(:RotationSection, "GeometryExtended", "Rotation", {"name"=>"rotations:rotationB"})
    @geometryManager.add_entry(:RotationSection, "GeometryExtended", "ReflectionRotation", {"name"=>"rotations:rotationC"})
    @geometryManager.add_entry(:SolidSection, "GeometryExtended", "Polyhedra", {"name"=>"solids:polyhedraA"})
    @geometryManager.add_entry(:SolidSection, "GeometryExtended", "Tubs", {"name"=>"solids:tubsA"})
    @geometryManager.add_entry(:LogicalPartSection, "GeometryExtended", "LogicalPart", {"name"=>"tracker:Tracker"})
    @geometryManager.add_entry(:PosPartSection, "GeometryExtended", "PosPart", {"copyNumber"=>"1"})

    @materialsManager = MockPartManager.new
    @rotationsManager = MockPartManager.new
    @solidsManager = MockPartManager.new
    @logicalPartsManager = MockPartManager.new
    @posPartsManager = MockPartManager.new

    @geometryManager.materialsManager = @materialsManager
    @geometryManager.rotationsManager = @rotationsManager
    @geometryManager.solidsManager = @solidsManager
    @geometryManager.logicalPartsManager = @logicalPartsManager
    @geometryManager.posPartsManager = @posPartsManager

    @geometryManager.reload_from_cache

    assert_equal([
                  {:sectionLabel=>:GeometryExtended, :partName=>:ElementaryMaterial, :args=>{"name"=>"materials:materialA"}},
                  {:sectionLabel=>:GeometryExtended, :partName=>:ElementaryMaterial, :args=>{"name"=>"materials:materialB"}},
                  {:sectionLabel=>:GeometryExtended, :partName=>:CompositeMaterial, :args=>{"name"=>"materials:materialC"}},
                 ], @materialsManager.parts)

    assert_equal([
                  {:sectionLabel=>:GeometryExtended, :partName=>:Rotation, :args=>{"name"=>"rotations:rotationA"}},
                  {:sectionLabel=>:GeometryExtended, :partName=>:Rotation, :args=>{"name"=>"rotations:rotationB"}},
                  {:sectionLabel=>:GeometryExtended, :partName=>:ReflectionRotation, :args=>{"name"=>"rotations:rotationC"}},
                 ], @rotationsManager.parts)

    assert_equal([
                  {:sectionLabel=>:GeometryExtended, :partName=>:Polyhedra, :args=>{"name"=>"solids:polyhedraA"}},
                  {:sectionLabel=>:GeometryExtended, :partName=>:Tubs, :args=>{"name"=>"solids:tubsA"}},
                 ], @solidsManager.parts)

    assert_equal([
                  {:sectionLabel=>:GeometryExtended, :partName=>:LogicalPart, :args=>{"name"=>"tracker:Tracker"}},
                 ], @logicalPartsManager.parts)

    assert_equal([
                  {:sectionLabel=>:GeometryExtended, :partName=>:PosPart, :args=>{"copyNumber"=>"1"}},
                 ], @posPartsManager.parts)

  end

end

##____________________________________________________________________________||

redpajama_set_name: RedPajamaGithub


text:
package com.ack.adventureandconquer.game.creature.npc.animal;

import com.ack.adventureandconquer.game.creature.npc.IsNpcType;
import com.ack.adventureandconquer.game.creature.npc.Npc;

import java.util.List;

/**
 * Created by saskyrar on 17/01/15.
 */
public class CrabSpiderType implements IsNpcType {
    @Override
    public boolean isLair(int number) {
        return number >= 70;
    }

    @Override
    public List<Npc> getNormalWildnessEncounter() {
        return CrabSpider.getGroup();
    }

    @Override
    public String getNormalWildnessEncounterName() {
        return "Clutter";
    }

    @Override
    public List<Npc> getLairWildnessEncounter() {
        return null;
    }

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


text:
import json
import chardet
from pyquery import PyQuery
from requests.structures import CaseInsensitiveDict
from requests.utils import get_encoding_from_headers, get_encodings_from_content
from requests import HTTPError

class Response(object):
    def __init__(self):
        self.status_code = None
        self.url = None
        self.orig_url = None
        self.headers = CaseInsensitiveDict()
        self.content = ''
        self.cookies = {}
        self.error = None
        self.time = 0

    def __repr__(self):
       return '<Response [%d]>' % self.status_code

    def __bool__(self):
        """Returns true if :attr:`status_code` is 'OK'."""
        return self.ok

    def __nonzero__(self):
        """Returns true if :attr:`status_code` is 'OK'."""
        return self.ok

    @property
    def ok(self):
        try:
            self.raise_for_status()
        except RequestException:
            return False
        return True

    @property
    def encoding(self):
        if hasattr(self, '_encoding'):
            return self._encoding

        # content is unicode
        if isinstance(self.content, unicode):
            return 'unicode'

        # Try charset from content-type
        encoding = get_encoding_from_headers(self.headers)
        if encoding == 'ISO-8859-1':
            encoding = None

        # Try charset from content
        if not encoding:
            encoding = get_encodings_from_content(self.content)
            encoding = encoding and encoding[0] or None

        # Fallback to auto-detected encoding.
        if not encoding and chardet is not None:
            encoding = chardet.detect(self.content)['encoding']

        if encoding and encoding.lower() == 'gb2312':
            encoding = 'gb18030'

        self._encoding = encoding or 'utf-8'
        return self._encoding

    @encoding.setter
    def encoding(self, value):
        self._encoding = value
        self._text = None

    @property
    def text(self):
        """Content of the response, in unicode.

        if Response.encoding is None and chardet module is available, encoding
        will be guessed.
        """
        if hasattr(self, '_text') and self._text:
            return self._text
        if not self.content:
            return u''
        if isinstance(self.content, unicode):
            return self.content

        content = None
        encoding = self.encoding

        # Decode unicode from given encoding.
        try:
            content = self.content.decode(encoding, 'replace')
        except LookupError:
            # A LookupError is raised if the encoding was not found which could
            # indicate a misspelling or similar mistake.
            #
            # So we try blindly encoding.
            content = self.content.decode('utf-8', 'replace')

        self._text = content
        return content

    @property
    def json(self):
        """Returns the json-encoded content of a request, if any."""
        try:
            return json.loads(self.text or self.content)
        except ValueError:
            return None

    @property
    def doc(self):
        """Returns a PyQuery object of a request's content"""
        if hasattr(self, '_doc'):
            return self._doc
        doc = self._doc = PyQuery(self.text or self.content)
        doc.make_links_absolute(self.url)
        return doc

    def raise_for_status(self, allow_redirects=True):
        """Raises stored :class:`HTTPError` or :class:`URLError`, if one occurred."""

        if self.error:
            raise HTTPError(self.error)

        if (self.status_code >= 300) and (self.status_code < 400) and not allow_redirects:
            http_error = HTTPError('%s Redirection' % (self.status_code))
            http_error.response = self
            raise http_error

        elif (self.status_code >= 400) and (self.status_code < 500):
            http_error = HTTPError('%s Client Error' % (self.status_code))
            http_error.response = self
            raise http_error

        elif (self.status_code >= 500) and (self.status_code < 600):
            http_error = HTTPError('%s Server Error' % (self.status_code))
            http_error.response = self
            raise http_error

def rebuild_response(r):
    response = Response()
    response.status_code = r.get('status_code', 599)
    response.url = r.get('url', '')
    response.headers = CaseInsensitiveDict(r.get('headers', {}))
    response.content = r.get('content', '')
    response.cookies = r.get('cookies', {})
    response.error = r.get('error')
    response.time = r.get('time', 0)
    response.orig_url = r.get('orig_url', response.url)
    return response


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="40dp"
    android:background="@android:color/black"
    android:clickable="true"
    android:orientation="vertical"
    android:paddingLeft="40dp"
    tools:context=".MainActivity" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="39dp"
        android:gravity="center_vertical" >

        <ImageView
            android:id="@+id/childImage"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_margin="5dp"
            android:background="@drawable/ic_launcher"
            android:contentDescription="@string/hello_world" />

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:text="@string/hello_world"
            android:textColor="#FFFFFF"
            android:textSize="14sp"
            android:textStyle="bold" />
    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@android:color/white" />

</LinearLayout><!-- From: file:/C:/Users/Andrew1/workspace/Android/MWCalc/MWCalc/src/main/res/layout/childrow.xml -->


text:
#include <common.h>
#include <linux/usb/ch9.h>
#include <linux/errno.h>
#include <linux/usb/gadget.h>
#include <asm/unaligned.h>
#include "gadget_chips.h"

#define isdigit(c)      ('0' <= (c) && (c) <= '9')

/* we must assign addresses for configurable endpoints (like net2280) */
static unsigned epnum;

/* #define MANY_ENDPOINTS */
#ifdef MANY_ENDPOINTS
/* more than 15 configurable endpoints */
static unsigned in_epnum;
#endif

/*
 * This should work with endpoints from controller drivers sharing the
 * same endpoint naming convention.  By example:
 *
 *	- ep1, ep2, ... address is fixed, not direction or type
 *	- ep1in, ep2out, ... address and direction are fixed, not type
 *	- ep1-bulk, ep2-bulk, ... address and type are fixed, not direction
 *	- ep1in-bulk, ep2out-iso, ... all three are fixed
 *	- ep-* ... no functionality restrictions
 *
 * Type suffixes are "-bulk", "-iso", or "-int".  Numbers are decimal.
 * Less common restrictions are implied by gadget_is_*().
 *
 * NOTE:  each endpoint is unidirectional, as specified by its USB
 * descriptor; and isn't specific to a configuration or altsetting.
 */
static int ep_matches(
	struct usb_gadget		*gadget,
	struct usb_ep			*ep,
	struct usb_endpoint_descriptor	*desc
)
{
	u8		type;
	const char	*tmp;
	u16		max;

	/* endpoint already claimed? */
	if (NULL != ep->driver_data)
		return 0;

	/* only support ep0 for portable CONTROL traffic */
	type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
	if (USB_ENDPOINT_XFER_CONTROL == type)
		return 0;

	/* some other naming convention */
	if ('e' != ep->name[0])
		return 0;

	/* type-restriction:  "-iso", "-bulk", or "-int".
	 * direction-restriction:  "in", "out".
	 */
	if ('-' != ep->name[2]) {
		tmp = strrchr(ep->name, '-');
		if (tmp) {
			switch (type) {
			case USB_ENDPOINT_XFER_INT:
				/* bulk endpoints handle interrupt transfers,
				 * except the toggle-quirky iso-synch kind
				 */
				if ('s' == tmp[2])	/* == "-iso" */
					return 0;
				/* for now, avoid PXA "interrupt-in";
				 * it's documented as never using DATA1.
				 */
				if (gadget_is_pxa(gadget)
						&& 'i' == tmp[1])
					return 0;
				break;
			case USB_ENDPOINT_XFER_BULK:
				if ('b' != tmp[1])	/* != "-bulk" */
					return 0;
				break;
			case USB_ENDPOINT_XFER_ISOC:
				if ('s' != tmp[2])	/* != "-iso" */
					return 0;
			}
		} else {
			tmp = ep->name + strlen(ep->name);
		}

		/* direction-restriction:  "..in-..", "out-.." */
		tmp--;
		if (!isdigit(*tmp)) {
			if (desc->bEndpointAddress & USB_DIR_IN) {
				if ('n' != *tmp)
					return 0;
			} else {
				if ('t' != *tmp)
					return 0;
			}
		}
	}

	/* endpoint maxpacket size is an input parameter, except for bulk
	 * where it's an output parameter representing the full speed limit.
	 * the usb spec fixes high speed bulk maxpacket at 512 bytes.
	 */
	max = 0x7ff & le16_to_cpu(get_unaligned(&desc->wMaxPacketSize));
	switch (type) {
	case USB_ENDPOINT_XFER_INT:
		/* INT:  limit 64 bytes full speed, 1024 high speed */
		if (!gadget->is_dualspeed && max > 64)
			return 0;
		/* FALLTHROUGH */

	case USB_ENDPOINT_XFER_ISOC:
		/* ISO:  limit 1023 bytes full speed, 1024 high speed */
		if (ep->maxpacket < max)
			return 0;
		if (!gadget->is_dualspeed && max > 1023)
			return 0;

		/* BOTH:  "high bandwidth" works only at high speed */
		if ((get_unaligned(&desc->wMaxPacketSize) &
					__constant_cpu_to_le16(3<<11))) {
			if (!gadget->is_dualspeed)
				return 0;
			/* configure your hardware with enough buffering!! */
		}
		break;
	}

	/* MATCH!! */

	/* report address */
	if (isdigit(ep->name[2])) {
		u8	num = simple_strtoul(&ep->name[2], NULL, 10);
		desc->bEndpointAddress |= num;
#ifdef	MANY_ENDPOINTS
	} else if (desc->bEndpointAddress & USB_DIR_IN) {
		if (++in_epnum > 15)
			return 0;
		desc->bEndpointAddress = USB_DIR_IN | in_epnum;
#endif
	} else {
		if (++epnum > 15)
			return 0;
		desc->bEndpointAddress |= epnum;
	}

	/* report (variable) full speed bulk maxpacket */
	if (USB_ENDPOINT_XFER_BULK == type) {
		int size = ep->maxpacket;

		/* min() doesn't work on bitfields with gcc-3.5 */
		if (size > 64)
			size = 64;
		put_unaligned(cpu_to_le16(size), &desc->wMaxPacketSize);
	}
	return 1;
}

static struct usb_ep *
find_ep(struct usb_gadget *gadget, const char *name)
{
	struct usb_ep	*ep;

	list_for_each_entry(ep, &gadget->ep_list, ep_list) {
		if (0 == strcmp(ep->name, name))
			return ep;
	}
	return NULL;
}

/**
 * usb_ep_autoconfig - choose an endpoint matching the descriptor
 * @gadget: The device to which the endpoint must belong.
 * @desc: Endpoint descriptor, with endpoint direction and transfer mode
 *	initialized.  For periodic transfers, the maximum packet
 *	size must also be initialized.  This is modified on success.
 *
 * By choosing an endpoint to use with the specified descriptor, this
 * routine simplifies writing gadget drivers that work with multiple
 * USB device controllers.  The endpoint would be passed later to
 * usb_ep_enable(), along with some descriptor.
 *
 * That second descriptor won't always be the same as the first one.
 * For example, isochronous endpoints can be autoconfigured for high
 * bandwidth, and then used in several lower bandwidth altsettings.
 * Also, high and full speed descriptors will be different.
 *
 * Be sure to examine and test the results of autoconfiguration on your
 * hardware.  This code may not make the best choices about how to use the
 * USB controller, and it can't know all the restrictions that may apply.
 * Some combinations of driver and hardware won't be able to autoconfigure.
 *
 * On success, this returns an un-claimed usb_ep, and modifies the endpoint
 * descriptor bEndpointAddress.  For bulk endpoints, the wMaxPacket value
 * is initialized as if the endpoint were used at full speed.  To prevent
 * the endpoint from being returned by a later autoconfig call, claim it
 * by assigning ep->driver_data to some non-null value.
 *
 * On failure, this returns a null endpoint descriptor.
 */
struct usb_ep *usb_ep_autoconfig(
	struct usb_gadget		*gadget,
	struct usb_endpoint_descriptor	*desc
)
{
	struct usb_ep	*ep = NULL;
	u8		type;

	type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;

	/* First, apply chip-specific "best usage" knowledge.
	 * This might make a good usb_gadget_ops hook ...
	 */
	if (gadget_is_net2280(gadget) && type == USB_ENDPOINT_XFER_INT) {
		/* ep-e, ep-f are PIO with only 64 byte fifos */
		ep = find_ep(gadget, "ep-e");
		if (ep && ep_matches(gadget, ep, desc))
			return ep;
		ep = find_ep(gadget, "ep-f");
		if (ep && ep_matches(gadget, ep, desc))
			return ep;

	} else if (gadget_is_goku(gadget)) {
		if (USB_ENDPOINT_XFER_INT == type) {
			/* single buffering is enough */
			ep = find_ep(gadget, "ep3-bulk");
			if (ep && ep_matches(gadget, ep, desc))
				return ep;
		} else if (USB_ENDPOINT_XFER_BULK == type
				&& (USB_DIR_IN & desc->bEndpointAddress)) {
			/* DMA may be available */
			ep = find_ep(gadget, "ep2-bulk");
			if (ep && ep_matches(gadget, ep, desc))
				return ep;
		}

	} else if (gadget_is_sh(gadget) && USB_ENDPOINT_XFER_INT == type) {
		/* single buffering is enough; maybe 8 byte fifo is too */
		ep = find_ep(gadget, "ep3in-bulk");
		if (ep && ep_matches(gadget, ep, desc))
			return ep;

	} else if (gadget_is_mq11xx(gadget) && USB_ENDPOINT_XFER_INT == type) {
		ep = find_ep(gadget, "ep1-bulk");
		if (ep && ep_matches(gadget, ep, desc))
			return ep;
	} else if (gadget_is_dwc3(gadget)) {
		const char *name = NULL;
		/*
		 * First try standard, common configuration: ep1in-bulk,
		 * ep2out-bulk, ep3in-int to match other udc drivers to avoid
		 * confusion in already deployed software (endpoint numbers
		 * hardcoded in userspace software/drivers)
		 */
		if ((desc->bEndpointAddress & USB_DIR_IN) &&
		    type == USB_ENDPOINT_XFER_BULK)
			name = "ep1in";
		else if ((desc->bEndpointAddress & USB_DIR_IN) == 0 &&
			 type == USB_ENDPOINT_XFER_BULK)
			name = "ep2out";
		else if ((desc->bEndpointAddress & USB_DIR_IN) &&
			 type == USB_ENDPOINT_XFER_INT)
			name = "ep3in";

		if (name)
			ep = find_ep(gadget, name);
		if (ep && ep_matches(gadget, ep, desc))
			return ep;
	}

	/* Second, look at endpoints until an unclaimed one looks usable */
	list_for_each_entry(ep, &gadget->ep_list, ep_list) {
		if (ep_matches(gadget, ep, desc))
			return ep;
	}

	/* Fail */
	return NULL;
}

/**
 * usb_ep_autoconfig_reset - reset endpoint autoconfig state
 * @gadget: device for which autoconfig state will be reset
 *
 * Use this for devices where one configuration may need to assign
 * endpoint resources very differently from the next one.  It clears
 * state such as ep->driver_data and the record of assigned endpoints
 * used by usb_ep_autoconfig().
 */
void usb_ep_autoconfig_reset(struct usb_gadget *gadget)
{
	struct usb_ep	*ep;

	list_for_each_entry(ep, &gadget->ep_list, ep_list) {
		ep->driver_data = NULL;
	}
#ifdef	MANY_ENDPOINTS
	in_epnum = 0;
#endif
	epnum = 0;
}


text:
/*
 * 2014 lovewilliam <ztong@vt.edu>
 */
// Copyright 2011 The Avalon Project Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0
// that can be found in the LICENSE file.
#ifndef SMS_PDU_H_
#define SMS_PDU_H_

#include <time.h>

enum { SMS_MAX_PDU_LENGTH  = 256 };

/*
 * Encode an SMS message. Output the encoded message into output pdu buffer.
 * Returns the length of the SMS encoded message in the output buffer or
 * a negative number in case encoding failed (for example provided output buffer
 * does not have enough space).
 */
int pdu_encode(const char* service_center_number, const char* phone_number, const char* text,
	      unsigned char* pdu, int pdu_size);

/*
 * Decode an SMS message. Output the decoded message into the sms text buffer.
 * Returns the length of the SMS dencoded message or a negative number in
 * case encoding failed (for example provided output buffer has not enough
 * space).
 */
int pdu_decode(const unsigned char* pdu, int pdu_len,
	       time_t* sms_time,
	       char* phone_number, int phone_number_size,
	       char* text, int text_size,
	       int* tp_dcs,
	       int* user_payload_header_size);

int ucs2_to_utf8 (int ucs2, unsigned char * utf8);

#endif   // SMS_SMS_H_


text:
/**
 *
 */
package com.github.nest.quelea.model;

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

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.joda.time.DateTime;

import com.github.nest.quelea.codes.Country;
import com.github.nest.quelea.codes.Gender;
import com.github.nest.quelea.codes.IndividualIdType;
import com.github.nest.quelea.codes.MaritalStatus;
import com.github.nest.quelea.codes.Occupation;
import com.github.nest.quelea.codes.PartyType;
import com.github.nest.quelea.codes.Race;
import com.github.nest.quelea.codes.Religion;

/**
 * individual party
 *
 * @author brad.wu
 */
@Entity
@DiscriminatorValue(PartyType.INDIVIDUAL)
public class Individual extends Party implements Serializable {
	private static final long serialVersionUID = -1427033874602578931L;

	@Column(name = "FIRST_NAME")
	private String firstName = null;

	@Column(name = "MIDDLE_NAME")
	private String middleName = null;

	@Column(name = "LAST_NAME")
	private String lastName = null;

	@Column(name = "ALIAS_NAME")
	private String alias = null;

	@Column(name = "COUNTRY_CODE_OF_BIRTH")
	private String countryCodeOfBirth = null;

	@Column(name = "COURTESY_TITLE")
	private String courtesyTitle = null;

	@Column(name = "DATE_OF_BIRTH")
	@Temporal(TemporalType.DATE)
	private Date dateOfBirth = null;

	@Column(name = "DATE_OF_DEATH")
	@Temporal(TemporalType.DATE)
	private Date dateOfDeath = null;

	@Column(name = "GENDER_CODE")
	private String genderCode = null;

	@Column(name = "ID_TYPE_CODE")
	private String idTypeCode = null;

	@Column(name = "NATIONALITY_CODE")
	private String nationalityCode = null;

	@Column(name = "OCCUPATION_CODE")
	private String occupationCode = null;

	@Column(name = "RACE_CODE")
	private String raceCode = null;

	@Column(name = "RELIGION_CODE")
	private String religionCode = null;

	@Column(name = "MARITAL_CODE")
	private String maritalCode = null;

	/**
	 * @return the firstName
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * @param firstName
	 *            the firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * @return the middleName
	 */
	public String getMiddleName() {
		return middleName;
	}

	/**
	 * @param middleName
	 *            the middleName to set
	 */
	public void setMiddleName(String middleName) {
		this.middleName = middleName;
	}

	/**
	 * @return the lastName
	 */
	public String getLastName() {
		return lastName;
	}

	/**
	 * @param lastName
	 *            the lastName to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/**
	 * @return the alias
	 */
	public String getAlias() {
		return alias;
	}

	/**
	 * @param alias
	 *            the alias to set
	 */
	public void setAlias(String alias) {
		this.alias = alias;
	}

	/**
	 * @return the countryCodeOfBirth
	 * @see Country
	 */
	public String getCountryCodeOfBirth() {
		return countryCodeOfBirth;
	}

	/**
	 * @param countryCodeOfBirth
	 *            the countryCodeOfBirth to set
	 * @see Country
	 */
	public void setCountryCodeOfBirth(String countryCodeOfBirth) {
		this.countryCodeOfBirth = countryCodeOfBirth;
	}

	/**
	 * @return the courtesyTitle
	 */
	public String getCourtesyTitle() {
		return courtesyTitle;
	}

	/**
	 * @param courtesyTitle
	 *            the courtesyTitle to set
	 */
	public void setCourtesyTitle(String courtesyTitle) {
		this.courtesyTitle = courtesyTitle;
	}

	/**
	 * @return the dateOfBirth
	 */
	public DateTime getDateOfBirth() {
		return dateOfBirth == null ? null : new DateTime(this.dateOfBirth);
	}

	/**
	 * @param dateOfBirth
	 *            the dateOfBirth to set
	 */
	public void setDateOfBirth(DateTime dateOfBirth) {
		this.dateOfBirth = null == dateOfBirth ? null : dateOfBirth.toDate();
	}

	/**
	 * @return the dateOfDeath
	 */
	public DateTime getDateOfDeath() {
		return dateOfDeath == null ? null : new DateTime(this.dateOfDeath);
	}

	/**
	 * @param dateOfDeath
	 *            the dateOfDeath to set
	 */
	public void setDateOfDeath(DateTime dateOfDeath) {
		this.dateOfDeath = null == dateOfDeath ? null : dateOfDeath.toDate();
	}

	/**
	 * @return the genderCode
	 * @see Gender
	 */
	public String getGenderCode() {
		return genderCode;
	}

	/**
	 * @param genderCode
	 *            the genderCode to set
	 * @see Gender
	 */
	public void setGenderCode(String genderCode) {
		this.genderCode = genderCode;
	}

	/**
	 * @return the idTypeCode
	 * @see IndividualIdType
	 */
	public String getIdTypeCode() {
		return idTypeCode;
	}

	/**
	 * @param idTypeCode
	 *            the idTypeCode to set
	 * @see IndividualIdType
	 */
	public void setIdTypeCode(String idTypeCode) {
		this.idTypeCode = idTypeCode;
	}

	/**
	 * @return the nationalityCode
	 * @see Country
	 */
	public String getNationalityCode() {
		return nationalityCode;
	}

	/**
	 * @param nationalityCode
	 *            the nationalityCode to set
	 * @see Country
	 */
	public void setNationalityCode(String nationalityCode) {
		this.nationalityCode = nationalityCode;
	}

	/**
	 * @return the occupationCode
	 * @See Occupation
	 */
	public String getOccupationCode() {
		return occupationCode;
	}

	/**
	 * @param occupationCode
	 *            the occupationCode to set
	 * @see Occupation
	 */
	public void setOccupationCode(String occupationCode) {
		this.occupationCode = occupationCode;
	}

	/**
	 * @return the raceCode
	 * @see Race
	 */
	public String getRaceCode() {
		return raceCode;
	}

	/**
	 * @param raceCode
	 *            the raceCode to set
	 * @see Race
	 */
	public void setRaceCode(String raceCode) {
		this.raceCode = raceCode;
	}

	/**
	 * @return the religionCode
	 * @see Religion
	 */
	public String getReligionCode() {
		return religionCode;
	}

	/**
	 * @param religionCode
	 *            the religionCode to set
	 * @see Religion
	 */
	public void setReligionCode(String religionCode) {
		this.religionCode = religionCode;
	}

	/**
	 * @return the maritalCode
	 * @see MaritalStatus
	 */
	public String getMaritalCode() {
		return maritalCode;
	}

	/**
	 * @param maritalCode
	 *            the maritalCode to set
	 * @see MaritalStatus
	 */
	public void setMaritalCode(String maritalCode) {
		this.maritalCode = maritalCode;
	}

	/**
	 * (non-Javadoc)
	 *
	 * @see com.github.nest.quelea.model.Party#getPartyTypeCode()
	 */
	@Override
	public String getPartyTypeCode() {
		return PartyType.INDIVIDUAL;
	}
}


text:
FROM gradle
VOLUME /tmp
ADD . /home/gradle/app
WORKDIR /home/gradle/app
USER root
run apt-get update && apt-get install -y sudo build-essential
run curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && apt-get install -y nodejs
run cd src/main/resources/ && npm install && npm run build && cd ../../..
RUN gradle jar --info && gradle bootRepackage
RUN mv ./build/libs/gs-spring-boot-0.1.0.jar app.jar
ENV JAVA_OPTS=""
CMD [ "bash", "-c", "java $JAVA_OPTS -Dspring.profiles.active=${CONFIG:-docker} -Djava.security.egd=file:/dev/urandom -jar app.jar" ]


text:
#include <future>
#include <thread>
#include <tuple>

#include "Surface.hpp"
#include "stb_rect_pack.h"

namespace KRE
{
	namespace
	{
		typedef std::map<std::string,std::tuple<SurfaceCreatorFileFn,SurfaceCreatorPixelsFn,SurfaceCreatorMaskFn,SurfaceCreatorFormatFn>> CreatorMap;
		CreatorMap& get_surface_creator()
		{
			static CreatorMap res;
			return res;
		}

		typedef std::map<std::string, SurfacePtr> SurfaceCacheType;
		SurfaceCacheType& get_surface_cache()
		{
			static SurfaceCacheType res;
			return res;
		}

		unsigned get_next_id()
		{
			static unsigned id = 1;
			return id++;
		}

		int alpha_strip_threshold = 20;	// 20/255 ~ 7.8%

		const int max_surface_width = 4096;
		const int max_surface_height = 4096;
	}

	Surface::Surface()
		: flags_(SurfaceFlags::NONE),
		  pf_(nullptr),
		  alpha_map_(nullptr),
		  name_(),
		  id_(get_next_id()),
		  alpha_borders_{}
	{
	}

	Surface::~Surface()
	{
	}

	PixelFormatPtr Surface::getPixelFormat()
	{
		return pf_;
	}

	void Surface::setPixelFormat(PixelFormatPtr pf)
	{
		pf_ = pf;
	}

	SurfaceLock::SurfaceLock(SurfacePtr surface)
		: surface_(surface)
	{
		surface_->lock();
	}

	SurfaceLock::~SurfaceLock()
	{
		surface_->unlock();
	}

	SurfacePtr Surface::convert(PixelFormat::PF fmt, SurfaceConvertFn convert)
	{
		return handleConvert(fmt, convert);
	}

	void Surface::convertInPlace(PixelFormat::PF fmt, SurfaceConvertFn convert)
	{
		auto surf = handleConvert(fmt, convert);
		*this = *surf.get();
	}

	bool Surface::registerSurfaceCreator(const std::string& name,
		SurfaceCreatorFileFn file_fn,
		SurfaceCreatorPixelsFn pixels_fn,
		SurfaceCreatorMaskFn mask_fn,
		SurfaceCreatorFormatFn format_fn)
	{
		return get_surface_creator().insert(std::make_pair(name,std::make_tuple(file_fn, pixels_fn, mask_fn, format_fn))).second;
	}

	void Surface::unRegisterSurfaceCreator(const std::string& name)
	{
		auto it = get_surface_creator().find(name);
		ASSERT_LOG(it != get_surface_creator().end(), "Unable to find surface creator: " << name);
		get_surface_creator().erase(it);
	}

	SurfacePtr Surface::create(const std::string& filename, SurfaceFlags flags, PixelFormat::PF fmt, SurfaceConvertFn convert)
	{
		ASSERT_LOG(get_surface_creator().empty() == false, "No resources registered to surfaces images from files.");
		auto create_fn_tuple = get_surface_creator().begin()->second;
		if(!(flags & SurfaceFlags::NO_CACHE)) {
			auto it = get_surface_cache().find(filename);
			if(it != get_surface_cache().end()) {
				return it->second;
			}
			auto surface = std::get<0>(create_fn_tuple)(filename, fmt, flags, convert);
			surface->name_ = filename;
			get_surface_cache()[filename] = surface;
			surface->init();
			return surface;
		}
		auto surf = std::get<0>(create_fn_tuple)(filename, fmt, flags, convert);
		surf->name_ = filename;
		surf->init();
		return surf;
	}

	SurfacePtr Surface::create(int width,
		int height,
		int bpp,
		int row_pitch,
		uint32_t rmask,
		uint32_t gmask,
		uint32_t bmask,
		uint32_t amask,
		const void* pixels)
	{
		// XXX no caching as default?
		ASSERT_LOG(get_surface_creator().empty() == false, "No resources registered to create surfaces from pixels.");
		auto create_fn_tuple = get_surface_creator().begin()->second;
		auto surf = std::get<1>(create_fn_tuple)(width, height, bpp, row_pitch, rmask, gmask, bmask, amask, pixels);
		std::stringstream ss;
		ss << "Surface(" << width << "," << height << "," << bpp << "," << row_pitch << "," << rmask << "," << gmask << "," << amask << ", has data:yes)";
		surf->name_ = ss.str();
		surf->init();
		return surf;
	}

	SurfacePtr Surface::create(int width,
		int height,
		int bpp,
		uint32_t rmask,
		uint32_t gmask,
		uint32_t bmask,
		uint32_t amask)
	{
		// XXX no caching as default?
		ASSERT_LOG(get_surface_creator().empty() == false, "No resources registered to create surfaces from masks.");
		auto create_fn_tuple = get_surface_creator().begin()->second;
		auto surf = std::get<2>(create_fn_tuple)(width, height, bpp, rmask, gmask, bmask, amask);
		std::stringstream ss;
		ss << "Surface(" << width << "," << height << "," << bpp << "," << rmask << "," << gmask << "," << amask << ", has data:no)";
		surf->name_ = ss.str();
		return surf;
	}

	SurfacePtr Surface::create(int width, int height, PixelFormat::PF fmt)
	{
		ASSERT_LOG(get_surface_creator().empty() == false, "No resources registered to create surfaces from pixel format.");
		auto create_fn_tuple = get_surface_creator().begin()->second;
		auto surf = std::get<3>(create_fn_tuple)(width, height, fmt);
		std::stringstream ss;
		ss << "Surface(" << width << "," << height << "," << static_cast<int>(fmt) << ")";
		surf->name_ = ss.str();
		return surf;
	}

	void Surface::init()
	{
		createAlphaMap();
		if(flags_ & SurfaceFlags::STRIP_ALPHA_BORDERS) {
			stripAlphaBorders(alpha_strip_threshold);
		}
	}

	void Surface::createAlphaMap()
	{
		const int npixels = width() * height();
		alpha_map_ = std::make_shared<std::vector<bool>>();
		alpha_map_->resize(npixels);

		if(getPixelFormat()->hasAlphaChannel()) {
			SurfaceLock lck(shared_from_this());
			auto pf = getPixelFormat();
			uint32_t alpha_mask = pf->getAlphaMask();
			if(bytesPerPixel() == 4 && rowPitch() % 4 == 0) {
				// Optimization for a common case. Operates ~25 faster than default case.
				const uint32_t* px = reinterpret_cast<const uint32_t*>(pixels());
				auto it = alpha_map_->begin();
				for(int n = 0; n != npixels; ++n) {
					*it++ = (*px++ & alpha_mask) ? false : true;
				}
			} else {
				std::fill(alpha_map_->begin(), alpha_map_->end(), false);
				int w = width();
				auto& am = *alpha_map_;
				iterateOverSurface([&am, w](int x, int y, int r, int g, int b, int a) {
					if(a == 0) {
						am[x + y * w] = true;
					}
				});
			}
		}

		//if(getPixelFormat()->hasAlphaChannel()) {
			//int w = width();
			//auto& am = alpha_map_;
			//iterateOverSurface([&am, w](int x, int y, int r, int g, int b, int a) {
			//	am[x + y * w] = a == 0 ? true : false;
			//});
		//}
	}

	void Surface::stripAlphaBorders(int threshold)
	{
		if(getPixelFormat()->hasAlphaChannel()) {
			const int w = width();
			const int h = height();
			SurfaceLock lck(shared_from_this());
			auto pf = getPixelFormat();
			uint32_t alpha_mask = pf->getAlphaMask();
			int alpha_shift = pf->getAlphaShift();
			threshold <<= alpha_shift;
			if(bytesPerPixel() == 4 && rowPitch() % 4 == 0) {
				// Optimization for a common case. Operates ~25 faster than default case.
				const int num_pixels = w * h;
				// top border
				uint32_t const* pxt = reinterpret_cast<const uint32_t*>(pixels());
				for(int ndx = 0; ndx < num_pixels; ++ndx) {
					if((*pxt++ & alpha_mask) > static_cast<uint32_t>(threshold)) {
						alpha_borders_[1] = ndx / w;
						break;
					}
				}
				const uint32_t* pxb = &reinterpret_cast<const uint32_t*>(pixels())[w * h];
				// bottom border
				for(int ndx = num_pixels - 1; ndx >= 0; --ndx) {
					if((*(--pxb) & alpha_mask) > static_cast<uint32_t>(threshold)) {
						alpha_borders_[3] = h - 1 - ndx / w;
						break;
					}
				}
				// left border
				const uint32_t* pxl = reinterpret_cast<const uint32_t*>(pixels());
				bool finished = false;
				for(int x = 0; x < w && !finished; ++x) {
					for(int y = 0; y < h && !finished; ++y) {
						if((pxl[x + y*w] & alpha_mask) > static_cast<uint32_t>(threshold)) {
							alpha_borders_[0] = x;
							finished = true;
						}
					}
				}
				// right border
				const uint32_t* pxr = reinterpret_cast<const uint32_t*>(pixels());
				finished = false;
				for(int x = w - 1; x >= 0 && !finished; --x) {
					for(int y = 0; y < h && !finished; ++y) {
						if((pxr[x + y*w] & alpha_mask) > static_cast<uint32_t>(threshold)) {
							alpha_borders_[2] = w - 1 - x;
							finished = true;
						}
					}
				}
			} else {
				ASSERT_LOG(false, "won't apply stripAlphaBorders to non 32-bit RGBA image");
			}
		}
	}

	void Surface::clearSurfaceCache()
	{
		resetSurfaceCache();
	}

	void Surface::resetSurfaceCache()
	{
		get_surface_cache().clear();
	}

	void Surface::fillRect(const rect& dst_rect, const Color& color)
	{
		// XXX do we need to consider ARGB/RGBA ordering issues here.
		ASSERT_LOG(dst_rect.x1() >= 0 && dst_rect.x1() <= width(), "destination co-ordinates out of bounds: " << dst_rect.x1() << " : (0," << width() << ")");
		ASSERT_LOG(dst_rect.x2() >= 0 && dst_rect.x2() <= width(), "destination co-ordinates out of bounds: " << dst_rect.x2() << " : (0," << width() << ")");
		ASSERT_LOG(dst_rect.y1() >= 0 && dst_rect.y1() <= height(), "destination co-ordinates out of bounds: " << dst_rect.y1() << " : (0," << height() << ")");
		ASSERT_LOG(dst_rect.y2() >= 0 && dst_rect.y2() <= height(), "destination co-ordinates out of bounds: " << dst_rect.y2() << " : (0," << height() << ")");
		unsigned char* pix = reinterpret_cast<unsigned char*>(pixelsWriteable());
		const int bpp = pf_->bytesPerPixel();
		for(int y = dst_rect.x1(); y < dst_rect.x2(); ++y) {
			for(int x = dst_rect.y1(); x < dst_rect.y2(); ++x) {
				unsigned char* p = &pix[(y * width() + x) * bpp];
				// XXX FIXME
				//uint32_t pixels;
				//pf_->encodeRGBA(&pixels, color.r(), color.g(), color.b(), color.a());
				switch(bpp) {
					case 1: p[0] = color.r_int(); break;
					case 2: p[0] = color.r_int(); p[1] = color.g_int(); break;
					case 3: p[0] = color.r_int(); p[1] = color.g_int(); p[2] = color.b_int(); break;
					case 4: p[0] = color.r_int(); p[1] = color.g_int(); p[2] = color.b_int(); p[3] = color.a_int(); break;
				}
			}
		}
	}

	Color Surface::getColorAt(int x, int y) const
	{
		int r, g, b, a;
		const int bpp = pf_->bytesPerPixel();
		const uint8_t* pix = reinterpret_cast<const uint8_t*>(pixels());
		const uint8_t* p = &pix[x * bpp + y * rowPitch()];
		switch(bpp) {
			case 1: pf_->getRGBA(*p, r, g, b, a); break;
			case 2: pf_->getRGBA(*reinterpret_cast<const uint16_t*>(p), r, g, b, a); break;
			case 3: pf_->getRGBA(*reinterpret_cast<const uint32_t*>(p), r, g, b, a); break;
			case 4: pf_->getRGBA(*reinterpret_cast<const uint32_t*>(p), r, g, b, a); break;
		}
		return Color(r, g, b, a);
	}

	color_histogram_type Surface::getColorHistogram(ColorCountFlags flags)
	{
		color_histogram_type res;
		iterateOverSurface([&res](int x, int y, int r, int g, int b, int a) {
			//Color color(r, g, b, a);
			color_histogram_type::key_type color = (static_cast<uint32_t>(r) << 24)
				| (static_cast<uint32_t>(g) << 16)
				| (static_cast<uint32_t>(b) << 8)
				| (static_cast<uint32_t>(a));
			//ASSERT_LOG(color >= 18446744072937384447UL, "ugh: " << r << "," << g << "," << b << "," << a);
			auto it = res.find(color);
			if(it == res.end()) {
				res[color] = 1;
			} else {
				it->second += 1;
			}
		});
		//for(auto px : *this) {
		//	Color color(px.red, px.green, px.blue, (flags & ColorCountFlags::IGNORE_ALPHA_VARIATIONS ? 255 : px.alpha));
		//	auto it = res.find(color);
		//	if(it == res.end()) {
		//		LOG_DEBUG("Adding color: " << px.red << "," << px.green << "," << px.blue);
		//		res[color] = 1;
		//	} else {
		//		it->second += 1;
		//	}
		//}
		return res;
	}

	size_t Surface::getColorCount(ColorCountFlags flags)
	{
		return getColorHistogram(flags).size();
	}

	namespace
	{
		std::map<FileFilterType, file_filter>& get_file_filter_map()
		{
			static std::map<FileFilterType, file_filter> res;
			return res;
		}

		alpha_filter alpha_filter_fn = nullptr;
	}

	void Surface::setFileFilter(FileFilterType type, file_filter fn)
	{
		get_file_filter_map()[type] = fn;
	}

	file_filter Surface::getFileFilter(FileFilterType type)
	{
		auto it = get_file_filter_map().find(type);
		if(it == get_file_filter_map().end()) {
			static auto null_filter = [](const std::string& s) { return s; };
			return null_filter;
		}
		return it->second;
	}

	void Surface::setAlphaFilter(alpha_filter fn)
	{
		alpha_filter_fn = fn;
	}

	alpha_filter Surface::getAlphaFilter()
	{
		return alpha_filter_fn;
	}

	void Surface::clearAlphaFilter()
	{
		alpha_filter_fn = nullptr;
	}

	PixelFormat::PixelFormat()
	{
	}

	PixelFormat::~PixelFormat()
	{
	}

	bool PixelFormat::isIndexedFormat(PixelFormat::PF pf)
	{
		switch(pf) {
		case PixelFormat::PF::PIXELFORMAT_INDEX1LSB:
		case PixelFormat::PF::PIXELFORMAT_INDEX1MSB:
		case PixelFormat::PF::PIXELFORMAT_INDEX4LSB:
		case PixelFormat::PF::PIXELFORMAT_INDEX4MSB:
		case PixelFormat::PF::PIXELFORMAT_INDEX8:
			return true;
		default: break;
		}
		return false;
	}

	bool Surface::isAlpha(unsigned x, unsigned y) const
	{
		ASSERT_LOG(alpha_map_ != nullptr && alpha_map_->size() > 0, "No alpha map found.");
		ASSERT_LOG(x + y* width() < static_cast<int>(alpha_map_->size()), "Index exceeds alpha map size.");
		return (*alpha_map_)[y*width()+x];
	}

	std::vector<bool>::const_iterator Surface::getAlphaRow(int x, int y) const
	{
		ASSERT_LOG(alpha_map_ != nullptr && alpha_map_->size() > 0, "No alpha map found.");
		ASSERT_LOG(x + y* width() < static_cast<int>(alpha_map_->size()), "Index exceeds alpha map size.");
		return alpha_map_->begin() + y * width() + x;
	}

	std::vector<bool>::const_iterator Surface::endAlpha() const
	{
		return alpha_map_->end();
	}

	void Surface::iterateOverSurface(surface_iterator_fn fn)
	{
		iterateOverSurface(0, 0, width(), height(), fn);
	}

	void Surface::iterateOverSurface(rect r, surface_iterator_fn fn)
	{
		iterateOverSurface(r.x(), r.y(), r.h(), r.w(), fn);
	}

	void Surface::iterateOverSurface(int sx, int sy, int sw, int sh, surface_iterator_fn iterator_fn)
	{
		SurfaceLock lck(shared_from_this());
		auto pf = getPixelFormat();
		if(pf->getFormat() == PixelFormat::PF::PIXELFORMAT_INDEX1LSB
			|| pf->getFormat() == PixelFormat::PF::PIXELFORMAT_INDEX1MSB
			|| pf->getFormat() == PixelFormat::PF::PIXELFORMAT_INDEX4LSB
			|| pf->getFormat() == PixelFormat::PF::PIXELFORMAT_INDEX4MSB) {
			int cnt = (pf->getFormat() == PixelFormat::PF::PIXELFORMAT_INDEX1LSB || pf->getFormat() == PixelFormat::PF::PIXELFORMAT_INDEX1MSB) ? 8 : 2;
			for(int y = sy; y != sh; ++y) {
				for(int x = sx; x != sw; ++x) {
					for(int n = 0; n != cnt; ++n) {
						int red = 0, green = 0, blue = 0, alpha = 0;
						const uint8_t* px = &reinterpret_cast<const uint8_t*>(pixels())[x * bytesPerPixel() + y * rowPitch()];
						pf->extractRGBA(px, n, red, green, blue, alpha);
						iterator_fn(x, y, red, green, blue, alpha);
					}
				}
			}
		} else {
			for(int y = sy; y != sh; ++y) {
				for(int x = sx; x != sw; ++x) {
					int red = 0, green = 0, blue = 0, alpha = 0;
					const uint8_t* px = &reinterpret_cast<const uint8_t*>(pixels())[x * bytesPerPixel() + y * rowPitch()];
					pf->extractRGBA(px, 0, red, green, blue, alpha);
					iterator_fn(x, y, red, green, blue, alpha);
				}
			}
		}
	}

	int Surface::setAlphaStripThreshold(int threshold)
	{
		int old_thr = alpha_strip_threshold;
		alpha_strip_threshold = threshold;
		return old_thr;
	}

	int Surface::getAlphaStripThreshold()
	{
		return alpha_strip_threshold;
	}

#include "profile_timer.hpp"

	SurfacePtr Surface::packImages(const std::vector<std::string>& filenames, std::vector<rect>* outr, std::vector<std::array<int, 4>>* borders)
	{
		profile::manager pman("fit rects");

		const int max_threads = 8;

		SurfaceFlags flags = SurfaceFlags::NO_CACHE;
		if(borders != nullptr) {
			flags = flags | SurfaceFlags::STRIP_ALPHA_BORDERS;
		}

		std::vector<std::future<void>> futures;

		std::vector<SurfacePtr> images;
		images.resize(filenames.size());
		const int n_incr = images.size() / max_threads;
		for(int n = 0; n < static_cast<int>(images.size()); n += n_incr) {
			int n2 = n + n_incr > static_cast<int>(images.size()) ? images.size() : n + n_incr;
			futures.push_back(std::async([&images, n, n2, &filenames, flags]() {
				for(int ndx = n; ndx != n2; ++ndx) {
					images[ndx] = Surface::create(filenames[ndx], flags);
				}
			}));
		}
		for(auto& f : futures) {
			f.get();
		}

		std::vector<stbrp_node> nodes;
		nodes.resize(max_surface_width);

		const int increment = 128;
		int width = 256;
		int height = 256;

		int nn = 0;

		std::vector<stbrp_rect> rects;
		for(auto& img : images) {
			stbrp_rect r;
			r.id = rects.size();
			r.w = img->width();
			r.h = img->height();
			if(borders != nullptr) {
				r.w -= img->getAlphaBorders()[0] + img->getAlphaBorders()[2];
				r.h -= img->getAlphaBorders()[1] + img->getAlphaBorders()[3];
			}
			rects.emplace_back(r);
		}

		bool packed = false;
		while(!packed) {
			for(auto& r : rects) {
				r.x = r.y = r.was_packed = 0;
			}
			stbrp_context context;
			stbrp_init_target(&context, width, height, nodes.data(), nodes.size());
			stbrp_pack_rects(&context, rects.data(), rects.size());

			packed = true;
			for(auto& r : rects) {
				if(!r.was_packed) {
					if(nn & 1) {
						height += increment;
					} else {
						width += increment;
					}
					++nn;
					if(width > max_surface_width || height > max_surface_height) {
						return nullptr;
					}
					packed = false;
					break;
				}
			}

		}

		if(borders != nullptr) {
			borders->resize(images.size());
		}
		outr->resize(images.size());

		auto out = Surface::create(width, height, PixelFormat::PF::PIXELFORMAT_RGBA8888);
		for(auto& r : rects) {
			(*outr)[r.id] = rect(r.x, r.y, r.w, r.h);
			rect alpha_borders(0, 0, r.w, r.h);
			if(borders != nullptr) {
				alpha_borders = rect(images[r.id]->getAlphaBorders()[0], images[r.id]->getAlphaBorders()[1], r.w, r.h);
			}
			out->blitTo(images[r.id], alpha_borders, (*outr)[r.id]);
			if(borders != nullptr) {
				(*borders)[r.id] = images[r.id]->getAlphaBorders();
			}
		}
		return out;
	}
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Parchment Test Suite</title>

  <link rel="stylesheet" href="../libs/qunit/qunit.css" media="screen">

  <link rel="stylesheet" href="../libs/bootstrap/css/bootstrap.css" media="screen">

  <link rel="stylesheet" href="../dist/parchment.css" media="screen">

    <textarea id="qunit-fixture1"></textarea>
    <textarea id="qunit-fixture2"></textarea>


text:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
  <property>
    <name>druid.extensions.pullList</name>
    <value>[]</value>
    <description>A comma-separated list of one or more druid extensions to download from maven.</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.extensions.repositoryList</name>
    <value>[]</value>
    <description>A comma-separated list of maven repositories to download extensions.</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.extensions.loadList</name>
    <value>["druid-datasketches"]
    </value>
    <depends-on>
      <property>
        <type>druid-common</type>
        <name>druid.metadata.storage.type</name>
      </property>
    </depends-on>
    <description>A comma-separated list of one or more druid extensions to load.</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.security.extensions.loadList</name>
    <value>[]</value>
    <description>A comma-separated list of one or more druid security extensions to load. This property will be set via the kerberos wizard and User will not be allowed to modify this when security is enabled.</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.zk.service.host</name>
    <value>localhost:2181</value>
    <description>
      zookeeper connection string.
    </description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.zk.paths.base</name>
    <value>/druid</value>
    <description>
      Base Zookeeper path
    </description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.discovery.curator.path</name>
    <value>/druid/discovery</value>
    <description>
      Services announce themselves under this ZooKeeper path.
    </description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.storage.type</name>
    <value></value>
    <description>
      Choices:local, noop, s3, hdfs, c*. The type of deep storage to use.
    </description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.storage.storageDirectory</name>
    <value></value>
    <description>
      directory to use as deep storage.
    </description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.metadata.storage.connector.password</name>
    <value></value>
    <property-type>PASSWORD</property-type>
    <display-name>Metadata storage password</display-name>
    <description>Password for the metadata storage data base.</description>
    <value-attributes>
      <type>password</type>
      <empty-value-valid>true</empty-value-valid>
    </value-attributes>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.metadata.storage.connector.user</name>
    <value>druid</value>
    <display-name>Metadata storage user</display-name>
    <description>Metadata storage user</description>
    <value-attributes>
      <empty-value-valid>true</empty-value-valid>
    </value-attributes>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.metadata.storage.connector.port</name>
    <value>1527</value>
    <display-name>Metadata storage port</display-name>
    <description>Metadata storage port</description>
    <value-attributes>
      <empty-value-valid>true</empty-value-valid>
    </value-attributes>
    <depends-on>
      <property>
        <type>druid-common</type>
        <name>druid.metadata.storage.type</name>
      </property>
    </depends-on>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>database_name</name>
    <value>druid</value>
    <display-name>Druid Metadata storage database name</display-name>
    <description>Druid Metadata storage database name</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>metastore_hostname</name>
    <value>localhost</value>
    <display-name>Metadata storage hostname</display-name>
    <description>Metadata storage hostname</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property require-input="true">
    <name>druid.metadata.storage.type</name>
    <display-name>Druid Metadata storage type</display-name>
    <value>derby</value>
    <value-attributes>
      <overridable>false</overridable>
      <type>value-list</type>
      <entries>
        <entry>
          <value>mysql</value>
          MYSQL
        </entry>
        <entry>
          <value>derby</value>
          DERBY
        </entry>
        <entry>
          <value>postgresql</value>
          POSTGRESQL
        </entry>
      </entries>
    </value-attributes>
    <description>Type of the metadata storage. Note that derby will work only if all the druid node are located
      within the same node. Use mysql or postgres for distributed mode.
      mysql installed by ambari is only for development and not suitable for production use cases due to it being not HA
    </description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property require-input="true">
    <name>druid.metadata.storage.connector.connectURI</name>
    <value>jdbc:derby://localhost:1527/druid;create=true</value>
    <display-name>Metadata storage connector url</display-name>
    <description>Metadata storage connector url</description>
    <on-ambari-upgrade add="false"/>
    <depends-on>
      <property>
        <type>druid-common</type>
        <name>database_name</name>
      </property>
      <property>
        <type>druid-common</type>
        <name>metastore_hostname</name>
      </property>
      <property>
        <type>druid-common</type>
        <name>druid.metadata.storage.type</name>
      </property>
      <property>
        <type>druid-common</type>
        <name>druid.metadata.storage.connector.port</name>
      </property>
    </depends-on>
  </property>
  <property>
    <name>druid.hadoop.security.kerberos.principal</name>
    <display-name>kerberos principal</display-name>
    <description>Kerberos principal e.g druid@EXAMPLE.COM</description>
    <property-type>KERBEROS_PRINCIPAL</property-type>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.hadoop.security.kerberos.keytab</name>
    <display-name>Kerberos keytab location</display-name>
    <description>Kerberos keytab location</description>
    <on-ambari-upgrade add="false"/>
  </property>

  <property>
    <name>druid.emitter</name>
    <value>{{metric_emitter_type}}</value>
    <description>Emitter used to emit metrics. Values - "noop", "logging", "ambari-metrics", or "http" will initialize
      one of the emitter modules.
    </description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.emitter.ambari-metrics.hostname</name>
    <value>{{metric_collector_host}}</value>
    <description>Timeline host</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.emitter.ambari-metrics.port</name>
    <value>{{metric_collector_port}}</value>
    <description>Timeline port</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.emitter.ambari-metrics.protocol</name>
    <value>{{metric_collector_protocol}}</value>
    <description>Timeline protocol(http or https)</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.emitter.ambari-metrics.trustStorePath</name>
    <value>{{metric_truststore_path}}</value>
    <description>Location of the trust store file.</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.emitter.ambari-metrics.trustStoreType</name>
    <value>{{metric_truststore_type}}</value>
    <description>Optional. Default value is "jks".</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.emitter.ambari-metrics.trustStorePassword</name>
    <value>{{metric_truststore_password}}</value>
    <description>Password to open the trust store file.</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.emitter.ambari-metrics.eventConverter</name>
    <value>{"type":"whiteList"}</value>
    <description>Password to open the trust store file.</description>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>druid.monitoring.monitors</name>
    <value>["com.metamx.metrics.JvmMonitor"]</value>
    <description>Password to open the trust store file.</description>
    <on-ambari-upgrade add="false"/>
  </property>

</configuration>


text:
class AddStatusRefToProjects < ActiveRecord::Migration
  def change
    #add_reference :projects, :status, index: true
  end
end


text:
package org.apache.camel.component.solr;

import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertTrue;

public class SolrServerMissingTest extends SolrTestSupport {

    @Test
    public void indexSingleDocumentToNonexistentServer() {
        Exchange exchange = createExchangeWithBody(null);
        exchange.getIn().setHeader(SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
        exchange.getIn().setHeader("SolrField.id", "MA147LL/A");

        template.send("direct:start", exchange);

        assertTrue(exchange.isFailed());
    }

    @Override
    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            @Override
            public void configure() {
                from("direct:start").to("solr://localhost:" + getPort() + "/missingSolr");
            }
        };
    }
}


text:
<?php

namespace App;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

class User extends Model implements AuthenticatableContract,
                                    AuthorizableContract,
                                    CanResetPasswordContract
{
    use Authenticatable, Authorizable, CanResetPassword;

    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'users';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['first_name', 'last_name', 'email', 'password', 'customer_id', 'permission_id'];

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    protected $hidden = ['password', 'remember_token'];

    /**
     * Get the permission associated with the user
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function permission() {
      return $this->belongsTo('App\Permission');
    }

    /**
     * Get the customer the user belongs to
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function customer() {
      return $this->belongsTo('App\Customer');
    }

    public function tickets() {
      return $this->hasMany('App\Ticket');
    }

    public function assignedTickets() {
      return $this->hasMany('App\Ticket', 'assigned_to');
    }

    public function ticketResponses() {
      return $this->hasMany('App\TicketResponse');
    }
}


text:
- 1.6.6 : 2015/08/01
 * Fix calculation of Multiple Antenna Multiplier again. (westamastaflash)

- 1.6.5 : 2015/07/31
 * Fix calculation of Multiple Antenna Multiplier. (westamastaflash)

- 1.6.4 : 2015/07/19
 * Implement Range Multiplier.
 * Implement Multiple Antenna Multiplier.

- 1.6.3 : 2015/07/18
 * Fix unit of Slide time.

- 1.6.2 : 2015/07/07
 * Fix Delta-V unit of Multiple Launch View.

- 1.6.1 : 2015/07/06
 * Fix settings page.
 * Fix reset feature.

- 1.6 : 2015/07/06
 * Add Multiple Launch View.
 * Borderlines are drawn clearer.
 * Improved units used in Views.

- 1.5.6 : 2015/06/05
 * Fix calculation of night time. (Aerospace)

- 1.5.5 : 2015/05/08
 * Fix display of Slide time.

- 1.5.4 : 2015/05/07
 * Fix calculation of Delta-V.

- 1.5.3 : 2015/04/22
 * Views are now rendered by SVG.

- 1.5.2 : 2015/03/26
 * Add data for Real Solar System. (dirtcrusher)
 * Views shrink on small window.

- 1.5.1 : 2015/03/03
 * Fix some problems.

- 1.5 : 2015/03/03
 * Support multiple pair of antenna and quantity.
 * Fix autosave feature with local storage. Last input and user's bodies/antennas will be saved and restored automatically. (westamastaflash)

- 1.4 : 2015/01/29
 * Add remaining four dishes.

- 1.3.1 : 2015/01/03
 * Fix file reference.

- 1.3 : 2015/01/03
 * Move user-data management for body and antenna to tab pages.
 * Views are now rendered on any change within Data Input.

- 1.2.1 : 2014/11/03
 * Fix label of the second distance.

- 1.2 : 2014/11/01
 * Faster loading of the page.
 * Fix position of labels in Night view.
 * Autosave last calculation.

- 1.1 : 2014/10/16
 * Show the distance between a satellite and the one after the next.

- 1.0 : 2014/08/27
 * Implement Delta-V view about the delta-v to deploy satellites.

- beta2.4.1 : 2014/08/23
 * Fix indication of sphere of influence.

- beta2.4 : 2014/08/17
 * Implement manual input mode for antenna (sorry for my wrong history).
 * User-created antenna data is stored in cookie.

- beta2.3.1 : 2014/08/16
 * Fix calculation of stable range, the result was too high.

- beta2.3 : 2014/08/15
 * Draw sphere of influence.
 * Overhaul input validation.
 * Better display method for numbers.

- beta2.2 : 2014/08/13
 * Filled all data except extra-long range dishes.
 * Implement dynamic canvas resizing.
 * User-created body data is stored in cookie.

- beta2.1 : 2014/08/12
 * Manual input mode is now available for body.

- beta2 : 2014/08/10
 * Implement Night view calculate about electricity.

- beta1 : 2014/08/09
 * Implement Entire view for satellites network planning.


text:
var appVars = require('app-vars');
var fs = require('fs');
var path = require('path');
var model = require('settings-model');
var electron = require('electron');
var remote = electron.remote;
var Window = remote.getCurrentWindow();
var vm = new Vue(model);
Window.emit('get-config',conf=>{
  vm.setConfig(conf);
});

Window.setMenu(null);
//Window.openDevTools();
Window.show();


text:
from challenges.models import Challenge, Hint
from challenges.templatetags.challenges_helper_tags import is_locked, is_solved

from django import forms

class RevealHintForm(forms.Form):
    hint_id = forms.IntegerField(widget=forms.HiddenInput(), min_value=1)

    def __init__(self, *args, **kwargs):
        self.player = kwargs.pop('player', None)
        super().__init__(*args, **kwargs)

    def clean(self):
        super().clean()

        hint_id = self.cleaned_data.get('hint_id')
        hint = Hint.objects.filter(pk=hint_id).first()

        if hint is None:
            raise forms.ValidationError('Invalid hint specified!')

        team = self.player.team
        if (team is not None
        and hint in team.hints.all()):
            raise forms.ValidationError(
                'Your team has already revealed this hint!'
            )
        if is_solved(hint.challenge, team):
            raise forms.ValidationError(
                'Your team has already completed this challenge!'
            )

class SubmitFlagForm(forms.Form):
    challenge_id = forms.IntegerField(widget=forms.HiddenInput(), min_value=1)
    attempted_flag = forms.CharField(
        widget=forms.TextInput(attrs={'style': 'width:80%'}),
        max_length=128
    )

    def __init__(self, *args, **kwargs):
        self.player = kwargs.pop('player', None)
        super().__init__(*args, **kwargs)

    def clean(self):
        super().clean()

        challenge_id = self.cleaned_data.get('challenge_id')
        challenge = Challenge.objects.filter(pk=challenge_id).first()
        if challenge is None:
            raise forms.ValidationError('Invalid challenge specified!')

        if not self.player.is_authenticated:
            raise forms.ValidationError('User not logged in!')

        if is_locked(challenge, self.player):
            raise forms.ValidationError(
                'This level is currently locked '
                'or the CTF is not currently active!'
            )
        if is_solved(challenge, self.player.team):
            raise forms.ValidationError(
                'Your team has already completed this challenge!'
            )


text:
package com.gl.time.server.dto;

import java.io.Serializable;

public class SimplePrincipal implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = -4538906118654513566L;

    private String username;
    private String password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "SimplePrincipal [username=" + username + ", password=" + password + "]";
    }

}


text:
Spelling List Generator
=======================

This is a very simple webapp to generate randomly-chosen word lists for spelling
bees. The number of contestants, number of rounds, and number of words can all
be customized.

Currently the word lists are hard-coded and packaged with the application, in
the [spelling/data](spelling/data) directory.

When you hit the "Generate" button, the word list is randomly generated and
saved to a database table, so if you save the URL you can retrieve it later.

Deployment
----------

This is a standard [Flask](http://flask.pocoo.org/) webapp. To run it in
development mode:

    pip install -r requirements.txt
    python runserver.py

The app fits comfortably within Heroku's free tier, so you can run your own
instance by clicking the button below.

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var relation_1 = require("../common/relation");
var component_1 = require("../common/component");
(0, component_1.VantComponent)({
    relation: (0, relation_1.useParent)('tabs'),
    props: {
        dot: {
            type: Boolean,
            observer: 'update',
        },
        info: {
            type: null,
            observer: 'update',
        },
        title: {
            type: String,
            observer: 'update',
        },
        disabled: {
            type: Boolean,
            observer: 'update',
        },
        titleStyle: {
            type: String,
            observer: 'update',
        },
        name: {
            type: null,
            value: '',
        },
    },
    data: {
        active: false,
    },
    methods: {
        getComputedName: function () {
            if (this.data.name !== '') {
                return this.data.name;
            }
            return this.index;
        },
        updateRender: function (active, parent) {
            var parentData = parent.data;
            this.inited = this.inited || active;
            this.setData({
                active: active,
                shouldRender: this.inited || !parentData.lazyRender,
                shouldShow: active || parentData.animated,
            });
        },
        update: function () {
            if (this.parent) {
                this.parent.updateTabs();
            }
        },
    },
});


text:
/***********************************************************

Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/Xmu/Drawing.h>

typedef struct _PixmapCache {
    Screen *screen;
    Pixmap pixmap;
    Pixel foreground, background;
    unsigned int depth;
    int ref_count;
    struct _PixmapCache *next;
  } CacheEntry;

static CacheEntry *pixmapCache = NULL;

Pixmap
XmuCreateStippledPixmap(Screen *screen, Pixel fore, Pixel back,
			unsigned int depth)
/*
 *	Creates a stippled pixmap of specified depth
 *	caches these so that multiple requests share the pixmap
 */
{
    register Display *display = DisplayOfScreen(screen);
    CacheEntry *cachePtr;
    Pixmap stippled_pixmap;
    static unsigned char pixmap_bits[] = {
	0x02, 0x01,
    };

/*
 *	Creates a stippled pixmap of depth DefaultDepth(screen)
 *	caches these so that multiple requests share the pixmap
 */

#define pixmap_width 2
#define pixmap_height 2

    /* see if we already have a pixmap suitable for this screen */
    for (cachePtr = pixmapCache; cachePtr; cachePtr = cachePtr->next) {
	if (cachePtr->screen == screen && cachePtr->foreground == fore &&
	    cachePtr->background == back && cachePtr->depth == depth)
	    return( cachePtr->ref_count++, cachePtr->pixmap );
    }

    stippled_pixmap = XCreatePixmapFromBitmapData (display,
			RootWindowOfScreen(screen), (char *)pixmap_bits,
			pixmap_width, pixmap_height, fore, back, depth);

    /* and insert it at the head of the cache */
    cachePtr = XtNew(CacheEntry);
    cachePtr->screen = screen;
    cachePtr->foreground = fore;
    cachePtr->background = back;
    cachePtr->depth = depth;
    cachePtr->pixmap = stippled_pixmap;
    cachePtr->ref_count = 1;
    cachePtr->next = pixmapCache;
    pixmapCache = cachePtr;

    return( stippled_pixmap );
}

void
XmuReleaseStippledPixmap(Screen *screen, Pixmap pixmap)
{
    register Display *display = DisplayOfScreen(screen);
    CacheEntry *cachePtr, **prevP;
    for (prevP = &pixmapCache, cachePtr = pixmapCache; cachePtr;) {
	if (cachePtr->screen == screen && cachePtr->pixmap == pixmap) {
	    if (--cachePtr->ref_count == 0) {
		XFreePixmap( display, pixmap );
		*prevP = cachePtr->next;
		XtFree( (char*)cachePtr );
		break;
	    }
	}
	prevP = &cachePtr->next;
	cachePtr = *prevP;
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <meta name="robots" content="index, follow, all" />
    <title>Thelia\ImportExport\Import\Type\ProductPricesImport | Thelia 2 API</title>

            <link rel="stylesheet" type="text/css" href="../../../../css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../../../../css/bootstrap-theme.min.css">
        <link rel="stylesheet" type="text/css" href="../../../../css/sami.css">

        <meta name="MobileOptimized" content="width">
        <meta name="HandheldFriendly" content="true">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">

                <form id="search-form" action="../../../../search.html" method="GET">

            <input name="search"
                   class="typeahead form-control"
                   type="search"
                   placeholder="Search">
        </form>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
                    Toggle navigation

                </button>
                Thelia 2 API

Classes

Namespaces

Interfaces

Traits

Index

Search

class

Thelia

ImportExport

Import

Type

ProductPricesImport

ProductPricesImport

    class
    ProductPricesImport        extends ImportHandler

Class ProductPricesImport

Methods

                    __construct(
    ContainerInterface $container)

No description

from
    ImportHandler

                    getContainer()

No description

from
    AbstractHandler

    Request

                    getRequest()

No description

from
    AbstractHandler

    string|array

                    getHandledTypes()

No description

                    getImportedRows()

No description

from
    ImportHandler

    string|array

                    retrieveFromFormatterData(
    FormatterData $data)

No description

Details

in
    ImportHandler at line 32

    __construct(
    ContainerInterface $container)

Parameters

    ContainerInterface
                $container
                Dependency injection: load the container to be able to get parameters and services

in
    AbstractHandler at line 41

    getContainer()

in
    AbstractHandler at line 49

    Request
    getRequest()

Return Value

    Request

at line 47

    string|array
    getHandledTypes()

Return Value

    string|array
            Define all the type of formatters that this can handle
return a string if it handle a single type ( specific exports ),
or an array if multiple.

Thelia types are defined in \Thelia\Core\FileFormat\FormatType

example:
return array(
    FormatType::TABLE,
    FormatType::UNBOUNDED,
);

in
    ImportHandler at line 39

    getImportedRows()

at line 61

    string|array
    retrieveFromFormatterData(
    FormatterData $data)

Parameters

    FormatterData
                $data

Return Value

    string|array
            error messages

The method does the import routine from a FormatterData

        Generated by Sami, the API Documentation Generator.


text:
module.exports.encodeBase64 = function encodeBase64(base64String) {
    return base64String.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
};

// Decode url safe base64 encoding and add padding ('=')
module.exports.decodeBase64 = function decodeBase64(base64String) {
    base64String = base64String.replace(/-/g, '+').replace(/_/g, '/');
    while (base64String.length % 4) {
        base64String += '=';
    }
    return base64String;
};


text:
package com.wytings.annotation;

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

/**
 * Created by rex on 06/10/2017.
 *
 * @author wytings@gmail.com
 */

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.CLASS)
public @interface Route {
    String value();
}


text:
This page was generated with Wiki Builder. Do not change the format!

## Info
Returns data about a character's status with a given Objective. Combine with DestinyObjectiveDefinition static data for display purposes.

## Schema
* **Schema Type:** Class
* **Type:** object

## Properties
Name | Type | Description
---- | ---- | -----------
objectiveHash | [[Destiny.Definitions.DestinyObjectiveDefinition|Destiny-Definitions-DestinyObjectiveDefinition]]:integer:uint32 | The unique identifier of the Objective being referred to. Use to look up the DestinyObjectiveDefinition in static data.
destinationHash | [[Destiny.Definitions.DestinyDestinationDefinition|Destiny-Definitions-DestinyDestinationDefinition]]:integer:uint32:nullable | If the Objective has a Destination associated with it, this is the unique identifier of the Destination being referred to. Use to look up the DestinyDestinationDefinition in static data. This will give localized data about *where* in the universe the objective should be achieved.
activityHash | [[Destiny.Definitions.DestinyActivityDefinition|Destiny-Definitions-DestinyActivityDefinition]]:integer:uint32:nullable | If the Objective has an Activity associated with it, this is the unique identifier of the Activity being referred to. Use to look up the DestinyActivityDefinition in static data. This will give localized data about *what* you should be playing for the objective to be achieved.
progress | integer:int32:nullable | If progress has been made, and the progress can be measured numerically, this will be the value of that progress. You can compare it to the DestinyObjectiveDefinition.completionValue property for current vs. upper bounds, and use DestinyObjectiveDefinition.valueStyle to determine how this should be rendered. Note that progress, in Destiny 2, need not be a literal numeric progression. It could be one of a number of possible values, even a Timestamp. Always examine DestinyObjectiveDefinition.valueStyle before rendering progress.
complete | boolean | Whether or not the Objective is completed.

## Example
```javascript
{
    // Type: [[Destiny.Definitions.DestinyObjectiveDefinition|Destiny-Definitions-DestinyObjectiveDefinition]]:integer:uint32
    "objectiveHash": 0,
    // Type: [[Destiny.Definitions.DestinyDestinationDefinition|Destiny-Definitions-DestinyDestinationDefinition]]:integer:uint32:nullable
    "destinationHash": 0,
    // Type: [[Destiny.Definitions.DestinyActivityDefinition|Destiny-Definitions-DestinyActivityDefinition]]:integer:uint32:nullable
    "activityHash": 0,
    // Type: integer:int32:nullable
    "progress": 0,
    // Type: boolean
    "complete": false
}

```

## References
1. https://bungie-net.github.io/multi/schema_Destiny-Quests-DestinyObjectiveProgress.html#schema_Destiny-Quests-DestinyObjectiveProgress


text:
package org.apache.lucene.index;

import org.apache.lucene.document.Field;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.DocValuesFieldExistsQuery;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.FixedBitSet;
import org.elasticsearch.common.lucene.Lucene;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * This is a modified version of {@link SoftDeletesDirectoryReaderWrapper} that materializes the liveDocs
 * bitset lazily. In contrast to {@link SoftDeletesDirectoryReaderWrapper}, this wrapper can only be used
 * for non-NRT readers.
 *
 * This reader filters out documents that have a doc values value in the given field and treat these
 * documents as soft deleted. Hard deleted documents will also be filtered out in the live docs of this reader.
 * @see IndexWriterConfig#setSoftDeletesField(String)
 * @see IndexWriter#softUpdateDocument(Term, Iterable, Field...)
 * @see SoftDeletesRetentionMergePolicy
 */
public final class LazySoftDeletesDirectoryReaderWrapper extends FilterDirectoryReader {
    private final CacheHelper readerCacheHelper;
    /**
     * Creates a new soft deletes wrapper.
     * @param in the incoming directory reader
     * @param field the soft deletes field
     */
    public LazySoftDeletesDirectoryReaderWrapper(DirectoryReader in, String field) throws IOException {
        super(in, new LazySoftDeletesSubReaderWrapper(field));
        readerCacheHelper = in.getReaderCacheHelper() == null ? null : new DelegatingCacheHelper(in.getReaderCacheHelper());
    }

    @Override
    protected DirectoryReader doWrapDirectoryReader(DirectoryReader in) throws IOException {
        throw new UnsupportedOperationException();
    }

    @Override
    public CacheHelper getReaderCacheHelper() {
        return readerCacheHelper;
    }

    private static class LazySoftDeletesSubReaderWrapper extends SubReaderWrapper {
        private final String field;

        LazySoftDeletesSubReaderWrapper(String field) {
            Objects.requireNonNull(field, "Field must not be null");
            this.field = field;
        }

        @Override
        protected LeafReader[] wrap(List<? extends LeafReader> readers) {
            List<LeafReader> wrapped = new ArrayList<>(readers.size());
            for (LeafReader reader : readers) {
                LeafReader wrap = wrap(reader);
                assert wrap != null;
                if (wrap.numDocs() != 0) {
                    wrapped.add(wrap);
                }
            }
            return wrapped.toArray(new LeafReader[0]);
        }

        @Override
        public LeafReader wrap(LeafReader reader) {
            return LazySoftDeletesDirectoryReaderWrapper.wrap(reader, field);
        }
    }

    static LeafReader wrap(LeafReader reader, String field) {
        final SegmentReader segmentReader = Lucene.segmentReader(reader);
        assert segmentReader.isNRT == false : "expected non-NRT reader";
        final SegmentCommitInfo segmentInfo = segmentReader.getSegmentInfo();
        final int numSoftDeletes = segmentInfo.getSoftDelCount();
        if (numSoftDeletes == 0) {
            return reader;
        }
        final int maxDoc = reader.maxDoc();
        final int numDocs = maxDoc - segmentInfo.getDelCount() - segmentInfo.getSoftDelCount();
        final LazyBits lazyBits = new LazyBits(maxDoc, field, reader, numSoftDeletes, numDocs);
        return reader instanceof CodecReader ? new LazySoftDeletesFilterCodecReader((CodecReader) reader, lazyBits, numDocs)
            : new LazySoftDeletesFilterLeafReader(reader, lazyBits, numDocs);
    }

    public static final class LazySoftDeletesFilterLeafReader extends FilterLeafReader {
        private final LeafReader reader;
        private final LazyBits bits;
        private final int numDocs;
        private final CacheHelper readerCacheHelper;

        public LazySoftDeletesFilterLeafReader(LeafReader reader, LazyBits bits, int numDocs) {
            super(reader);
            this.reader = reader;
            this.bits = bits;
            this.numDocs = numDocs;
            this.readerCacheHelper = reader.getReaderCacheHelper() == null ? null :
                new DelegatingCacheHelper(reader.getReaderCacheHelper());
        }

        @Override
        public LazyBits getLiveDocs() {
            return bits;
        }

        @Override
        public int numDocs() {
            return numDocs;
        }

        @Override
        public CacheHelper getCoreCacheHelper() {
            return reader.getCoreCacheHelper();
        }

        @Override
        public CacheHelper getReaderCacheHelper() {
            return readerCacheHelper;
        }
    }

    public static final class LazySoftDeletesFilterCodecReader extends FilterCodecReader {
        private final LeafReader reader;
        private final LazyBits bits;
        private final int numDocs;
        private final CacheHelper readerCacheHelper;

        public LazySoftDeletesFilterCodecReader(CodecReader reader, LazyBits bits, int numDocs) {
            super(reader);
            this.reader = reader;
            this.bits = bits;
            this.numDocs = numDocs;
            this.readerCacheHelper = reader.getReaderCacheHelper() == null ? null :
                new DelegatingCacheHelper(reader.getReaderCacheHelper());
        }

        @Override
        public LazyBits getLiveDocs() {
            return bits;
        }

        @Override
        public int numDocs() {
            return numDocs;
        }

        @Override
        public CacheHelper getCoreCacheHelper() {
            return reader.getCoreCacheHelper();
        }

        @Override
        public CacheHelper getReaderCacheHelper() {
            return readerCacheHelper;
        }
    }

    private static class DelegatingCacheHelper implements CacheHelper {
        private final CacheHelper delegate;
        private final CacheKey cacheKey = new CacheKey();

        DelegatingCacheHelper(CacheHelper delegate) {
            this.delegate = delegate;
        }

        @Override
        public CacheKey getKey() {
            return cacheKey;
        }

        @Override
        public void addClosedListener(ClosedListener listener) {
            // here we wrap the listener and call it with our cache key
            // this is important since this key will be used to cache the reader and otherwise we won't free caches etc.
            delegate.addClosedListener(unused -> listener.onClose(cacheKey));
        }
    }

    public static class LazyBits implements Bits {

        private final int maxDoc;
        private final String field;
        private final LeafReader reader;
        private final int numSoftDeletes;
        private final int numDocs;
        volatile Bits materializedBits;

        public LazyBits(int maxDoc, String field, LeafReader reader, int numSoftDeletes, int numDocs) {
            this.maxDoc = maxDoc;
            this.field = field;
            this.reader = reader;
            this.numSoftDeletes = numSoftDeletes;
            this.numDocs = numDocs;
            materializedBits = null;
            assert numSoftDeletes > 0;
        }

        @Override
        public boolean get(int index) {
            if (materializedBits == null) {
                synchronized (this) {
                    try {
                        if (materializedBits == null) {
                            materializedBits = init();
                        }
                    } catch (IOException e) {
                        throw new UncheckedIOException(e);
                    }
                }
            }
            return materializedBits.get(index);
        }

        @Override
        public int length() {
            return maxDoc;
        }

        private Bits init() throws IOException {
            assert Thread.holdsLock(this);

            DocIdSetIterator iterator = DocValuesFieldExistsQuery.getDocValuesDocIdSetIterator(field, reader);
            assert iterator != null;
            Bits liveDocs = reader.getLiveDocs();
            final FixedBitSet bits;
            if (liveDocs != null) {
                bits = FixedBitSet.copyOf(liveDocs);
            } else {
                bits = new FixedBitSet(maxDoc);
                bits.set(0, maxDoc);
            }
            int numComputedSoftDeletes = PendingSoftDeletes.applySoftDeletes(iterator, bits);
            assert numComputedSoftDeletes == numSoftDeletes :
                "numComputedSoftDeletes: " + numComputedSoftDeletes + " expected: " + numSoftDeletes;

            int numDeletes = reader.numDeletedDocs() + numComputedSoftDeletes;
            int computedNumDocs = reader.maxDoc() - numDeletes;
            assert computedNumDocs == numDocs : "computedNumDocs: " + computedNumDocs + " expected: " + numDocs;
            return bits;
        }

        public boolean initialized() {
            return materializedBits != null;
        }
    }
}


text:
package com.ecchilon.sadpanda.search;

import java.util.List;

import android.net.Uri;
import com.ecchilon.sadpanda.R;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import lombok.Data;
import roboguice.util.Strings;

@Data
public class SearchController {
	private static final String STAR_PARAM = "f_srdd";
	private static final String SEARCH_PARAM = "f_search";
	private static final String AUTHORITY = "exhentai.org";
	private static final String SCHEME = "http";

	private static final ImmutableList<CategoryObject> CATEGORY_PARAMS =
			new ImmutableList.Builder<CategoryObject>().add(
					(CategoryObject) new CategoryObject("f_doujinshi", "1", "0", R.color.doujinshi,
							R.string.doujinshi).setActive(true),
					(CategoryObject) new CategoryObject("f_manga", "1", "0", R.color.manga, R.string.manga).setActive(
							true),
					(CategoryObject) new CategoryObject("f_artistcg", "1", "0", R.color.artist_cg,
							R.string.artist_cg).setActive(true),
					(CategoryObject) new CategoryObject("f_gamecg", "1", "0", R.color.game_cg,
							R.string.game_cg).setActive(true),
					(CategoryObject) new CategoryObject("f_western", "1", "0", R.color.western,
							R.string.western).setActive(true),
					(CategoryObject) new CategoryObject("f_non-h", "1", "0", R.color.non_h, R.string.nonh).setActive(
							true),
					(CategoryObject) new CategoryObject("f_imageset", "1", "0", R.color.image_set,
							R.string.imageset).setActive(true),
					(CategoryObject) new CategoryObject("f_cosplay", "1", "0", R.color.cosplay,
							R.string.cosplay).setActive(true),
					(CategoryObject) new CategoryObject("f_asianporn", "1", "0", R.color.asian_porn, R.string
							.asianporn)
							.setActive(
									true),
					(CategoryObject) new CategoryObject("f_misc", "1", "0", R.color.misc, R.string.misc).setActive(
							true)).build();

	private static final ImmutableList<QueryObject> QUERY_PARAMS = new ImmutableList.Builder<QueryObject>().add(
			new QueryObject("f_sname", "on", "", R.string.by_name).setActive(true),
			new QueryObject("f_stags", "on", "", R.string.by_tag).setActive(false),
			new QueryObject("f_sh", "on", "", R.string.by_expunged).setActive(false),
			new QueryObject("f_sdesc", "on", "", R.string.by_desc).setActive(false),
			new QueryObject("f_sr", "on", "", R.string.by_star).setActive(false)).build();

	private final List<QueryObject> queryParameters =
			Lists.newArrayListWithCapacity(QUERY_PARAMS.size() + CATEGORY_PARAMS.size());

	private int stars = 0;

	public SearchController(String url) {
		Uri uri = Uri.parse(url);

		for (CategoryObject entry : CATEGORY_PARAMS) {
			CategoryObject copy = entry.copy();
			String param = uri.getQueryParameter(copy.getKey());
			if(param != null) {
				if(param.equals(copy.getOnValue())) {
					copy.setActive(true);
				}
				else if(param.equals(copy.getOffValue())) {
					copy.setActive(false);
				}
			}
			queryParameters.add(copy);
		}

		for (QueryObject entry : QUERY_PARAMS) {
			QueryObject copy = entry.copy();
			String param = uri.getQueryParameter(copy.getKey());
			if(param != null) {
				if(param.equals(copy.getOnValue())) {
					copy.setActive(true);
				}
				else if(param.equals(copy.getOffValue())) {
					copy.setActive(false);
				}
			}
			queryParameters.add(copy);
		}
	}

	public SearchController() {
		for (CategoryObject entry : CATEGORY_PARAMS) {
			CategoryObject copy = entry.copy();
			queryParameters.add(copy);
		}

		for (QueryObject entry : QUERY_PARAMS) {
			QueryObject copy = entry.copy();
			queryParameters.add(copy);
		}
	}

	public String getUrl(String query) {
		return buildUrl(queryParameters, query);
	}

	public static String getDefaultUrl(String query) {
		List<QueryObject> list = Lists.newArrayList(QUERY_PARAMS);
		list.addAll(CATEGORY_PARAMS);
		return buildUrl(list, query);
	}

	private static String buildUrl(List<QueryObject> queryObjects, String query) {
		Uri.Builder builder = new Uri.Builder().scheme(SCHEME).authority(AUTHORITY).path("/");
		for (QueryObject queryObj : queryObjects) {
			if (!Strings.isEmpty(queryObj.getValue())) {
				builder.appendQueryParameter(queryObj.getKey(), queryObj.getValue());
			}
		}

		builder.appendQueryParameter(SEARCH_PARAM, query);

		builder.appendQueryParameter(STAR_PARAM, Integer.toString(0));

		return builder.build().toString();
	}

	public static String getUploaderUrl(String uploader) {
		Uri.Builder builder = new Uri.Builder().scheme(SCHEME).authority(AUTHORITY).path("/uploader/" + uploader);
		return builder.build().toString();
	}

	public void reset() {
		int catSize = CATEGORY_PARAMS.size(), querySize = QUERY_PARAMS.size();
		for (int i = 0; i < catSize; i++) {
			queryParameters.get(i).setActive(CATEGORY_PARAMS.get(i).isActive());
		}

		for (int i = 0; i < querySize; i++) {
			queryParameters.get(catSize + i).setActive(QUERY_PARAMS.get(i).isActive());
		}

		stars = 0;
	}
}


text:
import { combineReducers } from 'redux';
import UploadXMLReducer from './UploadXMLReducer';
import NavigationReducer from './NavigationReducer';
import ActiveUploadXMLReducer from './ActiveUploadXMLReducer'
import InputXMLReducer from './InputXMLReducer'
import internationalReducer from './internationalReducer'

const rootReducer = combineReducers({
  UploadXMLReducer,
  NavigationReducer,
  ActiveUploadXMLReducer,
  InputXMLReducer,
  internationalReducer
})

export default rootReducer


text:
package org.apache.druid.server.metrics;

import com.google.common.collect.ImmutableList;
import com.google.inject.Binder;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Module;
import com.google.inject.name.Names;
import org.apache.druid.guice.GuiceInjectors;
import org.apache.druid.guice.JsonConfigProvider;
import org.apache.druid.guice.annotations.Self;
import org.apache.druid.initialization.Initialization;
import org.apache.druid.server.DruidNode;
import org.junit.Assert;
import org.junit.Test;

public class MetricsModuleTest
{
  @Test
  public void testSimpleInjection()
  {
    final Injector injector = Initialization.makeInjectorWithModules(
        GuiceInjectors.makeStartupInjector(),
        ImmutableList.of(new Module()
        {
          @Override
          public void configure(Binder binder)
          {
            JsonConfigProvider.bindInstance(
                binder,
                Key.get(DruidNode.class, Self.class),
                new DruidNode("test-inject", null, false, null, null, true, false)
            );
          }
        })
    );
    final DataSourceTaskIdHolder dimensionIdHolder = new DataSourceTaskIdHolder();
    injector.injectMembers(dimensionIdHolder);
    Assert.assertNull(dimensionIdHolder.getDataSource());
    Assert.assertNull(dimensionIdHolder.getTaskId());
  }

  @Test
  public void testSimpleInjectionWithValues()
  {
    final String dataSource = "some datasource";
    final String taskId = "some task";
    final Injector injector = Initialization.makeInjectorWithModules(
        GuiceInjectors.makeStartupInjector(),
        ImmutableList.of(new Module()
        {
          @Override
          public void configure(Binder binder)
          {
            JsonConfigProvider.bindInstance(
                binder,
                Key.get(DruidNode.class, Self.class),
                new DruidNode("test-inject", null, false, null, null, true, false)
            );
            binder.bind(Key.get(String.class, Names.named(DataSourceTaskIdHolder.DATA_SOURCE_BINDING)))
                  .toInstance(dataSource);
            binder.bind(Key.get(String.class, Names.named(DataSourceTaskIdHolder.TASK_ID_BINDING)))
                  .toInstance(taskId);
          }
        })
    );
    final DataSourceTaskIdHolder dimensionIdHolder = new DataSourceTaskIdHolder();
    injector.injectMembers(dimensionIdHolder);
    Assert.assertEquals(dataSource, dimensionIdHolder.getDataSource());
    Assert.assertEquals(taskId, dimensionIdHolder.getTaskId());
  }
}