text:
package task

import (
	"os"

	"github.com/emicklei/go-selfdiagnose"
)

type ReportHostname struct{}

func (r ReportHostname) Comment() string { return "hostname as reported by the os" }

func (r ReportHostname) Run(ctx *selfdiagnose.Context, result *selfdiagnose.Result) {
	h, err := os.Hostname()
	result.Severity = selfdiagnose.SeverityNone
	result.Passed = err == nil
	result.Reason = h
}

redpajama_set_name: RedPajamaGithub


text:
package lichen.activiti.entities;

/**
 * 适应workflow的实体类.
 * <p>
 * 所有业务实体想实现工作流机制,可以实现此接口
 * </p>
 * @author jcai
 */
public interface WorkflowAdapter {
    public void setProcessInstanceId(String processInstanceId);
    public String getBusinessId();
}


text:
package org.springframework.http.converter.json;

import java.io.IOException;
import java.lang.reflect.Type;
import java.nio.charset.Charset;

import org.codehaus.jackson.JsonEncoding;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.type.TypeFactory;
import org.codehaus.jackson.type.JavaType;
import org.springframework.http.HttpInputMessage;
import org.springframework.http.HttpOutputMessage;
import org.springframework.http.MediaType;
import org.springframework.http.converter.AbstractHttpMessageConverter;
import org.springframework.http.converter.GenericHttpMessageConverter;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.http.converter.HttpMessageNotWritableException;
import org.springframework.util.Assert;

/**
 * Implementation of {@link org.springframework.http.converter.HttpMessageConverter HttpMessageConverter} that
 * can read and write JSON using Jackson 1.x's {@link ObjectMapper}.
 *
 *
This converter can be used to bind to typed beans, or untyped {@link java.util.HashMap HashMap} instances.
 *
 *
By default, this converter supports {@code application/json}. This can be overridden by setting the
 * {@link #setSupportedMediaTypes supportedMediaTypes} property.
 *
 * @author Arjen Poutsma
 * @author Roy Clarkson
 * @since 1.0
 * @deprecated In favor of {@link MappingJackson2HttpMessageConverter}
 */
@Deprecated
public class MappingJacksonHttpMessageConverter extends AbstractHttpMessageConverter<Object>
		implements GenericHttpMessageConverter<Object> {

	public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");

	private ObjectMapper objectMapper = new ObjectMapper();

	private String jsonPrefix;

	private Boolean prettyPrint;

	/**
	 * Construct a new {@code MappingJacksonHttpMessageConverter}.
	 */
	public MappingJacksonHttpMessageConverter() {
		super(new MediaType("application", "json", DEFAULT_CHARSET),
				new MediaType("application", "*+json", DEFAULT_CHARSET));
	}

	/**
	 * Set the {@code ObjectMapper} for this view.
	 * If not set, a default {@link ObjectMapper#ObjectMapper() ObjectMapper} is used.
	 *
Setting a custom-configured {@code ObjectMapper} is one way to take further control of the JSON
	 * serialization process. For example, an extended {@link org.codehaus.jackson.map.SerializerFactory}
	 * can be configured that provides custom serializers for specific types. The other option for refining
	 * the serialization process is to use Jackson's provided annotations on the types to be serialized,
	 * in which case a custom-configured ObjectMapper is unnecessary.
	 */
	public void setObjectMapper(ObjectMapper objectMapper) {
		Assert.notNull(objectMapper, "ObjectMapper must not be null");
		this.objectMapper = objectMapper;
		configurePrettyPrint();
	}

	/**
	 * Return the underlying {@code ObjectMapper} for this view.
	 */
	public ObjectMapper getObjectMapper() {
		return this.objectMapper;
	}

	/**
	 * Specify a custom prefix to use for this view's JSON output.
	 * Default is none.
	 * @see #setPrefixJson
	 */
	public void setJsonPrefix(String jsonPrefix) {
		this.jsonPrefix = jsonPrefix;
	}

	/**
	 * Indicate whether the JSON output by this view should be prefixed with "{} &&". Default is false.
	 *
Prefixing the JSON string in this manner is used to help prevent JSON Hijacking.
	 * The prefix renders the string syntactically invalid as a script so that it cannot be hijacked.
	 * This prefix does not affect the evaluation of JSON, but if JSON validation is performed on the
	 * string, the prefix would need to be ignored.
	 * @see #setJsonPrefix
	 */
	public void setPrefixJson(boolean prefixJson) {
		this.jsonPrefix = (prefixJson ? "{} && " : null);
	}

	/**
	 * Whether to use the {@link org.codehaus.jackson.impl.DefaultPrettyPrinter} when writing JSON.
	 * This is a shortcut for setting up an {@code ObjectMapper} as follows:
	 *

	 * ObjectMapper mapper = new ObjectMapper();
	 * mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
	 * converter.setObjectMapper(mapper);
	 *

	 *
The default value is {@code false}.
	 */
	public void setPrettyPrint(boolean prettyPrint) {
		this.prettyPrint = prettyPrint;
		configurePrettyPrint();
	}

	private void configurePrettyPrint() {
		if (this.prettyPrint != null) {
			this.objectMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, this.prettyPrint);
		}
	}

	@Override
	public boolean canRead(Class<?> clazz, MediaType mediaType) {
		return canRead(clazz, null, mediaType);
	}

	public boolean canRead(Type type, Class<?> contextClass, MediaType mediaType) {
		JavaType javaType = getJavaType(type, contextClass);
		return (this.objectMapper.canDeserialize(javaType) && canRead(mediaType));
	}

	@Override
	public boolean canWrite(Class<?> clazz, MediaType mediaType) {
		return (this.objectMapper.canSerialize(clazz) && canWrite(mediaType));
	}

	@Override
	protected boolean supports(Class<?> clazz) {
		// should not be called, since we override canRead/Write instead
		throw new UnsupportedOperationException();
	}

	@Override
	protected Object readInternal(Class<?> clazz, HttpInputMessage inputMessage)
			throws IOException, HttpMessageNotReadableException {

		JavaType javaType = getJavaType(clazz, null);
		return readJavaType(javaType, inputMessage);
	}

	public Object read(Type type, Class<?> contextClass, HttpInputMessage inputMessage)
			throws IOException, HttpMessageNotReadableException {

		JavaType javaType = getJavaType(type, contextClass);
		return readJavaType(javaType, inputMessage);
	}

	private Object readJavaType(JavaType javaType, HttpInputMessage inputMessage) {
		try {
			return this.objectMapper.readValue(inputMessage.getBody(), javaType);
		}
		catch (IOException ex) {
			throw new HttpMessageNotReadableException("Could not read JSON: " + ex.getMessage(), ex);
		}
	}

	@Override
	protected void writeInternal(Object object, HttpOutputMessage outputMessage)
			throws IOException, HttpMessageNotWritableException {

		JsonEncoding encoding = getJsonEncoding(outputMessage.getHeaders().getContentType());
		JsonGenerator jsonGenerator =
				this.objectMapper.getJsonFactory().createJsonGenerator(outputMessage.getBody(), encoding);

		// A workaround for JsonGenerators not applying serialization features
		// https://github.com/FasterXML/jackson-databind/issues/12
		if (this.objectMapper.getSerializationConfig().isEnabled(SerializationConfig.Feature.INDENT_OUTPUT)) {
			jsonGenerator.useDefaultPrettyPrinter();
		}

		try {
			if (this.jsonPrefix != null) {
				jsonGenerator.writeRaw(this.jsonPrefix);
			}
			this.objectMapper.writeValue(jsonGenerator, object);
		}
		catch (JsonProcessingException ex) {
			throw new HttpMessageNotWritableException("Could not write JSON: " + ex.getMessage(), ex);
		}
	}

	/**
	 * Return the Jackson {@link JavaType} for the specified type and context class.
	 *
The default implementation returns {@link TypeFactory#type(java.lang.reflect.Type)}
	 * or {@code TypeFactory.type(type, TypeFactory.type(contextClass))},
	 * but this can be overridden in subclasses, to allow for custom generic collection handling.
	 * For instance:
	 *

	 * protected JavaType getJavaType(Type type) {
	 *   if (type instanceof Class && List.class.isAssignableFrom((Class)type)) {
	 *     return TypeFactory.collectionType(ArrayList.class, MyBean.class);
	 *   } else {
	 *     return super.getJavaType(type);
	 *   }
	 * }
	 *

	 * @param type the type to return the java type for
	 * @param contextClass a context class for the target type, for example a class
	 * in which the target type appears in a method signature, can be {@code null}
	 * @return the java type
	 */
	protected JavaType getJavaType(Type type, Class<?> contextClass) {
		return (contextClass != null) ?
			TypeFactory.type(type, TypeFactory.type(contextClass)) : TypeFactory.type(type);
	}

	/**
	 * Determine the JSON encoding to use for the given content type.
	 * @param contentType the media type as requested by the caller
	 * @return the JSON encoding to use (never {@code null})
	 */
	protected JsonEncoding getJsonEncoding(MediaType contentType) {
		if (contentType != null && contentType.getCharSet() != null) {
			Charset charset = contentType.getCharSet();
			for (JsonEncoding encoding : JsonEncoding.values()) {
				if (charset.name().equals(encoding.getJavaName())) {
					return encoding;
				}
			}
		}
		return JsonEncoding.UTF8;
	}

}


text:
#ifndef __ATOM_H__
#define __ATOM_H__

#ifndef __INDEX_H__
#include "index.h"
#endif

#include "erl_atom_table.h"

#define MAX_ATOM_LENGTH 255
#define ATOM_LIMIT (1024*1024)
#define MIN_ATOM_TABLE_SIZE 8192

#ifndef ARCH_32
/* Internal atom cache needs MAX_ATOM_TABLE_SIZE to be less than an
   unsigned 32 bit integer. See external.c(erts_encode_ext_dist_header_setup)
   for more details. */
#define MAX_ATOM_TABLE_SIZE ((MAX_ATOM_INDEX + 1 < (1UL << 32)) ? MAX_ATOM_INDEX + 1 : (1UL << 32))
#else
#define MAX_ATOM_TABLE_SIZE (MAX_ATOM_INDEX + 1)
#endif

/*
 * Atom entry.
 */
typedef struct atom {
    IndexSlot slot;  /* MUST BE LOCATED AT TOP OF STRUCT!!! */
    int len;         /* length of atom name */
    int ord0;        /* ordinal value of first 3 bytes + 7 bits */
    byte* name;      /* name of atom */
} Atom;

