text:
package org.apereo.cas.shell.commands.properties;

import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.config.YamlProcessor;
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
import org.springframework.core.io.FileSystemResource;
import org.springframework.shell.standard.ShellCommandGroup;
import org.springframework.shell.standard.ShellComponent;
import org.springframework.shell.standard.ShellMethod;
import org.springframework.shell.standard.ShellOption;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.Comparator;
import java.util.Map;
import java.util.Properties;
import java.util.stream.Collectors;

/**
 * This is {@link AddPropertiesToConfigurationCommand}.
 *
 * @author Misagh Moayyed
 * @since 5.2.0
 */
@ShellCommandGroup("CAS Properties")
@ShellComponent
@Slf4j
public class AddPropertiesToConfigurationCommand {
    /**
     * Add properties to configuration.
     *
     * @param file  the file
     * @param group the group
     * @throws Exception the exception
     */
    @ShellMethod(key = "add-properties", value = "Add properties associated with a CAS group/module to a Properties/Yaml configuration file.")
    public void add(
        @ShellOption(value = {"file"},
            help = "Path to the CAS configuration file",
            defaultValue = "/etc/cas/config/cas.properties") final String file,
        @ShellOption(value = {"group"},
            help = "Group/module whose associated settings should be added to the CAS configuration file") final String group) throws Exception {

        if (StringUtils.isBlank(file)) {
            LOGGER.warn("Configuration file must be specified");
            return;
        }

        val filePath = new File(file);
        if (filePath.exists() && (filePath.isDirectory() || !filePath.canRead() || !filePath.canWrite())) {
            LOGGER.warn("Configuration file [{}] is not readable/writable or is not a path to a file", filePath.getCanonicalPath());
            return;
        }

        val results = findProperties(group);
        LOGGER.info("Located [{}] properties matching [{}]", results.size(), group);

        switch (FilenameUtils.getExtension(filePath.getName()).toLowerCase()) {
            case "properties":
                createConfigurationFileIfNeeded(filePath);
                val props = loadPropertiesFromConfigurationFile(filePath);
                writeConfigurationPropertiesToFile(filePath, results, props);
                break;
            case "yml":
                createConfigurationFileIfNeeded(filePath);
                val yamlProps = loadYamlPropertiesFromConfigurationFile(filePath);
                writeYamlConfigurationPropertiesToFile(filePath, results, yamlProps);
                break;
            default:
                LOGGER.warn("Configuration file format [{}] is not recognized", filePath.getCanonicalPath());
        }

    }

    private void writeYamlConfigurationPropertiesToFile(final File filePath, final Map<String, ConfigurationMetadataProperty> results,
                                                        final Properties yamlProps) throws Exception {
        val options = new DumperOptions();
        options.setDefaultFlowStyle(DumperOptions.FlowStyle.AUTO);
        options.setDefaultScalarStyle(DumperOptions.ScalarStyle.PLAIN);
        options.setPrettyFlow(true);
        options.setAllowUnicode(true);
        val yaml = new Yaml(options);
        try (val writer = Files.newBufferedWriter(filePath.toPath(), StandardCharsets.UTF_8)) {
            putResultsIntoProperties(results, yamlProps);
            yaml.dump(yamlProps, writer);
        }
    }

    private Properties loadYamlPropertiesFromConfigurationFile(final File filePath) {
        val factory = new YamlPropertiesFactoryBean();
        factory.setResolutionMethod(YamlProcessor.ResolutionMethod.OVERRIDE);
        factory.setResources(new FileSystemResource(filePath));
        factory.setSingleton(true);
        factory.afterPropertiesSet();
        return factory.getObject();
    }

    private void writeConfigurationPropertiesToFile(final File filePath, final Map<String, ConfigurationMetadataProperty> results,
                                                    final Properties p) throws Exception {
        LOGGER.info("Located [{}] properties in configuration file [{}]", results.size(), filePath.getCanonicalPath());
        putResultsIntoProperties(results, p);
        val lines = p.stringPropertyNames().stream().map(s -> s + '=' + p.get(s)).collect(Collectors.toList());
        lines.sort(Comparator.naturalOrder());
        FileUtils.writeLines(filePath, lines);
    }

    private void putResultsIntoProperties(final Map<String, ConfigurationMetadataProperty> results, final Properties p) {
        val lines = results.values().stream()
            .sorted(Comparator.comparing(ConfigurationMetadataProperty::getName))
            .collect(Collectors.toList());
        lines.forEach(v -> {
            val value = getDefaultValueForProperty(v);
            LOGGER.info("Adding property [{}={}]", v.getId(), value);
            p.put("# " + v.getId(), value);
        });
    }

    private String getDefaultValueForProperty(final ConfigurationMetadataProperty v) {
        if (v.getDefaultValue() == null) {
            return StringUtils.EMPTY;
        }
        return v.getDefaultValue().toString();
    }

    private Properties loadPropertiesFromConfigurationFile(final File filePath) throws IOException {
        val p = new Properties();
        try (val f = Files.newBufferedReader(filePath.toPath(), StandardCharsets.UTF_8)) {
            p.load(f);
        }
        return p;
    }

    private Map<String, ConfigurationMetadataProperty> findProperties(final String group) {
        val find = new FindPropertiesCommand();
        val results = find.findByProperty(group);
        return results;
    }

