text:
=========================
NumPy 1.3.0 Release Notes
=========================

This minor includes numerous bug fixes, official python 2.6 support, and
several new features such as generalized ufuncs.

Highlights
==========

Python 2.6 support
------------------

Python 2.6 is now supported on all previously supported platforms, including
windows.

http://www.python.org/dev/peps/pep-0361/

Generalized ufuncs
------------------

There is a general need for looping over not only functions on scalars but also
over functions on vectors (or arrays), as explained on
http://scipy.org/scipy/numpy/wiki/GeneralLoopingFunctions. We propose to
realize this concept by generalizing the universal functions (ufuncs), and
provide a C implementation that adds ~500 lines to the numpy code base. In
current (specialized) ufuncs, the elementary function is limited to
element-by-element operations, whereas the generalized version supports
"sub-array" by "sub-array" operations. The Perl vector library PDL provides a
similar functionality and its terms are re-used in the following.

Each generalized ufunc has information associated with it that states what the
"core" dimensionality of the inputs is, as well as the corresponding
dimensionality of the outputs (the element-wise ufuncs have zero core
dimensions). The list of the core dimensions for all arguments is called the
"signature" of a ufunc. For example, the ufunc numpy.add has signature
"(),()->()" defining two scalar inputs and one scalar output.

Another example is (see the GeneralLoopingFunctions page) the function
inner1d(a,b) with a signature of "(i),(i)->()". This applies the inner product
along the last axis of each input, but keeps the remaining indices intact. For
example, where a is of shape (3,5,N) and b is of shape (5,N), this will return
an output of shape (3,5). The underlying elementary function is called 3*5
times. In the signature, we specify one core dimension "(i)" for each input and
zero core dimensions "()" for the output, since it takes two 1-d arrays and
returns a scalar. By using the same name "i", we specify that the two
corresponding dimensions should be of the same size (or one of them is of size
1 and will be broadcasted).

The dimensions beyond the core dimensions are called "loop" dimensions. In the
above example, this corresponds to (3,5).

The usual numpy "broadcasting" rules apply, where the signature determines how
the dimensions of each input/output object are split into core and loop
dimensions:

While an input array has a smaller dimensionality than the corresponding number
of core dimensions, 1's are pre-pended to its shape.  The core dimensions are
removed from all inputs and the remaining dimensions are broadcasted; defining
the loop dimensions.  The output is given by the loop dimensions plus the
output core dimensions.

Experimental Windows 64 bits support
------------------------------------

Numpy can now be built on windows 64 bits (amd64 only, not IA64), with both MS
compilers and mingw-w64 compilers:

This is *highly experimental*: DO NOT USE FOR PRODUCTION USE. See INSTALL.txt,
Windows 64 bits section for more information on limitations and how to build it
by yourself.

New features
============

Formatting issues
-----------------

Float formatting is now handled by numpy instead of the C runtime: this enables
locale independent formatting, more robust fromstring and related methods.
Special values (inf and nan) are also more consistent across platforms (nan vs
IND/NaN, etc...), and more consistent with recent python formatting work (in
2.6 and later).

Nan handling in max/min
-----------------------

The maximum/minimum ufuncs now reliably propagate nans. If one of the
arguments is a nan, then nan is returned. This affects np.min/np.max, amin/amax
and the array methods max/min. New ufuncs fmax and fmin have been added to deal
with non-propagating nans.

Nan handling in sign
--------------------

The ufunc sign now returns nan for the sign of anan.

New ufuncs
----------

#. fmax - same as maximum for integer types and non-nan floats. Returns the
   non-nan argument if one argument is nan and returns nan if both arguments
   are nan.
#. fmin - same as minimum for integer types and non-nan floats. Returns the
   non-nan argument if one argument is nan and returns nan if both arguments
   are nan.
#. deg2rad - converts degrees to radians, same as the radians ufunc.
#. rad2deg - converts radians to degrees, same as the degrees ufunc.
#. log2 - base 2 logarithm.
#. exp2 - base 2 exponential.
#. trunc - truncate floats to nearest integer towards zero.
#. logaddexp - add numbers stored as logarithms and return the logarithm
   of the result.
#. logaddexp2 - add numbers stored as base 2 logarithms and return the base 2
   logarithm of the result.

Masked arrays
-------------

Several new features and bug fixes, including:

	* structured arrays should now be fully supported by MaskedArray
	  (r6463, r6324, r6305, r6300, r6294...)
	* Minor bug fixes (r6356, r6352, r6335, r6299, r6298)
	* Improved support for __iter__ (r6326)
	* made baseclass, sharedmask and hardmask accessible to the user (but
	  read-only)
	* doc update

gfortran support on windows
---------------------------

Gfortran can now be used as a fortran compiler for numpy on windows, even when
the C compiler is Visual Studio (VS 2005 and above; VS 2003 will NOT work).
Gfortran + Visual studio does not work on windows 64 bits (but gcc + gfortran
does). It is unclear whether it will be possible to use gfortran and visual
studio at all on x64.

Arch option for windows binary
------------------------------

Automatic arch detection can now be bypassed from the command line for the superpack installed:

	numpy-1.3.0-superpack-win32.exe /arch=nosse

will install a numpy which works on any x86, even if the running computer
supports SSE set.

Deprecated features
===================

Histogram
---------

The semantics of histogram has been modified to fix long-standing issues
with outliers handling. The main changes concern

#. the definition of the bin edges, now including the rightmost edge, and
#. the handling of upper outliers, now ignored rather than tallied in the
   rightmost bin.

The previous behavior is still accessible using `new=False`, but this is
deprecated, and will be removed entirely in 1.4.0.

Documentation changes
=====================

A lot of documentation has been added. Both user guide and references can be
built from sphinx.

New C API
=========

Multiarray API
--------------

The following functions have been added to the multiarray C API:

	* PyArray_GetEndianness: to get runtime endianness

Ufunc API
---------

The following functions have been added to the ufunc API:

	* PyUFunc_FromFuncAndDataAndSignature: to declare a more general ufunc
	  (generalized ufunc).

New defines
-----------

New public C defines are available for ARCH specific code through numpy/npy_cpu.h:

	* NPY_CPU_X86: x86 arch (32 bits)
        * NPY_CPU_AMD64: amd64 arch (x86_64, NOT Itanium)
        * NPY_CPU_PPC: 32 bits ppc
        * NPY_CPU_PPC64: 64 bits ppc
        * NPY_CPU_SPARC: 32 bits sparc
        * NPY_CPU_SPARC64: 64 bits sparc
        * NPY_CPU_S390: S390
        * NPY_CPU_IA64: ia64
        * NPY_CPU_PARISC: PARISC

New macros for CPU endianness has been added as well (see internal changes
below for details):

	* NPY_BYTE_ORDER: integer
	* NPY_LITTLE_ENDIAN/NPY_BIG_ENDIAN defines

Those provide portable alternatives to glibc endian.h macros for platforms
without it.

Portable NAN, INFINITY, etc...
------------------------------

npy_math.h now makes available several portable macro to get NAN, INFINITY:

        * NPY_NAN: equivalent to NAN, which is a GNU extension
        * NPY_INFINITY: equivalent to C99 INFINITY
        * NPY_PZERO, NPY_NZERO: positive and negative zero respectively

Corresponding single and extended precision macros are available as well. All
references to NAN, or home-grown computation of NAN on the fly have been
removed for consistency.

Internal changes
================

numpy.core math configuration revamp
------------------------------------

This should make the porting to new platforms easier, and more robust. In
particular, the configuration stage does not need to execute any code on the
target platform, which is a first step toward cross-compilation.

http://numpy.github.io/neps/math_config_clean.html

umath refactor
--------------

A lot of code cleanup for umath/ufunc code (charris).

Improvements to build warnings
------------------------------

Numpy can now build with -W -Wall without warnings

http://numpy.github.io/neps/warnfix.html

Separate core math library
--------------------------

The core math functions (sin, cos, etc... for basic C types) have been put into
a separate library; it acts as a compatibility layer, to support most C99 maths
functions (real only for now). The library includes platform-specific fixes for
various maths functions, such as using those versions should be more robust
than using your platform functions directly. The API for existing functions is
exactly the same as the C99 math functions API; the only difference is the npy
prefix (npy_cos vs cos).

The core library will be made available to any extension in 1.4.0.

CPU arch detection
------------------

npy_cpu.h defines numpy specific CPU defines, such as NPY_CPU_X86, etc...
Those are portable across OS and toolchains, and set up when the header is
parsed, so that they can be safely used even in the case of cross-compilation
(the values is not set when numpy is built), or for multi-arch binaries (e.g.
fat binaries on Max OS X).

npy_endian.h defines numpy specific endianness defines, modeled on the glibc
endian.h. NPY_BYTE_ORDER  is equivalent to BYTE_ORDER, and one of
NPY_LITTLE_ENDIAN or NPY_BIG_ENDIAN is defined. As for CPU archs, those are set
when the header is parsed by the compiler, and as such can be used for
cross-compilation and multi-arch binaries.


text:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 *
 * @version $Id: $
 */
return array (
  '$_SERVER does not have {vars}.' => '$_SERVER heeft geen {vars}.',
  '$_SERVER variable' => '$_SERVER variabele',
  '$_SERVER["SCRIPT_FILENAME"] must be the same as the entry script file path.' => '$_SERVER["SCRIPT_FILENAME"] moet hetzelfde zijn als het bestandspad van het startscript.',
  'APC extension' => 'APC extensie',
  'All DB-related classes' => 'Alle DB-gerelateerde classes',
  'DOM extension' => 'DOM extensie',
  'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.' => 'Of $_SERVER["REQUEST_URI"] of $_SERVER["QUERY_STRING"] moet gedefinieerd zijn.',
  'GD extension' => 'GD extensie',
  'Mcrypt extension' => 'Mcrypt extensie',
  'Memcache extension' => 'Memcache extensie',
  'PCRE extension' => 'PCRE extensie',
  'PDO MySQL extension' => 'PDO MySQL extensie',
  'PDO PostgreSQL extension' => 'PDO PostgreSQL extensie',
  'PDO SQLite extension' => 'PDO SQLite extensie',
  'PDO extension' => 'PDO extensie',
  'PHP 5.1.0 or higher is required.' => 'PHP 5.1.0 of hoger is vereist.',
  'PHP version' => 'PHP versie',
  'Reflection extension' => 'Reflection extensie',
  'SOAP extension' => 'SOAP extensie',
  'SPL extension' => 'SPL extensie',
  'This is required if you are using MySQL database.' => 'Dit is vereist als een MySQL database wordt gebruikt.',
  'This is required if you are using PostgreSQL database.' => 'Dit is vereist als een PostgreSQL database wordt gebruikt.',
  'This is required if you are using SQLite database.' => 'Dit is vereist als een SQLite database wordt gebruikt.',
  'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.' => 'Niet in staat om informatie over het URL pad te verkrijgen. Zorg er a.u.b. voor dat $_SERVER["PATH_INFO"] (of $_SERVER["PHP_SELF"] en $_SERVER["SCRIPT_NAME"]) een juiste waarde bevatten.',
);

redpajama_set_name: RedPajamaGithub


text:
package org.apache.geronimo.jaxws.wsa;

import javax.annotation.PostConstruct;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceRef;

public class TestServletEJB extends TestServlet {

    @WebServiceRef(name = "services/ejb/Calculator")
    private Service myService;

    @PostConstruct
    private void myInit() {
        this.service = myService;
        updateAddress();
    }

}


text:
#include <linux/device.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_gpio.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/slab.h>
#include <linux/gpio/machine.h>

#include "gpiolib.h"

/* Private data structure for of_gpiochip_find_and_xlate */
struct gg_data {
	enum of_gpio_flags *flags;
	struct of_phandle_args gpiospec;

	struct gpio_desc *out_gpio;
};

/* Private function for resolving node pointer to gpio_chip */
static int of_gpiochip_find_and_xlate(struct gpio_chip *gc, void *data)
{
	struct gg_data *gg_data = data;
	int ret;

	if ((gc->of_node != gg_data->gpiospec.np) ||
	    (gc->of_gpio_n_cells != gg_data->gpiospec.args_count) ||
	    (!gc->of_xlate))
		return false;

	ret = gc->of_xlate(gc, &gg_data->gpiospec, gg_data->flags);
	if (ret < 0) {
		/* We've found a gpio chip, but the translation failed.
		 * Store translation error in out_gpio.
		 * Return false to keep looking, as more than one gpio chip
		 * could be registered per of-node.
		 */
		gg_data->out_gpio = ERR_PTR(ret);
		return false;
	 }

	gg_data->out_gpio = gpiochip_get_desc(gc, ret);
	return true;
}