extern IndexTable erts_atom_table;

ERTS_GLB_INLINE Atom* atom_tab(Uint i);
ERTS_GLB_INLINE int erts_is_atom_bytes(byte *text, size_t len, Eterm term);
ERTS_GLB_INLINE int erts_is_atom_str(char *str, Eterm term);

#if ERTS_GLB_INLINE_INCL_FUNC_DEF
ERTS_GLB_INLINE Atom*
atom_tab(Uint i)
{
    return (Atom *) erts_index_lookup(&erts_atom_table, i);
}

ERTS_GLB_INLINE int erts_is_atom_bytes(byte *text, size_t len, Eterm term)
{
    Atom *a;
    if (!is_atom(term))
	return 0;
    a = atom_tab(atom_val(term));
    return (len == (size_t) a->len
	    && sys_memcmp((void *) a->name, (void *) text, len) == 0);
}

ERTS_GLB_INLINE int erts_is_atom_str(char *str, Eterm term)
{
    Atom *a;
    int i, len;
    char *aname;
    if (!is_atom(term))
	return 0;
    a = atom_tab(atom_val(term));
    len = a->len;
    aname = (char *) a->name;
    for (i = 0; i < len; i++)
	if (aname[i] != str[i] || str[i] == '\0')
	    return 0;
    return str[len] == '\0';
}

#endif

/*
 * Note, ERTS_IS_ATOM_STR() expects the first argument to be a
 * string literal.
 */
#define ERTS_IS_ATOM_STR(LSTR, TERM) \
  (erts_is_atom_bytes((byte *) LSTR, sizeof(LSTR) - 1, (TERM)))
#define ERTS_DECL_AM(S) Eterm AM_ ## S = am_atom_put(#S, sizeof(#S) - 1)
#define ERTS_INIT_AM(S) AM_ ## S = am_atom_put(#S, sizeof(#S) - 1)

int atom_table_size(void);	/* number of elements */
int atom_table_sz(void);	/* table size in bytes, excluding stored objects */

Eterm am_atom_put(const char*, int); /* most callers pass plain char*'s */
int atom_erase(byte*, int);
int atom_static_put(byte*, int);
void init_atom_table(void);
void atom_info(int, void *);
void dump_atoms(int, void *);
int erts_atom_get(const char* name, int len, Eterm* ap);
void erts_atom_get_text_space_sizes(Uint *reserved, Uint *used);
#endif


text:
from .eventhandler import EventHandler
from .portapapeles import Portapapeles
from .resources import Resources
from .colores import *
from .RLE import *


text:
<!DOCTYPE html>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<title>About - Generic Website Template</title>
		<link rel="stylesheet" href="css/style.css" type="text/css" />

Home

About

Blog

Services

We Have Free Templates for Everyone

Our website templates are created with inspiration, checked for quality and originality and meticulously sliced and coded. What's more,
				they're absolutely free! You can do a lot with them. You can modify them. You can use them to design websites for clients, so long as you
				agree with the Terms of Use. You can even remove all our links if you want to.

We Have More Templates for You

Looking for more templates? Just browse through all our Free Website Templates and find what you're looking for. But if you don't find
				any website template you can use, you can try our Free Web Design service and tell us all about it. Maybe you're looking for something
				different, something special. And we love the challenge of doing something different and something special.

Be Part of Our Community

If you're experiencing issues and concerns about this website template, join the discussion on our forum and meet other people in the
				community who share the same interests with you.

Template details

Version 2

				Website Template details, discussion and updates for this Generic Website Template.

				Website Template design by Free Website Templates.

				Please feel free to remove some or all the text and links of this page and replace it with your own.

This website template has been designed by Free Website Templates for you, for free.
							You can replace all this text with your own text.

							Click to read more

This website template has been designed by Free Website Templates for you, for free.
							You can replace all this text with your own text.

							Click to read more

This website template has been designed by Free Website Templates for you, for free.
							You can replace all this text with your own text.

							Click to read more

Home

About

Blog

Gallery

© Copyright © 2011. Company name all rights reserved

					facebook
					twitter
					vimeo


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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>MAGMA: single precision</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

MAGMA
    1.5.0

Matrix Algebra for GPU and Multicore Architectures

Main Page

Modules

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

 All Functions Groups

Functions

single precision
Tiled LU

Functions

magma_int_t 	magma_sgessm_gpu (magma_order_t order, magma_int_t m, magma_int_t n, magma_int_t k, magma_int_t ib, magma_int_t *ipiv, float *dL1, magma_int_t lddl1, float *dL, magma_int_t lddl, float *dA, magma_int_t ldda, magma_int_t *info)

 	SGESSM applies the factors L computed by SGETRF_INCPIV to a real M-by-N tile A.  More...

magma_int_t 	magma_sssssm_gpu (magma_order_t order, magma_int_t m1, magma_int_t n1, magma_int_t m2, magma_int_t n2, magma_int_t k, magma_int_t ib, float *dA1, magma_int_t ldda1, float *dA2, magma_int_t ldda2, float *dL1, magma_int_t lddl1, float *dL2, magma_int_t lddl2, magma_int_t *ipiv, magma_int_t *info)

 	SSSSSM applies the LU factorization update from a real matrix formed by a lower triangular IB-by-K tile L1 on top of a M2-by-K tile L2 to a second real matrix formed by a M1-by-N1 tile A1 on top of a M2-by-N2 tile A2 (N1 == N2).  More...

Detailed Description

Function Documentation

          magma_int_t magma_sgessm_gpu
          (
          magma_order_t
          order,

          magma_int_t
          m,

          magma_int_t
          n,

          magma_int_t
          k,

          magma_int_t
          ib,

          magma_int_t *
          ipiv,

          float *
          dL1,

          magma_int_t
          lddl1,

          float *
          dL,

          magma_int_t
          lddl,

          float *
          dA,

          magma_int_t
          ldda,

          magma_int_t *
          info

          )

SGESSM applies the factors L computed by SGETRF_INCPIV to a real M-by-N tile A.

Parameters

[in]	m	INTEGER The number of rows of the matrix A. M >= 0.

[in]	n	INTEGER The number of columns of the matrix A. N >= 0.

[in]	k	INTEGER The number of columns of the matrix L. K >= 0.

[in]	ib	INTEGER The inner-blocking size. IB >= 0.

[in]	ipiv	INTEGER array on the cpu. The pivot indices array of size K as returned by SGETRF_INCPIV.

[in]	dL1	DOUBLE COMPLEX array, dimension(LDDL1, N) The IB-by-K matrix in which is stored L^(-1) as returned by GETRF_INCPIV

[in]	lddl1	INTEGER The leading dimension of the array L1. LDDL1 >= max(1,2*IB).

[in]	dL	DOUBLE COMPLEX array, dimension(LDDL, N) The M-by-K lower triangular tile on the gpu.

[in]	lddl	INTEGER The leading dimension of the array L. LDDL >= max(1,M).

[in,out]	dA	DOUBLE COMPLEX array, dimension (LDDA, N) On entry, the M-by-N tile A on the gpu. On exit, updated by the application of L on the gpu.

[in]	ldda	INTEGER The leading dimension of the array A. LDDA >= max(1,M).

          magma_int_t magma_sssssm_gpu
          (
          magma_order_t
          order,

          magma_int_t
          m1,

          magma_int_t
          n1,

          magma_int_t
          m2,

          magma_int_t
          n2,

          magma_int_t
          k,

          magma_int_t
          ib,

          float *
          dA1,

          magma_int_t
          ldda1,

          float *
          dA2,

          magma_int_t
          ldda2,

          float *
          dL1,

          magma_int_t
          lddl1,

          float *
          dL2,

          magma_int_t
          lddl2,

          magma_int_t *
          ipiv,

          magma_int_t *
          info

          )

SSSSSM applies the LU factorization update from a real matrix formed by a lower triangular IB-by-K tile L1 on top of a M2-by-K tile L2 to a second real matrix formed by a M1-by-N1 tile A1 on top of a M2-by-N2 tile A2 (N1 == N2).

This is the right-looking Level 2.5 BLAS version of the algorithm.

Parameters

[in]	m1	INTEGER The number of rows of the matrix A1. M1 >= 0.

[in]	n1	INTEGER The number of columns of the matrix A1. N1 >= 0.

[in]	m2	INTEGER The number of rows of the matrix A2. M2 >= 0.

[in]	n2	INTEGER The number of columns of the matrix A2. N2 >= 0.

[in]	k	INTEGER The number of columns of the matrix L1 and L2. K >= 0.

[in]	ib	INTEGER The inner-blocking size. IB >= 0.

[in,out]	dA1	REAL array, dimension(LDDA1, N), on gpu. On entry, the M1-by-N1 tile dA1. On exit, dA1 is updated by the application of dL (dL1 dL2).

[in]	ldda1	INTEGER The leading dimension of the array dA1. LDDA1 >= max(1,M1).

[in,out]	dA2	REAL array, dimension(LDDA2, N), on gpu. On entry, the M2-by-N2 tile dA2. On exit, dA2 is updated by the application of dL (dL1 dL2).

[in]	ldda2	INTEGER The leading dimension of the array dA2. LDDA2 >= max(1,M2).

[in]	dL1	REAL array, dimension(LDDL1, K), on gpu. The inverse of the IB-by-K lower triangular tile as returned by STSTRF.

[in]	lddl1	INTEGER The leading dimension of the array L1. LDDL1 >= max(1,2*IB).

[in]	dL2	REAL array, dimension(LDDL2, K) The M2-by-K tile as returned by STSTRF.

[in]	lddl2	INTEGER The leading dimension of the array L2. LDDL2 >= max(1,M2).

[in]	ipiv	INTEGER array on the cpu. The pivot indices array of size K as returned by STSTRF

Generated on Fri Jul 18 2014 17:34:42 for MAGMA by

     1.8.7


text:
============================
JSON functions and operators
============================

Cast to JSON
------------