    private void createConfigurationFileIfNeeded(final File filePath) throws IOException {
        if (!filePath.exists()) {
            LOGGER.debug("Creating configuration file [{}]", filePath.getCanonicalPath());
            val created = filePath.createNewFile();
            if (created) {
                LOGGER.info("Created configuration file [{}]", filePath.getCanonicalPath());
            }
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2017 Capital One Services, LLC and Bitwise, Inc.
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
 -->

<tns:Config xmlns:tns="hydrograph/ui/ComponentConfig"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="hydrograph/ui/ComponentConfig xsds/ComponentConfig.xsd ">
	<tns:component paletteIconPath="/icons/unique_sequence_palette.png"
		canvasIconPath="/icons/unique_sequence_canvas.png" name="UniqueSequence"
		nameInPalette="Unique Sequence" defaultNamePrefix="UniqueSeq"
		description="Generates a unique number for records flowing through this component."
		helpFilePath="/hydrograph.ui.help/html/Components/Unique_Sequence.html"
		acronym="UnqSeq">
		<tns:category>TRANSFORM</tns:category>
		<tns:port>
			<tns:portSpecification  numberOfPorts="1" portAlignment="left" changePortCountDynamically="false" allowMultipleLinks="false" linkMandatory="true">
				<tns:port sequenceOfPort="0" typeOfPort="in" labelOfPort="in0" portTerminal="in0" />
			</tns:portSpecification>
			<tns:portSpecification  numberOfPorts="1" portAlignment="right" changePortCountDynamically="false" allowMultipleLinks="false" linkMandatory="true">
				<tns:port sequenceOfPort="0" typeOfPort="out" labelOfPort="out0" portTerminal="out0"/>
			</tns:portSpecification>
		</tns:port>

		<tns:property dataType="string" name="name"
			renderer="COMPONENT_NAME_WIDGET" type="USER" group="GENERAL"
			subGroup="DETAILS" showAsTooltip="TRUE" tooltipDataType="TEXT" usage="REQUIRED" propertyHelpText="Displays Name provided by the user"/>

        <tns:property dataType="string" name="schema" renderer="STRAIGHT_SCHEMA_WIDGET" type="USER"
			group="SCHEMA" subGroup="RECORD_STRUCTURE_DETAILS" showAsTooltip="TRUE" tooltipDataType="LIST"
			usage="REQUIRED">
			<tns:validator>SCHEMA_GRID_VALIDATOR</tns:validator>
		</tns:property>

        <tns:property dataType="string" name="sequence_field" value=""
			renderer="TEXTBOX_WITH_IS_PARAMETER_CHECKBOX_WIDGET" type="USER" group="GENERAL" subGroup="CONFIGURATION"
			showAsTooltip="TRUE" tooltipDataType="TEXT" usage="REQUIRED" propertyHelpText="Field name for the generated Sequence. \nCan be parameterized.">
			<tns:validator>NON_BLANK_STRING_VALIDATOR</tns:validator>
		</tns:property>

		<tns:property dataType="string" name="runtime_properties"
			renderer="RUNTIME_PROPERTIES_WIDGET" type="USER" group="GENERAL"
			subGroup="CONFIGURATION" showAsTooltip="FALSE" tooltipDataType="NONE"
			usage="OPTIONAL" propertyHelpText="Used to override runtime Hadoop configurations \nspecific to this component at run time.">
		<tns:validator>RUNTIME_PROPERTY_VALIDATOR</tns:validator>
		</tns:property>

		<tns:property dataType="string" name="batch" value="0"
			renderer="BATCH_WIDGET" type="USER" group="GENERAL" subGroup="CONFIGURATION"
			showAsTooltip="TRUE" tooltipDataType="TEXT" usage="REQUIRED" propertyHelpText="Specifies the execution sequence \nof this component in the job flow.">
			<tns:validator>INTEGER_VALIDATOR</tns:validator>
		</tns:property>

		 <tns:property dataType="string" name="Propogate" renderer="PROPOGATE_WIDGET" type="USER"
			group="GENERAL" subGroup="CONFIGURATION" showAsTooltip="TRUE" tooltipDataType="TEXT"
			usage="OPTIONAL" propertyHelpText="Specifies propagating attributes from previous component in the job flow.">
		</tns:property>

	</tns:component>
</tns:Config>

redpajama_set_name: RedPajamaGithub


text:
Executes shell commands synchronously.

## Motivation

Simplifies build scripts.

Express 3 has asynchronous templates and helper functions are synchronous.
Some of my helper functions invoke compilers with async interfaces. I use
this library in DEVELOPMENT mode to precompile files on the fly through the
command line.

**NOT RECOMMENDED** on production servers.

## Install

    npm install execSync

## Usage

Require it

    var execSync = require('execSync');

Execute shell commands. `exec` interlaces stdout and stderr to `result.stdout`.

    var result = execSync.exec('echo $USER; echo some_err 1>&2; exit 1');
    console.log('return code ' + result.code);
    console.log('stdout + stderr ' + result.stdout);

## Legacy helper functions

Capture STDOUT

    var user = execSync.stdout('echo $USER');
    console.log('Hello ' + user);

Get result code

    var code = execSync.code('echo $HOME');
    console.log('result ' + code);


text:
package org.conscrypt.ct;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import org.conscrypt.Internal;

@Internal
public class Serialization {
    private Serialization() {}

    private static final int DER_TAG_MASK = 0x3f;
    private static final int DER_TAG_OCTET_STRING = 0x4;
    private static final int DER_LENGTH_LONG_FORM_FLAG = 0x80;

    public static byte[] readDEROctetString(byte[] input)
            throws SerializationException {
        return readDEROctetString(new ByteArrayInputStream(input));
    }

    public static byte[] readDEROctetString(InputStream input)
            throws SerializationException {
        int tag = readByte(input) & DER_TAG_MASK;
        if (tag != DER_TAG_OCTET_STRING) {
            throw new SerializationException("Wrong DER tag, expected OCTET STRING, got " + tag);
        }
        int length;
        int width = readNumber(input, 1);
        if ((width & DER_LENGTH_LONG_FORM_FLAG) != 0) {
            length = readNumber(input, width & ~DER_LENGTH_LONG_FORM_FLAG);
        } else {
            length = width;
        }

        return readFixedBytes(input, length);
    }

    public static byte[][] readList(byte[] input, int listWidth, int elemWidth)
            throws SerializationException {
        return readList(new ByteArrayInputStream(input), listWidth, elemWidth);
    }

    /**
     * Read a variable length vector of variable sized elements as described by RFC5246 section 4.3.
     * The vector is prefixed by its total length, in bytes and in big endian format,
     * so is each element contained in the vector.
     * @param listWidth the width of the vector's length field, in bytes.
     * @param elemWidth the width of each element's length field, in bytes.
     * @throws SerializationException if EOF is encountered.
     */
    public static byte[][] readList(InputStream input, int listWidth, int elemWidth)
            throws SerializationException {
        ArrayList<byte[]> result = new ArrayList<byte[]>();
        byte[] data = readVariableBytes(input, listWidth);
        input = new ByteArrayInputStream(data);
        try {
            while (input.available() > 0) {
                result.add(readVariableBytes(input, elemWidth));
            }
        } catch (IOException e) {
            throw new SerializationException(e);
        }
        return result.toArray(new byte[result.size()][]);
    }

    /**
     * Read a length-prefixed sequence of bytes.
     * The length must be encoded in big endian format.
     * @param width the width of the length prefix, in bytes.
     * @throws SerializationException if EOF is encountered, or if {@code width} is negative or
     * greater than 4
     */
    public static byte[] readVariableBytes(InputStream input, int width)
            throws SerializationException {
        int length = readNumber(input, width);
        return readFixedBytes(input, length);
    }

    /**
     * Read a fixed number of bytes from the input stream.
     * @param length the number of bytes to read.
     * @throws SerializationException if EOF is encountered.
     */
    public static byte[] readFixedBytes(InputStream input, int length)
            throws SerializationException {
        try {
            if (length < 0) {
                throw new SerializationException("Negative length: " + length);
            }

            byte[] data = new byte[length];
            int count = input.read(data);
            if (count < length) {
                throw new SerializationException("Premature end of input, expected " + length +
                                                 " bytes, only read " + count);
            }
            return data;
        } catch (IOException e) {
            throw new SerializationException(e);
        }
    }

    /**
     * Read a number in big endian format from the input stream.
     * This methods only supports a width of up to 4 bytes.
     * @param width the width of the number, in bytes.
     * @throws SerializationException if EOF is encountered, or if {@code width} is negative or
     * greater than 4
     */
    public static int readNumber(InputStream input, int width) throws SerializationException {
        if (width > 4 || width < 0) {
            throw new SerializationException("Invalid width: " + width);
        }

        int result = 0;
        for (int i = 0; i < width; i++) {
            result = (result << 8) | (readByte(input) & 0xFF);
        }

        return result;
    }

    /**
     * Read a number in big endian format from the input stream.
     * This methods supports a width of up to 8 bytes.
     * @param width the width of the number, in bytes.
     * @throws SerializationException if EOF is encountered.
     * @throws IllegalArgumentException if {@code width} is negative or greater than 8
     */
    public static long readLong(InputStream input, int width) throws SerializationException {
        if (width > 8 || width < 0) {
            throw new IllegalArgumentException("Invalid width: " + width);
        }

        long result = 0;
        for (int i = 0; i < width; i++) {
            result = (result << 8) | (readByte(input) & 0xFF);
        }

        return result;
    }

    /**
     * Read a single byte from the input stream.
     * @throws SerializationException if EOF is encountered.
     */
    public static byte readByte(InputStream input) throws SerializationException {
        try {
            int b = input.read();
            if (b == -1) {
                throw new SerializationException("Premature end of input, could not read byte.");
            }
            return (byte)b;
        } catch (IOException e) {
            throw new SerializationException(e);
        }
    }

    /**
     * Write length prefixed sequence of bytes to the ouput stream.
     * The length prefix is encoded in big endian order.
     * @param data the data to be written.
     * @param width the width of the length prefix, in bytes.
     * @throws SerializationException if the length of {@code data} is too large to fit in
     * {@code width} bytes or {@code width} is negative.
     */
    public static void writeVariableBytes(OutputStream output, byte[] data, int width)
            throws SerializationException {
        writeNumber(output, data.length, width);
        writeFixedBytes(output, data);
    }

    /**
     * Write a fixed number sequence of bytes to the ouput stream.
     * @param data the data to be written.
     */
    public static void writeFixedBytes(OutputStream output, byte[] data)
            throws SerializationException {
        try {
            output.write(data);
        } catch (IOException e) {
            throw new SerializationException(e);
        }
    }

    /**
     * Write a number to the output stream.
     * The number is encoded in big endian order.
     * @param value the value to be written.
     * @param width the width of the encoded number, in bytes
     * @throws SerializationException if the number is too large to fit in {@code width} bytes or
     * {@code width} is negative.
     */
    public static void writeNumber(OutputStream output, long value, int width)
            throws SerializationException {
        if (width < 0) {
            throw new SerializationException("Negative width: " + width);
        }
        if (width < 8 && value >= (1L << (8 * width))) {
            throw new SerializationException(
                    "Number too large, " + value + " does not fit in " + width + " bytes");
        }

        try {
            while (width > 0) {
                long shift = (width - 1) * 8L;
                // Java behaves weirdly if shifting by more than the variable's size
                if (shift < Long.SIZE) {
                    output.write((byte) ((value >> shift) & 0xFF));
                } else {
                    output.write(0);
                }

                width--;
            }
        } catch (IOException e) {
            throw new SerializationException(e);
        }
    }
}


text:
<?php
ini_set('display_errors', '1');
try {
    require_once '../DAO/MovimientoCuenta.php';

    $movimiento_cuenta_obj = MovimientoCuenta::getInstance();
    $cuenta= $movimiento_cuenta_obj->consultarMovimientos();
    if(!array_key_exists(0,$cuenta)){
      $retorno['respuesta'] = $cuenta;
      $retorno['mensaje'] = "False";
    }else{
      $retorno['user'] = $cuenta;
      $retorno['mensaje'] = 'Movimientos consultados.';
    }
} catch (Exception $e) {
    $retorno['respuesta'] = false;
    $retorno['mensaje'] = 'Error al consultar Cuenta del Fondo. '.$e->getMessage();
}

echo json_encode($retorno);
?>


text:
title: Welcome Fall 2016
categories:
    - echolink
---
Welcome to the students, staff, alumni, and friends of W1BUR amateur radio station at Boston University this Fall 2016 semester!
We have our [Echolink](http://echolink.org) service running at W1BUR-L, node 631098.
Any licensed amateur radio operator can [signup for Echolink](http://echolink.org/validation/) and join via smartphone, computer, or radio.
You can see [stations logged in worldwide on Echolink](http://echolink.org/logins.jsp) with whom to connect.
Likewise we can connect the Boston University Echolink server to other systems for example our multi-university nets.

The RF connected to Echolink is shared with the BUSAT ground station, but when available it's on 446.025MHz, PL 100.0.
Coverage is limited to the immediate Charles River Campus near the Boston University Photonics Center.
An effort to make a permanent Echolink setup would be welcomed; there is existing
[Raspberry Pi Echolink server software/hardware available for beta test from the OpenRepeater project](https://openrepeater.com/blog/hardware-interface-update).


text:
<?php

namespace Gcs\App\Resource\Entity;

use Gcs\Framework\Core\Orm\Entity\Entity;

/**
 * Class Image
 * @Table(name="image")
 * @Form(name="form-image")
 * @property integer $id
 * @package Orm\Entity
 */
class Image extends Entity {

    /**
     * @var int
     * @Column(type="INCREMENT", primary="true")
     */

    protected $id;
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Acta Univ. Lund. , 2, 22:209. 1926

#### Original name
null

### Remarks
null


text:
[![Relase Build Status](https://img.shields.io/appveyor/ci/bigegg/jsoncomparer.svg?style=flat-square&label=Release%20Build)](https://ci.appveyor.com/project/BigEgg/jsoncomparer)
[![CI Build Status](https://img.shields.io/appveyor/ci/bigegg/jsoncomparer-33wo6.svg?style=flat-square&label=CI%20Build)](https://ci.appveyor.com/project/BigEgg/jsoncomparer-33wo6)
[![GitHub Release](https://img.shields.io/github/release/BigEggTools/JsonComparer.svg?style=flat-square&label=GitHub%20Release)](https://github.com/BigEggTools/JsonComparer/releases)

# JsonComparer
The tool to compare JSON file(s) and output the differences in many kinds of report, such as: HTML report, Excel report.

## Extension Tools
Will also support the split JSON file and merge JSON files functions

## Features
To get what current verion of this tool support, use --help to get the following information:
```
JsonComparer: v0.3.0.9

Application support these commands:

    compare  |  Compare the JSON files in two folder.
    split    |  Split the big JSON file to multiple small files.
    merge    |  Merge the splited JSON files to node in one JSON file, to build a big file.

For help on command detail, please run <command> --help to check
```

To know more about the feature, please click the following links:

* [Compare](./docs/Compare.md)
* [Split](./docs/Split.md)
* [Merge](./docs/Merge.md)


text:
/**
 * @file
 * @brief Gearman State Definitions
 */

#include "gear_config.h"

#include "libgearman-server/common.h"
#include "libgearman-server/timer.h"

#include <algorithm>
#include <cerrno>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <pthread.h>

#ifdef _WIN32
# include <malloc.h>
#else
# include <alloca.h>
#endif

#pragma GCC diagnostic push
#ifndef __INTEL_COMPILER
# pragma GCC diagnostic ignored "-Wold-style-cast"
# pragma GCC diagnostic ignored "-Wformat-nonliteral"
# pragma GCC diagnostic ignored "-Wformat-security"
#endif

static pthread_key_t logging_key;
static pthread_once_t intitialize_log_once= PTHREAD_ONCE_INIT;

static void delete_log(void * ptr)
{
  if (ptr)
  {
    free(ptr);
  }
}

static void create_log(void)
{
  int pthread_error;
  if ((pthread_error= pthread_key_create(&logging_key, delete_log)))
  {
    gearmand_log_fatal_perror(GEARMAND_AT, "pthread_key_create", pthread_error, "pthread_key_create");
    abort();
  }
}

gearmand_error_t gearmand_initialize_thread_logging(const char *identity)
{
  if (identity)
  {
    int pthread_error;
    if ((pthread_error= pthread_once(&intitialize_log_once, create_log)))
    {
      return gearmand_log_fatal_perror(GEARMAND_AT, "pthread_once", pthread_error, "identity: %s", identity);
    }

    if (pthread_getspecific(logging_key) == NULL)
    {
      const char *key_to_use= strdup(identity);
      if ((pthread_error= pthread_setspecific(logging_key, key_to_use)))
      {
        return gearmand_log_fatal_perror(GEARMAND_AT, "pthread_setspecific", pthread_error, "identity: %s", identity);
      }
    }

    return GEARMAND_SUCCESS;
  }

  gearmand_fatal("identity was NULL");

  return GEARMAND_INVALID_ARGUMENT;
}

static gearmand_error_t __errno_to_gearmand_error_t(int local_errno)
{
  gearmand_error_t error_to_report= GEARMAND_ERRNO;

  switch (local_errno)
  {
  case ENOMEM:
    error_to_report= GEARMAND_MEMORY_ALLOCATION_FAILURE;

  case ECONNRESET:
  case EHOSTDOWN:
    error_to_report= GEARMAND_LOST_CONNECTION;

  default:
    break;
  }

  return error_to_report;
}

/**
 * Log a message.
 *
 * @param[in] gearman Structure previously initialized with gearman_create() or
 *  gearman_clone().
 * @param[in] verbose Logging level of the message.
 * @param[in] format Format and variable argument list of message.
 * @param[in] args Variable argument list that has been initialized.
 */

static void gearmand_log(const char *position, const char *func /* func */,
                         gearmand_verbose_t verbose,
                         const gearmand_error_t error_arg,
                         const char *format, va_list args)
{
  struct timeval current_epoch;

  if (Gearmand() and Gearmand()->verbose < GEARMAND_VERBOSE_DEBUG)
  {
    current_epoch= libgearman::server::Epoch::current();
    current_epoch.tv_usec= 0;
  }
  else
  {
    (void)gettimeofday(&current_epoch, NULL);
  }

  struct tm current_tm;
  if (current_epoch.tv_sec == 0)
  {
    (void)gettimeofday(&current_epoch, NULL);
  }

  if ((gmtime_r(&current_epoch.tv_sec, &current_tm) == NULL))
  {
    memset(&current_epoch, 0, sizeof(current_epoch));
  }

  (void) pthread_once(&intitialize_log_once, create_log);

  const char *identity= (const char *)pthread_getspecific(logging_key);

  if (identity == NULL)
  {
    identity= "[  main ]";
  }

  char log_buffer[GEARMAN_MAX_ERROR_SIZE*2] = { 0 };
  if (Gearmand() && Gearmand()->log_fn)
  {
    char *log_buffer_ptr= log_buffer;
    size_t remaining_size= sizeof(log_buffer);

    {
      int length= snprintf(log_buffer, sizeof(log_buffer), "%04d-%02d-%02d %02d:%02d:%02d.%06d %s ",
                           int(1900 +current_tm.tm_year), current_tm.tm_mon +1, current_tm.tm_mday, current_tm.tm_hour,
                           current_tm.tm_min, current_tm.tm_sec, int(current_epoch.tv_usec),
                           identity);
      // We just return whatever we have if this occurs
      if (length <= 0 or (size_t)length >= sizeof(log_buffer))
      {
        remaining_size= 0;
      }
      else
      {
        remaining_size-= size_t(length);
        log_buffer_ptr+= length;
      }
    }

    if (remaining_size)
    {
      int length= vsnprintf(log_buffer_ptr, remaining_size, format, args);
      if (length <= 0 or size_t(length) >= remaining_size)
      {
        remaining_size= 0;
      }
      else
      {
        remaining_size-= size_t(length);
        log_buffer_ptr+= length;
      }
    }

    if (remaining_size and error_arg != GEARMAND_SUCCESS)
    {
      int length= snprintf(log_buffer_ptr, remaining_size, " %s(%s)", func, gearmand_strerror(error_arg));
      if (length <= 0 or size_t(length) >= remaining_size)
      {
        remaining_size= 0;
      }
      else
      {
        remaining_size-= size_t(length);
        log_buffer_ptr+= length;
      }
    }

    if (remaining_size and position and verbose != GEARMAND_VERBOSE_INFO)
    {
      int length= snprintf(log_buffer_ptr, remaining_size, " -> %s", position);
      if (length <= 0 or size_t(length) >= remaining_size)
      {
        remaining_size= 0;
      }
    }

    // Make sure this is null terminated
    log_buffer[sizeof(log_buffer) -1]= 0;
  }

  if (Gearmand() and Gearmand()->log_fn)
  {
    Gearmand()->log_fn(log_buffer, verbose, (void *)Gearmand()->log_context);
  }
  else
  {
    fprintf(stderr, "%s -> %s",
            log_buffer,  gearmand_verbose_name(verbose));
    vfprintf(stderr, format, args);
    fprintf(stderr, "\n");
  }
}

gearmand_error_t gearmand_log_fatal(const char *position, const char *func, const char *format, ...)
{
  if (Gearmand() and  Gearmand()->verbose < GEARMAND_VERBOSE_FATAL)
  {
    return GEARMAND_ERRNO;
  }

  {
    va_list args;
    va_start(args, format);
    gearmand_log(position, func, GEARMAND_VERBOSE_FATAL, GEARMAND_SUCCESS, format, args);
    va_end(args);
  }
  gearmand_wakeup(Gearmand(), GEARMAND_WAKEUP_SHUTDOWN_GRACEFUL);

  return GEARMAND_ERRNO;
}

gearmand_error_t gearmand_log_fatal_perror(const char *position, const char *function, const int local_errno, const char *format, ...)
{
  if (Gearmand() and  Gearmand()->verbose < GEARMAND_VERBOSE_FATAL)
  {
    return GEARMAND_ERRNO;
  }

  char* message_buffer= NULL;
  {
    va_list args;
    va_start(args, format);

    size_t ask= snprintf(0, 0, format);
    ask++; // for null
    message_buffer= (char*)alloca(sizeof(char) * ask);
    if (message_buffer)
    {
      vsnprintf(message_buffer, ask, format, args);
    }
    va_end(args);
  }

  {
    const char *errmsg_ptr;
    char errmsg[GEARMAN_MAX_ERROR_SIZE];
    errmsg[0]= 0;

#ifdef STRERROR_R_CHAR_P
    errmsg_ptr= strerror_r(local_errno, errmsg, sizeof(errmsg));
#else
    strerror_r(local_errno, errmsg, sizeof(errmsg));
    errmsg_ptr= errmsg;
#endif

    if (message_buffer)
    {
      gearmand_log_fatal(position, function, "%s(%s)", message_buffer, errmsg_ptr);
    }
    else
    {
      gearmand_log_fatal(position, function, "%s", errmsg_ptr);
    }
  }

  return __errno_to_gearmand_error_t(local_errno);
}

gearmand_error_t gearmand_log_error(const char *position, const char *function, const char *format, ...)
{
  if (not Gearmand() or Gearmand()->verbose >= GEARMAND_VERBOSE_ERROR)
  {
    va_list args;
    va_start(args, format);
    gearmand_log(position, function, GEARMAND_VERBOSE_ERROR, GEARMAND_SUCCESS, format, args);
    va_end(args);
  }

  return GEARMAND_UNKNOWN_OPTION;
}

void gearmand_log_warning(const char *position, const char *function, const char *format, ...)
{
  if (not Gearmand() or Gearmand()->verbose >= GEARMAND_VERBOSE_WARN)
  {
    va_list args;
    va_start(args, format);
    gearmand_log(position, function, GEARMAND_VERBOSE_WARN, GEARMAND_SUCCESS, format, args);
    va_end(args);
  }
}

// LOG_NOTICE is only used for reporting job status.
void gearmand_log_notice(const char *position, const char *function, const char *format, ...)
{
  if (not Gearmand() or Gearmand()->verbose >= GEARMAND_VERBOSE_NOTICE)
  {
    va_list args;
    va_start(args, format);
    gearmand_log(position, function, GEARMAND_VERBOSE_NOTICE, GEARMAND_SUCCESS, format, args);
    va_end(args);
  }
}

void gearmand_log_info(const char *position, const char *function, const char *format, ...)
{
  if (not Gearmand() or Gearmand()->verbose >= GEARMAND_VERBOSE_INFO)
  {
    va_list args;
    va_start(args, format);
    gearmand_log(position, function, GEARMAND_VERBOSE_INFO, GEARMAND_SUCCESS, format, args);
    va_end(args);
  }
}

void gearmand_log_debug(const char *position, const char *function, const char *format, ...)
{
  va_list args;

  if (not Gearmand() || Gearmand()->verbose >= GEARMAND_VERBOSE_DEBUG)
  {
    va_start(args, format);
    gearmand_log(position, function, GEARMAND_VERBOSE_DEBUG, GEARMAND_SUCCESS, format, args);
    va_end(args);
  }
}

gearmand_error_t gearmand_log_perror(const char *position, const char *function, const int local_errno, const char *format, ...)
{
  if (not Gearmand() or (Gearmand()->verbose >= GEARMAND_VERBOSE_ERROR))
  {
    char* message_buffer= NULL;
    {
      va_list args;
      va_start(args, format);

      size_t ask= snprintf(0, 0, format);
      ask++; // for null
      message_buffer= (char*)alloca(sizeof(char) * ask);
      vsnprintf(message_buffer, ask, format, args);

      va_end(args);
    }

    const char *errmsg_ptr;
    char errmsg[GEARMAN_MAX_ERROR_SIZE];
    errmsg[0]= 0;

#ifdef STRERROR_R_CHAR_P
    errmsg_ptr= strerror_r(local_errno, errmsg, sizeof(errmsg));
#else
    strerror_r(local_errno, errmsg, sizeof(errmsg));
    errmsg_ptr= errmsg;
#endif
    if (message_buffer)
    {
      gearmand_log_error(position, function, "%s(%s)", message_buffer, errmsg_ptr);
    }
    else
    {
      gearmand_log_error(position, function, "%s", errmsg_ptr);
    }
  }

  return __errno_to_gearmand_error_t(local_errno);
}

void gearmand_log_perror_warn(const char *position, const char *function, const int local_errno, const char *format, ...)
{
  if (not Gearmand() or (Gearmand()->verbose >= GEARMAND_VERBOSE_WARN))
  {
    char* message_buffer= NULL;
    {
      va_list args;
      va_start(args, format);

      size_t ask= snprintf(0, 0, format);
      ask++; // for null
      message_buffer= (char*)alloca(sizeof(char) * ask);
      vsnprintf(message_buffer, ask, format, args);

      va_end(args);
    }

    const char *errmsg_ptr;
    char errmsg[GEARMAN_MAX_ERROR_SIZE];
    errmsg[0]= 0;

#ifdef STRERROR_R_CHAR_P
    errmsg_ptr= strerror_r(local_errno, errmsg, sizeof(errmsg));
#else
    strerror_r(local_errno, errmsg, sizeof(errmsg));
    errmsg_ptr= errmsg;
#endif
    if (message_buffer)
    {
      gearmand_log_warning(position, function, "%s(%s)", message_buffer, errmsg_ptr);
    }
    else
    {
      gearmand_log_warning(position, function, "%s", errmsg_ptr);
    }
  }
}

gearmand_error_t gearmand_log_gerror(const char *position, const char *function, const gearmand_error_t rc, const char *format, ...)
{
  if (gearmand_failed(rc) and rc != GEARMAND_IO_WAIT)
  {
    va_list args;

    if (Gearmand() == NULL or Gearmand()->verbose >= GEARMAND_VERBOSE_ERROR)
    {
      va_start(args, format);
      gearmand_log(position, function, GEARMAND_VERBOSE_ERROR, rc, format, args);
      va_end(args);
    }
  }
  else if (rc == GEARMAND_IO_WAIT)
  { }

  return rc;
}

void gearmand_log_gerror_warn(const char *position, const char *function, const gearmand_error_t rc, const char *format, ...)
{
  if (gearmand_failed(rc) and rc != GEARMAND_IO_WAIT)
  {
    va_list args;

    if (Gearmand() == NULL or Gearmand()->verbose >= GEARMAND_VERBOSE_WARN)
    {
      va_start(args, format);
      gearmand_log(position, function, GEARMAND_VERBOSE_WARN, rc, format, args);
      va_end(args);
    }
  }
}

gearmand_error_t gearmand_log_gai_error(const char *position, const char *function, const int rc, const char *message)
{
  if (rc == EAI_SYSTEM)
  {
    return gearmand_log_perror(position, function, errno, message);
  }

  gearmand_log_error(position, function, "%s getaddrinfo(%s)", message, gai_strerror(rc));

  return GEARMAND_GETADDRINFO;
}

gearmand_error_t gearmand_log_memory_error(const char *position, const char *function, const char *allocator, const char *object_type, size_t count, size_t size)
{
  if (count > 1)
  {
    gearmand_log_error(position, function, "%s(%s, count: %lu size: %lu)", allocator, object_type, static_cast<unsigned long>(count), static_cast<unsigned long>(size));
  }
  else
  {
    gearmand_log_error(position, function, "%s(%s, size: %lu)", allocator, object_type, static_cast<unsigned long>(count), static_cast<unsigned long>(size));
  }

  return GEARMAND_MEMORY_ALLOCATION_FAILURE;
}
#pragma GCC diagnostic pop


text:
@interface MKCollectionViewCell : UICollectionViewCell

@property (nonatomic, copy) NSString *image;

@end


text:
(function() {
    'use strict';

    var header = angular.module('opentele.controllers.header', [
    ]);

    header.controller('HeaderCtrl', function ($scope, $location) {

        $scope.goMainMenu = function () {
            $location.path('/menu');
            $scope.$parent.$broadcast('menuClick');
        };

        $scope.goBack = function () {
            $scope.$parent.$broadcast('backClick');
        };

        $scope.goLogout = function () {
            $location.path('/login');
        };

    });
}());


text:
#import <UIKit/UIKit.h>

@class IPNavSettingsManager;

@interface IPNavSettingsTableViewController : UITableViewController {
	IPNavSettingsManager *_settingsManager;
}

- (void)reloadSection:(NSNotification *)notification;

@end


text:
// Boost.Geometry - gis-projections (based on PROJ4)

// Copyright (c) 2008-2015 Barend Gehrels, Amsterdam, the Netherlands.

// This file was modified by Oracle on 2017, 2018.
// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle.

// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

// This file is converted from PROJ4, http://trac.osgeo.org/proj
// PROJ4 is originally written by Gerald Evenden (then of the USGS)
// PROJ4 is maintained by Frank Warmerdam
// PROJ4 is converted to Boost.Geometry by Barend Gehrels

// Last updated version of proj: 5.0.0

// Original copyright notice:

// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

#ifndef BOOST_GEOMETRY_PROJECTIONS_LOXIM_HPP
#define BOOST_GEOMETRY_PROJECTIONS_LOXIM_HPP

#include <boost/geometry/srs/projections/impl/base_static.hpp>
#include <boost/geometry/srs/projections/impl/base_dynamic.hpp>
#include <boost/geometry/srs/projections/impl/factory_entry.hpp>
#include <boost/geometry/srs/projections/impl/pj_param.hpp>
#include <boost/geometry/srs/projections/impl/projects.hpp>

#include <boost/geometry/util/math.hpp>

namespace boost { namespace geometry
{

namespace projections
{
    #ifndef DOXYGEN_NO_DETAIL
    namespace detail { namespace loxim
    {
            static const double epsilon = 1e-8;

            template <typename T>
            struct par_loxim
            {
                T phi1;
                T cosphi1;
                T tanphi1;
            };

            // template class, using CRTP to implement forward/inverse
            template <typename T, typename Parameters>
            struct base_loxim_spheroid
                : public base_t_fi<base_loxim_spheroid<T, Parameters>, T, Parameters>
            {
                par_loxim<T> m_proj_parm;

                inline base_loxim_spheroid(const Parameters& par)
                    : base_t_fi<base_loxim_spheroid<T, Parameters>, T, Parameters>(*this, par)
                {}

                // FORWARD(s_forward)  spheroid
                // Project coordinates from geographic (lon, lat) to cartesian (x, y)
                inline void fwd(T const& lp_lon, T const& lp_lat, T& xy_x, T& xy_y) const
                {
                    static const T fourth_pi = detail::fourth_pi<T>();
                    static const T half_pi = detail::half_pi<T>();

                    xy_y = lp_lat - this->m_proj_parm.phi1;
                    if (fabs(xy_y) < epsilon)
                        xy_x = lp_lon * this->m_proj_parm.cosphi1;
                    else {
                        xy_x = fourth_pi + 0.5 * lp_lat;
                        if (fabs(xy_x) < epsilon || fabs(fabs(xy_x) - half_pi) < epsilon)
                            xy_x = 0.;
                        else
                            xy_x = lp_lon * xy_y / log( tan(xy_x) / this->m_proj_parm.tanphi1 );
                    }
                }

                // INVERSE(s_inverse)  spheroid
                // Project coordinates from cartesian (x, y) to geographic (lon, lat)
                inline void inv(T const& xy_x, T const& xy_y, T& lp_lon, T& lp_lat) const
                {
                    static const T fourth_pi = detail::fourth_pi<T>();
                    static const T half_pi = detail::half_pi<T>();

                    lp_lat = xy_y + this->m_proj_parm.phi1;
                    if (fabs(xy_y) < epsilon) {
                        lp_lon = xy_x / this->m_proj_parm.cosphi1;
                    } else {
                        lp_lon = fourth_pi + 0.5 * lp_lat;
                        if (fabs(lp_lon) < epsilon || fabs(fabs(lp_lon) - half_pi) < epsilon)
                            lp_lon = 0.;
                        else
                            lp_lon = xy_x * log( tan(lp_lon) / this->m_proj_parm.tanphi1 ) / xy_y ;
                    }
                }

                static inline std::string get_name()
                {
                    return "loxim_spheroid";
                }

            };

            // Loximuthal
            template <typename Params, typename Parameters, typename T>
            inline void setup_loxim(Params const& params, Parameters& par, par_loxim<T>& proj_parm)
            {
                static const T fourth_pi = detail::fourth_pi<T>();

                proj_parm.phi1 = pj_get_param_r<T, srs::spar::lat_1>(params, "lat_1", srs::dpar::lat_1);
                proj_parm.cosphi1 = cos(proj_parm.phi1);
                if (proj_parm.cosphi1 < epsilon)
                    BOOST_THROW_EXCEPTION( projection_exception(error_lat_larger_than_90) );

                proj_parm.tanphi1 = tan(fourth_pi + 0.5 * proj_parm.phi1);

                par.es = 0.;
            }

    }} // namespace detail::loxim
    #endif // doxygen

    /*!
        \brief Loximuthal projection
        \ingroup projections
        \tparam Geographic latlong point type
        \tparam Cartesian xy point type
        \tparam Parameters parameter type
        \par Projection characteristics
         - Pseudocylindrical
         - Spheroid
        \par Projection parameters
         - lat_1: Latitude of first standard parallel (degrees)
        \par Example
        \image html ex_loxim.gif
    */
    template <typename T, typename Parameters>
    struct loxim_spheroid : public detail::loxim::base_loxim_spheroid<T, Parameters>
    {
        template <typename Params>
        inline loxim_spheroid(Params const& params, Parameters const& par)
            : detail::loxim::base_loxim_spheroid<T, Parameters>(par)
        {
            detail::loxim::setup_loxim(params, this->m_par, this->m_proj_parm);
        }
    };

    #ifndef DOXYGEN_NO_DETAIL
    namespace detail
    {

        // Static projection
        BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION(srs::spar::proj_loxim, loxim_spheroid, loxim_spheroid)

        // Factory entry(s)
        BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI(loxim_entry, loxim_spheroid)

        BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_BEGIN(loxim_init)
        {
            BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_ENTRY(loxim, loxim_entry)
        }

    } // namespace detail
    #endif // doxygen

} // namespace projections

}} // namespace boost::geometry

#endif // BOOST_GEOMETRY_PROJECTIONS_LOXIM_HPP


text:
package srt.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import srt.data.domain.management.User;
import srt.data.repository.management.IUserRepository;

@Controller
public class RegisterController {

	private IUserRepository userRepository;

	@Autowired
	public RegisterController(IUserRepository userRepository) {
		this.userRepository = userRepository;
	}

	@RequestMapping(value="/register", method=RequestMethod.GET)
	public String showRegisterPage(Model model){
		User user=new User();
		model.addAttribute("user",user);
		return "register";
	}

	@RequestMapping(value="/register", method=RequestMethod.POST)
	public String register(User user){
		userRepository.addUser(user);
		return "redirect:/result/register/successful";
	}

}


text:
namespace SerialNumber.Domain
{
    public class DefaultSerialNumberType : ISerialNumberType
    {
        public int NumberRequired()
        {
            return 1;
        }
    }
}


text:
bkbc-narakabridge
=================

Ethereum protocol implement

Naraka Bridge [奈何橋](http://zh.wikipedia.org/wiki/%E5%A5%88%E4%BD%95%E6%A9%8B)專案
用來測試實做[ethereum](http://ethereum.org/ethereum.html)概念,該協定採用GHOST選法,沿用
[Ghost in the Shell](http://en.wikipedia.org/wiki/Ghost_in_the_Shell)概念改為奈何。

[Ethereum - live updates](http://www.ursium.com/ethereum_so_far_live_updates/)

[ethereum github](https://github.com/ethereum)

[Ethereum: 2nd gen cryptocurrency with contract programming](https://bitcointalk.org/index.php?topic=412878.0)


text:
<?xml version="1.0" encoding="UTF-8"?>
<project>
	<modelVersion>4.0.0</modelVersion>
	<artifactId>getting-started</artifactId>
	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>build-info</goal>
						</goals>
						<configuration>
							<additionalProperties>
								<encoding.source>UTF-8</encoding.source>
								<encoding.reporting>UTF-8</encoding.reporting>
								<java.source>${maven.compiler.source}</java.source>
								<java.target>${maven.compiler.target}</java.target>
							</additionalProperties>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<!-- tag::plugin-repositories[] -->
	<pluginRepositories>
		<pluginRepository>
			<id>spring-snapshots</id>
			<url>https://repo.spring.io/snapshot</url>
		</pluginRepository>
		<pluginRepository>
			<id>spring-milestones</id>
			<url>https://repo.spring.io/milestone</url>
		</pluginRepository>
	</pluginRepositories>
	<!-- end::plugin-repositories[] -->

</project>


text:
{-# LANGUAGE CPP #-}
module Network.Wai.Handler.Warp.Environment (lookupEnv) where

import System.Environment

#if !MIN_VERSION_base(4,6,0)
lookupEnv :: String -> IO (Maybe String)
lookupEnv k = lookup k `fmap` getEnvironment
#endif


text:
define([
    '/narrative/nbextensions/appCell2/widgets/appParamsViewWidget',
    'common/runtime',
    'common/spec',
    'testUtil',
], (AppParamsViewWidget, Runtime, Spec, TestUtil) => {
    'use strict';

    describe('app params view widget tests', () => {
        const appSpec = {
            id: 'NarrativeTest/app_succeed',
            gitCommitHash: '8d1f8480aee9852e9354cf723f0808fae53b2fcc',
            version: '0.0.2',
            tag: 'dev',
            spec: {
                info: {
                    id: 'NarrativeTest/app_succeed',
                    module_name: 'NarrativeTest',
                    git_commit_hash: '8d1f8480aee9852e9354cf723f0808fae53b2fcc',
                    name: 'App Succeed',
                    ver: '0.0.2',
                    subtitle: 'A simple test app that always succeeds.',
                    tooltip: 'A simple test app that always succeeds.',
                    categories: ['active'],
                    authors: ['wjriehl'],
                    input_types: [],
                    output_types: [],
                    app_type: 'app',
                    namespace: 'NarrativeTest',
                },
                widgets: {
                    input: 'null',
                    output: 'no-display',
                },
                parameters: [
                    {
                        id: 'some_param',
                        ui_name: 'A String',
                        short_hint: 'A string.',
                        description: '',
                        field_type: 'text',
                        allow_multiple: 0,
                        optional: 0,
                        advanced: 0,
                        disabled: 0,
                        ui_class: 'parameter',
                        default_values: [''],
                        text_options: {
                            is_output_name: 0,
                            placeholder: '',
                            regex_constraint: [],
                        },
                    },
                ],
                fixed_parameters: [],
                behavior: {
                    kb_service_url: '',
                    kb_service_name: 'NarrativeTest',
                    kb_service_version: '8d1f8480aee9852e9354cf723f0808fae53b2fcc',
                    kb_service_method: 'app_succeed',
                    kb_service_input_mapping: [
                        {
                            input_parameter: 'some_param',
                            target_argument_position: 0,
                        },
                    ],
                    kb_service_output_mapping: [],
                },
                job_id_output_field: 'docker',
            },
        };
        const compiledSpec = Spec.make({ appSpec: appSpec.spec });
        const paramId = 'some_param';
        const initialParams = {
            [paramId]: 'foo',
        };
        const initialDisplay = {
            [paramId]: null,
        };

        afterEach(() => {
            TestUtil.clearRuntime();
        });

        it('should have a factory', () => {
            expect(AppParamsViewWidget.make).toEqual(jasmine.any(Function));
            const bus = Runtime.make().bus();
            const widget = AppParamsViewWidget.make({
                bus,
                initialParams,
                initialDisplay,
            });
            ['start', 'stop', 'bus'].forEach((fn) => {
                expect(widget[fn]).toEqual(jasmine.any(Function));
            });
        });

        describe('starting and stopping with simple value', () => {
            let bus, node;

            async function runSimpleTest(widget) {
                await widget.start({
                    node,
                    appSpec: appSpec.spec,
                    parameters: compiledSpec.getSpec().parameters,
                });
                checkRendering();
                await widget.stop();
                expect(node.innerHTML).toBe('');
            }

            function checkRendering() {
                // get the (single) input element, ensure it has the startup value
                const inputElem = node.querySelector('input[data-element="input"]');
                expect(inputElem).not.toBeNull();
                expect(inputElem.value).toEqual(initialParams[paramId]);
            }

            beforeEach(() => {
                bus = Runtime.make().bus();
                bus.respond({
                    key: {
                        type: 'get-batch-mode',
                    },
                    handle: () => {
                        return false;
                    },
                });
                node = document.createElement('div');
                document.body.appendChild(node);
            });

            afterEach(() => {
                node.remove();
            });

            it('should start and stop as expected, and have an accessible bus', async () => {
                const widget = AppParamsViewWidget.make({
                    bus,
                    initialParams,
                    initialDisplay,
                });
                await runSimpleTest(widget);
            });

            it('should start with missing display values', async () => {
                const widget = AppParamsViewWidget.make({
                    bus,
                    initialParams,
                });
                await runSimpleTest(widget);
            });

            it('should start with specific missing display value', async () => {
                const widget = AppParamsViewWidget.make({
                    bus,
                    initialParams,
                    initialDisplay: {},
                });
                await runSimpleTest(widget);
            });
        });
    });
});


text:
package com.xowave.sjwidget;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Point;

import javax.swing.BorderFactory;
import javax.swing.JScrollPane;

import com.xowave.sjwidget.util.BackgroundPainter;
import com.xowave.sjwidget.util.WidgetUtil;

/**
 * @author bjorn
 *
 */
public class SJScrollPane extends JScrollPane implements SJWidget {
	BackgroundPainter backgroundPainter;

	/**
	 *
	 */
	public SJScrollPane(String id) {
		setup(id);
	}

	/**
	 * @param view
	 */
	public SJScrollPane(Component view,String id) {
		super(view);
		setup(id);
	}

	/**
	 * @param vsbPolicy
	 * @param hsbPolicy
	 */
	public SJScrollPane(int vsbPolicy, int hsbPolicy,String id) {
		super(vsbPolicy, hsbPolicy);
		setup(id);
	}

	/**
	 * @param view
	 * @param vsbPolicy
	 * @param hsbPolicy
	 */
	public SJScrollPane(Component view, int vsbPolicy, int hsbPolicy,String id) {
		super(view, vsbPolicy, hsbPolicy);
		setup(id);
	}

	private void setup(String id) {
		setOpaque(true);
		setBorder(BorderFactory.createEmptyBorder());
		WidgetUtil.registerAndSetup(this, id);
	}

	public void presetScrollPosition(Point scrollPosition) {
		if (this.isShowing())
			setScrollPositionPrivate(scrollPosition);
	}

	private void setScrollPositionPrivate(Point scrollPosition) {
		if (scrollPosition == null)
			return;
		super.getHorizontalScrollBar().setValue(scrollPosition.x);
		super.getVerticalScrollBar().setValue(scrollPosition.y);
	}

	public Point getScrollPosition() {
		return new Point(
				super.getHorizontalScrollBar().getValue(),
				super.getVerticalScrollBar().getValue());
	}

	public SJScrollPane setWidgetID( String ID ) {
		WidgetUtil.registerAndSetup(this, ID);
		return this;
	}

	@Override
	public void setBackground( Color bg ) {
		setOpaque( bg.getAlpha() == 255 );
		super.setBackground(bg);
	}

	public String getWidgetID() {
		return (String) this.getClientProperty(ID_KEY);
	}

	public String getWidgetClass() {
		return (String) this.getClientProperty(CLASS_KEY);
	}

	@Override
	public void paintComponent( Graphics g ) {
		if( backgroundPainter != null ) {
			backgroundPainter.paintBackground(g,this);
		} else {
			super.paintComponent(g);
		}
	}

	public void setBackgroundPainter(BackgroundPainter bp) {
		if( bp != null )
			setOpaque(true);
		backgroundPainter = bp;
	}

	public void setWidgetText(String text) {
		this.putClientProperty(WIDGET_TEXT_KEY, text);
	}
	public String getWidgetText() {
		return (String) this.getClientProperty(WIDGET_TEXT_KEY);
	}
}


text:
/**
 * This script uses Lambda from aws to crawl. The lambda function body can be
 * found in ./lib/lambda.js.
 *
 * The API gateway endpoint should be passed via environment variable YCRAWL_EP,
 * the key to the gateway should be passed as YCRAWL_KEY.
 *
 * If key and gateway endpoint are missing, this module throws an error.
 */

var outFileName = 'youtube-worker-jul31.json';
var fs = require('fs');
var JSONStream = require('JSONStream');
var es = require('event-stream');
var download = require('./lib/downloadLambda.js');
var outgoing;

var maxWorkerCount = 2;
var channelsPerWorker = 30;
var activeWorker = 0;

var seen = new Set();
readProcessedFile(outFileName, crawl);

function crawl(queue, processedRowsCount) {
  downloadMore();

  function chunkDownloaded(chunk, workerId, timeMS) {
    if (typeof chunk.forEach !== 'function') {
      console.log('What are you: ' + chunk + '?');
      throw new Error('somehow no forEach in chunk')
    }
    chunk.forEach(channelDownloaded);
    activeWorker -= 1;
    processedRowsCount += chunk.length;
    console.log(workerId + ' <- Done in ' + timeMS + 'ms! Stats (downloaded/enqueued): ' + processedRowsCount + '/' + seen.size);
    downloadMore(workerId);
  }

  function channelDownloaded(channel) {
    seen.add(channel.id);
    write(channel);
    enqueueRelated(queue, channel);
  }

  function downloadMore(id) {
    while (activeWorker < maxWorkerCount && queue.length > 0) {
      activeWorker += 1;
      var channels = queue.splice(0, channelsPerWorker)
      download(channels, chunkDownloaded, id || activeWorker);
    }
  }
}

function write(page) {
  if(!outgoing) {
    createOutStream();
  }

  outgoing.write(page);
}

function createOutStream() {
  outgoing = JSONStream.stringify(false);
  var fileStream = fs.createWriteStream(outFileName, {
    encoding: 'utf8',
    flags: 'a'
  });
  outgoing.pipe(fileStream);
}

function enqueueRelated(queue, page) {
  if (page.error) {
    console.log('Failed to download ' + page.id, page.error);
    return;
  }
  var related = page.related;
  if (!related || related.length === 0) return;
  for (var i = 0; i < related.length; ++i) {
    var channel = related[i];
    if (!channel) {
      console.log('missing related for ' + JSON.stringify(page));
      throw 'blah';
    }
    var alreadySeen = seen.has(channel);
    if (!alreadySeen) {
      // make sure we are not adding anything already queued.
      seen.add(channel);
      queue.push(channel);
    }
  }
}

function readProcessedFile(fileName, done) {
  if (!fs.existsSync(fileName)) {
    startFromTotalBiscuit(done);
    return;
  }
  var queue = [];
  var processedRowsCount = 0;

  console.log('Parsing processed list...');
  var jsonStreamParser = JSONStream.parse();
  fs.createReadStream(fileName)
    .pipe(jsonStreamParser)
    .pipe(es.mapSync(markProcessed))
    .on('end', fileInitialized);

  function markProcessed(pkg) {
    processedRowsCount += 1;
    seen.add(pkg.id);
  }

  function fileInitialized() {
    // on the second pass we will go into each related channel and queue it up
    // if it was not already indexed.
    console.log('Restoring download queue...');
    var jsonStreamParser = JSONStream.parse();
    fs.createReadStream(fileName)
      .pipe(jsonStreamParser)
      .pipe(es.mapSync(addToQueue))
      .on('end', reportDone);
  }

  function reportDone() {
    console.log('Processed: ' + processedRowsCount );
    console.log('Enqueued: ' + queue.length);
    done(queue, processedRowsCount);
  }

  function addToQueue(pkg) {
    if (!pkg.related) return;
    enqueueRelated(queue, pkg);
  }
}

function startFromTotalBiscuit(cb) {
  setTimeout(function() {
    cb(['UCy1Ms_5qBTawC-k7PVjHXKQ'], 0);
  }, 0);
}


text:
<?php

//@codeCoverageIgnoreStart
require __DIR__ . '/bootstrap.php';

$_SESSION = [];
VinaiKopp\PostCodeFilter\Mage1IntegrationTestCase::initMagento();

//@codeCoverageIgnoreEnd


text:
package org.apache.hadoop.hbase.mob;

import org.apache.hadoop.hbase.classification.InterfaceAudience;
import org.apache.hadoop.hbase.util.MD5Hash;

/**
 * The mob file name.
 * It consists of a md5 of a start key, a date and an uuid.
 * It looks like md5(start) + date + uuid.
 *

 *
characters 0-31: md5 hex string of a start key. Since the length of the start key is not
 * fixed, have to use the md5 instead which has a fix length.

 *
characters 32-39: a string of a date with format yyyymmdd. The date is the latest timestamp
 * of cells in this file

 *
the remaining characters: the uuid.

 *

 * Using md5 hex string of start key as the prefix of file name makes files with the same start
 * key unique, they're different from the ones with other start keys
 * The cells come from different regions might be in the same mob file by region split,
 * this is allowed.
 * Has the latest timestamp of cells in the file name in order to clean the expired mob files by
 * TTL easily. If this timestamp is older than the TTL, it's regarded as expired.
 */
@InterfaceAudience.Private
public final class MobFileName {

  private final String date;
  private final String startKey;
  private final String uuid;
  private final String fileName;

  /**
   * @param startKey
   *          The start key.
   * @param date
   *          The string of the latest timestamp of cells in this file, the format is yyyymmdd.
   * @param uuid
   *          The uuid
   */
  private MobFileName(byte[] startKey, String date, String uuid) {
    this.startKey = MD5Hash.getMD5AsHex(startKey, 0, startKey.length);
    this.uuid = uuid;
    this.date = date;
    this.fileName = this.startKey + date + uuid;
  }

  /**
   * @param startKey
   *          The md5 hex string of the start key.
   * @param date
   *          The string of the latest timestamp of cells in this file, the format is yyyymmdd.
   * @param uuid
   *          The uuid
   */
  private MobFileName(String startKey, String date, String uuid) {
    this.startKey = startKey;
    this.uuid = uuid;
    this.date = date;
    this.fileName = this.startKey + date + uuid;
  }

  /**
   * Creates an instance of MobFileName
   *
   * @param startKey
   *          The start key.
   * @param date
   *          The string of the latest timestamp of cells in this file, the format is yyyymmdd.
   * @param uuid The uuid.
   * @return An instance of a MobFileName.
   */
  public static MobFileName create(byte[] startKey, String date, String uuid) {
    return new MobFileName(startKey, date, uuid);
  }

  /**
   * Creates an instance of MobFileName
   *
   * @param startKey
   *          The md5 hex string of the start key.
   * @param date
   *          The string of the latest timestamp of cells in this file, the format is yyyymmdd.
   * @param uuid The uuid.
   * @return An instance of a MobFileName.
   */
  public static MobFileName create(String startKey, String date, String uuid) {
    return new MobFileName(startKey, date, uuid);
  }

  /**
   * Creates an instance of MobFileName.
   * @param fileName The string format of a file name.
   * @return An instance of a MobFileName.
   */
  public static MobFileName create(String fileName) {
    // The format of a file name is md5HexString(0-31bytes) + date(32-39bytes) + UUID
    // The date format is yyyyMMdd
    String startKey = fileName.substring(0, 32);
    String date = fileName.substring(32, 40);
    String uuid = fileName.substring(40);
    return new MobFileName(startKey, date, uuid);
  }

  /**
   * Gets the hex string of the md5 for a start key.
   * @return The hex string of the md5 for a start key.
   */
  public String getStartKey() {
    return startKey;
  }

  /**
   * Gets the date string. Its format is yyyymmdd.
   * @return The date string.
   */
  public String getDate() {
    return this.date;
  }

  @Override
  public int hashCode() {
    StringBuilder builder = new StringBuilder();
    builder.append(startKey);
    builder.append(date);
    builder.append(uuid);
    return builder.toString().hashCode();
  }

  @Override
  public boolean equals(Object anObject) {
    if (this == anObject) {
      return true;
    }
    if (anObject instanceof MobFileName) {
      MobFileName another = (MobFileName) anObject;
      if (this.startKey.equals(another.startKey) && this.date.equals(another.date)
          && this.uuid.equals(another.uuid)) {
        return true;
      }
    }
    return false;
  }

  /**
   * Gets the file name.
   * @return The file name.
   */
  public String getFileName() {
    return this.fileName;
  }
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Ocellularia kinabalensis Nagarkar & Hale

### Remarks
null


text:
import { getRuntimeEdgeEnvVar } from './buildInjectableEdgeEnv'

/**
 * Builds the code to initialize the `debug` package.
 *
 * The code running in the Edge Client entry point has access to `process.env`
 * if it's defined, but the code in the runtime bundle doesn't. Furthermore, in
 * some environments `DEBUG` may be defined as a global variable rather than
 * available in `process.env`. The entry point fetches the value of `DEBUG` and
 * passes into the `debug` package.
 *
 * @param edge Whether the edge runtime is used
 */
export function buildDebugInitialization(edge: boolean) {
  if (!edge) {
    return ''
  }

  const debugVar = getRuntimeEdgeEnvVar('DEBUG')

  return `\
if (${debugVar}) {
  Debug.enable(${debugVar})
}
`
}


text:
.class public Lcom/android/gallery3d/ui/AlbumSetSlidingWindow$AlbumSetEntry;
.super Ljava/lang/Object;
.source "AlbumSetSlidingWindow.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/gallery3d/ui/AlbumSetSlidingWindow;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "AlbumSetEntry"
.end annotation

# instance fields
.field public album:Lcom/android/gallery3d/data/MediaSet;

.field public bitmapTexture:Lcom/android/gallery3d/ui/BitmapTexture;

.field public cacheFlag:I

.field public cacheStatus:I

.field public content:Lcom/android/gallery3d/ui/Texture;

.field public coverDataVersion:J

.field public coverItem:Lcom/android/gallery3d/data/MediaItem;

.field private coverLoader:Lcom/android/gallery3d/ui/BitmapLoader;

.field public isPanorama:Z

.field public isWaitLoadingDisplayed:Z

.field private labelLoader:Lcom/android/gallery3d/ui/BitmapLoader;

.field public labelTexture:Lcom/android/gallery3d/ui/BitmapTexture;

.field public mediaType:I

.field public rotation:I

.field public setDataVersion:J

.field public setPath:Lcom/android/gallery3d/data/Path;

.field public sourceType:I

.field public subType:I

.field public title:Ljava/lang/String;

.field public totalCount:I

# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 72
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static synthetic access$000(Lcom/android/gallery3d/ui/AlbumSetSlidingWindow$AlbumSetEntry;)Lcom/android/gallery3d/ui/BitmapLoader;
    .locals 1
    .parameter "x0"

    .prologue
    .line 72
    iget-object v0, p0, Lcom/android/gallery3d/ui/AlbumSetSlidingWindow$AlbumSetEntry;->coverLoader:Lcom/android/gallery3d/ui/BitmapLoader;

    return-object v0
.end method

.method static synthetic access$002(Lcom/android/gallery3d/ui/AlbumSetSlidingWindow$AlbumSetEntry;Lcom/android/gallery3d/ui/BitmapLoader;)Lcom/android/gallery3d/ui/BitmapLoader;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 72
    iput-object p1, p0, Lcom/android/gallery3d/ui/AlbumSetSlidingWindow$AlbumSetEntry;->coverLoader:Lcom/android/gallery3d/ui/BitmapLoader;

    return-object p1
.end method

.method static synthetic access$100(Lcom/android/gallery3d/ui/AlbumSetSlidingWindow$AlbumSetEntry;)Lcom/android/gallery3d/ui/BitmapLoader;
    .locals 1
    .parameter "x0"

    .prologue
    .line 72
    iget-object v0, p0, Lcom/android/gallery3d/ui/AlbumSetSlidingWindow$AlbumSetEntry;->labelLoader:Lcom/android/gallery3d/ui/BitmapLoader;

    return-object v0
.end method

.method static synthetic access$102(Lcom/android/gallery3d/ui/AlbumSetSlidingWindow$AlbumSetEntry;Lcom/android/gallery3d/ui/BitmapLoader;)Lcom/android/gallery3d/ui/BitmapLoader;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 72
    iput-object p1, p0, Lcom/android/gallery3d/ui/AlbumSetSlidingWindow$AlbumSetEntry;->labelLoader:Lcom/android/gallery3d/ui/BitmapLoader;

    return-object p1
.end method