/**
 * of_get_named_gpiod_flags() - Get a GPIO descriptor and flags for GPIO API
 * @np:		device node to get GPIO from
 * @propname:	property name containing gpio specifier(s)
 * @index:	index of the GPIO
 * @flags:	a flags pointer to fill in
 *
 * Returns GPIO descriptor to use with Linux GPIO API, or one of the errno
 * value on the error condition. If @flags is not NULL the function also fills
 * in flags for the GPIO.
 */
struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
		     const char *propname, int index, enum of_gpio_flags *flags)
{
	/* Return -EPROBE_DEFER to support probe() functions to be called
	 * later when the GPIO actually becomes available
	 */
	struct gg_data gg_data = {
		.flags = flags,
		.out_gpio = ERR_PTR(-EPROBE_DEFER)
	};
	int ret;

	/* .of_xlate might decide to not fill in the flags, so clear it. */
	if (flags)
		*flags = 0;

	ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", index,
					 &gg_data.gpiospec);
	if (ret) {
		pr_debug("%s: can't parse '%s' property of node '%s[%d]'\n",
			__func__, propname, np->full_name, index);
		return ERR_PTR(ret);
	}

	gpiochip_find(&gg_data, of_gpiochip_find_and_xlate);

	of_node_put(gg_data.gpiospec.np);
	pr_debug("%s: parsed '%s' property of node '%s[%d]' - status (%d)\n",
		 __func__, propname, np->full_name, index,
		 PTR_ERR_OR_ZERO(gg_data.out_gpio));
	return gg_data.out_gpio;
}

int of_get_named_gpio_flags(struct device_node *np, const char *list_name,
			    int index, enum of_gpio_flags *flags)
{
	struct gpio_desc *desc;

	desc = of_get_named_gpiod_flags(np, list_name, index, flags);

	if (IS_ERR(desc))
		return PTR_ERR(desc);
	else
		return desc_to_gpio(desc);
}
EXPORT_SYMBOL(of_get_named_gpio_flags);

/**
 * of_parse_own_gpio() - Get a GPIO hog descriptor, names and flags for GPIO API
 * @np:		device node to get GPIO from
 * @name:	GPIO line name
 * @lflags:	gpio_lookup_flags - returned from of_find_gpio() or
 *		of_parse_own_gpio()
 * @dflags:	gpiod_flags - optional GPIO initialization flags
 *
 * Returns GPIO descriptor to use with Linux GPIO API, or one of the errno
 * value on the error condition.
 */
static struct gpio_desc *of_parse_own_gpio(struct device_node *np,
					   const char **name,
					   enum gpio_lookup_flags *lflags,
					   enum gpiod_flags *dflags)
{
	struct device_node *chip_np;
	enum of_gpio_flags xlate_flags;
	struct gg_data gg_data = {
		.flags = &xlate_flags,
	};
	u32 tmp;
	int i, ret;

	chip_np = np->parent;
	if (!chip_np)
		return ERR_PTR(-EINVAL);

	xlate_flags = 0;
	*lflags = 0;
	*dflags = 0;

	ret = of_property_read_u32(chip_np, "#gpio-cells", &tmp);
	if (ret)
		return ERR_PTR(ret);

	if (tmp > MAX_PHANDLE_ARGS)
		return ERR_PTR(-EINVAL);

	gg_data.gpiospec.args_count = tmp;
	gg_data.gpiospec.np = chip_np;
	for (i = 0; i < tmp; i++) {
		ret = of_property_read_u32_index(np, "gpios", i,
					   &gg_data.gpiospec.args[i]);
		if (ret)
			return ERR_PTR(ret);
	}

	gpiochip_find(&gg_data, of_gpiochip_find_and_xlate);
	if (!gg_data.out_gpio) {
		if (np->parent == np)
			return ERR_PTR(-ENXIO);
		else
			return ERR_PTR(-EINVAL);
	}

	if (xlate_flags & OF_GPIO_ACTIVE_LOW)
		*lflags |= GPIO_ACTIVE_LOW;

	if (of_property_read_bool(np, "input"))
		*dflags |= GPIOD_IN;
	else if (of_property_read_bool(np, "output-low"))
		*dflags |= GPIOD_OUT_LOW;
	else if (of_property_read_bool(np, "output-high"))
		*dflags |= GPIOD_OUT_HIGH;
	else {
		pr_warn("GPIO line %d (%s): no hogging state specified, bailing out\n",
			desc_to_gpio(gg_data.out_gpio), np->name);
		return ERR_PTR(-EINVAL);
	}

	if (name && of_property_read_string(np, "line-name", name))
		*name = np->name;

	return gg_data.out_gpio;
}

/**
 * of_gpiochip_scan_gpios - Scan gpio-controller for gpio definitions
 * @chip:	gpio chip to act on
 *
 * This is only used by of_gpiochip_add to request/set GPIO initial
 * configuration.
 */
static void of_gpiochip_scan_gpios(struct gpio_chip *chip)
{
	struct gpio_desc *desc = NULL;
	struct device_node *np;
	const char *name;
	enum gpio_lookup_flags lflags;
	enum gpiod_flags dflags;

	for_each_child_of_node(chip->of_node, np) {
		if (!of_property_read_bool(np, "gpio-hog"))
			continue;

		desc = of_parse_own_gpio(np, &name, &lflags, &dflags);
		if (IS_ERR(desc))
			continue;

		if (gpiod_hog(desc, name, lflags, dflags))
			continue;
	}
}

/**
 * of_gpio_simple_xlate - translate gpio_spec to the GPIO number and flags
 * @gc:		pointer to the gpio_chip structure
 * @np:		device node of the GPIO chip
 * @gpio_spec:	gpio specifier as found in the device tree
 * @flags:	a flags pointer to fill in
 *
 * This is simple translation function, suitable for the most 1:1 mapped
 * gpio chips. This function performs only one sanity check: whether gpio
 * is less than ngpios (that is specified in the gpio_chip).
 */
int of_gpio_simple_xlate(struct gpio_chip *gc,
			 const struct of_phandle_args *gpiospec, u32 *flags)
{
	/*
	 * We're discouraging gpio_cells < 2, since that way you'll have to
	 * write your own xlate function (that will have to retrieve the GPIO
	 * number and the flags from a single gpio cell -- this is possible,
	 * but not recommended).
	 */
	if (gc->of_gpio_n_cells < 2) {
		WARN_ON(1);
		return -EINVAL;
	}

	if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
		return -EINVAL;

	if (gpiospec->args[0] >= gc->ngpio)
		return -EINVAL;

	if (flags)
		*flags = gpiospec->args[1];

	return gpiospec->args[0];
}
EXPORT_SYMBOL(of_gpio_simple_xlate);

/**
 * of_mm_gpiochip_add_data - Add memory mapped GPIO chip (bank)
 * @np:		device node of the GPIO chip
 * @mm_gc:	pointer to the of_mm_gpio_chip allocated structure
 * @data:	driver data to store in the struct gpio_chip
 *
 * To use this function you should allocate and fill mm_gc with:
 *
 * 1) In the gpio_chip structure:
 *    - all the callbacks
 *    - of_gpio_n_cells
 *    - of_xlate callback (optional)
 *
 * 3) In the of_mm_gpio_chip structure:
 *    - save_regs callback (optional)
 *
 * If succeeded, this function will map bank's memory and will
 * do all necessary work for you. Then you'll able to use .regs
 * to manage GPIOs from the callbacks.
 */
int of_mm_gpiochip_add_data(struct device_node *np,
			    struct of_mm_gpio_chip *mm_gc,
			    void *data)
{
	int ret = -ENOMEM;
	struct gpio_chip *gc = &mm_gc->gc;

	gc->label = kstrdup(np->full_name, GFP_KERNEL);
	if (!gc->label)
		goto err0;

	mm_gc->regs = of_iomap(np, 0);
	if (!mm_gc->regs)
		goto err1;

	gc->base = -1;

	if (mm_gc->save_regs)
		mm_gc->save_regs(mm_gc);

	mm_gc->gc.of_node = np;

	ret = gpiochip_add_data(gc, data);
	if (ret)
		goto err2;

	return 0;
err2:
	iounmap(mm_gc->regs);
err1:
	kfree(gc->label);
err0:
	pr_err("%s: GPIO chip registration failed with status %d\n",
	       np->full_name, ret);
	return ret;
}
EXPORT_SYMBOL(of_mm_gpiochip_add_data);

/**
 * of_mm_gpiochip_remove - Remove memory mapped GPIO chip (bank)
 * @mm_gc:	pointer to the of_mm_gpio_chip allocated structure
 */
void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc)
{
	struct gpio_chip *gc = &mm_gc->gc;

	if (!mm_gc)
		return;

	gpiochip_remove(gc);
	iounmap(mm_gc->regs);
	kfree(gc->label);
}
EXPORT_SYMBOL(of_mm_gpiochip_remove);

#ifdef CONFIG_PINCTRL
static int of_gpiochip_add_pin_range(struct gpio_chip *chip)
{
	struct device_node *np = chip->of_node;
	struct of_phandle_args pinspec;
	struct pinctrl_dev *pctldev;
	int index = 0, ret;
	const char *name;
	static const char group_names_propname[] = "gpio-ranges-group-names";
	struct property *group_names;

	if (!np)
		return 0;

	group_names = of_find_property(np, group_names_propname, NULL);

	for (;; index++) {
		ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3,
				index, &pinspec);
		if (ret)
			break;

		pctldev = of_pinctrl_get(pinspec.np);
		if (!pctldev)
			return -EPROBE_DEFER;

		if (pinspec.args[2]) {
			if (group_names) {
				of_property_read_string_index(np,
						group_names_propname,
						index, &name);
				if (strlen(name)) {
					pr_err("%s: Group name of numeric GPIO ranges must be the empty string.\n",
						np->full_name);
					break;
				}
			}
			/* npins != 0: linear range */
			ret = gpiochip_add_pin_range(chip,
					pinctrl_dev_get_devname(pctldev),
					pinspec.args[0],
					pinspec.args[1],
					pinspec.args[2]);
			if (ret)
				return ret;
		} else {
			/* npins == 0: special range */
			if (pinspec.args[1]) {
				pr_err("%s: Illegal gpio-range format.\n",
					np->full_name);
				break;
			}

			if (!group_names) {
				pr_err("%s: GPIO group range requested but no %s property.\n",
					np->full_name, group_names_propname);
				break;
			}

			ret = of_property_read_string_index(np,
						group_names_propname,
						index, &name);
			if (ret)
				break;

			if (!strlen(name)) {
				pr_err("%s: Group name of GPIO group range cannot be the empty string.\n",
				np->full_name);
				break;
			}

			ret = gpiochip_add_pingroup_range(chip, pctldev,
						pinspec.args[0], name);
			if (ret)
				return ret;
		}
	}

	return 0;
}

#else
static int of_gpiochip_add_pin_range(struct gpio_chip *chip) { return 0; }
#endif

int of_gpiochip_add(struct gpio_chip *chip)
{
	int status;

	if ((!chip->of_node) && (chip->parent))
		chip->of_node = chip->parent->of_node;

	if (!chip->of_node)
		return 0;

	if (!chip->of_xlate) {
		chip->of_gpio_n_cells = 2;
		chip->of_xlate = of_gpio_simple_xlate;
	}

	status = of_gpiochip_add_pin_range(chip);
	if (status)
		return status;

	of_node_get(chip->of_node);

	of_gpiochip_scan_gpios(chip);

	return 0;
}

void of_gpiochip_remove(struct gpio_chip *chip)
{
	gpiochip_remove_pin_ranges(chip);
	of_node_put(chip->of_node);
}


text:
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.debugger.streams.trace.impl;

import com.intellij.debugger.streams.lib.InterpreterFactory;
import com.intellij.debugger.streams.trace.CallTraceInterpreter;
import com.intellij.debugger.streams.trace.TraceInfo;
import com.intellij.debugger.streams.trace.TraceResultInterpreter;
import com.intellij.debugger.streams.trace.TracingResult;
import com.intellij.debugger.streams.trace.impl.interpret.ValuesOrderInfo;
import com.intellij.debugger.streams.wrapper.StreamCall;
import com.intellij.debugger.streams.wrapper.StreamChain;
import com.intellij.openapi.diagnostic.Logger;
import com.sun.jdi.*;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @author Vitaliy.Bibaev
 */