Casting from ``BOOLEAN``, ``TINYINT``, ``SMALLINT``, ``INTEGER``,
``BIGINT``, ``REAL``, ``DOUBLE`` or ``VARCHAR`` is supported.
Casting from ``ARRAY``, ``MAP`` or ``ROW`` is supported when the element type of
the array is one of the supported types, or when the key type of the map
is ``VARCHAR`` and value type of the map is one of the supported types,
or when every field type of the row is one of the supported types.
Behaviors of the casts are shown with the examples below::

    SELECT CAST(NULL AS JSON);
    -- NULL

    SELECT CAST(1 AS JSON);
    -- JSON '1'

    SELECT CAST(9223372036854775807 AS JSON);
    -- JSON '9223372036854775807'

    SELECT CAST('abc' AS JSON);
    -- JSON '"abc"'

    SELECT CAST(true AS JSON);
    -- JSON 'true'

    SELECT CAST(1.234 AS JSON);
    -- JSON '1.234'

    SELECT CAST(ARRAY[1, 23, 456] AS JSON);
    -- JSON '[1,23,456]'

    SELECT CAST(ARRAY[1, NULL, 456] AS JSON);
    -- JSON '[1,null,456]'

    SELECT CAST(ARRAY[ARRAY[1, 23], ARRAY[456]] AS JSON);
    -- JSON '[[1,23],[456]]'

    SELECT CAST(MAP(ARRAY['k1', 'k2', 'k3'], ARRAY[1, 23, 456]) AS JSON);
    -- JSON '{"k1":1,"k2":23,"k3":456}'

    SELECT CAST(CAST(ROW(123, 'abc', true) AS
                ROW(v1 BIGINT, v2 VARCHAR, v3 BOOLEAN)) AS JSON);
    -- JSON '{"v1":123,"v2":"abc","v3":true}'

Casting from NULL to ``JSON`` is not straightforward. Casting
from a standalone ``NULL`` will produce a SQL ``NULL`` instead of
``JSON 'null'``. However, when casting from arrays or map containing
``NULL``\s, the produced ``JSON`` will have ``null``\s in it.

Cast from JSON
--------------

Casting to ``BOOLEAN``, ``TINYINT``, ``SMALLINT``, ``INTEGER``,
``BIGINT``, ``REAL``, ``DOUBLE`` or ``VARCHAR`` is supported.
Casting to ``ARRAY`` and ``MAP`` is supported when the element type of
the array is one of the supported types, or when the key type of the map
is ``VARCHAR`` and value type of the map is one of the supported types.
Behaviors of the casts are shown with the examples below::

    SELECT CAST(JSON 'null' AS VARCHAR);
    -- NULL

    SELECT CAST(JSON '1' AS INTEGER);
    -- 1

    SELECT CAST(JSON '9223372036854775807' AS BIGINT);
    -- 9223372036854775807

    SELECT CAST(JSON '"abc"' AS VARCHAR);
    -- abc

    SELECT CAST(JSON 'true' AS BOOLEAN);
    -- true

    SELECT CAST(JSON '1.234' AS DOUBLE);
    -- 1.234

    SELECT CAST(JSON '[1,23,456]' AS ARRAY(INTEGER));
    -- [1, 23, 456]

    SELECT CAST(JSON '[1,null,456]' AS ARRAY(INTEGER));
    -- [1, NULL, 456]

    SELECT CAST(JSON '[[1,23],[456]]' AS ARRAY(ARRAY(INTEGER)));
    -- [[1, 23], [456]]

    SELECT CAST(JSON '{"k1":1,"k2":23,"k3":456}' AS MAP(VARCHAR, INTEGER));
    -- {k1=1, k2=23, k3=456}

    SELECT CAST(JSON '{"v1":123,"v2":"abc","v3":true}' AS
                ROW(v1 BIGINT, v2 VARCHAR, v3 BOOLEAN));
    -- {v1=123, v2=abc, v3=true}

    SELECT CAST(JSON '[123,"abc",true]' AS
                ROW(v1 BIGINT, v2 VARCHAR, v3 BOOLEAN));
    -- {value1=123, value2=abc, value3=true}

JSON arrays can have mixed element types and JSON maps can have mixed
value types. This makes it impossible to cast them to SQL arrays and maps in
some cases. To address this, Trino supports partial casting of arrays and maps::

    SELECT CAST(JSON '[[1, 23], 456]' AS ARRAY(JSON));
    -- [JSON '[1,23]', JSON '456']

    SELECT CAST(JSON '{"k1": [1, 23], "k2": 456}' AS MAP(VARCHAR, JSON));
    -- {k1 = JSON '[1,23]', k2 = JSON '456'}

    SELECT CAST(JSON '[null]' AS ARRAY(JSON));
    -- [JSON 'null']

When casting from ``JSON`` to ``ROW``, both JSON array and JSON object are supported.

JSON functions
--------------
.. function:: is_json_scalar(json) -> boolean

    Determine if ``json`` is a scalar (i.e. a JSON number, a JSON string, ``true``, ``false`` or ``null``)::

        SELECT is_json_scalar('1');         -- true
        SELECT is_json_scalar('[1, 2, 3]'); -- false

.. function:: json_array_contains(json, value) -> boolean

    Determine if ``value`` exists in ``json`` (a string containing a JSON array)::

        SELECT json_array_contains('[1, 2, 3]', 2);

.. function:: json_array_get(json_array, index) -> json

   .. warning::

       The semantics of this function are broken. If the extracted element
       is a string, it will be converted into an invalid ``JSON`` value that
       is not properly quoted (the value will not be surrounded by quotes
       and any interior quotes will not be escaped).

       We recommend against using this function. It cannot be fixed without
       impacting existing usages and may be removed in a future release.

   Returns the element at the specified index into the ``json_array``.
   The index is zero-based::

        SELECT json_array_get('["a", [3, 9], "c"]', 0); -- JSON 'a' (invalid JSON)
        SELECT json_array_get('["a", [3, 9], "c"]', 1); -- JSON '[3,9]'

   This function also supports negative indexes for fetching element indexed
   from the end of an array::

        SELECT json_array_get('["c", [3, 9], "a"]', -1); -- JSON 'a' (invalid JSON)
        SELECT json_array_get('["c", [3, 9], "a"]', -2); -- JSON '[3,9]'

   If the element at the specified index doesn't exist, the function returns null::

        SELECT json_array_get('[]', 0);                -- NULL
        SELECT json_array_get('["a", "b", "c"]', 10);  -- NULL
        SELECT json_array_get('["c", "b", "a"]', -10); -- NULL

.. function:: json_array_length(json) -> bigint

    Returns the array length of ``json`` (a string containing a JSON array)::

        SELECT json_array_length('[1, 2, 3]'); -- 3

.. function:: json_extract(json, json_path) -> json

    Evaluates the `JSONPath`_-like expression ``json_path`` on ``json``
    (a string containing JSON) and returns the result as a JSON string::

        SELECT json_extract(json, '$.store.book');
        SELECT json_extract(json, '$.store[book]');
        SELECT json_extract(json, '$.store["book name"]');

    .. _JSONPath: http://goessner.net/articles/JsonPath/

.. function:: json_extract_scalar(json, json_path) -> varchar

    Like :func:`json_extract`, but returns the result value as a string (as opposed
    to being encoded as JSON). The value referenced by ``json_path`` must be a
    scalar (boolean, number or string). ::

        SELECT json_extract_scalar('[1, 2, 3]', '$[2]');
        SELECT json_extract_scalar(json, '$.store.book[0].author');

.. function:: json_format(json) -> varchar

    Returns the JSON text serialized from the input JSON value.
    This is inverse function to :func:`json_parse`. ::

        SELECT json_format(JSON '[1, 2, 3]'); -- '[1,2,3]'
        SELECT json_format(JSON '"a"');       -- '"a"'

    .. note::

        :func:`json_format` and ``CAST(json AS VARCHAR)`` have completely
        different semantics.

        :func:`json_format` serializes the input JSON value to JSON text conforming to
        :rfc:`7159`. The JSON value can be a JSON object, a JSON array, a JSON string,
        a JSON number, ``true``, ``false`` or ``null``. ::

            SELECT json_format(JSON '{"a": 1, "b": 2}'); -- '{"a":1,"b":2}'
            SELECT json_format(JSON '[1, 2, 3]');        -- '[1,2,3]'
            SELECT json_format(JSON '"abc"');            -- '"abc"'
            SELECT json_format(JSON '42');               -- '42'
            SELECT json_format(JSON 'true');             -- 'true'
            SELECT json_format(JSON 'null');             -- 'null'

        ``CAST(json AS VARCHAR)`` casts the JSON value to the corresponding SQL VARCHAR value.
        For JSON string, JSON number, ``true``, ``false`` or ``null``, the cast
        behavior is same as the corresponding SQL type. JSON object and JSON array
        cannot be cast to VARCHAR. ::

            SELECT CAST(JSON '{"a": 1, "b": 2}' AS VARCHAR); -- ERROR!
            SELECT CAST(JSON '[1, 2, 3]' AS VARCHAR);        -- ERROR!
            SELECT CAST(JSON '"abc"' AS VARCHAR);            -- 'abc' (the double quote is gone)
            SELECT CAST(JSON '42' AS VARCHAR);               -- '42'
            SELECT CAST(JSON 'true' AS VARCHAR);             -- 'true'
            SELECT CAST(JSON 'null' AS VARCHAR);             -- NULL

.. function:: json_parse(string) -> json

    Returns the JSON value deserialized from the input JSON text.
    This is inverse function to :func:`json_format`::

        SELECT json_parse('[1, 2, 3]');   -- JSON '[1,2,3]'
        SELECT json_parse('"abc"');       -- JSON '"abc"'

    .. note::

        :func:`json_parse` and ``CAST(string AS JSON)`` have completely
        different semantics.

        :func:`json_parse` expects a JSON text conforming to :rfc:`7159`, and returns
        the JSON value deserialized from the JSON text.
        The JSON value can be a JSON object, a JSON array, a JSON string, a JSON number,
        ``true``, ``false`` or ``null``. ::

            SELECT json_parse('not_json');         -- ERROR!
            SELECT json_parse('["a": 1, "b": 2]'); -- JSON '["a": 1, "b": 2]'
            SELECT json_parse('[1, 2, 3]');        -- JSON '[1,2,3]'
            SELECT json_parse('"abc"');            -- JSON '"abc"'
            SELECT json_parse('42');               -- JSON '42'
            SELECT json_parse('true');             -- JSON 'true'
            SELECT json_parse('null');             -- JSON 'null'

        ``CAST(string AS JSON)`` takes any VARCHAR value as input, and returns
        a JSON string with its value set to input string. ::

            SELECT CAST('not_json' AS JSON);         -- JSON '"not_json"'
            SELECT CAST('["a": 1, "b": 2]' AS JSON); -- JSON '"[\"a\": 1, \"b\": 2]"'
            SELECT CAST('[1, 2, 3]' AS JSON);        -- JSON '"[1, 2, 3]"'
            SELECT CAST('"abc"' AS JSON);            -- JSON '"\"abc\""'
            SELECT CAST('42' AS JSON);               -- JSON '"42"'
            SELECT CAST('true' AS JSON);             -- JSON '"true"'
            SELECT CAST('null' AS JSON);             -- JSON '"null"'

.. function:: json_size(json, json_path) -> bigint

    Like :func:`json_extract`, but returns the size of the value.
    For objects or arrays, the size is the number of members,
    and the size of a scalar value is zero. ::

        SELECT json_size('{"x": {"a": 1, "b": 2}}', '$.x');   -- 2
        SELECT json_size('{"x": [1, 2, 3]}', '$.x');          -- 3
        SELECT json_size('{"x": {"a": 1, "b": 2}}', '$.x.a'); -- 0


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Lysee Reference Manual - Create module</title>
<link href="index.css" rel="stylesheet" type="text/css">
<link href="logo.ico" rel="Shortcut Icon">

        <PREV  HOME  NEXT>

      4.1 Lysee Reference Manual - Developments - Create module

    This page explains how to write LYSEE module with project lysee_zipper.

    4.1.1 Load zipper

          >>> import zipper;

            >>> = zipper.file;

            C:\lysee\modules\zipper.dll

          >>>

      There are the steps LYSEE load zipper module:

Search and find zipper.dll in ${search} path.

Load zipper.dll into LYSEE space.

 Setup zipper module.

 Get address of InitExchange function from zipper.dll.

 Call InitExchange with zipper module and function  QueryEntry.

        At this time, zipper.dll registers its informations into zipper module.

Setup classes, functions in zipper module with zipper's informations.

      Important:

LYSEE module must export function InitExchange.

Module must register its information (classes, function and others) in  InitExchange function.

    4.1.2 Prepare functions

      zipper exports 4 module functions:

          Name
          Description

          list
           List sub file names in a zip file

          unzip
          unzip all files

          unzipf
          unzip one file

           zip
          create zip file

      (1) Realize these functions:

procedure zipper_list(invoker: TLseInvoke);cdecl;

        procedure zipper_unzip(invoker: TLseInvoke);cdecl;

        procedure zipper_unzip_file(invoker: TLseInvoke);cdecl;

        procedure zipper_zip(invoker: TLseInvoke);cdecl;

      (2) Register these functions in array:

const

          zipper_func_count = 4;

          zipper_func_array: array[0..zipper_func_count - 1] of RLseFuncRec = (

            (fr_prot:'strlist list(string zipFile)';

             fr_addr:@zipper_list;

             fr_desc:'list sub-files in source zip file'

            ),

            (fr_prot:'void unzip(string zipFile, string outputPath)';

             fr_addr:@zipper_unzip;

             fr_desc:'unzip all files to specified path'

            ),

            (fr_prot:'void unzipf(string zipFile, string subFile, string outputPath)';

             fr_addr:@zipper_unzip_file;

             fr_desc:'unzip specified sub file'

            ),

            (fr_prot:'int zip(string zipFile, string sourceFile)';

             fr_addr:@zipper_zip;

             fr_desc:'create zip file with passed source file or LB delimited list'

            )

      );

      4.1.3 Realize InitExchange function

    The following is zipper's InitExchange function.

    procedure InitExchange(const MR: PLseModuleRec; const QE: TLseQueryEntry);cdecl;

    begin

      lse_prepare(QE);

      MR^.iw_production := 'fpc zip/unzip module for lysee';

      MR^.iw_version := LSE_VERSION;

      MR^.iw_copyright := LSE_COPYRIGHT;

      MR^.iw_desc := MR^.iw_production;

      MR^.iw_homepage := LSE_HOMEPAGE;

      MR^.iw_email := LSE_EMAIL;

      MR^.iw_libfuncs.count := zipper_func_count;

      MR^.iw_libfuncs.entry :=@zipper_func_array;

      MR^.iw_invoke :=@lse_call_gate;

    end;

    exports InitExchange;
Explains:

lse_prepare(QE);

      get and save call-into-kernel function entries.

MR^.iw_libfuncs.count := zipper_func_count;
set module function count.

MR^.iw_libfuncs.entry :=@zipper_func_array;
set module function array address.

MR^.iw_invoke :=@lse_call_gate;
tell kernel, the  module functions are TLseFuncInvoke type.

exports InitExchange;

          exports InitExchange function.

    <PREV  HOME  NEXT>


text:
require("shelljs/make")
var fs = require("fs");

target.all = function() {
  target.browser();
  target.test();
}

target.browser = function() {
  console.log("Bundling browser version..");

  var browserify = require("browserify")
    , minify = require("node-minify")
    , source = null;

  source = browserify("browser.js", {
    ignore: ["source-map"]
  }).bundle();

  fs.writeFileSync("./browser/pellets.js", source);
  new minify.minify({
    type: "gcc",
    fileIn: "./browser/pellets.js",
    fileOut: "./browser/pellets.min.js",
    callback: function(err) {
      if(err) console.error(err);
    }
  });
}

target.test = function() {
  console.log("Running tests..");
  exec("mocha --growl test/")
}


text:
#pragma once
#include <aws/apigateway/APIGateway_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/apigateway/model/ThrottleSettings.h>
#include <aws/apigateway/model/QuotaSettings.h>
#include <aws/apigateway/model/ApiStage.h>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace APIGateway
{
namespace Model
{
  /**
   *
Represents a usage plan than can specify who can assess associated API stages
   * with specified request limits and quotas.

In a
   * usage plan, you associate an API by specifying the API's Id and a stage name of
   * the specified API. You add plan customers by adding API keys to the plan.

   *

 Create
   * and Use Usage Plans

   */
  class AWS_APIGATEWAY_API GetUsagePlanResult
  {
  public:
    GetUsagePlanResult();
    GetUsagePlanResult(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    GetUsagePlanResult& operator=(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The identifier of a UsagePlan resource.

     */
    inline const Aws::String& GetId() const{ return m_id; }

    /**
     *
The identifier of a UsagePlan resource.

     */
    inline void SetId(const Aws::String& value) { m_id = value; }

    /**
     *
The identifier of a UsagePlan resource.

     */
    inline void SetId(Aws::String&& value) { m_id = value; }

    /**
     *
The identifier of a UsagePlan resource.

     */
    inline void SetId(const char* value) { m_id.assign(value); }

    /**
     *
The identifier of a UsagePlan resource.

     */
    inline GetUsagePlanResult& WithId(const Aws::String& value) { SetId(value); return *this;}

    /**
     *
The identifier of a UsagePlan resource.

     */
    inline GetUsagePlanResult& WithId(Aws::String&& value) { SetId(value); return *this;}

    /**
     *
The identifier of a UsagePlan resource.

     */
    inline GetUsagePlanResult& WithId(const char* value) { SetId(value); return *this;}

    /**
     *
The name of a usage plan.

     */
    inline const Aws::String& GetName() const{ return m_name; }

    /**
     *
The name of a usage plan.

     */
    inline void SetName(const Aws::String& value) { m_name = value; }

    /**
     *
The name of a usage plan.

     */
    inline void SetName(Aws::String&& value) { m_name = value; }

    /**
     *
The name of a usage plan.

     */
    inline void SetName(const char* value) { m_name.assign(value); }

    /**
     *
The name of a usage plan.

     */
    inline GetUsagePlanResult& WithName(const Aws::String& value) { SetName(value); return *this;}

    /**
     *
The name of a usage plan.

     */
    inline GetUsagePlanResult& WithName(Aws::String&& value) { SetName(value); return *this;}

    /**
     *
The name of a usage plan.

     */
    inline GetUsagePlanResult& WithName(const char* value) { SetName(value); return *this;}

    /**
     *
The description of a usage plan.

     */
    inline const Aws::String& GetDescription() const{ return m_description; }

    /**
     *
The description of a usage plan.

     */
    inline void SetDescription(const Aws::String& value) { m_description = value; }

    /**
     *
The description of a usage plan.

     */
    inline void SetDescription(Aws::String&& value) { m_description = value; }

    /**
     *
The description of a usage plan.

     */
    inline void SetDescription(const char* value) { m_description.assign(value); }

    /**
     *
The description of a usage plan.

     */
    inline GetUsagePlanResult& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}

    /**
     *
The description of a usage plan.

     */
    inline GetUsagePlanResult& WithDescription(Aws::String&& value) { SetDescription(value); return *this;}

    /**
     *
The description of a usage plan.

     */
    inline GetUsagePlanResult& WithDescription(const char* value) { SetDescription(value); return *this;}

    /**
     *
The associated API stages of a usage plan.

     */
    inline const Aws::Vector<ApiStage>& GetApiStages() const{ return m_apiStages; }

    /**
     *
The associated API stages of a usage plan.

     */
    inline void SetApiStages(const Aws::Vector<ApiStage>& value) { m_apiStages = value; }

    /**
     *
The associated API stages of a usage plan.

     */
    inline void SetApiStages(Aws::Vector<ApiStage>&& value) { m_apiStages = value; }

    /**
     *
The associated API stages of a usage plan.

     */
    inline GetUsagePlanResult& WithApiStages(const Aws::Vector<ApiStage>& value) { SetApiStages(value); return *this;}

    /**
     *
The associated API stages of a usage plan.

     */
    inline GetUsagePlanResult& WithApiStages(Aws::Vector<ApiStage>&& value) { SetApiStages(value); return *this;}

    /**
     *
The associated API stages of a usage plan.

     */
    inline GetUsagePlanResult& AddApiStages(const ApiStage& value) { m_apiStages.push_back(value); return *this; }

    /**
     *
The associated API stages of a usage plan.

     */
    inline GetUsagePlanResult& AddApiStages(ApiStage&& value) { m_apiStages.push_back(value); return *this; }

    /**
     *
The request throttle limits of a usage plan.

     */
    inline const ThrottleSettings& GetThrottle() const{ return m_throttle; }

    /**
     *
The request throttle limits of a usage plan.

     */
    inline void SetThrottle(const ThrottleSettings& value) { m_throttle = value; }

    /**
     *
The request throttle limits of a usage plan.

     */
    inline void SetThrottle(ThrottleSettings&& value) { m_throttle = value; }

    /**
     *
The request throttle limits of a usage plan.

     */
    inline GetUsagePlanResult& WithThrottle(const ThrottleSettings& value) { SetThrottle(value); return *this;}

    /**
     *
The request throttle limits of a usage plan.

     */
    inline GetUsagePlanResult& WithThrottle(ThrottleSettings&& value) { SetThrottle(value); return *this;}

    /**
     *
The maximum number of permitted requests per a given unit time interval.

     */
    inline const QuotaSettings& GetQuota() const{ return m_quota; }

    /**
     *
The maximum number of permitted requests per a given unit time interval.

     */
    inline void SetQuota(const QuotaSettings& value) { m_quota = value; }

    /**
     *
The maximum number of permitted requests per a given unit time interval.

     */
    inline void SetQuota(QuotaSettings&& value) { m_quota = value; }

    /**
     *
The maximum number of permitted requests per a given unit time interval.

     */
    inline GetUsagePlanResult& WithQuota(const QuotaSettings& value) { SetQuota(value); return *this;}

    /**
     *
The maximum number of permitted requests per a given unit time interval.

     */
    inline GetUsagePlanResult& WithQuota(QuotaSettings&& value) { SetQuota(value); return *this;}

  private:
    Aws::String m_id;
    Aws::String m_name;
    Aws::String m_description;
    Aws::Vector<ApiStage> m_apiStages;
    ThrottleSettings m_throttle;
    QuotaSettings m_quota;
  };

} // namespace Model
} // namespace APIGateway
} // namespace Aws