public class TraceResultInterpreterImpl implements TraceResultInterpreter {
  private static final Logger LOG = Logger.getInstance(TraceResultInterpreterImpl.class);
  private final InterpreterFactory myInterpreterFactory;

  public TraceResultInterpreterImpl(@NotNull InterpreterFactory interpreterFactory) {
    myInterpreterFactory = interpreterFactory;
  }

  @NotNull
  @Override
  public TracingResult interpret(@NotNull StreamChain chain, @NotNull ArrayReference resultArray) {
    final ArrayReference info = (ArrayReference)resultArray.getValue(0);
    final ArrayReference result = (ArrayReference)resultArray.getValue(1);
    final Value streamResult = result.getValue(0);
    final Value time = resultArray.getValue(2);
    logTime(time);
    final List<TraceInfo> trace = getTrace(chain, info);
    return new TracingResultImpl(chain, TraceElementImpl.ofResultValue(streamResult), trace, isException(result));
  }

  @NotNull
  private List<TraceInfo> getTrace(@NotNull StreamChain chain, @NotNull ArrayReference info) {
    final int callCount = chain.length();
    final List<TraceInfo> result = new ArrayList<>(callCount);

    for (int i = 0; i < callCount; i++) {
      final StreamCall call = chain.getCall(i);
      final Value trace = info.getValue(i);
      final CallTraceInterpreter interpreter = myInterpreterFactory.getInterpreter(call.getName());

      final TraceInfo traceInfo = trace == null ? ValuesOrderInfo.empty(call) : interpreter.resolve(call, trace);
      result.add(traceInfo);
    }

    return result;
  }

  private static void logTime(@NotNull Value elapsedTimeArray) {
    final Value elapsedTime = ((ArrayReference)elapsedTimeArray).getValue(0);
    final long elapsedNanoseconds = ((LongValue)elapsedTime).value();
    final long elapsedMillis = TimeUnit.NANOSECONDS.toMillis(elapsedNanoseconds);
    LOG.info("evaluation completed in " + elapsedMillis + "ms");
  }

  private static boolean isException(@NotNull ArrayReference result) {
    final ReferenceType type = result.referenceType();
    if (type instanceof ArrayType) {
      if (((ArrayType)type).componentTypeName().contains("Throwable")) {
        return true;
      }
    }

    return false;
  }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
  <meta name="COPYRIGHT" content=
  "Copyright (c) 2001-2006 IBM Corporation and others. All Rights Reserved." />
  <meta name="Author" content="Eric Mader" />

  <title>Readme file for the ICU LayoutEngine demo</title>

What is the layout demo?

The layout demo displays a paragraph of text that is laid out using the
  LayoutEngine. There are two versions of this demo, "layout.exe" which runs on
  Windows 2000, and "gnomelayout" which runs on Linux. Both programs read a
  file containing the Unicode text to display, and a file that says which font
  to use to display each script.

How do I build the layout demo?
First, you need to build ICU,
  including the LayoutEngine.

On Windows, the layout project should be listed as a dependency of all, so
  layout will build when you build all. If it doesn't for some reason, just
  select the layout project in the project toolbar and build it.

On Linux systems, you need to add the "--enable-layout=yes" option when
  you invoke the runConfigureICU script. When you've done that, layout should
  build when you do "make all install"

To build the demo on Windows, just open the layout project in
  <icu>\source\samples\layout and build it.

On Linux systems, connect to <top-build-dir>/samples/layout and do
  "make all". To build the layout demo on Linux, you'll need the
  gnome-libs-devel and freetype-devel packages, which should be part of your
  Linux distribution. The demo uses the FreeType 1 library, and the make files
  assume that the FreeType header files are in /usr/include/freetype1, and that
  the freetype library is /usr/lib/libttf.so. This is how RedHat Linux 7.2
  installs FreeType 1. If your system is different, you may need to add sym
  links to where the files are stored on your system, or modify
  <top-src-dir>/samples/layout/Makefile.in to reference the files
  correctly for your system.

How do I run the demo?

Before you can run the demo, you'll need to get the fonts it uses. For
  legal reasons, we can't include these fonts with ICU, but you can download
  them from the web. To do this, you'll need access to a computer running
  Windows. Here's how to get the fonts:

First, download the Thai font. Go to into-asia.com and
  click on the link for the Angsana font. This will download a .ZIP file.
  Extract the font file, angsd___.ttf On Windows, copy this font file to your
  Fonts folder, on Linux, copy this font file to the directory from which
  you'll run the layout demo.

Next is the Hindi font. Go to the NCST site and download raghu.ttf. Be
  sure to look at the README file
  before you download the font. On Linux, you can download raghu.ttf into the
  directory from which you'll run the layout demo. On Windows, you'll need to
  install it in your Fonts folder.

There's still one more font to get, the Code2000 Unicode font. Go to James
  Kass' Unicode Support In Your
  Browser page and click on the link that says "Click Here to download
  Code2000 shareware demo Unicode font." This will download a .ZIP file which
  contains CODE2000.TTF and CODE2000.HTM. Expand this .ZIP file. If you're
  going to run the layout demo on Linux, put the CODE2000.TTF file in the
  directory from which you'll run the demo. On Windows, copy the font to your
  fonts folder.

Note: The Code2000 font is shareware. If you want to use
  it for longer than a trial period, you should send a shareware fee to James.
  Directions for how to do this are in CODE2000.HTM.

That's it! Now all you have to do is run letest (CTRL+F5 in Visual C++, or
  "./gnomelayout" in Linux)

How can I customize the layout demo?

The text that the layout demo displays is read from the file "Sample.txt."
  You can change the text by editing this file using a Unicode-aware text
  editor. (it is in UTF8 format with a BOM as the first character; the demo can
  also read UTF16 and UTF32 format files) Remember that the text will be
  displayed in a single paragraph; you can include CR and LF characters in the
  text, but they will be ignored.

If you add scripts to the text other than Arabic, Devanagari, Latin or
  Thai, you'll need to find a font which contains the characters in that
  script, and add an entry to the FontMap file ("FontMap.GDI" on Windows,
  "FontMap.Gnome" on Linux) This file contains a single entry per line. Each
  entry contains a script name followed by a colon, and then a font name.

Here is the list of legal script names:

    <tt>ARABIC</tt>

    <tt>ARMENIAN</tt>

    <tt>BENGALI</tt>

    <tt>BOPOMOFO</tt>

    BUHID

    <tt>CANADIAN_ABORIGINAL</tt>

    <tt>CHEROKEE</tt>

    <tt>CYRILLIC</tt>

    <tt>DESERET</tt>

    <tt>DEVANAGARI</tt>

    <tt>ETHIOPIC</tt>

    <tt>GEORGIAN</tt>

    <tt>GOTHIC</tt>

    <tt>GREEK</tt>

    <tt>GUJARATI</tt>

    <tt>GURMUKHI</tt>

    <tt>HAN</tt>

    <tt>HANGUL</tt>

    HANUNOO

    <tt>HEBREW</tt>

    <tt>HIRAGANA</tt>

    <tt>KANNADA</tt>

    <tt>KATAKANA</tt>

    <tt>KHMER</tt>

    <tt>LATIN</tt>

    <tt>MALAYALAM</tt>

    <tt>MONGOLIAN</tt>

    <tt>MYANMAR</tt>

    <tt>OGHAM</tt>

    <tt>OLD_ITALIC</tt>

    <tt>ORIYA</tt>

    <tt>RUNIC</tt>

    <tt>SINHALA</tt>

    <tt>SYRIAC</tt>

    TAGALOG

    TAGBANWA

    <tt>TAMIL</tt>

    <tt>TELUGU</tt>

    <tt>THAANA</tt>

    <tt>THAI</tt>

    <tt>TIBETAN</tt>

    <tt>YI
</tt>

You can also use the script name "DEFAULT" to represent all scripts which
  you don't explicitly list in the FontMap file.

On Windows use the full name of the font as it appears in the Windows
  Fonts folder (eg. "Times New Roman") On Linux, use the file name of the font
  file (e.g. "Times.TTF") If you're running on Windows, you'll need to install
  the new fonts in your Fonts folder. If you're running on Linux, put them in
  the directory from which you'll run the demo.


text:
var assert      = require('assert');
var should      = require('should');
var smtpapi     = require('../lib/main');
var t           = require('./smtpapi_test_strings.json');

describe('smtapi', function() {
  beforeEach(function() {
    header = new smtpapi();
  });

  it('version should be set', function() {
    header.version.should.eql("1.0.3");
  });

  it('has a jsonString method', function() {
    header.jsonString().should.eql(t.json_string);
  });

  it('addTo', function() {
    header.addTo('addTo@mailinator.com');
    header.jsonString().should.eql(t.add_to);
  });

  it('setTos', function() {
    header.setTos(['setTos@mailinator.com']);
    header.jsonString().should.eql(t.set_tos);
  });

  it('addSubstitution', function() {
    header.addSubstitution('sub', 'val');
    header.jsonString().should.eql(t.add_substitution);
  });

  it('addSubstitution array value', function() {
    header.setSubstitutions({'sub': ['val 1']});
    header.addSubstitution('sub', ['val 2']);
    header.jsonString().should.eql(t.add_substitution_array_value);
  });

  it('setSubstitutions', function() {
    header.setSubstitutions({'sub': ['val']});
    header.jsonString().should.eql(t.set_substitutions);
  });

  it('addUniqueArg', function() {
    header.addUniqueArg('add_unique_argument_key', 'add_unique_argument_value');
    header.addUniqueArg('add_unique_argument_key_2', 'add_unique_argument_value_2');
    header.jsonString().should.eql(t.add_unique_arg);
  });

  it('setUniqueArgs', function() {
    header.setUniqueArgs({set_unique_argument_key: 'set_unique_argument_value'});
    header.jsonString().should.eql(t.set_unique_args);
  });

  it('addCategory', function() {
    header.addCategory('addCategory');
    header.addCategory('addCategory2');
    header.jsonString().should.eql(t.add_category);
  });

  it('addCategoryUnicode', function() {
    header.addCategory('カテゴリUnicode');
    header.addCategory('カテゴリ2Unicode');
    header.jsonString().should.eql(t.add_category_unicode);
  });

  it('setCategories', function() {
    header.setCategories(['setCategories']);
    header.jsonString().should.eql(t.set_categories);
  });

  it('addSection', function() {
    header.addSection('set_section_key', 'set_section_value');
    header.addSection('set_section_key_2', 'set_section_value_2');
    header.jsonString().should.eql(t.add_section);
  });

  it('setSections', function() {
    header.setSections({'set_section_key': 'set_section_value'});
    header.jsonString().should.eql(t.set_sections);
  });

  it('addFilter', function() {
    header.addFilter('footer', 'text/html', 'boo');
    header.jsonString().should.eql(t.add_filter);
  });

  it('setFilters', function() {
    var filter = {
      'footer': {
        'setting': {
          'enable': 1,
          'text/plain': 'You can haz footers!'
        }
      }
    }

    header.setFilters(filter);
    header.jsonString().should.eql(t.set_filters);
  });
});