text:
curl -X PUT \
-H "Content-Type: application/json" \
'https://api.mercadopago.com/preapproval/:ID?access_token=ACCESS_TOKEN' \
-d '{"auto_recurring": {"transaction_amount": NEW_AMOUNT}}'


text:
/*
 * Author: tdanford
 * Date: Sep 16, 2008
 */
package edu.psu.compbio.seqcode.gse.viz.eye;

public interface ModelPaintablePropertyListener {
	public void propertyChanged(ModelPaintableProperty p);
}


text:
#include "tensorflow/compiler/xla/service/memory_space_assignment_utils.h"

#include "tensorflow/compiler/xla/service/hlo_casting_utils.h"
#include "tensorflow/compiler/xla/service/hlo_instructions.h"

namespace xla {

bool MemorySpaceAssignmentUtils::IsValueAllowedInAlternateMemory(
    const HloValue* value) {
  // If the buffer is a tuple, don't use this algorithm for now. The buffers
  // that are pointed to by the tuple will still use this algorithm.  Because
  // tuples are cheap to place in the alternate memory (they are just pointers)
  // we don't need to use prefetch/evict logic.
  if (value->shape().IsTuple()) {
    VLOG(4) << "Keeping value " << value->ToShortString()
            << " in default mem because it is a tuple.";
    return false;
  }

  // Don't place scalars in the alternate memory.
  if (ShapeUtil::IsEffectiveScalar(value->shape())) {
    VLOG(4) << "Keeping value " << value->ToShortString()
            << " in default mem because it is a scalar.";
    return false;
  }

  // TODO(berkin): Not allocating add-dependencies either since they need to be
  // treated specially. We should revisit this later.
  for (const HloPosition& position : value->positions()) {
    if (position.instruction->opcode() == HloOpcode::kAddDependency) {
      VLOG(4) << "Keeping value " << value->ToShortString()
              << " in default mem because it has a "
              << "add-dependency position.";
      return false;
    }
  }

  // Send and Recv HLOs return a request identifier. These should not be
  // allocated in the alternate memory.
  for (const HloPosition& position : value->positions()) {
    if ((position.instruction->opcode() == HloOpcode::kSend ||
         position.instruction->opcode() == HloOpcode::kRecv) &&
        DynCast<HloSendRecvInstruction>(position.instruction)
            ->is_host_transfer()) {
      // TODO(berkin): Host transfers using alternate memory space doesn't seem
      // to work at the moment.
      VLOG(4) << "Keeping value " << value->ToShortString()
              << " in default mem because it is a send/recv buffer used for "
                 "host transfer.";
      return false;
    }

    if (auto* custom_call =
            DynCast<HloCustomCallInstruction>(position.instruction)) {
      for (const auto& pair : custom_call->output_to_operand_aliasing()) {
        if (position.index == pair.first) {
          VLOG(4) << "Keeping value " << value->ToShortString()
                  << " in default mem because it is a custom-call output that "
                     "aliases an operand buffer.";
          return false;
        }
      }
    }
  }

  return true;
}

bool MemorySpaceAssignmentUtils::IsIntervalAllowedInAlternateMemory(
    const GlobalDecreasingSizeBestFitHeap<HloValue>::BufferInterval& interval) {
  return IsValueAllowedInAlternateMemory(interval.buffer) &&
         absl::c_all_of(interval.colocations, IsValueAllowedInAlternateMemory);
}

/*static*/ void MemorySpaceAssignmentUtils::HoistEntryParameters(
    HloModule& module) {
  CHECK(module.has_schedule());
  HloSchedule& schedule = module.schedule();
  const HloComputation* entry = module.entry_computation();
  CHECK(schedule.is_computation_scheduled(entry));
  const HloInstructionSequence& sequence = schedule.sequence(entry);
  bool hoisting_needed = false;
  int parameters_found = 0;
  for (HloInstruction* instruction : sequence.instructions()) {
    if (instruction->opcode() == HloOpcode::kParameter) {
      ++parameters_found;
    }
    if (parameters_found == entry->num_parameters()) {
      break;
    }
    if (instruction->opcode() != HloOpcode::kGetTupleElement &&
        instruction->opcode() != HloOpcode::kTuple &&
        instruction->opcode() != HloOpcode::kConstant &&
        instruction->opcode() != HloOpcode::kBitcast) {
      hoisting_needed = true;
      break;
    }
  }

  if (!hoisting_needed) {
    return;
  }
  HloInstructionSequence new_sequence;
  for (HloInstruction* parameter : entry->parameter_instructions()) {
    new_sequence.push_back(parameter);
  }
  for (HloInstruction* instruction : sequence.instructions()) {
    if (instruction->opcode() != HloOpcode::kParameter) {
      new_sequence.push_back(instruction);
    }
  }
  CHECK_EQ(new_sequence.size(), sequence.size());
  schedule.set_sequence(entry, new_sequence);
}

/*static*/ void MemorySpaceAssignmentUtils::HoistConstantOperations(
    HloModule& module) {
  CHECK(module.has_schedule());
  HloSchedule& schedule = module.schedule();
  for (const HloComputation* computation : module.MakeNonfusionComputations()) {
    CHECK(schedule.is_computation_scheduled(computation));
    const HloInstructionSequence& sequence = schedule.sequence(computation);
    // Conservatively don't modify the schedule if any instruction has a control
    // successor or predecessor on a constant op. Computations with these
    // dependencies should be very rare anyway.
    bool contains_constant_successor_or_predecessors = false;
    for (HloInstruction* instruction : sequence.instructions()) {
      if (instruction->opcode() == HloOpcode::kConstant) {
        contains_constant_successor_or_predecessors |=
            !instruction->control_predecessors().empty();
        contains_constant_successor_or_predecessors |=
            !instruction->control_successors().empty();
      } else {
        auto is_constant = [](const HloInstruction* inst) {
          return inst->opcode() == HloOpcode::kConstant;
        };
        contains_constant_successor_or_predecessors |=
            absl::c_find_if(instruction->control_predecessors(), is_constant) !=
            instruction->control_predecessors().end();
        contains_constant_successor_or_predecessors |=
            absl::c_find_if(instruction->control_successors(), is_constant) !=
            instruction->control_successors().end();
      }
    }
    if (contains_constant_successor_or_predecessors) {
      continue;
    }
    HloInstructionSequence new_sequence;

    for (HloInstruction* instruction : sequence.instructions()) {
      if (instruction->opcode() == HloOpcode::kConstant) {
        new_sequence.push_back(instruction);
      }
    }
    for (HloInstruction* instruction : sequence.instructions()) {
      if (instruction->opcode() != HloOpcode::kConstant) {
        new_sequence.push_back(instruction);
      }
    }
    CHECK_EQ(new_sequence.size(), sequence.size());
    schedule.set_sequence(computation, new_sequence);
  }
}

}  // namespace xla


text:
package com.xix.cleanMvpArchitecture.presentation;

import com.xix.cleanMvpArchitecture.domain.PostExecutionThread;
import io.reactivex.Scheduler;
import io.reactivex.android.schedulers.AndroidSchedulers;
import javax.inject.Inject;
import javax.inject.Singleton;

/**
 * Created by xix on 4/8/17.
 */

@Singleton
public class UIThread implements PostExecutionThread {

    @Inject public UIThread() {
    }

    @Override public Scheduler getScheduler() {
        return AndroidSchedulers.mainThread();
    }
}


text:
module Sequel
  # Yield the Inflections module if a block is given, and return
  # the Inflections module.
  def self.inflections
    yield Inflections if block_given?
    Inflections
  end

  # This module acts as a singleton returned/yielded by Sequel.inflections,
  # which is used to override or specify additional inflection rules
  # for Sequel. Examples:
  #
  #   Sequel.inflections do |inflect|
  #     inflect.plural /^(ox)$/i, '\1\2en'
  #     inflect.singular /^(ox)en/i, '\1'
  #
  #     inflect.irregular 'octopus', 'octopi'
  #
  #     inflect.uncountable "equipment"
  #   end
  #
  # New rules are added at the top. So in the example above, the irregular rule for octopus will now be the first of the
  # pluralization and singularization rules that is runs. This guarantees that your rules run before any of the rules that may
  # already have been loaded.
  module Inflections
    CAMELIZE_CONVERT_REGEXP = /(^|_)(.)/.freeze
    CAMELIZE_MODULE_REGEXP = /\/(.?)/.freeze
    DASH = '-'.freeze
    DEMODULIZE_CONVERT_REGEXP = /^.*::/.freeze
    EMPTY_STRING= ''.freeze
    SLASH = '/'.freeze
    VALID_CONSTANT_NAME_REGEXP = /\A(?:::)?([A-Z]\w*(?:::[A-Z]\w*)*)\z/.freeze
    UNDERSCORE = '_'.freeze
    UNDERSCORE_CONVERT_REGEXP1 = /([A-Z]+)([A-Z][a-z])/.freeze
    UNDERSCORE_CONVERT_REGEXP2 = /([a-z\d])([A-Z])/.freeze
    UNDERSCORE_CONVERT_REPLACE = '\1_\2'.freeze
    UNDERSCORE_MODULE_REGEXP = /::/.freeze

    @plurals, @singulars, @uncountables = [], [], []

    class << self
      attr_reader :plurals, :singulars, :uncountables
    end

    # Clears the loaded inflections within a given scope (default is :all). Give the scope as a symbol of the inflection type,
    # the options are: :plurals, :singulars, :uncountables
    #
    # Examples:
    #   clear :all
    #   clear :plurals
    def self.clear(scope = :all)
      case scope
      when :all
        @plurals, @singulars, @uncountables = [], [], []
      else
        instance_variable_set("@#{scope}", [])
      end
    end

    # Specifies a new irregular that applies to both pluralization and singularization at the same time. This can only be used
    # for strings, not regular expressions. You simply pass the irregular in singular and plural form.
    #
    # Examples:
    #   irregular 'octopus', 'octopi'
    #   irregular 'person', 'people'
    def self.irregular(singular, plural)
      plural(Regexp.new("(#{singular[0,1]})#{singular[1..-1]}$", "i"), '\1' + plural[1..-1])
      singular(Regexp.new("(#{plural[0,1]})#{plural[1..-1]}$", "i"), '\1' + singular[1..-1])
    end

    # Specifies a new pluralization rule and its replacement. The rule can either be a string or a regular expression.
    # The replacement should always be a string that may include references to the matched data from the rule.
    #
    # Example:
    #   plural(/(x|ch|ss|sh)$/i, '\1es')
    def self.plural(rule, replacement)
      @plurals.insert(0, [rule, replacement])
    end

    # Specifies a new singularization rule and its replacement. The rule can either be a string or a regular expression.
    # The replacement should always be a string that may include references to the matched data from the rule.
    #
    # Example:
    #   singular(/([^aeiouy]|qu)ies$/i, '\1y')
    def self.singular(rule, replacement)
      @singulars.insert(0, [rule, replacement])
    end

    # Add uncountable words that shouldn't be attempted inflected.
    #
    # Examples:
    #   uncountable "money"
    #   uncountable "money", "information"
    #   uncountable %w( money information rice )
    def self.uncountable(*words)
      (@uncountables << words).flatten!
    end

    # Setup the default inflections
    # Commented out until the deprecated inflector is removed
=begin
    plural(/$/, 's')
    plural(/s$/i, 's')
    plural(/(ax|test)is$/i, '\1es')
    plural(/(octop|vir)us$/i, '\1i')
    plural(/(alias|status)$/i, '\1es')
    plural(/(bu)s$/i, '\1ses')
    plural(/(buffal|tomat)o$/i, '\1oes')
    plural(/([ti])um$/i, '\1a')
    plural(/sis$/i, 'ses')
    plural(/(?:([^f])fe|([lr])f)$/i, '\1\2ves')
    plural(/(hive)$/i, '\1s')
    plural(/([^aeiouy]|qu)y$/i, '\1ies')
    plural(/(x|ch|ss|sh)$/i, '\1es')
    plural(/(matr|vert|ind)ix|ex$/i, '\1ices')
    plural(/([m|l])ouse$/i, '\1ice')
    plural(/^(ox)$/i, '\1en')
    plural(/(quiz)$/i, '\1zes')

    singular(/s$/i, '')
    singular(/(n)ews$/i, '\1ews')
    singular(/([ti])a$/i, '\1um')
    singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '\1\2sis')
    singular(/(^analy)ses$/i, '\1sis')
    singular(/([^f])ves$/i, '\1fe')
    singular(/(hive)s$/i, '\1')
    singular(/(tive)s$/i, '\1')
    singular(/([lr])ves$/i, '\1f')
    singular(/([^aeiouy]|qu)ies$/i, '\1y')
    singular(/(s)eries$/i, '\1eries')
    singular(/(m)ovies$/i, '\1ovie')
    singular(/(x|ch|ss|sh)es$/i, '\1')
    singular(/([m|l])ice$/i, '\1ouse')
    singular(/(bus)es$/i, '\1')
    singular(/(o)es$/i, '\1')
    singular(/(shoe)s$/i, '\1')
    singular(/(cris|ax|test)es$/i, '\1is')
    singular(/(octop|vir)i$/i, '\1us')
    singular(/(alias|status)es$/i, '\1')
    singular(/^(ox)en/i, '\1')
    singular(/(vert|ind)ices$/i, '\1ex')
    singular(/(matr)ices$/i, '\1ix')
    singular(/(quiz)zes$/i, '\1')

    irregular('person', 'people')
    irregular('man', 'men')
    irregular('child', 'children')
    irregular('sex', 'sexes')
    irregular('move', 'moves')

    uncountable(%w(equipment information rice money species series fish sheep))
=end

    private

    # Convert the given string to CamelCase.  Will also convert '/' to '::' which is useful for converting paths to namespaces.
    def camelize(s)
      s = s.to_s
      # return s.camelize if s.respond_to?(:camelize)
      s = s.gsub(CAMELIZE_MODULE_REGEXP){|x| "::#{x[-1..-1].upcase unless x == SLASH}"}.gsub(CAMELIZE_CONVERT_REGEXP){|x| x[-1..-1].upcase}
      s
    end

    # Tries to find a declared constant with the name specified
    # in the string. It raises a NameError when the name is not in CamelCase
    # or is not initialized.
    def constantize(s)
      s = s.to_s
      # return s.constantize if s.respond_to?(:constantize)
      raise(NameError, "#{inspect} is not a valid constant name!") unless m = VALID_CONSTANT_NAME_REGEXP.match(s.to_s)
      Object.module_eval("::#{m[1]}", __FILE__, __LINE__)
    end

    # Removes the module part from the expression in the string
    def demodulize(s)
      s = s.to_s
      # return s.demodulize if s.respond_to?(:demodulize)
      s.gsub(DEMODULIZE_CONVERT_REGEXP, EMPTY_STRING)
    end

    # Returns the plural form of the word in the string.
    def pluralize(s)
      s = s.to_s
      # return s.pluralize if s.respond_to?(:pluralize)
      result = s.dup
      Inflections.plurals.each{|(rule, replacement)| break if result.gsub!(rule, replacement)} unless Inflections.uncountables.include?(s.downcase)
      result
    end

    # The reverse of pluralize, returns the singular form of a word in a string.
    def singularize(s)
      s = s.to_s
      # return s.singularize if s.respond_to?(:singularize)
      result = s.dup
      Inflections.singulars.each{|(rule, replacement)| break if result.gsub!(rule, replacement)} unless Inflections.uncountables.include?(s.downcase)
      result
    end

    # The reverse of camelize. Makes an underscored form from the expression in the string.
    # Also changes '::' to '/' to convert namespaces to paths.
    def underscore(s)
      s = s.to_s
      # return s.underscore if s.respond_to?(:underscore)
      s.gsub(UNDERSCORE_MODULE_REGEXP, SLASH).gsub(UNDERSCORE_CONVERT_REGEXP1, UNDERSCORE_CONVERT_REPLACE).
        gsub(UNDERSCORE_CONVERT_REGEXP2, UNDERSCORE_CONVERT_REPLACE).tr(DASH, UNDERSCORE).downcase
    end
  end
end


text:
package com.thebluealliance.androidclient.accounts;

import android.content.Context;
import android.os.AsyncTask;
import android.os.Handler;
import android.util.Log;
import android.widget.Toast;

import com.appspot.tbatv_prod_hrd.tbaMobile.TbaMobile;
import com.appspot.tbatv_prod_hrd.tbaMobile.model.ModelsMobileApiMessagesBaseResponse;
import com.appspot.tbatv_prod_hrd.tbaMobile.model.ModelsMobileApiMessagesModelPreferenceMessage;
import com.google.gson.JsonObject;
import com.thebluealliance.androidclient.Constants;
import com.thebluealliance.androidclient.R;
import com.thebluealliance.androidclient.datafeed.Database;
import com.thebluealliance.androidclient.datafeed.JSONManager;
import com.thebluealliance.androidclient.gcm.GCMAuthHelper;
import com.thebluealliance.androidclient.helpers.ModelHelper;
import com.thebluealliance.androidclient.helpers.ModelNotificationFavoriteSettings;
import com.thebluealliance.androidclient.helpers.MyTBAHelper;
import com.thebluealliance.androidclient.interfaces.ModelSettingsCallbacks;
import com.thebluealliance.androidclient.models.Favorite;
import com.thebluealliance.androidclient.models.Subscription;

import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * File created by phil on 8/2/14.
 */
public class UpdateUserModelSettings extends AsyncTask<String, Void, UpdateUserModelSettings.Result> {

    protected enum Result {
        SUCCESS, NOOP, ERROR
    }

    private Context context;
    private ModelNotificationFavoriteSettings settings;

    // We use a WeakReference so that the Activity can be garbage-collected if need be.
    private WeakReference<ModelSettingsCallbacks> callbacks;

    public UpdateUserModelSettings(Context context, ModelNotificationFavoriteSettings settings) {
        this.context = context;
        this.settings = settings;
    }

    public void setCallbacks(ModelSettingsCallbacks callbacks) {
        this.callbacks = new WeakReference<>(callbacks);
    }