text:
{% extends "bootstrap/base.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% block title %}
Login
{% endblock %}

{% block styles %}
{{super()}}
<link rel="stylesheet" href="{{url_for('.static', filename='signin.css')}}">
{% endblock %}

{% block content %}

  <form class="form-signin" method="POST" action="/">

Enter the inputs you need to Run Speech API Tester

    {{ wtf.form_field(form.spotifyId) }}
    {{ wtf.form_field(form.spotifySecret) }}
    {{ wtf.form_field(form.spotifyPlaylist) }}
    {{ wtf.form_field(form.artistAlbumTracks) }}
    {{ wtf.form_field(form.sttapiCheckbox) }}
    {{ wtf.form_field(form.nbPlaylist) }}
    {{ wtf.form_field(form.nbSamples) }}

    {{ wtf.form_field(form.sttaltCheckbox) }}
    {{ wtf.form_field(form.stthintCheckbox) }}

    <button class="btn btn-lg btn-primary btn-block" type="submit">Lunch Speech API Tester</button>
  </form>

{% endblock %}


text:
extern "C" {
#include <X11/Xlib.h>
}

#include "ui/gl/gl_surface_glx.h"

#include "base/basictypes.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/synchronization/cancellation_flag.h"
#include "base/synchronization/lock.h"
#include "base/thread_task_runner_handle.h"
#include "base/threading/non_thread_safe.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/gfx/x/x11_connection.h"
#include "ui/gfx/x/x11_types.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/sync_control_vsync_provider.h"

namespace gfx {

namespace {

Display* g_display = nullptr;
bool g_glx_context_create = false;
bool g_glx_create_context_robustness_supported = false;
bool g_glx_texture_from_pixmap_supported = false;
bool g_glx_oml_sync_control_supported = false;

// Track support of glXGetMscRateOML separately from GLX_OML_sync_control as a
// whole since on some platforms (e.g. crosbug.com/34585), glXGetMscRateOML
// always fails even though GLX_OML_sync_control is reported as being supported.
bool g_glx_get_msc_rate_oml_supported = false;

bool g_glx_sgi_video_sync_supported = false;

static const int kGetVSyncParametersMinSeconds =
#if defined(OS_LINUX)
    // See crbug.com/373489
    // On Linux, querying the vsync parameters might burn CPU for up to an
    // entire vsync, so we only query periodically to reduce CPU usage.
    // 5 seconds is chosen somewhat abitrarily as a balance between:
    //  a) Drift in the phase of our signal.
    //  b) Potential janks from periodically pegging the CPU.
    5;
#else
    0;
#endif

class OMLSyncControlVSyncProvider
    : public gfx::SyncControlVSyncProvider {
 public:
  explicit OMLSyncControlVSyncProvider(gfx::AcceleratedWidget window)
      : SyncControlVSyncProvider(),
        window_(window) {
  }

  ~OMLSyncControlVSyncProvider() override {}

 protected:
  bool GetSyncValues(int64* system_time,
                     int64* media_stream_counter,
                     int64* swap_buffer_counter) override {
    return glXGetSyncValuesOML(g_display, window_, system_time,
                               media_stream_counter, swap_buffer_counter);
  }

  bool GetMscRate(int32* numerator, int32* denominator) override {
    if (!g_glx_get_msc_rate_oml_supported)
      return false;

    if (!glXGetMscRateOML(g_display, window_, numerator, denominator)) {
      // Once glXGetMscRateOML has been found to fail, don't try again,
      // since each failing call may spew an error message.
      g_glx_get_msc_rate_oml_supported = false;
      return false;
    }

    return true;
  }

 private:
  XID window_;

  DISALLOW_COPY_AND_ASSIGN(OMLSyncControlVSyncProvider);
};

class SGIVideoSyncThread
     : public base::Thread,
       public base::NonThreadSafe,
       public base::RefCounted<SGIVideoSyncThread> {
 public:
  static scoped_refptr<SGIVideoSyncThread> Create() {
    if (!g_video_sync_thread) {
      g_video_sync_thread = new SGIVideoSyncThread();
      g_video_sync_thread->Start();
    }
    return g_video_sync_thread;
  }

 private:
  friend class base::RefCounted<SGIVideoSyncThread>;

  SGIVideoSyncThread() : base::Thread("SGI_video_sync") {
    DCHECK(CalledOnValidThread());
  }

  ~SGIVideoSyncThread() override {
    DCHECK(CalledOnValidThread());
    g_video_sync_thread = nullptr;
    Stop();
  }

  static SGIVideoSyncThread* g_video_sync_thread;

  DISALLOW_COPY_AND_ASSIGN(SGIVideoSyncThread);
};

class SGIVideoSyncProviderThreadShim {
 public:
  explicit SGIVideoSyncProviderThreadShim(XID window)
      : window_(window),
        context_(nullptr),
        task_runner_(base::ThreadTaskRunnerHandle::Get()),
        cancel_vsync_flag_(),
        vsync_lock_() {
    // This ensures that creation of |window_| has occured when this shim
    // is executing in the same process as the call to create |window_|.
    XSync(g_display, False);
  }

  virtual ~SGIVideoSyncProviderThreadShim() {
    if (context_) {
      glXDestroyContext(display_, context_);
      context_ = nullptr;
    }
  }

  base::CancellationFlag* cancel_vsync_flag() {
    return &cancel_vsync_flag_;
  }

  base::Lock* vsync_lock() {
    return &vsync_lock_;
  }

  void Initialize() {
    DCHECK(display_);

    XWindowAttributes attributes;
    if (!XGetWindowAttributes(display_, window_, &attributes)) {
      LOG(ERROR) << "XGetWindowAttributes failed for window " <<
        window_ << ".";
      return;
    }

    XVisualInfo visual_info_template;
    visual_info_template.visualid = XVisualIDFromVisual(attributes.visual);

    int visual_info_count = 0;
    gfx::XScopedPtr<XVisualInfo> visual_info_list(XGetVisualInfo(
        display_, VisualIDMask, &visual_info_template, &visual_info_count));

    DCHECK(visual_info_list.get());
    if (visual_info_count == 0) {
      LOG(ERROR) << "No visual info for visual ID.";
      return;
    }

    context_ =
        glXCreateContext(display_, visual_info_list.get(), nullptr, True);

    DCHECK(nullptr != context_);
  }

  void GetVSyncParameters(const VSyncProvider::UpdateVSyncCallback& callback) {
    base::TimeTicks now;
    {
      // Don't allow |window_| destruction while we're probing vsync.
      base::AutoLock locked(vsync_lock_);

      if (!context_ || cancel_vsync_flag_.IsSet())
        return;

      glXMakeCurrent(display_, window_, context_);

      unsigned int retrace_count = 0;
      if (glXWaitVideoSyncSGI(1, 0, &retrace_count) != 0)
        return;

      TRACE_EVENT_INSTANT0("gpu", "vblank", TRACE_EVENT_SCOPE_THREAD);
      now = base::TimeTicks::Now();

      glXMakeCurrent(display_, 0, 0);
    }

    const base::TimeDelta kDefaultInterval =
        base::TimeDelta::FromSeconds(1) / 60;

    task_runner_->PostTask(
        FROM_HERE, base::Bind(callback, now, kDefaultInterval));
  }

 private:
  // For initialization of display_ in GLSurface::InitializeOneOff before
  // the sandbox goes up.
  friend class gfx::GLSurfaceGLX;

  static Display* display_;

  XID window_;
  GLXContext context_;

  scoped_refptr<base::SingleThreadTaskRunner> task_runner_;

  base::CancellationFlag cancel_vsync_flag_;
  base::Lock vsync_lock_;

  DISALLOW_COPY_AND_ASSIGN(SGIVideoSyncProviderThreadShim);
};

class SGIVideoSyncVSyncProvider
    : public gfx::VSyncProvider,
      public base::SupportsWeakPtr<SGIVideoSyncVSyncProvider> {
 public:
  explicit SGIVideoSyncVSyncProvider(gfx::AcceleratedWidget window)
      : vsync_thread_(SGIVideoSyncThread::Create()),
        shim_(new SGIVideoSyncProviderThreadShim(window)),
        cancel_vsync_flag_(shim_->cancel_vsync_flag()),
        vsync_lock_(shim_->vsync_lock()) {
    vsync_thread_->message_loop()->PostTask(
        FROM_HERE,
        base::Bind(&SGIVideoSyncProviderThreadShim::Initialize,
                   base::Unretained(shim_.get())));
  }

  ~SGIVideoSyncVSyncProvider() override {
    {
      base::AutoLock locked(*vsync_lock_);
      cancel_vsync_flag_->Set();
    }

    // Hand-off |shim_| to be deleted on the |vsync_thread_|.
    vsync_thread_->message_loop()->DeleteSoon(
        FROM_HERE,
        shim_.release());
  }

  void GetVSyncParameters(
      const VSyncProvider::UpdateVSyncCallback& callback) override {
    if (kGetVSyncParametersMinSeconds > 0) {
      base::TimeTicks now = base::TimeTicks::Now();
      base::TimeDelta delta = now - last_get_vsync_parameters_time_;
      if (delta.InSeconds() < kGetVSyncParametersMinSeconds)
        return;
      last_get_vsync_parameters_time_ = now;
    }

    // Only one outstanding request per surface.
    if (!pending_callback_) {
      pending_callback_.reset(
          new VSyncProvider::UpdateVSyncCallback(callback));
      vsync_thread_->message_loop()->PostTask(
          FROM_HERE,
          base::Bind(&SGIVideoSyncProviderThreadShim::GetVSyncParameters,
                     base::Unretained(shim_.get()),
                     base::Bind(
                         &SGIVideoSyncVSyncProvider::PendingCallbackRunner,
                         AsWeakPtr())));
    }
  }

 private:
  void PendingCallbackRunner(const base::TimeTicks timebase,
                             const base::TimeDelta interval) {
    DCHECK(pending_callback_);
    pending_callback_->Run(timebase, interval);
    pending_callback_.reset();
  }

  scoped_refptr<SGIVideoSyncThread> vsync_thread_;

  // Thread shim through which the sync provider is accessed on |vsync_thread_|.
  scoped_ptr<SGIVideoSyncProviderThreadShim> shim_;

  scoped_ptr<VSyncProvider::UpdateVSyncCallback> pending_callback_;

  // Raw pointers to sync primitives owned by the shim_.
  // These will only be referenced before we post a task to destroy
  // the shim_, so they are safe to access.
  base::CancellationFlag* cancel_vsync_flag_;
  base::Lock* vsync_lock_;

  base::TimeTicks last_get_vsync_parameters_time_;

  DISALLOW_COPY_AND_ASSIGN(SGIVideoSyncVSyncProvider);
};

SGIVideoSyncThread* SGIVideoSyncThread::g_video_sync_thread = nullptr;

// In order to take advantage of GLX_SGI_video_sync, we need a display
// for use on a separate thread. We must allocate this before the sandbox
// goes up (rather than on-demand when we start the thread).
Display* SGIVideoSyncProviderThreadShim::display_ = nullptr;

}  // namespace

GLSurfaceGLX::GLSurfaceGLX() {}

bool GLSurfaceGLX::InitializeOneOff() {
  static bool initialized = false;
  if (initialized)
    return true;

  // http://crbug.com/245466
  setenv("force_s3tc_enable", "true", 1);

  // SGIVideoSyncProviderShim (if instantiated) will issue X commands on
  // it's own thread.
  gfx::InitializeThreadedX11();
  g_display = gfx::GetXDisplay();

  if (!g_display) {
    LOG(ERROR) << "XOpenDisplay failed.";
    return false;
  }

  int major, minor;
  if (!glXQueryVersion(g_display, &major, &minor)) {
    LOG(ERROR) << "glxQueryVersion failed";
    return false;
  }

  if (major == 1 && minor < 3) {
    LOG(ERROR) << "GLX 1.3 or later is required.";
    return false;
  }

  g_glx_context_create =
      HasGLXExtension("GLX_ARB_create_context");
  g_glx_create_context_robustness_supported =
      HasGLXExtension("GLX_ARB_create_context_robustness");
  g_glx_texture_from_pixmap_supported =
      HasGLXExtension("GLX_EXT_texture_from_pixmap");
  g_glx_oml_sync_control_supported =
      HasGLXExtension("GLX_OML_sync_control");
  g_glx_get_msc_rate_oml_supported = g_glx_oml_sync_control_supported;
  g_glx_sgi_video_sync_supported =
      HasGLXExtension("GLX_SGI_video_sync");

  if (!g_glx_get_msc_rate_oml_supported && g_glx_sgi_video_sync_supported)
    SGIVideoSyncProviderThreadShim::display_ = gfx::OpenNewXDisplay();

  initialized = true;
  return true;
}

// static
const char* GLSurfaceGLX::GetGLXExtensions() {
  return glXQueryExtensionsString(g_display, 0);
}

// static
bool GLSurfaceGLX::HasGLXExtension(const char* name) {
  return ExtensionsContain(GetGLXExtensions(), name);
}

// static
bool GLSurfaceGLX::IsCreateContextSupported() {
  return g_glx_context_create;
}

// static
bool GLSurfaceGLX::IsCreateContextRobustnessSupported() {
  return g_glx_create_context_robustness_supported;
}

// static
bool GLSurfaceGLX::IsTextureFromPixmapSupported() {
  return g_glx_texture_from_pixmap_supported;
}

// static
bool GLSurfaceGLX::IsOMLSyncControlSupported() {
  return g_glx_oml_sync_control_supported;
}

void* GLSurfaceGLX::GetDisplay() {
  return g_display;
}

GLSurfaceGLX::~GLSurfaceGLX() {}

void* GLSurfaceGLX::GetConfig(gfx::AcceleratedWidget window) {
  DCHECK(window != 0);

  // This code path is expensive, but we only take it when
  // attempting to use GLX_ARB_create_context_robustness, in which
  // case we need a GLXFBConfig for the window in order to create a
  // context for it.
  //
  // TODO(kbr): this is not a reliable code path. On platforms which
  // support it, we should use glXChooseFBConfig in the browser
  // process to choose the FBConfig and from there the X Visual to
  // use when creating the window in the first place. Then we can
  // pass that FBConfig down rather than attempting to reconstitute
  // it.

  XWindowAttributes attributes;
  if (!XGetWindowAttributes(g_display, window, &attributes)) {
    LOG(ERROR) << "XGetWindowAttributes failed for window " << window << ".";
    return nullptr;
  }

  int visual_id = XVisualIDFromVisual(attributes.visual);

  int num_elements = 0;
  gfx::XScopedPtr<GLXFBConfig> configs(
      glXGetFBConfigs(g_display, DefaultScreen(g_display), &num_elements));
  if (!configs.get()) {
    LOG(ERROR) << "glXGetFBConfigs failed.";
    return nullptr;
  }
  if (!num_elements) {
    LOG(ERROR) << "glXGetFBConfigs returned 0 elements.";
    return nullptr;
  }
  bool found = false;
  int i;
  for (i = 0; i < num_elements; ++i) {
    int value;
    if (glXGetFBConfigAttrib(g_display, configs.get()[i], GLX_VISUAL_ID,
                             &value)) {
      LOG(ERROR) << "glXGetFBConfigAttrib failed.";
      return nullptr;
    }
    if (value == visual_id) {
      found = true;
      break;
    }
  }
  if (found) {
    return configs.get()[i];
  }
  return nullptr;
}

NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window)
    : parent_window_(window), window_(0), config_(nullptr) {
}

gfx::AcceleratedWidget NativeViewGLSurfaceGLX::GetDrawableHandle() const {
  return window_;
}

bool NativeViewGLSurfaceGLX::Initialize() {
  XWindowAttributes attributes;
  if (!XGetWindowAttributes(g_display, parent_window_, &attributes)) {
    LOG(ERROR) << "XGetWindowAttributes failed for window " << parent_window_
        << ".";
    return false;
  }
  size_ = gfx::Size(attributes.width, attributes.height);
  // Create a child window, with a CopyFromParent visual (to avoid inducing
  // extra blits in the driver), that we can resize exactly in Resize(),
  // correctly ordered with GL, so that we don't have invalid transient states.
  // See https://crbug.com/326995.
  XSetWindowAttributes swa;
  memset(&swa, 0, sizeof(swa));
  swa.background_pixmap = 0;
  swa.bit_gravity = NorthWestGravity;
  window_ = XCreateWindow(g_display, parent_window_, 0, 0, size_.width(),
                          size_.height(), 0, CopyFromParent, InputOutput,
                          CopyFromParent, CWBackPixmap | CWBitGravity, &swa);
  XMapWindow(g_display, window_);

  ui::PlatformEventSource* event_source =
      ui::PlatformEventSource::GetInstance();
  // Can be nullptr in tests, when we don't care about Exposes.
  if (event_source) {
    XSelectInput(g_display, window_, ExposureMask);
    ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
  }
  XFlush(g_display);

  gfx::AcceleratedWidget window_for_vsync = window_;

  if (g_glx_oml_sync_control_supported)
    vsync_provider_.reset(new OMLSyncControlVSyncProvider(window_for_vsync));
  else if (g_glx_sgi_video_sync_supported)
    vsync_provider_.reset(new SGIVideoSyncVSyncProvider(window_for_vsync));

  return true;
}

void NativeViewGLSurfaceGLX::Destroy() {
  if (window_) {
    ui::PlatformEventSource* event_source =
        ui::PlatformEventSource::GetInstance();
    if (event_source)
      event_source->RemovePlatformEventDispatcher(this);
    XDestroyWindow(g_display, window_);
    window_ = 0;
    XFlush(g_display);
  }
}

bool NativeViewGLSurfaceGLX::CanDispatchEvent(const ui::PlatformEvent& event) {
  return event->type == Expose && event->xexpose.window == window_;
}

uint32_t NativeViewGLSurfaceGLX::DispatchEvent(const ui::PlatformEvent& event) {
  XEvent forwarded_event = *event;
  forwarded_event.xexpose.window = parent_window_;
  XSendEvent(g_display, parent_window_, False, ExposureMask,
             &forwarded_event);
  XFlush(g_display);
  return ui::POST_DISPATCH_STOP_PROPAGATION;
}

bool NativeViewGLSurfaceGLX::Resize(const gfx::Size& size, float scale_factor) {
  size_ = size;
  glXWaitGL();
  XResizeWindow(g_display, window_, size.width(), size.height());
  glXWaitX();
  return true;
}

bool NativeViewGLSurfaceGLX::IsOffscreen() {
  return false;
}

gfx::SwapResult NativeViewGLSurfaceGLX::SwapBuffers() {
  TRACE_EVENT2("gpu", "NativeViewGLSurfaceGLX:RealSwapBuffers",
      "width", GetSize().width(),
      "height", GetSize().height());

  glXSwapBuffers(g_display, GetDrawableHandle());
  return gfx::SwapResult::SWAP_ACK;
}

gfx::Size NativeViewGLSurfaceGLX::GetSize() {
  return size_;
}

void* NativeViewGLSurfaceGLX::GetHandle() {
  return reinterpret_cast<void*>(GetDrawableHandle());
}

bool NativeViewGLSurfaceGLX::SupportsPostSubBuffer() {
  return gfx::g_driver_glx.ext.b_GLX_MESA_copy_sub_buffer;
}

void* NativeViewGLSurfaceGLX::GetConfig() {
  if (!config_)
    config_ = GLSurfaceGLX::GetConfig(window_);
  return config_;
}

gfx::SwapResult NativeViewGLSurfaceGLX::PostSubBuffer(int x,
                                                      int y,
                                                      int width,
                                                      int height) {
  DCHECK(gfx::g_driver_glx.ext.b_GLX_MESA_copy_sub_buffer);
  glXCopySubBufferMESA(g_display, GetDrawableHandle(), x, y, width, height);
  return gfx::SwapResult::SWAP_ACK;
}

VSyncProvider* NativeViewGLSurfaceGLX::GetVSyncProvider() {
  return vsync_provider_.get();
}

NativeViewGLSurfaceGLX::~NativeViewGLSurfaceGLX() {
  Destroy();
}

UnmappedNativeViewGLSurfaceGLX::UnmappedNativeViewGLSurfaceGLX(
    const gfx::Size& size)
    : size_(size), config_(nullptr), window_(0) {
  // Ensure that we don't create a window with zero size.
  if (size_.GetArea() == 0)
    size_.SetSize(1, 1);
}

bool UnmappedNativeViewGLSurfaceGLX::Initialize() {
  DCHECK(!window_);

  gfx::AcceleratedWidget parent_window =
      RootWindow(g_display, DefaultScreen(g_display));

  // We create a window with CopyFromParent visual so that we have the same
  // visual as NativeViewGLSurfaceGLX (i.e. same GLXFBConfig), to ensure
  // contexts are compatible and can be made current with either.
  window_ = XCreateWindow(g_display, parent_window, 0, 0, size_.width(),
                          size_.height(), 0, CopyFromParent, InputOutput,
                          CopyFromParent, 0, nullptr);
  return window_ != 0;
}

void UnmappedNativeViewGLSurfaceGLX::Destroy() {
  config_ = nullptr;
  if (window_) {
    XDestroyWindow(g_display, window_);
    window_ = 0;
  }
}

bool UnmappedNativeViewGLSurfaceGLX::IsOffscreen() {
  return true;
}

gfx::SwapResult UnmappedNativeViewGLSurfaceGLX::SwapBuffers() {
  NOTREACHED() << "Attempted to call SwapBuffers on an unmapped window.";
  return gfx::SwapResult::SWAP_FAILED;
}

gfx::Size UnmappedNativeViewGLSurfaceGLX::GetSize() {
  return size_;
}

void* UnmappedNativeViewGLSurfaceGLX::GetHandle() {
  return reinterpret_cast<void*>(window_);
}

void* UnmappedNativeViewGLSurfaceGLX::GetConfig() {
  if (!config_)
    config_ = GLSurfaceGLX::GetConfig(window_);
  return config_;
}

UnmappedNativeViewGLSurfaceGLX::~UnmappedNativeViewGLSurfaceGLX() {
  Destroy();
}

}  // namespace gfx


text:
using eDocumentReader.Hubs.activities.system;
using eDocumentReader.Hubs.activities.user;
using eDocumentReader.Hubs.devices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;

namespace eDocumentReader.Hubs
{
    /*
     * An activity model for the Interactive eBook.
     * It contains specific knowledge on what system action (system activity)
     * should be used when a user performs something on the browser interface.
     */
    public class EBookActivityModel : AbstractActivityModel
    {

        private StoryManager storyManager;

        public EBookActivityModel()
        {
        }

        public void init(string storyDirectory)
        {
            storyManager.init(storyDirectory);
        }

        //any resource that a system activity is needed should be passing in the construct
        public override Dictionary<string, AbstractSystemActivity> initializeActivityMap()
        {
            if (storyManager == null)
            {
                storyManager = new StoryManager();
            }
            Dictionary<string, AbstractSystemActivity> map = new Dictionary<string, AbstractSystemActivity>();
            //gesture related activities
            map.Add(EBookConstant.USER_SELECT_STORY_NAME, new SystemSelectStoryActivity(storyManager));
            map.Add(EBookConstant.USER_SELECT_STORY_MODE, new SystemSelectStoryModeActivity(storyManager));
            map.Add(EBookConstant.USER_START_REPLAYING_VOICE, new SystemStartReplayingActivity(storyManager));
            map.Add(EBookConstant.USER_ACCEPT_RECORDED_SPEECH, new SystemConfirmRecordedSpeechActivity(storyManager));
            map.Add(EBookConstant.USER_CHANGE_PAGE, new SystemChangePageActivity(storyManager));
            map.Add(EBookConstant.USER_PAUSE_RESUME, new SystemPauseResumeActivity(storyManager));
            map.Add(EBookConstant.USER_START_RECORDING, new SystemStartRecordingActivity(storyManager));
            map.Add(EBookConstant.USER_RESTART_SYSTEM, new SystemRestartActivity(storyManager));
            map.Add(EBookConstant.INTERNAL_DISPLAY_MAIN_PAGE, new SystemDisplayMainPageActivity(storyManager));

            //ASR related activities
            map.Add(EBookConstant.INTERNAL_REJECT_RECOGNITION, new SystemRejectRecognitionActivity(storyManager));
            map.Add(EBookConstant.INTERNAL_AUDIO_LEVEL_CHANGE, new SystemAudioLevelChangeActivity(storyManager));
            map.Add(EBookConstant.INTERNAL_SPEECH_STATE_CHANGE, new SystemSpeechStateChangeActivity(storyManager));
            map.Add(EBookConstant.INTERNAL_SPEECH_RECOGNITION_RESULT, new SystemSpeechRecognitionResultActivity(storyManager));
            map.Add(EBookConstant.INTERNAL_RELOAD_ONGOING_GRAMMAR, new SystemReloadOnGoingGrammarActivity());
            map.Add(EBookConstant.INTERNAL_CHANGE_GRAMMAR_PRIORITY, new SystemChangeGrammarPriorityActivity());
            map.Add(EBookConstant.INTERNAL_RELOAD_STORY_GRAMMAR, new SystemReloadStoryGrammarActivity());

            //screen display related activities
            map.Add(EBookConstant.INTERNAL_UPDATE_PAGE_TEXT, new SystemUpdatePageTextActivity());
            map.Add(EBookConstant.INTERNAL_UPDATE_HTML_TEXT, new SystemUpdatePageTextActivity());
            map.Add(EBookConstant.INTERNAL_SPEECH_NAVIGATE_PAGE, new SystemChangePageActivity(storyManager));
            map.Add(EBookConstant.INTERNAL_FINISH_PAGE_ACTIVITY, new SystemChangePageActivity(storyManager));
            map.Add(EBookConstant.INTERNAL_PLAY_ANIMATION, new SystemPlayAnimationActivity());
            map.Add(EBookConstant.INTERNAL_CHANGE_BACKGROUND, new SystemChangeBackgroundActivity());

            //audio related activities
            map.Add(EBookConstant.INTERNAL_REPLAY_ADUIO, new SystemReplayAudioActivity());
            map.Add(EBookConstant.INTERNAL_FINISH_REPLAY_AUDIO, new SystemFinishReplayAudioActivity(storyManager));
            return map;
        }
    }
}