    @Override
    protected Result doInBackground(String... params) {
        String modelKey = settings.modelKey;
        List<String> notifications = settings.enabledNotifications;
        boolean isFavorite = settings.isFavorite;

        String user = AccountHelper.getSelectedAccount(context);
        String key = MyTBAHelper.createKey(user, modelKey);
        ModelHelper.MODELS modelType = settings.modelType;

        ModelsMobileApiMessagesModelPreferenceMessage request = new ModelsMobileApiMessagesModelPreferenceMessage();
        request.setModelKey(modelKey);
        request.setDeviceKey(GCMAuthHelper.getRegistrationId(context));
        request.setNotifications(notifications);
        request.setFavorite(isFavorite);
        request.setModelType(Long.valueOf(settings.modelType.getEnum()));

        Database.Subscriptions subscriptionsTable = Database.getInstance(context).getSubscriptionsTable();
        Database.Favorites favoritesTable = Database.getInstance(context).getFavoritesTable();

        // Determine if we have to do anything
        List<String> existingNotificationsList = new ArrayList<>();
        Subscription existingSubscription = subscriptionsTable.get(key);
        if (existingSubscription != null) {
            existingNotificationsList = existingSubscription.getNotificationList();
        }

        Collections.sort(notifications);
        Collections.sort(existingNotificationsList);

        Log.d(Constants.LOG_TAG, "New notifications: " + notifications.toString());
        Log.d(Constants.LOG_TAG, "Existing notifications: " + existingNotificationsList.toString());

        boolean notificationsHaveChanged = !(notifications.equals(existingNotificationsList));

        // If the user is requesting a favorite and is already a favorite,
        // or if the user is requesting an unfavorite and it is already not a favorite,
        // and if the existing notification settings equal the new ones, do nothing.
        if (((isFavorite && favoritesTable.exists(key)) || (!isFavorite && !favoritesTable.exists(key))) && !notificationsHaveChanged) {
            // nothing has changed, no-op
            return Result.NOOP;
        } else {
            try {
                TbaMobile service = AccountHelper.getAuthedTbaMobile(context);
                if (service == null) {
                    Log.e(Constants.LOG_TAG, "Couldn't get TBA Mobile Service");
                    Handler mainHandler = new Handler(context.getMainLooper());
                    mainHandler.post(new Runnable() {
                        @Override
                        public void run() {
                            Toast.makeText(context, context.getString(R.string.mytba_error_no_account), Toast.LENGTH_SHORT).show();
                        }
                    });
                    return Result.ERROR;
                }
                ModelsMobileApiMessagesBaseResponse response = service.model().setPreferences(request).execute();
                Log.d(Constants.LOG_TAG, "Result: " + response.getCode() + "/" + response.getMessage());
                if (response.getCode() == 401) {
                    Log.e(Constants.LOG_TAG, response.getMessage());
                    return Result.ERROR;
                }
                JsonObject responseJson = JSONManager.getasJsonObject(response.getMessage());
                JsonObject fav = responseJson.get("favorite").getAsJsonObject(),
                        sub = responseJson.get("subscription").getAsJsonObject();
                int favCode = fav.get("code").getAsInt(),
                        subCode = sub.get("code").getAsInt();
                if (subCode == 200) {
                    // Request was successful, update the local databases
                    if (notifications.isEmpty()) {
                        subscriptionsTable.remove(key);
                    } else if (subscriptionsTable.exists(key)) {
                        subscriptionsTable.update(key, new Subscription(user, modelKey, notifications, modelType.getEnum()));
                    } else {
                        subscriptionsTable.add(new Subscription(user, modelKey, notifications, modelType.getEnum()));
                    }
                } else if (subCode == 500) {
                    Toast.makeText(context, String.format(context.getString(R.string.mytba_error), subCode, sub.get("message").getAsString()), Toast.LENGTH_SHORT).show();
                }
                // otherwise, we tried to add a favorite that already exists or remove one that didn't
                // so the database doesn't need to be changed

                if (favCode == 200) {
                    if (!isFavorite) {
                        favoritesTable.remove(key);
                    } else if (favoritesTable.exists(key)) {
                        // Already favorited, do nothing
                    } else {
                        favoritesTable.add(new Favorite(user, modelKey, modelType.getEnum()));
                    }
                } else if (favCode == 500) {
                    Toast.makeText(context, String.format(context.getString(R.string.mytba_error), favCode, fav.get("message").getAsString()), Toast.LENGTH_SHORT).show();
                }
                return Result.SUCCESS;

            } catch (IOException e) {
                Log.e(Constants.LOG_TAG, "IO Exception while updating model preferences!");
                e.printStackTrace();
                return Result.ERROR;
            }
        }
    }

    @Override
    protected void onPostExecute(Result result) {
        super.onPostExecute(result);

        if (callbacks.get() != null) {
            ModelSettingsCallbacks cb = callbacks.get();
            switch (result) {
                case SUCCESS:
                    cb.onSuccess();
                    break;
                case NOOP:
                    cb.onNoOp();
                    break;
                case ERROR:
                    cb.onError();
                    break;
            }
        } else {
            Toast.makeText(context, "Callbacks were null", Toast.LENGTH_SHORT).show();
        }
    }
}


text:
package test.jmock;

public class ToDo
{
    //TODO Rename Mock to MockObjectBuilder [OPEN TO DISCUSSION]
    //TODO Rename proxy() to mock()
    //TODO Extract org.jmock.MockObjectBuilder interface and move class to org.jmock.builder

    //Source cleanup prior to version 1.0 alpha
    //TODO RESOLVE ALL TO-DO COMMENTS
    //TODO JavaDoc interfaces and those classes that need it.

    //-----------------------------------------------------------------------------------------
    // Tasks completed

    //DONE Implement matchers for call ordering.
    //DONE Add invokedMethod to builder API for ordering calls across mocks
    //DONE Extract NoArgs and AnyArgs matcher classes from C
    //DONE Stop core packages relying on C
    //DONE Put low-level hook methods into builder interfaces
    //DONE Sensible default: If no expectation/match setup, invocation should produce no-op instead of fail.
    //  - this is to be dropped following user feedback
    //DONE When no args specified in dynamock.Mock, use ANY-args instead of NO-args.
    //  - dropped methods without arg specification in dynamock because of this ambiguity
    //DONE Expose setDefaultStub through high-level API
    //DONE Default result stub should return zero-length arrays for array types
    //DONE Make name of mock more visible in error messages
    //DONE ExpectNotCalled (or equivalent) makes tests more expressive.
    //DONE CoreMock should implement the hashCode invokedMethod for proxies
    //DONE new hotmock syntax for expects and stubs
    //DONE new hotmock syntax for expectNotCalled
    //DONE moved expect(...) and stub() to beginning of expectation statement
    //DONE demote dynamock API to an optional extension
    //DONE move default behaviour of default result stub into constructor
    //DONE reorganise directories. Change src/{framework,acceptance-tests} to core/{src,acceptance-tests}.
    //DONE open hooks to allow different proxying mechanisms to reuse CoreMock implementation
    //DONE Extract Describable interface. Priority one!
    //DONE Better format for expected calls in error messages
    //      - make expected and actual call signatures look similar
    //DONE Removed dynamock API.
    //      - if anybody wants it they can pull it out of CVS and maintain it as an extension
    //DONE Test error message on verify failure
    //DONE Good names for high-level and low-level API packages
    //DONE Remove pending from BuilderId stuff. Complain if a matcher specifies an after clause for itself.
    //DONE Remove deprecated methods
    //DONE make constraints SelfDescribing
    //DONE Create mock(...) methods in MockObjectTestCase
    //DONE Move generation of mock name to MockObjectTestCase (or support test case)
    //DONE Good error reporting (i.e. more than just a ClassCastException) when the type of a returned object is wrong.
    //DONE Ditto for thrown exceptions
    //DONE roll returnValues into main branch (see MockObjectTestCase.onConsecutiveCalls).
    //DONE Add copyright comments to files
    //DONE Reformat all source
    //DONE Refactor CoreMock test cases to remove duplication

    //-----------------------------------------------------------------------------------------
    // Post 1.0 tasks

    //TODO Clean up org.jmock.expectation package.
    //TODO Make jmock.expectation package use Constraints instead of calling equals on expected value
    //TODO Remove getters from Invocation (?)
    //TODO Extract interface from Invocation class (?)
    //TODO for trainer syntax: ((Thingy)mock.will(returnValue(10)).after("prev").id("asdad").train()),doIt(); ??
    //TODO on failure, show previous invocations for all Mocks within test?
    //TODO Extract construction and verification of mock objects into verifiable MockFactory class.
}


text:
			<a itemprop="url" href="<?php echo HTTP; ?>">
				ホーム

			<a itemprop="url" href="<?php echo HTTP; ?>help/">

				Sharetube ヘルプセンター

				新しいテーマを作ることはできますか?

新しいテーマを作ることはできますか?

もちろんできます。Sharetubeにないテーマを挿入してまとめ(記事)を作成しますとそのテーマのページが自動生成される仕組みとなっております。


text:
from setuptools import setup

import django_pylibmc

setup(
    name='django-pylibmc',
    version=django_pylibmc.__version__,
    description='Django cache backend using pylibmc',
    long_description=open('README.rst').read(),
    author='Jeff Balogh',
    author_email='jbalogh@mozilla.com',
    url='http://github.com/jbalogh/django-pylibmc',
    license='BSD',
    packages=['django_pylibmc'],
    include_package_data=True,
    zip_safe=False,
    install_requires=['pylibmc', 'Django>=1.2'],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        # I don't know what exactly this means, but why not?
        'Environment :: Web Environment :: Mozilla',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ]
)


text:
#ifndef JSONObject_h
#define JSONObject_h

#include "JSObject.h"

namespace JSC {

    class Stringifier;

    class JSONObject : public JSNonFinalObject {
    public:
        typedef JSNonFinalObject Base;

        static JSONObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
        {
            JSONObject* object = new (NotNull, allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure);
            object->finishCreation(globalObject);
            return object;
        }

        static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
        {
            return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
        }

        DECLARE_INFO;

    protected:
        void finishCreation(JSGlobalObject*);
        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags;

    private:
        JSONObject(JSGlobalObject*, Structure*);
        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);

    };

    JS_EXPORT_PRIVATE JSValue JSONParse(ExecState*, const String&);
    String JSONStringify(ExecState*, JSValue, unsigned indent);

} // namespace JSC

#endif // JSONObject_h


text:
import { Router } from 'express';
// import { version } from '../../package.json';

function socketConnect(socket) {
  socket.emit('news', { hello: 'world' });
  socket.on('my other event', data => console.log(data)); // eslint-disable-line
}

export default (io) => {
  const controller = new Router();

  controller.get('/', (req, res) => {
    res.json({ cat: 'dog' }); // eslint-disable-line
  });

  controller.get('/hello', (req, res) => {
    res.json({ message: 'hello' });
  });

  controller.get('/home', (req, res) => {
    res.render('home', { url: req.originalUrl });
  });

  io.on('connection', socketConnect);

  return controller;
};


text:
import { NotFoundModule } from './not-found.module';

describe('NotFoundModule', () => {
  let notFoundModule: NotFoundModule;

  beforeEach(() => {
    notFoundModule = new NotFoundModule();
  });

  it('should create an instance', () => {
    expect(notFoundModule).toBeTruthy();
  });
});