text:
use_orm :datamapper

Merb::Config.use do |c|

  # Sets up a custom session id key which is used for the session persistence
  # cookie name.  If not specified, defaults to '_session_id'.
  # c[:session_id_key] = '_session_id'

  # The session_secret_key is only required for the cookie session store.
  c[:session_secret_key]  = '2853e2483f426744ea1ec36916dd2ae78cd8fc41'

  # There are various options here, by default Merb comes with 'cookie',
  # 'memory', 'memcache' or 'container'.
  # You can of course use your favorite ORM instead:
  # 'datamapper', 'sequel' or 'activerecord'.
  c[:session_store] = 'cookie'

  # When running a slice standalone, you're usually developing it,
  # so enable template reloading by default.
  c[:reload_templates] = true

end


text:
package common

import (
	"encoding/json"
	"net/http"
	"regexp"
	"strings"

	"github.com/appc/spec/discovery"
	"github.com/juju/errors"
	"github.com/n0rad/go-erlog/data"
	"github.com/n0rad/go-erlog/errs"
	"github.com/n0rad/go-erlog/logs"
)

type ACFullname string

func (n *ACFullname) UnmarshalJSON(data []byte) error {
	var s string
	if err := json.Unmarshal(data, &s); err != nil {
		return err
	}
	nn := NewACFullName(s)
	*n = *nn
	return nil
}

func (n ACFullname) LatestVersion() (string, error) {
	app, err := discovery.NewAppFromString(n.Name() + ":latest")
	if app.Labels["os"] == "" {
		app.Labels["os"] = "linux"
	}
	if app.Labels["arch"] == "" {
		app.Labels["arch"] = "amd64"
	}

	endpoints, _, err := discovery.DiscoverACIEndpoints(*app, nil, discovery.InsecureTLS|discovery.InsecureHTTP, 0) //TODO support security
	if err != nil {
		return "", errors.Annotate(err, "Latest discovery fail")
	}

	r, _ := regexp.Compile(`^\d+(.\d+){0,2}(-[\.\-\dA-Za-z]+){0,1}$`) // TODO this is nexus specific

	if len(endpoints) == 0 {
		return "", errs.WithF(data.WithField("aci", string(n)), "Discovery does not give an endpoint to check latest version")
	}

	url := getRedirectForLatest(endpoints[0].ACI)
	logs.WithField("url", url).Debug("latest verion url")

	for _, part := range strings.Split(url, "/") {
		if r.Match([]byte(part)) {
			return part, nil
		}
	}
	return "", errors.New("No latest version found")
}

func (n ACFullname) MarshalJSON() ([]byte, error) {
	return json.Marshal(n.String())
}

func (n ACFullname) String() string {
	return string(n)
}

/* example.com/dgr/yopla:1 */
func NewACFullName(s string) *ACFullname {
	n := ACFullname(s)
	return &n
}

func (n ACFullname) FullyResolved() (*ACFullname, error) {
	version := n.Version()
	if version != "" {
		return &n, nil
	}
	version, err := n.LatestVersion()
	if err != nil {
		return nil, errors.Annotate(err, "Cannot fully resolve AcFullname")
	}
	return NewACFullName(n.Name() + ":" + version), nil
}

/* 1 */
func (n ACFullname) Version() string {
	split := strings.Split(string(n), ":")
	if len(split) == 1 {
		return ""
	}
	return split[1]
}

/* yopla:1 */
func (n ACFullname) TinyNameId() string {
	split := strings.Split(string(n), "/")
	return split[len(split)-1]
}

/* dgr/yopla */
func (n ACFullname) ShortName() string {
	name := n.Name()
	if !strings.Contains(name, "/") {
		return name
	}
	return strings.SplitN(n.Name(), "/", 2)[1]
}

/* yopla */
func (n ACFullname) TinyName() string {
	split := strings.Split(n.Name(), "/")
	return split[len(split)-1]
}

/* example.com */
func (n ACFullname) DomainName() string {
	return strings.Split(n.Name(), "/")[0]
}

/* example.com/dgr/yopla */
func (n ACFullname) Name() string {
	return strings.Split(string(n), ":")[0]
}

////////////////////////////////

func getRedirectForLatest(url string) string {
	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		return ""
	}
	transport := http.DefaultTransport
	//	if insecureSkipVerify {
	//		transport = &http.Transport{
	//			TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
	//		}
	//	}
	client := &http.Client{Transport: transport}
	myurl := ""
	client.CheckRedirect = func(req *http.Request, via []*http.Request) error {
		myurl = req.URL.Path
		return errors.New("do not want to get the file")
	}
	_, err2 := client.Do(req)
	if err2 != nil {
		if myurl != "" {
			return myurl
		}
		return ""
	}
	return myurl
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definition"
             xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
             targetNamespace="Examples">

    <process id="parallelMultiInstanceSubProcess">

        <startEvent id="theStart"/>
        <sequenceFlow id="flow1" sourceRef="theStart" targetRef="parallelSubProcess"/>

        <subProcess id="parallelSubProcess">
            <multiInstanceLoopCharacteristics isSequential="false">
                <loopCardinality>${nrOfLoops}</loopCardinality>
            </multiInstanceLoopCharacteristics>
            <startEvent id="theSubProcessStart" />
            <sequenceFlow id="subflow1" sourceRef="theSubProcessStart" targetRef="subTask1" />
            <userTask id="subTask1" />
            <sequenceFlow id="subflow2" sourceRef="subTask1" targetRef="subTask2" />
            <userTask id="subTask2" />
            <sequenceFlow id="subflow3" sourceRef="subTask2" targetRef="theSubProcessEnd" />
            <endEvent id="theSubProcessEnd" />
        </subProcess>

        <sequenceFlow id="flow2" sourceRef="parallelSubProcess" targetRef="lastTask"/>
        <userTask id="lastTask" name="last task"/>
        <sequenceFlow id="flow3" sourceRef="lastTask" targetRef="theEnd"/>
        <endEvent id="theEnd"/>

    </process>

</definitions>


text:
module Admin::OutletsHelper
   def get_city_names
    cities=[]
    city=City.find(:all, :conditions => ['is_active = ? ',  true])
    city.each do |cty|
      cities<<[cty.name, cty.id]
    end
     cities
  end
end


text:
<?xml version="1.0"?>
<!--

-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
    <page name="CmsBlockEdit" area="Adminhtml" mca="cms_block/edit" module="Mage_Cms">
        <block name="blockForm" class="Mage\Adminhtml\Test\Block\Cms\Block\Edit\BlockForm" locator="[id='page:main-container']" strategy="css selector" />
        <block name="pageMainActions" class="Mage\Adminhtml\Test\Block\Cms\Block\Edit\FormPageActions" locator=".form-buttons" strategy="css selector"/>
    </page>
</config>


text:
package org.cactoos.scalar;

import java.util.function.Supplier;

/**
 * ScalarOfSupplier.
 *
 * @param <T> Element type.
 * @since 0.47
 */
public final class ScalarOfSupplier<T> extends ScalarEnvelope<T> {
    /**
     * Ctor.
     *
     * @param supplier The supplier
     */
    public ScalarOfSupplier(final Supplier<? extends T> supplier) {
        super(supplier::get);
    }

}


text:
Please read the [issue guidelines](./.github/ISSUE_TEMPLATE.md).

## Making pull requests

Please read the [pull request guidelines](./.github/PULL_REQUEST_TEMPLATE.md).

## GitHub labels

We use the following [labels](https://github.com/plotly/plotly.js/labels) to track issues and PRs:

| Label | Purpose |
|--------|---------|
| `type: bug` | bug report confirmed by a plotly team member |
| `type: feature` | planned feature additions |
| `type: performance` | performance related tasks |
| `type: maintenance` | source code cleanup resulting in no enhancement for users |
| `type: documentation` | API doc or attribute description improvements |
| `type: community` | issue left open for community input and pull requests |
| `type: duplicate` | *self-explanatory* |
| `type: wontfix` | *self-explanatory* |
| `status: discussion needed` | Issue or PR that required discussion among maintaners before moving forward |
| `status: in progress` | PRs that required some intial feedback but not ready to merge |
| `status: reviewable` | PRs that are completed from the author's perspective |
| `status: on hold` | PRs that are put on hold |

## Development

#### Perequisites

- git
- [node.js](https://nodejs.org/en/). We recommend using node.js v6.x or v4.x (both LTS).
  Upgrading and managing node versions can be easily done using
  [`nvm`](https://github.com/creationix/nvm) or its Windows alternatives.

#### Step 1: Clone the plotly.js repo and install its dependencies

```bash
git clone https://github.com/plotly/plotly.js.git
cd plotly.js
npm install
```

#### Step 2: Setup test environment

```bash
npm run pretest
```

#### Step 3: Start the test dashboard

```bash
npm start
```

This command bundles up the source files with source maps using
[browserify](https://github.com/substack/node-browserify), starts a
[watchify](https://github.com/substack/watchify) file watcher (making the your
dev plotly.js bundle update every time a source file is saved) and opens up a
tab in your browser.

#### Step 4: Open up the console and start developing

A typical workflow is to make some modifications to the source, update the
test dashboard, inspect and debug the changes, then repeat. The test dashboard
comes bundled with some useful tools while developing - all bundled under the
`Tabs` object:

| Method/Property        | Description |
|------------------------|-------------|
| `Tabs.fresh([id])` | Creates a fresh graph div and returns it (default id of `graph`). |
| `Tabs.getGraph([id])` | Returns the default or specified graph div. |
| `Tabs.plotMock(mock, [id])` | Plots the specified mock (`.json` extension is not required). |
| `Tabs.snapshot([id])` | Creates a png snapshot of the plot and places it below. |
| `Tabs.reload()` | Reloads the plotly.js script and will execute `Tabs.onReload` once completed. |
| `Tabs.onReload()` | By default, set to `noop` but you may set `Tabs.onReload` to any function you wish. This is useful for replotting a mock or test every time you reload the plotly.js script. |
| `Tabs.purge()` | Destroys all plots. |

View [the source](https://github.com/plotly/plotly.js/blob/master/devtools/test_dashboard/devtools.js) for more info.

Three additional helpers exist that are refreshed every second:

* `gd` - this is the default plot div
* `fullData` - shortcut to `gd._fullData`
* `fullLayout` - shortcut to `gd._fullLayout`

There is also a search bar in the top right of the dashboard. This fuzzy-searches
image mocks based on their file name and trace type.

#### Other npm scripts

- `npm run preprocess`: pre-processes the css and svg source file in js. This
  script must be run manually when updating the css and svg source files.
- `npm run watch`: starts a watchify file watcher just like the test dashboard but
  without booting up a server.

## Testing

Both jasmine and image tests are run on
[CircleCI](https://circleci.com/gh/plotly/plotly.js) on every push to this
repo.

### Jasmine tests

Jasmine tests are run in a browser using
[karma](https://github.com/karma-runner/karma). To run them locally:

```
npm run test-jasmine
```

To run a specific suite, use:

```
npm run test-jasmine -- <suite>
```

where the `<suite>` corresponds to the suite's file name as found in
[`test/jasmine/tests/`](https://github.com/plotly/plotly.js/tree/master/test/jasmine/tests).

You can also test multiple suites at a time, for example:

```
npm run test-jasmine -- bar axes scatter
```

which will run tests in the `bar_test.js`, `axes_test.js` and `scatter_test.js`
suites.

To turn off the `autoWatch` / auto-bundle / multiple run mode:

```
npm run test-jasmine -- <suite> --nowatch
```

In certain situations, you may find that the default reporting is not verbose
enough to pin down the source of the failing test. In this situation, you may
wish to use
[karma-verbose-reporter](https://www.npmjs.com/package/karma-verbose-reporter):

```
npm run test-jasmine -- <suite> --verbose
```

For more info on the karma / jasmine CLI:

```
npm run test-jasmine -- --help
npm run test-jasmine -- --info
```

### Image pixel comparison tests

Image pixel comparison tests are run in a docker container. For more
information on how to run them locally, please refer to [image test
README](https://github.com/plotly/plotly.js/blob/master/test/image/README.md).

Running the test locally outputs the generated png images in `build/test_images/` and the png diffs in `build/test_images_diff/` (two git-ignored directories).

To view the image pixel comparison test results, run

```
npm run start-image_viewer
```
which shows the baseline image, the generated image, the diff and the json mocks of test cases that failed.

To view the results of a run on CircleCI, download the `build/test_images/` and `build/test_images_diff/` artifacts into your local repo and then run `npm run start-image_viewer`.

## Repo organization

- Distributed files are in `dist/`
- CommonJS require-able modules are in `lib/`
- Sources files are in `src/`, including the index
- Build and repo management scripts are in `tasks/`
- All tasks can be run using [`npm run-script`](https://docs.npmjs.com/cli/run-script)
- Tests are `test/`, they are partitioned into `image` and `jasmine` tests
- Test dashboard and image viewer code is in `devtools/`
- Non-distributed, built files are in `build/` (most files in here are git-ignored, the css and font built files are exceptions)

## Coding style

Check if ok, with `npm run lint`

- See [eslintrc](https://github.com/plotly/plotly.js/blob/master/.eslintrc) and
  the eslint [list of rules](http://eslint.org/docs/rules/) for more details.
- Rules listed in the eslintrc file with the ignore flag `0` are the recommended
  rules for new code added.


text:
[Return to viewing taxa import records...]
    [Taxa Import Home]

Taxa Import Record for  ()

			clade name:
			log id:

reconcile with previous:

preserve node name info:

preserve node properties:

	show taxa import ingest xml


text:
#if __has_include("BraintreeCore.h")
#import "BraintreeCore.h"
#else
#import <BraintreeCore/BraintreeCore.h>
#endif

@interface BTConfiguration (UnionPay)

/**
 @brief Indicates whether UnionPay is enabled for the merchant account.
*/
@property (nonatomic, readonly, assign) BOOL isUnionPayEnabled;

@end


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Plato - JavaScript Introspection</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

  <link href="assets/css/vendor/bootstrap.css" rel="stylesheet">
  <link href="assets/css/vendor/font-awesome.css" rel="stylesheet">
  <link href="assets/css/vendor/morris.css" rel="stylesheet">
  <link href="assets/css/plato.css" rel="stylesheet">
  <link href="assets/css/plato-display.css" rel="stylesheet">

JavaScript Source Analysis

                    Total / Average Lines

322 / 322

                    Average Maintainability

64.72

Worst Maintainability Scores

                        65 score
                        index.js

Largest Files

                        322 lines
                        index.js


text:
<?php

namespace Symfony\Component\Security\Core\Tests\Validator\Constraints;

use Symfony\Component\Validator\Validation;

/**
 * @since  2.5.4
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class LegacyUserPasswordValidator2Dot4ApiTest extends UserPasswordValidatorTest
{
    protected function getApiVersion()
    {
        return Validation::API_VERSION_2_4;
    }
}


text:
import NetRegexes from '../../../../../resources/netregexes';
import ZoneId from '../../../../../resources/zone_id';
import { OopsyData } from '../../../../../types/data';
import { OopsyTriggerSet } from '../../../../../types/oopsy';

export type Data = OopsyData;

const triggerSet: OopsyTriggerSet<Data> = {
  zoneId: ZoneId.TheFinalDay,
  damageWarn: {
    'Endsinger Stellar Collision 1': '662E', // planet collision
    'Endsinger Stellar Collision 2': '663B', // planet collision
    'Endsinger Elenchos Middle': '6644', // middle laser
    'Endsinger Elenchos Sides': '6643', // side lasers
    'Endsinger Elenchos Heads': '663E', // head lasers
    'Endsinger Feather of Despair Pharmakon': '664C', // feather circles after Death's Embrace
    'Endsinger Epigonoi': '664C', // circles after Ekstasis that spawn heads with puddles
    'Endsinger Misery': '6648', // black puddles
    'Endsinger Interstellar': '67FB', // large line dive (with spread during)
    'Endsinger Kakodaimon Crash': '6657', // planets being tossed during midphase
    'Endsinger Dead Star': '5E4E', // targeted circles during final phase
  },
  shareWarn: {
    'EndSinger Death\'s Embrace': '6649', // purple protean triangles
    'Endsinger Nemesis': '664E', // spread during Interstellar
  },
  shareFail: {
    'Endsinger Hubris': '6653', // tankbuster
  },
  triggers: [
    {
      id: 'Endsinger Galaxias',
      type: 'Ability',
      netRegex: NetRegexes.ability({ id: '6C6A' }),
      deathReason: (_data, matches) => {
        return {
          id: matches.targetId,
          name: matches.target,
          text: {
            en: 'Knocked off',
            de: 'Runtergefallen',
            fr: 'Renversé(e)',
            ja: 'ノックバック',
            cn: '击退坠落',
            ko: '넉백',
          },
        };
      },
    },
  ],
};

export default triggerSet;


text:
                                <input type="text" data-dojo-attach-point="txtAddress" class="esriCTTxtAddress" onfocus="if(this.setSelectionRange)this.setSelectionRange(this.value.length, this.value.length);" />

                                ${sharedNls.errorMessages.invalidSearch}


text:
import Module from '../../core/Module.js';

class ResizeColumns extends Module{

	constructor(table){
		super(table);

		this.startColumn = false;
		this.startX = false;
		this.startWidth = false;
		this.latestX = false;
		this.handle = null;
		this.initialNextColumn = null;
		this.nextColumn = null;

		this.initialized = false;
		this.registerColumnOption("resizable", true);
		this.registerTableOption("resizableColumnFit", false);
	}

	initialize(){
		this.subscribe("column-rendered", this.layoutColumnHeader.bind(this));
	}

	initializeEventWatchers(){
		if(!this.initialized){

			this.subscribe("cell-rendered", this.layoutCellHandles.bind(this));
			this.subscribe("cell-delete", this.deInitializeComponent.bind(this));

			this.subscribe("cell-height", this.resizeHandle.bind(this));
			this.subscribe("column-moved", this.columnLayoutUpdated.bind(this));

			this.subscribe("column-hide", this.deInitializeColumn.bind(this));
			this.subscribe("column-show", this.columnLayoutUpdated.bind(this));
			this.subscribe("column-width", this.columnWidthUpdated.bind(this));

			this.subscribe("column-delete", this.deInitializeComponent.bind(this));
			this.subscribe("column-height", this.resizeHandle.bind(this));

			this.initialized = true;
		}
	}

	layoutCellHandles(cell){
		if(cell.row.type === "row"){
			this.deInitializeComponent(cell);
			this.initializeColumn("cell", cell, cell.column, cell.element);
		}
	}

	layoutColumnHeader(column){
		if(column.definition.resizable){
			this.initializeEventWatchers();
			this.deInitializeComponent(column);
			this.initializeColumn("header", column, column, column.element);
		}
	}

	columnLayoutUpdated(column){
		var prev = column.prevColumn();

		this.reinitializeColumn(column);

		if(prev){
			this.reinitializeColumn(prev);
		}
	}

	columnWidthUpdated(column){
		if(column.modules.frozen){
			if(this.table.modules.frozenColumns.leftColumns.includes(column)){
				this.table.modules.frozenColumns.leftColumns.forEach((col) => {
					this.reinitializeColumn(col);
				});
			}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){
				this.table.modules.frozenColumns.rightColumns.forEach((col) => {
					this.reinitializeColumn(col);
				});
			}
		}
	}

	frozenColumnOffset(column){
		var offset = false;

		if(column.modules.frozen){
			offset = column.modules.frozen.marginValue;

			if(column.modules.frozen.position === "left"){
				offset += column.getWidth() - 3;
			}else{
				if(offset){
					offset -= 3;
				}
			}
		}

		return offset !== false ? offset + "px" : false;
	}

	reinitializeColumn(column){
		var frozenOffset = this.frozenColumnOffset(column);

		column.cells.forEach((cell) => {
			if(cell.modules.resize && cell.modules.resize.handleEl){
				if(frozenOffset){
					cell.modules.resize.handleEl.style[column.modules.frozen.position] = frozenOffset;
				}

				cell.element.after(cell.modules.resize.handleEl);
			}
		});

		if(column.modules.resize && column.modules.resize.handleEl){
			if(frozenOffset){
				column.modules.resize.handleEl.style[column.modules.frozen.position] = frozenOffset;
			}

			column.element.after(column.modules.resize.handleEl);
		}
	}

	initializeColumn(type, component, column, element){
		var self = this,
		variableHeight = false,
		mode = column.definition.resizable,
		config = {},
		nearestColumn = column.getLastColumn();

		//set column resize mode
		if(type === "header"){
			variableHeight = column.definition.formatter == "textarea" || column.definition.variableHeight;
			config = {variableHeight:variableHeight};
		}

		if((mode === true || mode == type) && this._checkResizability(nearestColumn)){

			var handle = document.createElement('span');
			handle.className = "tabulator-col-resize-handle";

			handle.addEventListener("click", function(e){
				e.stopPropagation();
			});

			var handleDown = function(e){
				self.startColumn = column;
				self.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();
				self._mouseDown(e, nearestColumn, handle);
			};

			handle.addEventListener("mousedown", handleDown);
			handle.addEventListener("touchstart", handleDown, {passive: true});

			//resize column on  double click
			handle.addEventListener("dblclick", (e) => {
				var oldWidth = nearestColumn.getWidth();

				e.stopPropagation();
				nearestColumn.reinitializeWidth(true);

				if(oldWidth !== nearestColumn.getWidth()){
					self.dispatch("column-resized", nearestColumn);
					self.table.externalEvents.dispatch("columnResized", nearestColumn.getComponent());
				}
			});

			if(column.modules.frozen){
				handle.style.position = "sticky";
				handle.style[column.modules.frozen.position] = this.frozenColumnOffset(column);
			}

			config.handleEl = handle;

			if(element.parentNode && column.visible){
				element.after(handle);
			}
		}

		component.modules.resize = config;
	}

	deInitializeColumn(column){
		this.deInitializeComponent(column);

		column.cells.forEach((cell) => {
			this.deInitializeComponent(cell);
		});
	}

	deInitializeComponent(component){
		var handleEl;

		if(component.modules.resize){
			handleEl = component.modules.resize.handleEl;

			if(handleEl && handleEl.parentElement){
				handleEl.parentElement.removeChild(handleEl);
			}
		}
	}

	resizeHandle(component, height){
		if(component.modules.resize && component.modules.resize.handleEl){
			component.modules.resize.handleEl.style.height = height;
		}
	}

	_checkResizability(column){
		return column.definition.resizable;
	}

	_mouseDown(e, column, handle){
		var self = this;

		self.table.element.classList.add("tabulator-block-select");

		function mouseMove(e){
			var x = typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX,
			startDiff = x - self.startX,
			moveDiff = x - self.latestX,
			blockedBefore, blockedAfter;

			self.latestX = x;

			if(self.table.rtl){
				startDiff = -startDiff;
				moveDiff = -moveDiff;
			}

			blockedBefore = column.width == column.minWidth || column.width == column.maxWidth;

			column.setWidth(self.startWidth + startDiff);

			blockedAfter = column.width == column.minWidth || column.width == column.maxWidth;

			if(moveDiff < 0){
				self.nextColumn = self.initialNextColumn;
			}

			if(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){
				let colWidth = self.nextColumn.getWidth();

				if(moveDiff > 0){
					if(colWidth <= self.nextColumn.minWidth){
						self.nextColumn = self.nextColumn.nextColumn();
					}
				}

				if(self.nextColumn){
					self.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);
				}
			}

			self.table.columnManager.rerenderColumns(true);

			if(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){
				column.checkCellHeights();
			}
		}

		function mouseUp(e){

			//block editor from taking action while resizing is taking place
			if(self.startColumn.modules.edit){
				self.startColumn.modules.edit.blocked = false;
			}

			if(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){
				column.checkCellHeights();
			}

			document.body.removeEventListener("mouseup", mouseUp);
			document.body.removeEventListener("mousemove", mouseMove);

			handle.removeEventListener("touchmove", mouseMove);
			handle.removeEventListener("touchend", mouseUp);

			self.table.element.classList.remove("tabulator-block-select");

			if(self.startWidth !== column.getWidth()){
				self.table.columnManager.verticalAlignHeaders();

				self.dispatch("column-resized", column);
				self.table.externalEvents.dispatch("columnResized", column.getComponent());
			}
		}

		e.stopPropagation(); //prevent resize from interfering with movable columns

		//block editor from taking action while resizing is taking place
		if(self.startColumn.modules.edit){
			self.startColumn.modules.edit.blocked = true;
		}

		self.startX = typeof e.screenX === "undefined" ? e.touches[0].screenX : e.screenX;
		self.latestX = self.startX;
		self.startWidth = column.getWidth();

		document.body.addEventListener("mousemove", mouseMove);
		document.body.addEventListener("mouseup", mouseUp);
		handle.addEventListener("touchmove", mouseMove, {passive: true});
		handle.addEventListener("touchend", mouseUp);
	}
}

ResizeColumns.moduleName = "resizeColumns";

export default ResizeColumns;


text:
package cli

import (
	"fmt"
	"strings"

	"github.com/abiosoft/dockward/balancer"
	"github.com/abiosoft/dockward/util"
)

// forwardToHost does port forwarding to host endpoints.
func forwardToHost(args cliConf) error {
	endpoints := make(balancer.Endpoints, len(args.Endpoints))
	for i, endpoint := range args.Endpoints {
		endpoints[i] = balancer.ParseEndpoint(endpoint)
	}

	lb := balancer.New(args.HostPort, endpoints, args.Policy)

	go lb.ListenForEndpoints(balancer.EndpointPort)

	fmt.Println("Forwarding", args.HostPort, "to", strings.Join(endpoints.Addrs(), ", "))
	return lb.Start(nil)
}

// forwardToDocker does port forwarding to docker endpoints.
func forwardToDocker(args cliConf) {
	endpoints, err := endpointsFromFilter(args.ContainerPort, args.Filter, args.FilterValue)
	exitIfErr(err)

	// if filter is not label, it has to exist.
	if args.Filter != string(labelFilter) && endpoints.Len() == 0 {
		exit(fmt.Errorf("Container with %s=%s not found.", args.Filter, args.FilterValue))
	}

	destinations := make([]string, len(endpoints))
	for i, e := range endpoints {
		destinations[i] = e.String()
	}

	endpointPort, err := util.RandomPort()
	exitIfErr(err)

	err = launchBalancerContainer(args.HostPort, endpointPort, args.Policy, destinations...)
	exitIfErr(err)

	if args.Filter == string(labelFilter) {
		go monitor(endpointPort, args.ContainerPort, args.FilterValue, args.DockerHost)
		fmt.Println("Forwarding", args.HostPort, "to", args.ContainerPort, "in containers with label="+args.FilterValue)
	} else {
		fmt.Println("Forwarding", args.HostPort, "to", args.ContainerPort, "in container", args.FilterValue)
	}
}


text:
package com.guonl.httpclient;

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class DoPOST {

    public static void main(String[] args) throws Exception {

        // 创建Httpclient对象
        CloseableHttpClient httpclient = HttpClients.createDefault();

        // 创建http POST请求
        HttpPost httpPost = new HttpPost("http://www.baidu.com");

        CloseableHttpResponse response = null;
        try {
            // 执行请求
            response = httpclient.execute(httpPost);
            // 判断返回状态是否为200
            if (response.getStatusLine().getStatusCode() == 200) {
                String content = EntityUtils.toString(response.getEntity(), "UTF-8");
                System.out.println(content);
            }
        } finally {
            if (response != null) {
                response.close();
            }
            httpclient.close();
        }

    }

}


text:
using System;
using System.Globalization;

namespace PcapDotNet.Packets.IpV6
{
    /// <summary>
    /// RFC 6621.
    /// Simplified Multicast Forwarding Duplicate Packet Detection.
    /// Sequence-based approach.
    /// Default Tagger ID.
    /// <pre>
    /// +-----+---+-------+--------+
    /// | Bit | 0 | 1-3   | 4-7    |
    /// +-----+---+-------+--------+
    /// | 0   | Option Type        |
    /// +-----+--------------------+
    /// | 8   | Opt Data Len       |
    /// +-----+---+-------+--------+
    /// | 16  | 0 | TidTy | TidLen |
    /// +-----+---+-------+--------+
    /// | 24  | TaggerId           |
    /// | ... |                    |
    /// +-----+--------------------+
    /// |     | Identifier         |
    /// | ... |                    |
    /// +-----+--------------------+
    /// </pre>
    /// </summary>
    public sealed class IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionDefault : IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased
    {
        /// <summary>
        /// Creates an instance from tagger id and identifier.
        /// </summary>
        /// <param name="taggerId">
        /// Used to differentiate multiple ingressing border gateways that may commonly apply the SMF_DPD option header to packets from a particular source.
        /// Non-specific context.
        /// </param>
        /// <param name="identifier">
        /// DPD packet Identifier.
        /// When the TaggerId field is present, the Identifier can be considered a unique packet identifier
        /// in the context of the TaggerId:srcAddr:dstAddr tuple.
        /// When the TaggerId field is not present, then it is assumed that the source applied the SMF_DPD option
        /// and the Identifier can be considered unique in the context of the IPv6 packet header srcAddr:dstAddr tuple.
        /// </param>
        public IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionDefault(DataSegment taggerId, DataSegment identifier)
            : base(identifier)
        {
            if (taggerId == null)
                throw new ArgumentNullException("taggerId");
            if (taggerId.Length > TaggerIdMaxLength)
            {
                throw new ArgumentOutOfRangeException("taggerId", taggerId,
                                                      string.Format(CultureInfo.InvariantCulture, "Length is {0} but it must not be longer than {1} bytes.",
                                                                    taggerId.Length, TaggerIdMaxLength));
            }
            if (taggerId.Length == 0)
            {
                throw new ArgumentOutOfRangeException("taggerId", taggerId,
                                                      string.Format(CultureInfo.InvariantCulture, "Length is {0} but it must be longer than 0 bytes.",
                                                                    taggerId.Length));
            }
            TaggerId = taggerId;
        }

        /// <summary>
        /// Used to differentiate multiple ingressing border gateways that may commonly apply the SMF_DPD option header to packets from a particular source.
        /// Non-specific context.
        /// </summary>
        public DataSegment TaggerId { get; private set; }

        /// <summary>
        /// The length of the Tagger Id.
        /// </summary>
        public override int TaggerIdLength
        {
            get { return TaggerId.Length; }
        }

        /// <summary>
        /// Indicating the presence and type of the optional TaggerId field.
        /// </summary>
        public override IpV6TaggerIdType TaggerIdType
        {
            get { return IpV6TaggerIdType.Default; }
        }

        internal override bool EqualsTaggerId(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased other)
        {
            return EqualsTaggerId(other as IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionDefault);
        }

        internal override int GetTaggerIdHashCode()
        {
            return TaggerId.GetHashCode();
        }

        internal override void WriteTaggerId(byte[] buffer, ref int offset)
        {
            buffer.Write(ref offset, TaggerId);
        }

        private bool EqualsTaggerId(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionDefault other)
        {
            return other != null &&
                   TaggerId.Equals(other.TaggerId);
        }
    }
}


text:
import hashlib
import os
import tempfile

class LFSStore(object):
    """Stores objects on disk, indexed by SHA256."""

    def __init__(self, path):
        self.path = path

    @classmethod
    def create(cls, lfs_dir):
        if not os.path.isdir(lfs_dir):
            os.mkdir(lfs_dir)
        os.mkdir(os.path.join(lfs_dir, "tmp"))
        os.mkdir(os.path.join(lfs_dir, "objects"))
        return cls(lfs_dir)

    @classmethod
    def from_repo(cls, repo, create=False):
        lfs_dir = os.path.join(repo.controldir, "lfs")
        if create:
            return cls.create(lfs_dir)
        return cls(lfs_dir)

    def _sha_path(self, sha):
        return os.path.join(self.path, "objects", sha[0:2], sha[2:4], sha)

    def open_object(self, sha):
        """Open an object by sha."""
        try:
            return open(self._sha_path(sha), "rb")
        except FileNotFoundError:
            raise KeyError(sha)

    def write_object(self, chunks):
        """Write an object.

        Returns: object SHA
        """
        sha = hashlib.sha256()
        tmpdir = os.path.join(self.path, "tmp")
        with tempfile.NamedTemporaryFile(dir=tmpdir, mode="wb", delete=False) as f:
            for chunk in chunks:
                sha.update(chunk)
                f.write(chunk)
            f.flush()
            tmppath = f.name
        path = self._sha_path(sha.hexdigest())
        if not os.path.exists(os.path.dirname(path)):
            os.makedirs(os.path.dirname(path))
        os.rename(tmppath, path)
        return sha.hexdigest()


text:
@implementation UIView (UAFAdditions_SFX)

+ (id)soundEffectPlayer
{
  return [UAFUISoundController sharedController];
}

@end


text:
import {CdkTableModule} from '@angular/cdk/table';
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';

import {CdkRowSelection} from './row-selection';
import {CdkSelectAll} from './select-all';
import {CdkSelection} from './selection';
import {CdkSelectionColumn} from './selection-column';
import {CdkSelectionToggle} from './selection-toggle';

@NgModule({
  imports: [CommonModule, CdkTableModule],
  exports: [CdkSelection, CdkSelectionToggle, CdkSelectAll, CdkSelectionColumn, CdkRowSelection],
  declarations: [
    CdkSelection,
    CdkSelectionToggle,
    CdkSelectAll,
    CdkSelectionColumn,
    CdkRowSelection,
  ],
})
export class CdkSelectionModule {}


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@drawable/trunks" />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@drawable/spidy" />

</FrameLayout>


text:
package postgres

import (
	"log"
	"time"

	"github.com/gebv/hey"

	pg "gopkg.in/jackc/pgx.v2"
)

var (
	_ hey.Hey = (*Service)(nil)

	// PerPageMax max count items of page search
	PerPageMax = 100

	// PerPageDefault default count items of page search
	PerPageDefault = 25

	// TimeoutDefault default timeout of simple procedure
	TimeoutDefault time.Duration = 50

	// FindTimeoutDefault default timeout of search procedure
	FindTimeoutDefault = TimeoutDefault * 5

	DefaultPort     uint16 = 5432
	DefaultMaxConns int    = 10
)

// NewService new hey service
func NewService(
	db *pg.ConnPool,
	logger *log.Logger,
) *Service {
	return &Service{
		db:       db,
		channels: &ChannelRepository{db},
		threads:  &ThreadRepository{db},
		events:   &EventRepository{db},
		logger:   logger,
	}
}

// Service service of threads and events
type Service struct {
	logger   *log.Logger
	db       *pg.ConnPool
	channels *ChannelRepository
	threads  *ThreadRepository
	events   *EventRepository
}


text:
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

    <ProgressBar android:indeterminate="true"
                 android:layout_width="wrap_content"
                 android:layout_height="50dip"
                 android:id="@+id/com_facebook_login_activity_progress_bar"
                 android:layout_centerInParent="true"
                 android:visibility="gone"
                 android:indeterminateOnly="true"
            />
</RelativeLayout>
<!-- From: file:/C:/Users/Henry/AndroidstudioProjects/facebook-android-sdk-3.19.0/facebook/res/layout/com_facebook_login_activity_layout.xml --><!-- From: file:/C:/Users/Henry/AndroidstudioProjects/facebook-android-sdk-3.19.0/samples/SwitchUserSample/build/intermediates/exploded-aar/facebook-android-sdk-3.19.0/facebook/unspecified/res/layout/com_facebook_login_activity_layout.xml -->


text:
using Newtonsoft.Json;

namespace OCM.API.Common.Model.Extensions
{
    public class UserSubscription
    {
        public static Model.UserSubscription FromDataModel(Core.Data.UserSubscription source, bool isVerboseMode)
        {
            if (source == null) return null;

            var item = new Model.UserSubscription
            {
                ID = source.Id,
                Title = source.Title,
                CountryID = source.CountryId,
                DistanceKM = source.DistanceKm,

                IsEnabled = (bool)source.IsEnabled,
                Latitude = source.Latitude,
                Longitude = source.Longitude,
                NotifyComments = source.NotifyComments,
                NotifyEmergencyChargingRequests = source.NotifyEmergencyChargingRequests,
                NotifyGeneralChargingRequests = source.NotifyGeneralChargingRequests,
                NotifyMedia = source.NotifyMedia,
                NotifyPOIAdditions = source.NotifyPoiadditions,
                NotifyPOIUpdates = source.NotifyPoiupdates,
                NotifyPOIEdits = source.NotifyPoiedits,
                NotificationFrequencyMins = source.NotificationFrequencyMins,
                DateCreated = source.DateCreated,
                DateLastNotified = source.DateLastNotified,
                UserID = source.UserId
            };

            if (source.FilterSettings != null)
            {
                item.FilterSettings = JsonConvert.DeserializeObject<UserSubscriptionFilter>(source.FilterSettings);
            }

            if (isVerboseMode)
            {
                item.Country = OCM.API.Common.Model.Extensions.Country.FromDataModel(source.Country);
            }

            return item;
        }
    }
}