text:
package dgi.soap.rut;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="Data" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "data"
})
@XmlRootElement(name = "WS_PersonaGetActEmpresarial.ExecuteResponse")
public class WSPersonaGetActEmpresarialExecuteResponse {

    @XmlElement(name = "Data", required = true)
    protected String data;

    /**
     * Gets the value of the data property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getData() {
        return data;
    }

    /**
     * Sets the value of the data property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setData(String value) {
        this.data = value;
    }

}


text:
PYTHON_VERSION="3.10"
INSTALL_DIR="/Users/$(whoami)/git/osgeo"
LOG_DIR="/Users/$(whoami)/git/minus34/gnaf-loader/testing/geoparquet"

echo "-------------------------------------------------------------------------"
echo "Installing CMake and prerequisites"
echo "-------------------------------------------------------------------------"

## get Homebrew packages
#brew update
#brew install openssl cmake apache-arrow protobuf sqlite proj tiledb-inc/stable/tiledb

# WARNING - removes existing environment
conda deactivate
conda env remove --name gdal

# update Conda platform & install Mamba (much faster package installer)
conda update -n base conda
conda install -y -c conda-forge mamba -n base

# Create Conda environment
conda create -y -n gdal python=${PYTHON_VERSION}

# activate and setup env
conda activate gdal
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict

# reactivate for env vars to take effect
conda activate gdal

mamba install --yes --quiet curl libiconv icu git swig numpy pytest zlib clcache
#mamba install --yes --quiet -c conda-forge compilers
mamba install --yes --quiet -c conda-forge \
    cmake proj geos protobuf arrow-cpp hdf4 hdf5 \
    libnetcdf openjpeg poppler libtiff libpng xerces-c expat libxml2 kealib json-c \
    cfitsio freexl geotiff jpeg libpq libspatialite libwebp-base pcre postgresql \
    sqlite tiledb zstd charls cryptopp cgal librttopo libkml openssl xz

echo "-------------------------------------------------------------------------"
echo "Downloading GDAL source code"
echo "-------------------------------------------------------------------------"

cd ${HOME}

# WARNING: delete existing source code & build directory
rm -rf "${INSTALL_DIR}/gdal"

# get GitHub repo
mkdir -p "${INSTALL_DIR}"
cd "${INSTALL_DIR}"
git clone https://github.com/OSGeo/gdal.git

mkdir -p "${INSTALL_DIR}/gdal/build"

echo "-------------------------------------------------------------------------"
echo "Building GDAL with Parquet support"
echo "-------------------------------------------------------------------------"

cd "${INSTALL_DIR}/gdal/build"

# TODO: need to edit package version numbers in future
#cmake -DCMAKE_PREFIX_PATH="/usr/local/Cellar/apache-arrow/8.0.0_1/lib;/usr/local/Cellar/protobuf/3.19.4;/usr/local/Cellar/openssl@3/3.0.3;/usr/local/Cellar/sqlite/3.38.5;/usr/local/Cellar/tiledb/2.5.0" \
#      -DPROJ_INCLUDE_DIR="/usr/local/Cellar/proj/9.0.0_1/include" \
#      -DPython_ROOT=""
#      .. | tee ${LOG_DIR}/xx_gdal_nightly_build_1.log
#cmake --build . | tee ${LOG_DIR}/xx_gdal_nightly_build_2.log
#cmake --build . --target install | tee ${LOG_DIR}/xx_gdal_nightly_build_3.log

cmake .. -DCMAKE_PREFIX_PATH:FILEPATH="%CONDA_PREFIX%" | tee ${LOG_DIR}/xx_gdal_nightly_build_1.log
cmake --build . | tee ${LOG_DIR}/xx_gdal_nightly_build_2.log
cmake --build . --target install | tee ${LOG_DIR}/xx_gdal_nightly_build_3.log


text:
ListsEditListPhotoSelectorModalView = Backbone.View.extend({
    events: {
    },

    initialize: function () {
        this.render();

        this.list_edit_upload_image_form_view = new ListsEditListPhotoUploadImageFormView({
            model: this.model,
            el: '#upload_image_form_container',
        });

        this.list_edit_user_images_list_view = new ListsEditListPhotoUserImagesListView({
            model: this.model,
            el: '#user_images_list',
        });
    },

    render: function () {
        this.$el.html(render('lists/edit_list_photo_selector_modal', this.model));
    }
});


text:
var ng;
dir = [];

//////////////////////////////////////
// Chart Directives
//
// This file defines Angular directives
// that use D3 to draw charts.
//

ng = a.directive('staticDonutHead', function($compile) {

    function link(scope, element, attr) {

        var el = element[0];

        $(el).empty();

        var dir = $("div#donut_title");

        var h1 = $("<h1 />");

        var b = $("<b />")
            .text("Static Donut Chart Example")
            .appendTo(h1);

        h1.appendTo(dir);

    }
    return {
        restrict: "E",
        link: link,
        scope: {}
    }
});
dir.push(ng);

/*
///////////////////////////////////////////////
// Plain Chart Controls

ng = a.directive('staticDonutControlssliderSunburstControls', function($compile) {

    function link(scope, element, attr) {

        pscope = scope.$parent;

        var el = $("div#sunburst_controls");

        pscope.countval_btn = "count";
        pscope.countval_current = "magnitude";

        var div = $("<div />");

        var alrt_t = $("<p />")
            .html("Data is currently binned by [[countval_current]].")
            .appendTo(div);

        var alrt_p = $("<p />").appendTo(alrt_t);

        var alrt_b = $("<a />", {
                "class" : "btn btn-large btn-default",
                "countval" : ""
            })
            .html("Group by [[countval_btn]]")
            .appendTo(alrt_p);

        angular.element(el).append($compile(div)(pscope));

    }
    return {
        restrict: "E",
        link: link,
        scope: {}
    }
});
dir.push(ng);
*/

/*

///////////////////////////////////////////////
// Plain Sunburst Control action directive

ng = a.directive("countval", function($compile){
    return function(pscope, element, attrs){
        element.bind("click", function(){

            console.log('clicked countval switch.');

            if( pscope.countval_btn=="magnitude" ) {
                pscope.countval_btn = "count";
            } else if( pscope.countval_btn=="count" ) {
                pscope.countval_btn = "magnitude";
            }

            if( pscope.countval_current=="magnitude" ) {
                pscope.countval_current = "count";
            } else if( pscope.countval_current=="count" ) {
                pscope.countval_current = "magnitude";
            }

            var key = pscope.countval_current;

            console.log('updating filter on key '+key);

            pscope.updateFilter(key)

            pscope.$apply();

        });
    }
});
dir.push(ng);

*/

///////////////////////////////////////////////
// Panels

ng = a.directive('staticDonutPanels', function($compile) {

    function link(scope, element, attr) {

        var el = element[0];

        var pscope = scope.$parent;

        // --------------------------
        // add display for details
        // about current mouseover selection

        // assemble the tags,
        // then compile the html
        // select element of interest with angular.element
        // and append the compiled tags
        //
        var br = $("<br />").appendTo(el);

        var panel = $("<div />", {
                "class" : "panel panel-primary",
                "id" : "first"
            });

        var panelhead = $("<div />", {
                "class" : "panel-heading"
            }).appendTo(panel);

        var h3 = $("<h3 />", {
                "class" : "panel-title"
            }).text("Current ICD 10 Code")
            .appendTo(panelhead);

        var panelbody = $("<div />", {
                "class" : "panel-body"
            }).appendTo(panel);

        var maindiv = $("<div />", {
            }).appendTo(panelbody);

        var h = $("<h3 />")
            .html("ICD 10 Code: [[icd10code]]")
            .appendTo(maindiv);

        var de = $("<p />", {
            "class" : "lead" })
            .html("Description: [[description]]")
            .appendTo(maindiv);

        angular.element(el).prepend($compile(panel)(pscope));

    }

    return {
        link: link,
        restrict: "E",
        scope: { }
    };
});
dir.push(ng);

///////////////////////////////////////////////
// Chart

ng = a.directive('staticDonutChart', function($compile) {

    function link(scope, element, attr) {

        scope.$parent.$watch('staticData',doStuff);

        function doStuff() {
            if(!scope.$parent.staticData) { return }
            buildChart(element, scope.$parent);
        }

    };

    function buildChart(element,pscope) {

        /////////////////////////////////////////
        // Create chart
        //
        // data has not been loaded yet.
        // start by initializing variables
        // that don't depend on the data.

        var chart = $("div#staticdonut_chart");
        chart.empty();

        ///////////////////////////////////
        // now draw the svg with d3

        // ---------------
        // the chart itself:

        var margin = {
            top:    10,
            right:  40,
            bottom: 10,
            left:   40
        };

        var width   = 400 - margin.right - margin.left,
            height  = 400 - margin.top   - margin.bottom;

        var radius = Math.min(width, height) / 2;

        var x = d3.scale.linear()
            .range([0, 2 * Math.PI]);

        var y = d3.scale.sqrt()
            .range([0, radius]);

        var svg = d3.select("div#staticdonut_chart").append("svg")
            .attr("width", width)
            .attr("height", height)
            .append("g")
            .attr("transform", "translate(" + width / 2 + "," + (height / 2 + 10) + ")");

        // ---------------
        // chart-specific,
        // data-independent variables:

        // (example: if you have a custom sort method...)

        // Sunburst needs these to be functions,
        // donut chart does not.
        var arc = d3.svg.arc()
            .outerRadius(radius - 10)
            .innerRadius(radius - 70);

        var colors = {
            "M" : "#5687d1",
            "F" : "#e377c2",
            "None" : "#bbbbbb"
        };

        // ------------------
        // if you build it,
        // you must update it.
        updateChart();

        // ------------------
        // update chart
        function updateChart() {

            var data = pscope.staticData;

            var pie = d3.layout.pie()
                .sort(null)
                .value(function(d) {
                    return +d.value;
                });

            var g = svg.selectAll(".arc")
                .data(pie(data))
              .enter().append("g")
                .attr("class", "arc");

            g.append("path")
                .attr("d", arc)
                .style("fill", function(d) { return colors[d.data.label]; })

            g.append("text")
                .attr("transform", function(d) { return "translate(" + arc.centroid(d) + ")"; })
                .attr("dy", ".35em")
                .text(function(d) { return d.data.label; });

        }

    }

    return {
        link: link,
        restrict: "E",
        scope: { }
    };
});
dir.push(ng);