text:
namespace impl {

// Iterator traits - pg. 957
// The other iterator traits are also container properties, and are found there.
// Thus, we only need to handle iterator_category here.

// The technique used here is the same as the one in operators.h

template<typename T>
  struct get_associated_iterator_category {
  private:
    template<typename X>
      static typename X::iterator_category check(const X&);

    static substitution_failure check(...);

  public:
    using type = decltype(check(std::declval<T>()));
  };

template<typename T>
  struct iterator_category_traits {
    using type = typename get_associated_iterator_category<T>::type;
  };

// Specialization for pointers.
template<typename T>
  struct iterator_category_traits<T*> {
    using type = std::random_access_iterator_tag;
  };

// Make sure we can get iterator_category through reference types.
template<typename T>
  struct iterator_category_traits<T&>
    : iterator_category_traits<T> { };

template<typename T>
  struct iterator_category_traits<T&&>
    : iterator_category_traits<T> { };

template<typename T>
  struct get_std_begin_result {
  private:
    template<typename X>
      static auto check(X&& x) -> decltype(std::begin(x));

    static substitution_failure check(...);

  public:
    using type = decltype(check(std::declval<T>()));
  };

template<typename T>
  constexpr bool Has_std_begin()
  {
    return Substitution_succeeded<typename get_std_begin_result<T>::type>();
  }

template<typename T>
  struct get_std_end_result {
  private:
    template<typename X>
      static auto check(X&& x) -> decltype(std::end(x));

    static substitution_failure check(...);

  public:
    using type = decltype(check(std::declval<T>()));
  };

template<typename T>
  constexpr bool Has_std_end()
  {
    return Substitution_succeeded<typename get_std_end_result<T>::type>();
  }

template<typename T>
  struct get_adl_begin_result {
  private:
    template<typename X>
      static auto check(X&& x) -> decltype(begin(x));

    static substitution_failure check(...);

  public:
    using type = decltype(check(std::declval<T>()));
  };

template<typename T>
  struct get_adl_end_result {
  private:
    template<typename X>
      static auto check(X&& x) -> decltype(end(x));

    static substitution_failure check(...);

  public:
    using type = decltype(check(std::declval<T>()));
  };

template<typename T,
         bool = Has_std_begin<T>()>
  struct get_begin_result;

template<typename T>
  struct get_begin_result<T, true> {
    using type = typename get_std_begin_result<T>::type;
  };

template<typename T>
  struct get_begin_result<T, false> {
    using type = typename get_adl_begin_result<T>::type;
  };

template<typename T,
         bool = Has_std_end<T>()>
  struct get_end_result;

template<typename T>
  struct get_end_result<T, true> {
    using type = typename get_std_end_result<T>::type;
  };

template<typename T>
  struct get_end_result<T, false> {
    using type = typename get_adl_end_result<T>::type;
  };

}	// namespace impl


text:
//
//  GFSquareItem.h
//  GFBS
//
//  Created by apple on 2016/11/20.
//  Copyright © 2016年 apple. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface GFSquareItem : NSObject

/**
 SquareImage
 */
@property (strong , nonatomic)NSString *icon;
/**
 SquareName
 */
@property (strong , nonatomic)NSString *name;
/**
 SquareUrl
 */
@property (strong , nonatomic)NSString *url;

@end

redpajama_set_name: RedPajamaGithub


text:
package com.spotify.heroic.shell;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Charsets;
import com.spotify.heroic.HeroicCoreInstance;
import com.spotify.heroic.common.Series;
import com.spotify.heroic.dagger.CoreComponent;
import com.spotify.heroic.filter.Filter;
import com.spotify.heroic.filter.TrueFilter;
import com.spotify.heroic.grammar.QueryParser;
import com.spotify.heroic.metric.BackendKeyFilter;
import com.spotify.heroic.shell.task.AnalyticsDumpFetchSeries;
import com.spotify.heroic.shell.task.AnalyticsReportFetchSeries;
import com.spotify.heroic.shell.task.BackendKeyArgument;
import com.spotify.heroic.shell.task.Configure;
import com.spotify.heroic.shell.task.CountData;
import com.spotify.heroic.shell.task.DeleteKeys;
import com.spotify.heroic.shell.task.DeserializeKey;
import com.spotify.heroic.shell.task.Fetch;
import com.spotify.heroic.shell.task.IngestionFilter;
import com.spotify.heroic.shell.task.Keys;
import com.spotify.heroic.shell.task.ListBackends;
import com.spotify.heroic.shell.task.LoadGenerated;
import com.spotify.heroic.shell.task.MetadataCount;
import com.spotify.heroic.shell.task.MetadataDelete;
import com.spotify.heroic.shell.task.MetadataEntries;
import com.spotify.heroic.shell.task.MetadataFetch;
import com.spotify.heroic.shell.task.MetadataFindSeries;
import com.spotify.heroic.shell.task.MetadataFindSeriesIds;
import com.spotify.heroic.shell.task.MetadataLoad;
import com.spotify.heroic.shell.task.MetadataMigrate;
import com.spotify.heroic.shell.task.MetadataTags;
import com.spotify.heroic.shell.task.MetadataWrite;
import com.spotify.heroic.shell.task.ParseQuery;
import com.spotify.heroic.shell.task.Pause;
import com.spotify.heroic.shell.task.Query;
import com.spotify.heroic.shell.task.ReadWriteTest;
import com.spotify.heroic.shell.task.Refresh;
import com.spotify.heroic.shell.task.Resume;
import com.spotify.heroic.shell.task.SerializeKey;
import com.spotify.heroic.shell.task.Statistics;
import com.spotify.heroic.shell.task.SuggestKey;
import com.spotify.heroic.shell.task.SuggestPerformance;
import com.spotify.heroic.shell.task.SuggestTag;
import com.spotify.heroic.shell.task.SuggestTagKeyCount;
import com.spotify.heroic.shell.task.SuggestTagValue;
import com.spotify.heroic.shell.task.SuggestTagValues;
import com.spotify.heroic.shell.task.TestPrint;
import com.spotify.heroic.shell.task.TestReadFile;
import com.spotify.heroic.shell.task.Write;
import com.spotify.heroic.shell.task.WritePerformance;
import com.spotify.heroic.shell.task.datamigrate.DataMigrate;
import com.spotify.heroic.shell.task.parameters.KeyspaceBase;
import com.spotify.heroic.shell.task.parameters.TaskQueryParameters;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.Chronology;
import org.joda.time.DateTime;
import org.joda.time.chrono.ISOChronology;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeParser;
import org.joda.time.format.DateTimeParserBucket;

public final class Tasks {
    static final List<ShellTaskDefinition> available = new ArrayList<>();
    static final Map<Class<?>, ShellTaskDefinition> availableMap = new HashMap<>();

    static {
        shellTask(TestReadFile::setup, TestReadFile.class);
        shellTask(TestPrint::setup, TestPrint.class);
        shellTask(Refresh::setup, Refresh.class);
        shellTask(Configure::setup, Configure.class);
        shellTask(Statistics::setup, Statistics.class);
        shellTask(Keys::setup, Keys.class);
        shellTask(DeleteKeys::setup, DeleteKeys.class);
        shellTask(CountData::setup, CountData.class);
        shellTask(SerializeKey::setup, SerializeKey.class);
        shellTask(DeserializeKey::setup, DeserializeKey.class);
        shellTask(ListBackends::setup, ListBackends.class);
        shellTask(Fetch::setup, Fetch.class);
        shellTask(Write::setup, Write.class);
        shellTask(WritePerformance::setup, WritePerformance.class);
        shellTask(MetadataDelete::setup, MetadataDelete.class);
        shellTask(MetadataFetch::setup, MetadataFetch.class);
        shellTask(MetadataTags::setup, MetadataTags.class);
        shellTask(MetadataCount::setup, MetadataCount.class);
        shellTask(MetadataEntries::setup, MetadataEntries.class);
        shellTask(MetadataFindSeries::setup, MetadataFindSeries.class);
        shellTask(MetadataFindSeriesIds::setup, MetadataFindSeriesIds.class);
        shellTask(MetadataMigrate::setup, MetadataMigrate.class);
        shellTask(MetadataLoad::setup, MetadataLoad.class);
        shellTask(SuggestTag::setup, SuggestTag.class);
        shellTask(SuggestKey::setup, SuggestKey.class);
        shellTask(SuggestTagValue::setup, SuggestTagValue.class);
        shellTask(SuggestTagValues::setup, SuggestTagValues.class);
        shellTask(SuggestTagKeyCount::setup, SuggestTagKeyCount.class);
        shellTask(SuggestPerformance::setup, SuggestPerformance.class);
        shellTask(Query::setup, Query.class);
        shellTask(ReadWriteTest::setup, ReadWriteTest.class);
        shellTask(Pause::setup, Pause.class);
        shellTask(Resume::setup, Resume.class);
        shellTask(IngestionFilter::setup, IngestionFilter.class);
        shellTask(DataMigrate::setup, DataMigrate.class);
        shellTask(ParseQuery::setup, ParseQuery.class);
        shellTask(AnalyticsReportFetchSeries::setup, AnalyticsReportFetchSeries.class);
        shellTask(AnalyticsDumpFetchSeries::setup, AnalyticsDumpFetchSeries.class);
        shellTask(LoadGenerated::setup, LoadGenerated.class);
        shellTask(MetadataWrite::setup, MetadataWrite.class);
    }

    public static List<ShellTaskDefinition> available() {
        return available;
    }

    public static Map<Class<?>, ShellTaskDefinition> availableMap() {
        return availableMap;
    }

    static <T extends ShellTask> ShellTaskDefinition shellTask(
        final Function<CoreComponent, T> task, Class<T> type
    ) {
        final String usage = taskUsage(type);

        final String name = name(type);
        final List<String> names = allNames(type);
        final List<String> aliases = aliases(type);

        final ShellTaskDefinition d = new ShellTaskDefinition() {
            @Override
            public String name() {
                return name;
            }

            @Override
            public List<String> names() {
                return names;
            }

            @Override
            public List<String> aliases() {
                return aliases;
            }

            @Override
            public String usage() {
                return usage;
            }

            @Override
            public ShellTask setup(final HeroicCoreInstance core) throws Exception {
                return core.inject(task);
            }
        };

        available.add(d);
        availableMap.put(type, d);
        return d;
    }

    public static String taskUsage(final Class<? extends ShellTask> task) {
        final TaskUsage u = task.getAnnotation(TaskUsage.class);

        if (u != null) {
            return u.value();
        }

        return String.format("<no @ShellTaskUsage annotation for %s>", task.getCanonicalName());
    }

    public static String name(final Class<? extends ShellTask> task) {
        final TaskName n = task.getAnnotation(TaskName.class);

        if (n != null) {
            return n.value();
        }

        throw new IllegalStateException(
            String.format("No name configured with @TaskName on %s", task.getCanonicalName()));
    }

    public static List<String> allNames(final Class<? extends ShellTask> task) {
        final TaskName n = task.getAnnotation(TaskName.class);
        final List<String> names = new ArrayList<>();

        if (n != null) {
            names.add(n.value());

            for (final String alias : n.aliases()) {
                names.add(alias);
            }
        }

        if (names.isEmpty()) {
            throw new IllegalStateException(
                String.format("No name configured with @TaskName on %s", task.getCanonicalName()));
        }

        return names;
    }

    public static List<String> aliases(final Class<? extends ShellTask> task) {
        final TaskName n = task.getAnnotation(TaskName.class);
        final List<String> names = new ArrayList<>();

        if (n != null) {
            for (final String alias : n.aliases()) {
                names.add(alias);
            }
        }

        return names;
    }

    public static Filter setupFilter(QueryParser parser, TaskQueryParameters params) {
        final List<String> query = params.getQuery();

        if (query.isEmpty()) {
            return TrueFilter.get();
        }

        return parser.parseFilter(StringUtils.join(query, " "));
    }

    public static BackendKeyFilter setupKeyFilter(KeyspaceBase params, ObjectMapper mapper)
        throws Exception {
        BackendKeyFilter filter = new BackendKeyFilter();

        if (params.getStart() != null) {
            filter = filter.withStart(new BackendKeyFilter.GTE(
                mapper.readValue(params.getStart(), BackendKeyArgument.class).toBackendKey()));
        }

        if (params.getStartPercentage() >= 0) {
            filter = filter.withStart(
                new BackendKeyFilter.GTEPercentage((float) params.getStartPercentage() / 100f));
        }

        if (params.getStartToken() != null) {
            filter = filter.withStart(new BackendKeyFilter.GTEToken(params.getStartToken()));
        }

        if (params.getEnd() != null) {
            filter = filter.withEnd(new BackendKeyFilter.LT(
                mapper.readValue(params.getEnd(), BackendKeyArgument.class).toBackendKey()));
        }

        if (params.getEndPercentage() >= 0) {
            filter =
                filter.withEnd(new BackendKeyFilter.LTPercentage((float) params.getEndPercentage()
                                                                 / 100f));
        }

        if (params.getEndToken() != null) {
            filter = filter.withEnd(new BackendKeyFilter.LTToken(params.getEndToken()));
        }

        filter = filter.withLimit(params.getLimit());
        return filter;
    }

    public static Series parseSeries(final ObjectMapper mapper, final Optional<String> series) {
        return series.map(s -> {
            try {
                return mapper.readValue(s, Series.class);
            } catch (IOException e) {
                throw new RuntimeException("Bad series: " + s, e);
            }
        }).orElseGet(Series::empty);
    }

    public static <T> Stream<T> parseJsonLines(
        final ObjectMapper mapper, final Optional<Path> file, final ShellIO io, final Class<T> type
    ) {
        return file.map(f -> {
            try {
                final BufferedReader reader =
                    new BufferedReader(new InputStreamReader(io.newInputStream(f), Charsets.UTF_8));

                return reader.lines().onClose(() -> {
                    try {
                        reader.close();
                    } catch (IOException e) {
                        throw new RuntimeException("Failed to close file", e);
                    }
                }).map(line -> {
                    try {
                        return mapper.readValue(line.trim(), type);
                    } catch (IOException e) {
                        throw new RuntimeException("Failed to decode line (" + line.trim() + ")",
                            e);
                    }
                });
            } catch (final IOException e) {
                throw new RuntimeException("Failed to open file: " + f, e);
            }
        }).orElseGet(Stream::empty);
    }

    private static final List<DateTimeParser> today = new ArrayList<>();
    private static final List<DateTimeParser> full = new ArrayList<>();

    static {
        today.add(DateTimeFormat.forPattern("HH:mm").getParser());
        today.add(DateTimeFormat.forPattern("HH:mm:ss").getParser());
        today.add(DateTimeFormat.forPattern("HH:mm:ss.SSS").getParser());
        full.add(DateTimeFormat.forPattern("yyyy-MM-dd/HH:mm").getParser());
        full.add(DateTimeFormat.forPattern("yyyy-MM-dd/HH:mm:ss").getParser());
        full.add(DateTimeFormat.forPattern("yyyy-MM-dd/HH:mm:ss.SSS").getParser());
    }

    public static long parseInstant(String input, long now) {
        if (input.charAt(0) == '+') {
            return now + Long.parseLong(input.substring(1));
        }

        if (input.charAt(0) == '-') {
            return now - Long.parseLong(input.substring(1));
        }

        // try to parse just milliseconds
        try {
            return Long.parseLong(input);
        } catch (IllegalArgumentException e) {
            // pass-through
        }

        final Chronology chrono = ISOChronology.getInstanceUTC();

        if (input.indexOf('/') >= 0) {
            return parseFullInstant(input, chrono);
        }

        return parseTodayInstant(input, chrono, now);
    }

    private static long parseTodayInstant(String input, final Chronology chrono, long now) {
        final DateTime n = new DateTime(now, chrono);

        for (final DateTimeParser p : today) {
            final DateTimeParserBucket bucket =
                new DateTimeParserBucket(0, chrono, null, null, 2000);

            bucket.saveField(chrono.year(), n.getYear());
            bucket.saveField(chrono.monthOfYear(), n.getMonthOfYear());
            bucket.saveField(chrono.dayOfYear(), n.getDayOfYear());

            try {
                p.parseInto(bucket, input, 0);
            } catch (IllegalArgumentException e) {
                // pass-through
                continue;
            }

            return bucket.computeMillis();
        }

        throw new IllegalArgumentException(input + " is not a valid instant");
    }

    private static long parseFullInstant(String input, final Chronology chrono) {
        for (final DateTimeParser p : full) {
            final DateTimeParserBucket bucket =
                new DateTimeParserBucket(0, chrono, null, null, 2000);

            try {
                p.parseInto(bucket, input, 0);
            } catch (IllegalArgumentException e) {
                // pass-through
                continue;
            }

            return bucket.computeMillis();
        }

        throw new IllegalArgumentException(input + " is not a valid instant");
    }

    public static String formatTimeNanos(long diff) {
        if (diff < 1000) {
            return String.format("%d ns", diff);
        }

        if (diff < 1000000) {
            final double v = ((double) diff) / 1000;
            return String.format("%.3f us", v);
        }

        if (diff < 1000000000) {
            final double v = ((double) diff) / 1000000;
            return String.format("%.3f ms", v);
        }

        final double v = ((double) diff) / 1000000000;
        return String.format("%.3f s", v);
    }
}


text:
<?php

namespace Basho\Riak\Api;

use Basho\Riak\Api;
use Basho\Riak\ApiInterface;
use Basho\Riak\Bucket;
use Basho\Riak\Command;
use Basho\Riak\DataType\Counter;
use Basho\Riak\DataType\Map;
use Basho\Riak\DataType\Set;
use Basho\Riak\DataType\Hll;
use Basho\Riak\Location;
use Basho\Riak\Node;
use Basho\Riak\Object;
use Basho\Riak\Search\Doc;
use Basho\Riak\TimeSeries\Cell;

/**
 * Handles communications between end user app & Riak via Riak HTTP API using cURL
 *
 * @author Christopher Mancini <cmancini at basho d0t com>
 */
class Http extends Api implements ApiInterface
{
    // Header keys
    const VCLOCK_KEY = 'X-Riak-Vclock';
    const CONTENT_TYPE_KEY = 'Content-Type';
    const METADATA_PREFIX = 'X-Riak-Meta-';
    const LAST_MODIFIED_KEY = 'Last-Modified';

    // Content Types
    const CONTENT_TYPE_JSON = 'application/json';
    const CONTENT_TYPE_XML = 'application/xml';

    const TS_API_PREFIX = '/ts/v1';

    /**
     * Request body to be sent
     *
     * @var string
     */
    protected $requestBody = '';

    /**
     * Request url the request is being sent to
     *
     * @var string
     */
    protected $requestURL = '';

    /**
     * Response headers returned from request
     *
     * @var array
     */
    protected $responseHeaders = [];

    /**
     * Response body returned from request
     *
     * @var string
     */
    protected $responseBody = '';

    /**
     * HTTP Status Code from response
     *
     * @var int
     */
    protected $statusCode = 0;

    /**
     * cURL connection handle
     *
     * @var null
     */
    protected $connection = null;

    /**
     * API path
     *
     * @var string
     */
    protected $path = '';

    /**
     * Query string
     *
     * @var string
     */
    protected $query = '';

    private $options = [];

    protected $headers = [];

    /**
     * @return int
     */
    public function getStatusCode()
    {
        return $this->statusCode;
    }

    /**
     * @return string
     */
    public function getResponseBody()
    {
        return $this->responseBody;
    }

    /**
     * @return array
     */
    public function getResponseHeaders()
    {
        return $this->responseHeaders;
    }

    /**
     * @return string
     */
    public function getRequest()
    {
        return $this->request . $this->requestBody;
    }

    public function closeConnection()
    {
        if ($this->connection) {
            curl_close($this->connection);
            $this->connection = null;
        }
    }

    /**
     * Prepare request to be sent
     *
     * @param Command $command
     * @param Node $node
     *
     * @return $this
     */
    public function prepare(Command $command, Node $node)
    {
        if ($this->connection) {
            $this->resetConnection();
        }

        // call parent prepare method to setup object members
        parent::prepare($command, $node);

        // set the API path to be used
        $this->buildPath();

        // general connection preparation
        $this->prepareConnection();

        // request specific connection preparation
        $this->prepareRequest();

        return $this;
    }

    public function resetConnection()
    {
        $this->command = null;
        $this->options = [];
        $this->path = '';
        $this->query = '';
        $this->requestBody = '';
        $this->requestURL = '';
        $this->responseHeaders = [];
        $this->responseBody = '';

        if (version_compare(PHP_VERSION, '5.5.0') >= 0) {
            curl_reset($this->connection);
        } else {
            curl_close($this->connection);
            $this->connection = null;
        }
    }

    /**
     * Sets the API path for the command
     *
     * @return $this
     */
    protected function buildPath()
    {
        $bucket = null;
        $key = '';

        $bucket = $this->command->getBucket();

        $location = $this->command->getLocation();
        if (!empty($location) && $location instanceof Location) {
            $key = $location->getKey();
        }
        switch (get_class($this->command)) {
            /** @noinspection PhpMissingBreakStatementInspection */
            case 'Basho\Riak\Command\Bucket\Store':
                $this->headers[static::CONTENT_TYPE_KEY] = static::CONTENT_TYPE_JSON;
            case 'Basho\Riak\Command\Bucket\Fetch':
            case 'Basho\Riak\Command\Bucket\Delete':
                $this->path = sprintf('/types/%s/buckets/%s/props', $bucket->getType(), $bucket->getName());
                break;
            /** @noinspection PhpMissingBreakStatementInspection */
            case 'Basho\Riak\Command\Object\Fetch':
                $this->headers['Accept'] = '*/*, multipart/mixed';
            case 'Basho\Riak\Command\Object\Store':
            case 'Basho\Riak\Command\Object\Delete':
                $this->path = sprintf('/types/%s/buckets/%s/keys/%s', $bucket->getType(), $bucket->getName(), $key);
                break;
            case 'Basho\Riak\Command\Object\Keys\Fetch':
                $this->headers[static::CONTENT_TYPE_KEY] = static::CONTENT_TYPE_JSON;
                $this->path = sprintf('/types/%s/buckets/%s/keys', $bucket->getType(), $bucket->getName());
                break;
            case 'Basho\Riak\Command\DataType\Counter\Store':
            case 'Basho\Riak\Command\DataType\GSet\Store':
            case 'Basho\Riak\Command\DataType\Set\Store':
            /** @noinspection PhpMissingBreakStatementInspection */
            case 'Basho\Riak\Command\DataType\Map\Store':
            case 'Basho\Riak\Command\DataType\Hll\Store':
                $this->headers[static::CONTENT_TYPE_KEY] = static::CONTENT_TYPE_JSON;
            case 'Basho\Riak\Command\DataType\Counter\Fetch':
            case 'Basho\Riak\Command\DataType\Set\Fetch':
            case 'Basho\Riak\Command\DataType\Map\Fetch':
            case 'Basho\Riak\Command\DataType\Hll\Fetch':
                $this->path = sprintf('/types/%s/buckets/%s/datatypes/%s', $bucket->getType(), $bucket->getName(), $key);
                break;
            /** @noinspection PhpMissingBreakStatementInspection */
            case 'Basho\Riak\Command\Search\Index\Store':
                $this->headers[static::CONTENT_TYPE_KEY] = static::CONTENT_TYPE_JSON;
            case 'Basho\Riak\Command\Search\Index\Fetch':
            case 'Basho\Riak\Command\Search\Index\Delete':
                $this->path = sprintf('/search/index/%s', $this->command);
                break;
            /** @noinspection PhpMissingBreakStatementInspection */
            case 'Basho\Riak\Command\Search\Schema\Store':
                $this->headers[static::CONTENT_TYPE_KEY] = static::CONTENT_TYPE_XML;
            case 'Basho\Riak\Command\Search\Schema\Fetch':
                $this->path = sprintf('/search/schema/%s', $this->command);
                break;
            case 'Basho\Riak\Command\Search\Fetch':
                $this->path = sprintf('/search/query/%s', $this->command);
                break;
            case 'Basho\Riak\Command\MapReduce\Fetch':
                $this->headers[static::CONTENT_TYPE_KEY] = static::CONTENT_TYPE_JSON;
                $this->path = sprintf('/%s', $this->config['mapred_prefix']);
                break;
            case 'Basho\Riak\Command\Indexes\Query':
                $this->path = $this->createIndexQueryPath($bucket);
                break;
            case 'Basho\Riak\Command\Ping':
                $this->path = '/ping';
                break;
            case 'Basho\Riak\Command\Stats':
                $this->path = '/stats';
                break;
            case 'Basho\Riak\Command\Object\FetchPreflist':
                $this->path = sprintf('/types/%s/buckets/%s/keys/%s/preflist', $bucket->getType(), $bucket->getName(), $key);
                break;
            case 'Basho\Riak\Command\TimeSeries\Fetch':
            case 'Basho\Riak\Command\TimeSeries\Delete':
                /** @var $command Command\TimeSeries\Fetch */
                $command = $this->command;
                $this->path = sprintf('%s/tables/%s/keys/%s', static::TS_API_PREFIX, $command->getTable(), implode("/", $command->getData()));
                break;
            case 'Basho\Riak\Command\TimeSeries\Store':
                /** @var $command Command\TimeSeries\Store */
                $command = $this->command;
                $this->path = sprintf('%s/tables/%s/keys', static::TS_API_PREFIX, $command->getTable());
                break;
            case 'Basho\Riak\Command\TimeSeries\Query\Fetch':
                $this->path = sprintf('%s/query', static::TS_API_PREFIX);
                break;
            default:
                $this->path = '';
        }

        return $this;
    }

    /**
     * Generates the URL path for a 2i Query
     *
     * @param Bucket $bucket
     * @return string
     * @throws Api\Exception if 2i query is invalid.
     */
    private function createIndexQueryPath(Bucket $bucket)
    {
        /**  @var Command\Indexes\Query $command */
        $command = $this->command;

        if($command->isMatchQuery()) {
            $path =  sprintf('/types/%s/buckets/%s/index/%s/%s', $bucket->getType(),
                        $bucket->getName(),
                        $command->getIndexName(),
                        $command->getMatchValue());
        }
        elseif($command->isRangeQuery()) {
            $path =  sprintf('/types/%s/buckets/%s/index/%s/%s/%s', $bucket->getType(),
                        $bucket->getName(),
                        $command->getIndexName(),
                        $command->getLowerBound(),
                        $command->getUpperBound());
        }
        else
        {
            throw new Api\Exception("Invalid Secondary Index Query.");
        }

        return $path;
    }

    /**
     * Prepare Connection
     *
     * Sets general connection options that are used with every request
     *
     * @return $this
     * @throws Api\Exception
     */
    protected function prepareConnection()
    {
        // record outgoing headers
        $this->options[CURLINFO_HEADER_OUT] = 1;

        if ($this->command->getConnectionTimeout()) {
            $this->options[CURLOPT_TIMEOUT] = $this->command->getConnectionTimeout();
        }

        if ($this->node->useTls()) {
            // CA File
            if ($this->node->getCaFile()) {
                $this->options[CURLOPT_CAINFO] = $this->node->getCaFile();
            } elseif ($this->node->getCaDirectory()) {
                $this->options[CURLOPT_CAPATH] = $this->node->getCaDirectory();
            } else {
                throw new Api\Exception('A Certificate Authority file is required for secure connections.');
            }

            // verify CA file
            $this->options[CURLOPT_SSL_VERIFYPEER] = true;

            // verify host common name
            $this->options[CURLOPT_SSL_VERIFYHOST] = 0;

            if ($this->node->getUserName()) {
                $this->options[CURLOPT_USERPWD] = sprintf('%s:%s', $this->node->getUserName(),
                    $this->node->getPassword());
            } elseif ($this->node->getCertificate()) {
                /*
                 * NOT CURRENTLY SUPPORTED ON HTTP
                 *
                $this->options[CURLOPT_SSLCERT] = $this->node->getCertificate();
                $this->options[CURLOPT_SSLCERTTYPE] = 'P12';
                if ($this->node->getCertificatePassword()) {
                    $this->options[CURLOPT_SSLCERTPASSWD] = $this->node->getCertificatePassword();
                }
                if ($this->node->getPrivateKey()) {
                    $this->options[CURLOPT_SSLKEY] = $this->node->getPrivateKey();
                    if ($this->node->getPrivateKeyPassword()) {
                        $this->options[CURLOPT_SSLKEYPASSWD] = $this->node->getPrivateKeyPassword();
                    }
                }
                */
            }
        }

        return $this;
    }

    /**
     * Prepare request
     *
     * Sets connection options that are specific to this request
     *
     * @return $this
     */
    protected function prepareRequest()
    {
        return $this->prepareRequestMethod()
            ->prepareRequestHeaders()
            ->prepareRequestParameters()
            ->prepareRequestUrl()
            ->prepareRequestData();
    }

    /**
     * Prepare request data
     *
     * @return $this
     */
    protected function prepareRequestData()
    {
        // if POST or PUT, add parameters to post data, else add to uri
        if (in_array($this->command->getMethod(), ['POST', 'PUT'])) {
            $this->requestBody = $this->command->getEncodedData();
            $this->options[CURLOPT_POSTFIELDS] = $this->requestBody;
        }

        return $this;
    }

    /**
     * Prepares the complete request URL
     *
     * @return $this
     */
    protected function prepareRequestUrl()
    {
        $protocol = $this->node->useTls() ? 'https' : 'http';
        $this->requestURL = sprintf('%s://%s%s?%s', $protocol, $this->node->getUri(), $this->path, $this->query);

        // set the built request URL on the connection
        $this->options[CURLOPT_URL] = $this->requestURL;

        return $this;
    }

    /**
     * Prepare request parameters
     *
     * @return $this
     */
    protected function prepareRequestParameters()
    {
        if ($this->command->hasParameters()) {
            // build query using RFC 3986 (spaces become %20 instead of '+')
            $this->query = http_build_query($this->command->getParameters(), '', '&', PHP_QUERY_RFC3986);
        }

        return $this;
    }

    /**
     * Prepares the request headers
     *
     * @return $this
     */
    protected function prepareRequestHeaders()
    {
        $curl_headers = [];

        foreach ($this->headers as $key => $value) {
            $curl_headers[] = sprintf('%s: %s', $key, $value);
        }

        // if we have an object, set appropriate object headers
        $object = $this->command->getObject();
        if ($object) {
            if ($object->getVclock()) {
                $curl_headers[] = sprintf('%s: %s', static::VCLOCK_KEY, $object->getVclock());
            }

            if ($object->getContentType()) {
                $charset = '';
                if ($object->getCharset()) {
                    $charset = sprintf('; charset=%s', $object->getCharset());
                }
                $curl_headers[] = sprintf('%s: %s', static::CONTENT_TYPE_KEY, $object->getContentType(), $charset);
            }

            // setup index headers
            $translator = new Api\Http\Translator\SecondaryIndex();
            $indexHeaders = $translator->createHeadersFromIndexes($object->getIndexes());
            foreach ($indexHeaders as $value) {
                $curl_headers[] = sprintf('%s: %s', $value[0], $value[1]);
            }

            // setup metadata headers
            foreach($object->getMetaData() as $key => $value) {
                $curl_headers[] = sprintf('%s%s: %s', static::METADATA_PREFIX, $key, $value);
            }
        }

        // set the request headers on the connection
        $this->options[CURLOPT_HTTPHEADER] = $curl_headers;

        // dump local headers to start fresh
        $this->headers = [];

        return $this;
    }

    /**
     * Prepare the request method
     *
     * @return $this
     */
    protected function prepareRequestMethod()
    {
        switch ($this->command->getMethod()) {
            case "POST":
                $this->options[CURLOPT_POST] = 1;
                break;
            case "PUT":
                $this->options[CURLOPT_CUSTOMREQUEST] = 'PUT';
                break;
            case "DELETE":
                $this->options[CURLOPT_CUSTOMREQUEST] = 'DELETE';
                break;
            case "HEAD":
                $this->options[CURLOPT_NOBODY] = 1;
                break;
            default:
                // reset http method to get in case its changed
                $this->options[CURLOPT_HTTPGET] = 1;
        }

        return $this;
    }

    /**
     * @return string
     */
    public function getPath()
    {
        return $this->path;
    }

    /**
     * @return string
     */
    public function getQuery()
    {
        return $this->query;
    }

    /**
     * @return bool
     */
    public function send()
    {
        // set the response header and body callback functions
        $this->options[CURLOPT_HEADERFUNCTION] = [$this, 'responseHeaderCallback'];
        $this->options[CURLOPT_WRITEFUNCTION] = [$this, 'responseBodyCallback'];
        if ($this->command->isVerbose()) {
            // set curls output to be the output buffer stream
            $this->options[CURLOPT_STDERR] = fopen('php://stdout', 'w+');
            $this->options[CURLOPT_VERBOSE] = 1;

            // there is a bug when verbose is enabled, header out causes no output
            // @see https://bugs.php.net/bug.php?id=65348
            unset($this->options[CURLINFO_HEADER_OUT]);

            echo "cURL Command:\n\tcurl -X{$this->command->getMethod()} {$this->requestURL} --data \"{$this->requestBody}\"\n";
        }

        // set all options on the resource
        curl_setopt_array($this->getConnection(), $this->options);

        // execute the request
        $this->success = curl_exec($this->getConnection());
        if ($this->success === false) {
            $this->error = curl_error($this->getConnection());
        } elseif ($this->success === true) {
            $this->error = '';
        }

        $this->request = curl_getinfo($this->getConnection(), CURLINFO_HEADER_OUT);

        // set the response http code
        $this->statusCode = curl_getinfo($this->getConnection(), CURLINFO_HTTP_CODE);

        $this->parseResponse();

        return $this->success;
    }

    /**
     * Add a custom header to the request
     *
     * @param $key
     * @param $value
     */
    public function addHeader($key, $value)
    {
        $this->headers[$key] = $value;
    }

    /**
     * @return resource
     */
    public function getConnection()
    {
        if (!$this->connection) {
            $this->openConnection();
        }

        return $this->connection;
    }

    public function openConnection()
    {
        $this->connection = curl_init();

        return $this;
    }

    /**
     * Response header callback
     *
     * Handles callback from curl when the response is received, it parses the headers into an array sets them as
     * member of the class.
     *
     * Has to be public for curl to be able to access it.
     *
     * @param $ch
     * @param $header
     *
     * @return int
     */
    public function responseHeaderCallback($ch, $header)
    {
        if (strpos($header, ':')) {
            list ($key, $value) = explode(':', $header, 2);

            $value = trim($value);

            if (!empty($value)) {
                if (!isset($this->responseHeaders[$key])) {
                    $this->responseHeaders[$key] = $value;
                } elseif (is_array($this->responseHeaders[$key])) {
                    $this->responseHeaders[$key] = array_merge($this->responseHeaders[$key], [$value]);
                } else {
                    $this->responseHeaders[$key] = array_merge([$this->responseHeaders[$key]], [$value]);
                }
            }
        }

        return strlen($header);
    }

    /**
     * Response body callback
     *
     * Handles callback from curl when the response is received, it sets the response body as a member of the class.
     *
     * Has to be public for curl to be able to access it.
     *
     * @param $ch
     * @param $body
     *
     * @return int
     */
    public function responseBodyCallback($ch, $body)
    {
        $this->responseBody .= $body;
        return strlen($body);
    }

    protected function parseResponse()
    {
        // trim leading / trailing whitespace
        $body = $this->responseBody;
        $location = null;
        if ($this->getResponseHeader('Location')) {
            $location = Location::fromString($this->getResponseHeader('Location'));
        }

        if ($this->statusCode == 500) {
            $this->success = false;
            $this->error = $body;
        }

        switch (get_class($this->command)) {
            case 'Basho\Riak\Command\Bucket\Store':
            case 'Basho\Riak\Command\Bucket\Fetch':
                $bucket = null;
                $modified = $this->getResponseHeader(static::LAST_MODIFIED_KEY, '');
                $properties = json_decode($body, true);
                if (isset($properties['props']) && $this->command->getBucket()) {
                    $bucket = new Bucket($this->command->getBucket()->getName(), $this->command->getBucket()->getType(), $properties['props']);
                }
                $response = new Command\Bucket\Response($this->success, $this->statusCode, $this->error, $bucket, $modified);
                break;

            case 'Basho\Riak\Command\Object\Fetch':
            case 'Basho\Riak\Command\Object\Store':
                /** @var Command\Object $command */
                $command = $this->command;
                $objects = (new Api\Http\Translator\ObjectResponse($command, $this->statusCode))
                    ->parseResponse($body, $this->responseHeaders);
                $response = new Command\Object\Response($this->success, $this->statusCode, $this->error, $location, $objects);
                break;

            case 'Basho\Riak\Command\Object\FetchPreflist':
                $response = new Command\Object\Response($this->success, $this->statusCode, $this->error, $location, [new Object(json_decode($body))]);
                break;

            case 'Basho\Riak\Command\Object\Keys\Fetch':
                $data = json_decode($body);
                $keys = [];
                foreach ($data->keys as $key) {
                    $keys[] = new Location($key, $this->command->getBucket());
                }
                $response = new Command\Object\Keys\Response($this->success, $this->statusCode, $this->error, $keys);
                break;

            case 'Basho\Riak\Command\DataType\Counter\Store':
            case 'Basho\Riak\Command\DataType\Counter\Fetch':
                $counter = null;
                $json_object = json_decode($body);
                if ($json_object && isset($json_object->value)) {
                    $counter = new Counter($json_object->value);
                }
                $response = new Command\DataType\Counter\Response(
                    $this->success, $this->statusCode, $this->error, $location, $counter, $this->getResponseHeader('Date')
                );
                break;

            case 'Basho\Riak\Command\DataType\GSet\Store':
            case 'Basho\Riak\Command\DataType\Set\Store':
            case 'Basho\Riak\Command\DataType\Set\Fetch':
                $set = null;
                $json_object = json_decode($body);
                if ($json_object && isset($json_object->value)) {
                    $context = '';
                    if (isset($json_object->context)) {
                        $context = $json_object->context;
                    }
                    $set = new Set($json_object->value, $context);
                }
                $response = new Command\DataType\Set\Response(
                    $this->success, $this->statusCode, $this->error, $location, $set, $this->getResponseHeader('Date')
                );
                break;

            case 'Basho\Riak\Command\DataType\Map\Store':
            case 'Basho\Riak\Command\DataType\Map\Fetch':
                $map = null;
                $json_object = json_decode($body, true);
                if ($json_object && isset($json_object['value'])) {
                    $map = new Map($json_object['value'], $json_object['context']);
                }
                $response = new Command\DataType\Map\Response(
                    $this->success, $this->statusCode, $this->error, $location, $map, $this->getResponseHeader('Date')
                );
                break;

            case 'Basho\Riak\Command\DataType\Hll\Store':
            case 'Basho\Riak\Command\DataType\Hll\Fetch':
                $hll = null;
                $json_object = json_decode($body);
                if ($json_object && isset($json_object->value)) {
                    $hll = new Hll($json_object->value);
                }
                $response = new Command\DataType\Hll\Response(
                    $this->success, $this->statusCode, $this->error, $location, $hll, $this->getResponseHeader('Date')
                );
                break;

            case 'Basho\Riak\Command\Search\Fetch':
                $results = in_array($this->statusCode, [200,204]) ? json_decode($body) : null;
                $docs = [];
                if (!empty($results->response->docs)) {
                    foreach ($results->response->docs as $doc) {
                        $docs[] = new Doc($doc);
                    }
                }
                $numFound = !empty($results->response->numFound) ? $results->response->numFound : 0;

                $response = new Command\Search\Response($this->success, $this->statusCode, $this->error, $numFound, $docs);
                break;
            case 'Basho\Riak\Command\Search\Index\Store':
            case 'Basho\Riak\Command\Search\Index\Fetch':
                $index = json_decode($body);
                $response = new Command\Search\Index\Response($this->success, $this->statusCode, $this->error, $index);
                break;

            case 'Basho\Riak\Command\Search\Schema\Store':
            case 'Basho\Riak\Command\Search\Schema\Fetch':
                $response = new Command\Search\Schema\Response(
                    $this->success, $this->statusCode, $this->error, $body, $this->getResponseHeader(static::CONTENT_TYPE_KEY)
                );
                break;

            case 'Basho\Riak\Command\MapReduce\Fetch':
                $results = in_array($this->statusCode, [200,204]) ? json_decode($body) : null;
                $response = new Command\MapReduce\Response($this->success, $this->statusCode, $this->error, $results);
                break;
            case 'Basho\Riak\Command\Indexes\Query':
                $json_object = in_array($this->statusCode, [200,204]) ? json_decode($body, true) : null;
                $results = [];
                $termsReturned = false;
                $continuation = null;
                $done = true;

                if (isset($json_object['keys'])) {
                    $results = $json_object['keys'];
                }

                if (isset($json_object['results'])) {
                    $results = $json_object['results'];
                    $termsReturned = true;
                }

                if (isset($json_object['continuation'])) {
                    $continuation = $json_object['continuation'];
                    $done = false;
                }

                $response = new Command\Indexes\Response(
                    $this->success, $this->statusCode, $this->error, $results, $termsReturned, $continuation, $done, $this->getResponseHeader('Date')
                );
                break;
            case 'Basho\Riak\Command\Stats':
                $response = new Command\Stats\Response($this->success, $this->statusCode, $this->error, json_decode($body, true));
                break;
            case 'Basho\Riak\Command\TimeSeries\Fetch':
                $row = in_array($this->statusCode, ['200','201','204']) ? json_decode($body, true) : [];
                $response = new Command\TimeSeries\Response($this->success, $this->statusCode, $this->error, [$row]);
                break;
            case 'Basho\Riak\Command\TimeSeries\Query\Fetch':
                $results = in_array($this->statusCode, ['200','204']) ? json_decode($body) : [];
                $rows = [];
                if (isset($results->rows)) {
                    foreach ($results->rows as $row) {
                        $cells = [];
                        foreach ($results->columns as $index => $column) {
                            $cells[$column] = $row[$index];
                        }
                        $rows[] = $cells;
                    }
                }
                $response = new Command\TimeSeries\Query\Response($this->success, $this->statusCode, $this->error, $rows);
                break;
            case 'Basho\Riak\Command\TimeSeries\Store':
            case 'Basho\Riak\Command\TimeSeries\Delete':
            case 'Basho\Riak\Command\Object\Delete':
            case 'Basho\Riak\Command\Bucket\Delete':
            case 'Basho\Riak\Command\Search\Index\Delete':
            case 'Basho\Riak\Command\Ping':
            default:
                $response = new Command\Response($this->success, $this->statusCode, $this->error);
                break;
        }

        $this->response = $response;
    }

    protected function getResponseHeader($key, $default = '')
    {
        if (!empty($this->responseHeaders[$key])) {
            return $this->responseHeaders[$key];
        } else {
            return $default;
        }
    }
}


text:
// Require the underscore.js lib and the Parent Model
var _           = require('lib/underscore');
var ListingModel = require('./ListingModel');

// Create new object inheriting from the parent
var Farm = Object.create(ListingModel);

// Set the resource that applies to this model
Farm.resource = 'Farm';
Farm.originalResource = Farm.resource;

// Set the fields to be used when invoking limited results
Farm.limitfields = new Array(
    'listno',
    'image',
    'status_tx',
    'shortsale',
    'address',
    'listprice',
    'sold_price',
    'dim_acres',
    'zoningchar',
    'office',
    'openhouse_count',
    'latitude',
    'longitude',
    'status',
    'dt_sold',
    'dt_expire',
    'status',
    'dt_sold',
    'dt_expire',
    'property_rating'
);

/**
 * Grabs a SINGLE listing using it's unique listing number
 *
 * @param {int} listno
 * @param {function} callback
 */
Farm.getListing = function(listno, callback){
    this.setHistorical();
    this.getWithId('listno', listno, callback);
    this.resetHistorical();
}

/**
 * This calls the parent's object of the same name
 *
 * @param {int} offset
 * @param {function} callback
 */
Farm.getListings = function(offset, callback) {
    this.setHistorical();

    var selectFields = this.limitfields.slice(0);

    this.setViewingFavorites();

    this.getRowsWithOffset(selectFields, this.currentSearch.getPropertySearch(), offset, callback);
    this.resetHistorical();
}

module.exports = Farm;


text:
'use strict'

process.env.NODE_ENV = 'development'

const config0 = require('../../build/dev-config'),
	port = config0.testRunnerPort,
	MongoClient = require('mongodb').MongoClient,
	pack = require('../../package.json'),
	path = require('path'),
	co = require('co')

let config = require('../../node_modules/jade-press/config-sample')
config.setting.theme = {
	path: path.resolve(__dirname, '../..'),
	name: pack.name,
	version: pack.version
}
config.setting.plugins = {}
config.setting.mongoStoreOptions.url = 'mongodb://127.0.0.1:27017/test0'
config.setting.dbLink = 'mongodb://127.0.0.1:27017/test0'
config.local.port = port

let init = require('jade-press').init

co(function*() {
		let dd = yield MongoClient.connect(config.setting.dbLink)
		yield dd.dropDatabase()
		let res = yield init(config)
		return Promise.resolve(res)
	})
	.then(function(app) {

		app.listen(port, config.setting.listenAddress, function() {
			console.log('' + new Date(), config.local.siteName, 'runs on port', port)

			// 2. run the nightwatch test suite against it
			// to run in additional browsers:
			//    1. add an entry in test/e2e/nightwatch.conf.json under "test_settings"
			//    2. add it to the --env flag below
			// For more information on Nightwatch's config file, see
			// http://nightwatchjs.org/guide#settings-file

			var spawn = require('cross-spawn')
			var runner = spawn(
				'./node_modules/.bin/nightwatch', [
					'--config', 'test/e2e/nightwatch.conf.js',
					'--env', 'chrome'
				], {
					stdio: 'inherit'
				}
			)

			runner.on('exit', function(code) {
				process.exit(code)
			})

			runner.on('error', function(err) {
				throw err
			})

		})

	})


text:
namespace IronJS.Tests.UnitTests.Sputnik.Conformance.NativeECMAScriptObjects.BooleanObjects
{
    using System;
    using NUnit.Framework;

    [TestFixture]
    public class PropertiesOfTheBooleanPrototypeObjectTests : SputnikTestFixture
    {
        public PropertiesOfTheBooleanPrototypeObjectTests()
            : base(@"Conformance\15_Native_ECMA_Script_Objects\15.6_Boolean_Objects\15.6.4_Properties_of_the_Boolean_Prototype_Object")
        {
        }

        [Test]
        [Category("Sputnik Conformance")]
        [Category("ECMA 15.6.4.1")]
        [TestCase("S15.6.4.1_A1.js", Description = "The initial value of Boolean.prototype.constructor is the built-in Boolean constructor")]
        public void TheInitialValueOfBooleanPrototypeConstructorIsTheBuiltInBooleanConstructor(string file)
        {
            RunFile(file);
        }

        [Test]
        [Category("Sputnik Conformance")]
        [Category("ECMA 15.6.4.2")]
        [TestCase("S15.6.4.2_A1_T1.js", Description = "toString: If this boolean value is true, then the string \"true\" is returned, otherwise, this boolean value must be false, and the string \"false\" is returned")]
        [TestCase("S15.6.4.2_A1_T2.js", Description = "toString: If this boolean value is true, then the string \"true\" is returned, otherwise, this boolean value must be false, and the string \"false\" is returned")]
        public void ToStringIfThisBooleanValueIsTrueThenTheStringTrueIsReturnedOtherwiseThisBooleanValueMustBeFalseAndTheStringFalseIsReturned(string file)
        {
            RunFile(file);
        }

        [Test]
        [Category("Sputnik Conformance")]
        [Category("ECMA 15.6.4.2")]
        [TestCase("S15.6.4.2_A2_T1.js", Description = "The toString function is not generic, it cannot be transferred to other kinds of objects for use as a method and there is should be a TypeError exception if its this value is not a Boolean object")]
        [TestCase("S15.6.4.2_A2_T2.js", Description = "The toString function is not generic, it cannot be transferred to other kinds of objects for use as a method and there is should be a TypeError exception if its this value is not a Boolean object")]
        [TestCase("S15.6.4.2_A2_T3.js", Description = "The toString function is not generic, it cannot be transferred to other kinds of objects for use as a method and there is should be a TypeError exception if its this value is not a Boolean object")]
        [TestCase("S15.6.4.2_A2_T4.js", Description = "The toString function is not generic, it cannot be transferred to other kinds of objects for use as a method and there is should be a TypeError exception if its this value is not a Boolean object")]
        [TestCase("S15.6.4.2_A2_T5.js", Description = "The toString function is not generic, it cannot be transferred to other kinds of objects for use as a method and there is should be a TypeError exception if its this value is not a Boolean object")]
        public void TheToStringFunctionIsNotGenericItCannotBeTransferredToOtherKindsOfObjectsForUseAsAMethodAndThereIsShouldBeATypeErrorExceptionIfItsThisValueIsNotABooleanObject(string file)
        {
            RunFile(file);
        }

        [Test]
        [Category("Sputnik Conformance")]
        [Category("ECMA 15.6.4.3")]
        [TestCase("S15.6.4.3_A1_T1.js", Description = "Boolean.prototype.valueOf() returns this boolean value")]
        [TestCase("S15.6.4.3_A1_T2.js", Description = "Boolean.prototype.valueOf() returns this boolean value")]
        public void BooleanPrototypeValueOfReturnsThisBooleanValue(string file)
        {
            RunFile(file);
        }

        [Test]
        [Category("Sputnik Conformance")]
        [Category("ECMA 15.6.4.3")]
        [TestCase("S15.6.4.3_A2_T1.js", Description = "The valueOf function is not generic, it cannot be transferred to other kinds of objects for use as a method and there is should be a TypeError exception if its this value is not a Boolean object")]
        [TestCase("S15.6.4.3_A2_T2.js", Description = "The valueOf function is not generic, it cannot be transferred to other kinds of objects for use as a method and there is should be a TypeError exception if its this value is not a Boolean object")]
        [TestCase("S15.6.4.3_A2_T3.js", Description = "The valueOf function is not generic, it cannot be transferred to other kinds of objects for use as a method and there is should be a TypeError exception if its this value is not a Boolean object")]
        [TestCase("S15.6.4.3_A2_T4.js", Description = "The valueOf function is not generic, it cannot be transferred to other kinds of objects for use as a method and there is should be a TypeError exception if its this value is not a Boolean object")]
        [TestCase("S15.6.4.3_A2_T5.js", Description = "The valueOf function is not generic, it cannot be transferred to other kinds of objects for use as a method and there is should be a TypeError exception if its this value is not a Boolean object")]
        public void TheValueOfFunctionIsNotGenericItCannotBeTransferredToOtherKindsOfObjectsForUseAsAMethodAndThereIsShouldBeATypeErrorExceptionIfItsThisValueIsNotABooleanObject(string file)
        {
            RunFile(file);
        }

        [Test]
        [Category("Sputnik Conformance")]
        [Category("ECMA 15.6.4")]
        [TestCase("S15.6.4_A1.js", Description = "The Boolean prototype object is itself a Boolean object (its [[Class]] is \"Boolean\") whose value is false")]
        public void TheBooleanPrototypeObjectIsItselfABooleanObjectItsClassIsBooleanWhoseValueIsFalse(string file)
        {
            RunFile(file);
        }

        [Test]
        [Category("Sputnik Conformance")]
        [Category("ECMA 15.6.4")]
        [TestCase("S15.6.4_A2.js", Description = "The value of the internal [[Prototype]] property of the Boolean prototype object is the Object prototype object")]
        public void TheValueOfTheInternalPrototypePropertyOfTheBooleanPrototypeObjectIsTheObjectPrototypeObject(string file)
        {
            RunFile(file);
        }
    }
}


text:
package com.waincent.fleet.domain.interactor;

import com.waincent.fleet.domain.User;
import com.waincent.fleet.domain.executor.PostExecutionThread;
import com.waincent.fleet.domain.executor.ThreadExecutor;
import com.waincent.fleet.domain.repository.UserRepository;

import javax.inject.Inject;

import dagger.internal.Preconditions;
import io.reactivex.Observable;

/**
 * This class is an implementation of {@link UseCase} that represents a use case for
 * retrieving data related to an specific {@link User}.
 */
public class GetUserDetails extends UseCase<User, GetUserDetails.Params> {

    private final UserRepository userRepository;

    @Inject
    GetUserDetails(UserRepository userRepository, ThreadExecutor threadExecutor,
                   PostExecutionThread postExecutionThread) {
        super(threadExecutor, postExecutionThread);
        this.userRepository = userRepository;
    }

    @Override
    Observable<User> buildUseCaseObservable(Params params) {
        Preconditions.checkNotNull(params);
        return this.userRepository.user(params.userId);
    }

    public static final class Params {

        private final int userId;

        private Params(int userId) {
            this.userId = userId;
        }

        public static Params forUser(int userId) {
            return new Params(userId);
        }
    }
}


text:
1. kill all `cat` processes
2. kill all processes passed as an argument


text:
var express = require('../../node_modules/express'),
    lessMiddlware = require('../../node_modules/less-middleware')({ src: __dirname + '/../../public' }),
    path = require('path');

module.exports = function(app, config){
    app.use(lessMiddlware);
    app.use(express.static(path.join(__dirname + '/../../', 'public')));
}


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

-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd">
    <order>
        <available_product_type name="grouped"/>
    </order>
</config>


text:
dot_files
=========

my dot files to improve productivity on ubuntu.

![image](terminal.png "Terminal")

###Install

Copy .bash_aliases, .bash_completion and .bashrc to `~/` .

	cp .bashrc ~/
	cp .bash_aliases ~/
	cp .bash_completion ~/

####Files

###.bash_aliases

* cd alias 		- 	. for each cd .. until max of 3
* apt alias 	- 	alias for aptget commands

    Example:

        install -> sudo apt-get install
        update  -> sudo apt-get update
        upgrade -> sudo apt-get upgrade

* python utils  -   calendar, server, pydoc, timeit, profile
* git alias		-   git commands

    Example:

    	ga   -> git add
        gcl  -> git clone
        gc   -> git commit
    	gco  -> git checkout

* tree          -   better directory visualisation

* vagrant       -   vagrant alias

    Example:

    	vup  -> vagrant up
        vssh -> vagrant ssh
        vh   -> vagrant halt

* kernel clean  -   remove older kernel using kernelcleanup

To list all aliases type `alias` at the terminal.

###bash_completion

Git, django, vagrant and pip completions.

###bashrc

Better ps1 with color and git status.


text:
layout: kanji-remain
v4: 2977
kanji: 峯
keyword: summit [alternate]
strokes: 10
on-yomi: ホウ
permalink: /rtk/峯/
---

## Koohii stories:

1) [cameron_en] 3-12-2008(19): The alternative summit is so steep that the mountain is above you rather than beside you. People usually just go with the regular summit.

2) [gavmck] 31-3-2010(4): Logically, an alternate way to arrange the primitives for 峰 summit (#1562 峰) is to have 山 on top where it rightfully belongs.

3) [thecite] 4-10-2009(4): The couple have a tryst just below the alternate mountain summit, where no one goes anymore.

4) [abaddon] 14-6-2008(3): Mountain, walking through the bushes: The hippies didn't want to climb the entire mountain and decided to go to the 'alternative summit' which involved walking through the bushes below the mountain.

5) [mantixen] 2-8-2009(2): An alternate type of environmental summit arranges the mountain above the walking legs and Smart Cars necessary to reduce energy consumption and emissions.


text:
function F = asinh(F, varargin)
%ASINH   Inverse hyperbolic sine of a CHEBFUN.
%   ASINH(F) computes the inverse hyperbolic sine of the CHEBFUN F.
%
%   ASINH(F, PREF) does the same but uses the CHEBFUNPREF object PREF when
%   computing the composition.
%
% See also SINH.

% Copyright 2016 by The University of Oxford and The Chebfun Developers. See
% http://www.chebfun.org/ for Chebfun information.

% Call the compose method:
F = compose(F, @asinh, varargin{:});

end


text:
use autocxx_engine::{parse_file, HeaderNamer};
use clap::{crate_authors, crate_version, App, Arg, ArgGroup};
use proc_macro2::TokenStream;
use quote::ToTokens;
use std::io::{Read, Write};
use std::path::PathBuf;
use std::{cell::Cell, fs::File, path::Path};

pub(crate) static BLANK: &str = "// Blank autocxx placeholder";

static LONG_HELP: &str = "
Command line utility to expand the Rust 'autocxx' include_cpp! directive.

This tool can generate both the C++ and Rust side binding code for
a Rust file containing an include_cpp! directive.

If you're using cargo, don't use this: use autocxx_build instead,
which is much easier to include in build.rs build scripts. You'd likely
use this tool only if you're using some non-Cargo build system. If
that's you, read on.

This tool has three modes: generate the C++; generate a new Rust file where
the include_cpp! directive is *replaced* with bindings, or generate
a Rust file which can be included by the autocxx_macro. You may specify
multiple modes, or of course, invoke the tool multiple times.

In any mode, you'll need to pass the source Rust file name and the C++
include path.

For generation of the Rust side bindings, here's how to choose between
the two modes. If you're copying the entire Rust crate to a different
location during your build process, you may as well use --gen-rs-complete
to generate a whole new replacement .rs file with the autocxx
include_cpp! macro expanded.

But in most build systems, you won't be copying all the crate source
to a new location. In such a case, you should use --gen-rs-include
which will generate a file that will be included by the autocxx_macro
crate.

The second decision you must make is naming of the output files.
If your build system is able to cope with autocxx_gen building
unpredictable filenames, then:
a) set AUTOCXX_RS when using autocxx_macro
b) build all *.cc files produced by this tool.

If your build system requires each build rule to make precise filenames
known in advance, then you will need to:
a) Use `--generate-exact <N> --gen-rs-complete`
b) Teach your build system that the C++ files to compile are named `gen0.h`,
   `gen0.cc`, `gen1.h`, `gen1.cc`, etc (through `N`), corresponding
   to each `include_cpp!` section, plus 'cxxgen.h`. `gen.complete.rs` will also
   be generated and should be compiled _instead of_ the original Rust file.
c) If `N` is bigger than the number of files needed, extra no-op files will
   be emitted. These may still be compiled normally, but won't do anything. If
   `N` is smaller than the number of files needed, generation will fail.

Note that there is currently no way to teach each `include_cpp!` section
which `.include.rs` file to use, so the only way to get fixed output paths is
with `--gen-rs-complete`. There are always multiple `.cc` files (even with just
a single `include_cpp!` section), and we always generate the same number of each
type of file.
";

fn main() {
    let matches = App::new("autocxx-gen")
        .version(crate_version!())
        .author(crate_authors!())
        .about("Generates bindings files from Rust files that contain include_cpp! macros")
        .long_about(LONG_HELP)
        .arg(
            Arg::with_name("INPUT")
                .help("Sets the input .rs file to use")
                .required(true)
                .index(1),
        )
        .arg(
            Arg::with_name("outdir")
                .short("o")
                .long("outdir")
                .value_name("PATH")
                .help("output directory path")
                .takes_value(true)
                .required(true),
        )
        .arg(
            Arg::with_name("inc")
                .short("I")
                .long("inc")
                .multiple(true)
                .number_of_values(1)
                .value_name("INCLUDE DIRS")
                .help("include path")
                .takes_value(true),
        )
        .arg(
            Arg::with_name("cpp-extension")
                .long("cpp-extension")
                .value_name("EXTENSION")
                .default_value("cc")
                .help("C++ filename extension")
                .takes_value(true),
        )
        .arg(
            Arg::with_name("gen-cpp")
                .long("gen-cpp")
                .help("whether to generate C++ implementation and header files")
        )
        .arg(
            Arg::with_name("gen-rs-complete")
                .long("gen-rs-complete")
                .help("whether to generate a Rust file replacing the original file (suffix will be .complete.rs)")
        )
        .arg(
            Arg::with_name("gen-rs-include")
                .long("gen-rs-include")
                .help("whether to generate Rust files for inclusion using autocxx_macro (suffix will be .include.rs)")
        )
        .group(ArgGroup::with_name("mode")
            .required(true)
            .multiple(true)
            .arg("gen-cpp")
            .arg("gen-rs-complete")
            .arg("gen-rs-include")
        )
        .arg(
            Arg::with_name("skip-cxx-gen")
                .long("skip-cxx-gen")
                .help("Skip performing C++ codegen for #[cxx::bridge] blocks. Only applies for --gen-cpp")
                .requires("gen-cpp")
        )
        .arg(
            Arg::with_name("generate-exact")
                .long("generate-exact")
                .value_name("NUM")
                .help("assume and ensure there are exactly NUM bridge blocks in the file. Only applies for --gen-cpp or --gen-rs-include")
                .takes_value(true),
        )
        .arg(
            Arg::with_name("fix-rs-include-name")
                .long("fix-rs-include-name")
                .help("Make the name of the .rs file predictable. You must set AUTOCXX_RS_FILE during Rust build time to educate autocxx_macro about your choice.")
                .requires("gen-rs-include")
        )
        .arg(
            Arg::with_name("auto-allowlist")
                .long("auto-allowlist")
                .help("Dynamically construct allowlist from real uses of APIs.")
        )
        .arg(
            Arg::with_name("suppress-system-headers")
                .long("suppress-system-headers")
                .help("Do not refer to any system headers from generated code. May be useful for minimization.")
        )
        .arg(
            Arg::with_name("cxx-impl-annotations")
                .long("cxx-impl-annotations")
                .value_name("ANNOTATION")
                .help("prefix for symbols to be exported from C++ bindings, e.g. __attribute__ ((visibility (\"default\")))")
                .takes_value(true),
        )
        .arg(
            Arg::with_name("cxx-h-path")
                .long("cxx-h-path")
                .value_name("PREFIX")
                .help("prefix for path to cxx.h (from the cxx crate) within #include statements. Must end in /")
                .takes_value(true),
        )
        .arg(
            Arg::with_name("cxxgen-h-path")
                .long("cxxgen-h-path")
                .value_name("PREFIX")
                .help("prefix for path to cxxgen.h (which we generate into the output directory) within #include statements. Must end in /")
                .takes_value(true),
        )
        .arg(
            Arg::with_name("clang-args")
                .last(true)
                .multiple(true)
                .help("Extra arguments to pass to Clang"),
        )
        .get_matches();

    env_logger::builder().init();
    let mut parsed_file = parse_file(
        matches.value_of("INPUT").unwrap(),
        matches.is_present("auto-allowlist"),
    )
    .expect("Unable to parse Rust file and interpret autocxx macro");
    let incs = matches
        .values_of("inc")
        .unwrap_or_default()
        .map(PathBuf::from)
        .collect();
    let extra_clang_args: Vec<_> = matches
        .values_of("clang-args")
        .unwrap_or_default()
        .collect();
    let suppress_system_headers = matches.is_present("suppress-system-headers");
    let desired_number = matches
        .value_of("generate-exact")
        .map(|s| s.parse::<usize>().unwrap());
    let header_counter = Cell::new(0);
    let header_namer = if desired_number.is_some() {
        HeaderNamer(Box::new(|_| {
            let r = format!("gen{}.h", header_counter.get());
            header_counter.set(header_counter.get() + 1);
            r
        }))
    } else {
        Default::default()
    };
    let cpp_codegen_options = autocxx_engine::CppCodegenOptions {
        suppress_system_headers,
        cxx_impl_annotations: get_option_string("cxx-impl-annotations", &matches),
        path_to_cxx_h: get_option_string("cxx-h-path", &matches),
        path_to_cxxgen_h: get_option_string("cxxgen-h-path", &matches),
        skip_cxx_gen: matches.is_present("skip-cxx-gen"),
        header_namer,
    };
    // In future, we should provide an option to write a .d file here
    // by passing a callback into the dep_recorder parameter here.
    // https://github.com/google/autocxx/issues/56
    parsed_file
        .resolve_all(incs, &extra_clang_args, None, &cpp_codegen_options)
        .expect("Unable to resolve macro");
    let outdir: PathBuf = matches.value_of_os("outdir").unwrap().into();
    if matches.is_present("gen-cpp") {
        let cpp = matches.value_of("cpp-extension").unwrap();
        let mut counter = 0usize;
        for include_cxx in parsed_file.get_cpp_buildables() {
            let generations = include_cxx
                .generate_h_and_cxx(&cpp_codegen_options)
                .expect("Unable to generate header and C++ code");
            for pair in generations.0 {
                let cppname = format!("gen{}.{}", counter, cpp);
                write_to_file(&outdir, cppname, &pair.implementation.unwrap_or_default());
                write_to_file(&outdir, pair.header_name, &pair.header);
                counter += 1;
            }
        }
        write_placeholders(&outdir, counter, desired_number, cpp);
    }
    drop(cpp_codegen_options);
    write_placeholders(&outdir, header_counter.into_inner(), desired_number, "h");
    if matches.is_present("gen-rs-complete") {
        let mut ts = TokenStream::new();
        parsed_file.to_tokens(&mut ts);
        write_to_file(
            &outdir,
            "gen.complete.rs".to_string(),
            ts.to_string().as_bytes(),
        );
    }
    if matches.is_present("gen-rs-include") {
        let autocxxes = parsed_file.get_rs_buildables();
        let mut counter = 0usize;
        for include_cxx in autocxxes {
            let ts = include_cxx.generate_rs();
            let fname = if matches.is_present("fix-rs-include-name") {
                format!("gen{}.include.rs", counter)
            } else {
                include_cxx.get_rs_filename()
            };
            write_to_file(&outdir, fname, ts.to_string().as_bytes());
            counter += 1;
        }
        if matches.is_present("fix-rs-include-name") {
            write_placeholders(&outdir, counter, desired_number, "include.rs");
        }
    }
}

fn get_option_string(option: &str, matches: &clap::ArgMatches) -> Option<String> {
    let cxx_impl_annotations = matches.value_of(option).map(|s| s.to_string());
    cxx_impl_annotations
}

fn write_placeholders(
    outdir: &Path,
    mut counter: usize,
    desired_number: Option<usize>,
    extension: &str,
) {
    if let Some(desired_number) = desired_number {
        if counter > desired_number {
            panic!("More .{} files were generated than expected. Increase the value passed to --generate-exact or reduce the number of include_cpp! sections.", extension);
        }
        while counter < desired_number {
            let fname = format!("gen{}.{}", counter, extension);
            write_to_file(outdir, fname, BLANK.as_bytes());
            counter += 1;
        }
    }
}

fn write_to_file(dir: &Path, filename: String, content: &[u8]) {
    let path = dir.join(filename);
    {
        let f = File::open(&path);
        if let Ok(mut f) = f {
            let mut existing_content = Vec::new();
            let r = f.read_to_end(&mut existing_content);
            if r.is_ok() && existing_content == content {
                return; // don't change timestamp on existing file unnecessarily
            }
        }
    }
    let mut f = File::create(&path).expect("Unable to create file");
    f.write_all(content).expect("Unable to write file");
}


text:
import com.microsoft.msr.malmo.*;

import static java.lang.System.loadLibrary;

/**
 * A Java translation of the Python "tutorial_1" example for the Malmo platform made by Microsoft
 */
public class Tutorial1 {

    static {
        loadLibrary("MalmoJava"); // Load the Malmo JNI
    }

    public static void main(String[] argv) {
        AgentHost agentHost = new AgentHost();
        try {
            StringVector args = new StringVector();
            args.add("Tutorial1");
            for(String arg: argv)
                args.add(arg);
        } catch(Exception e) {
            System.out.format("ERROR: %s", e.getMessage());
            System.out.println(agentHost.getUsage());
        }
        if(agentHost.receivedArgument("help")) {
            System.out.println(agentHost.getUsage());
            System.exit(0);
        }

        MissionSpec missionSpec = new MissionSpec();                                        // Initialize our mission
        MissionRecordSpec missionRecordSpec = new MissionRecordSpec("./saved_data.tgz");    // Initialize where we want to store our mission logs

        // Try to start the mission
        int maxRetries = 3;                 // How many times will we try to start our mission
        for(int i=0; i<maxRetries; i++) {
            try {
                // Start the mission - hope it doesn't throw an exception
                agentHost.startMission(missionSpec, missionRecordSpec);
                break;
            } catch(Exception e) {
                // Failed to start the mission since an exception was thrown.
                if(i == maxRetries - 1) {   // Failed to start the mission as many times as we defined in "maxRetries"
                    System.out.format("ERROR: %s", e.getMessage());
                    System.out.format("Couldn't start the mission after trying %d times. Exiting mission.", maxRetries);
                    System.exit(1);
                }

                System.out.format("Failed to start the mission after %d/%d attempts. Retrying in 2 seconds.", i+1, maxRetries);
                try {
                    Thread.sleep(2000);
                } catch(InterruptedException e2) {
                    System.out.format("ERROR: %s", e2.getMessage());
                    System.out.println("Couldn't sleep the thread for two seconds");
                }
            }
        }

        // Wait for the mission to start
        WorldState worldState = agentHost.getWorldState();
        while(!worldState.getHasMissionBegun()) {   // Wait for the mission to begin
            System.out.print(".");
            try {
                Thread.sleep(100);
            } catch(InterruptedException e) {
                System.out.format("ERROR: %s", e.getMessage());
                System.out.println("Couldn't sleep the thread for 0.1 second while waiting for the mission to begin");
            }

            worldState = agentHost.getWorldState();
            for(int i=0; i<worldState.getErrors().size(); i++) {
                System.out.format("ERROR: "+worldState.getErrors().get(i));
            }
        }

        // Log that the mission started
        System.out.println("\nMission started");

        // Do something. In our case, we do nothing for 10 seconds.
        while(worldState.getIsMissionRunning()) {
            System.out.print(".");

            try {
                Thread.sleep(100);
            } catch(InterruptedException e) {
                System.out.format("ERROR: %s", e.getMessage());
                System.out.println("Couldn't sleep the thread for 0.1 second while the mission's executing");
            }

            worldState = agentHost.getWorldState();
            for(int i=0; i<worldState.getErrors().size(); i++) {
                System.out.format("ERROR: "+worldState.getErrors().get(i));
            }
        }

        System.out.println("\n\nMission has ended.");
    }

}


text:
<?php

namespace BlockCypher\Builder;

use BlockCypher\Api\TXOutput;

/**
 * Class TXOutputBuilder
 */
class TXOutputBuilder
{
    /**
     * @var string[]
     */
    private $addresses;

    /**
     * @var string
     */
    private $scryptType;

    /**
     * @var int
     */
    private $value;

    function __construct()
    {
        $this->addresses = array();
        $this->scryptType = null;
        $this->value = null;
    }

    /**
     * @return TXOutputBuilder
     */
    public static function aTXOutput()
    {
        return new TXOutputBuilder();
    }

    /**
     * @param string $scryptType
     * @return $this
     */
    public function withScryptType($scryptType)
    {
        $this->scryptType = $scryptType;
        return $this;
    }

    /**
     * @param int $value
     * @return $this
     */
    public function withValue($value)
    {
        $this->value = $value;
        return $this;
    }

    /**
     * @param string $address
     * @return $this
     */
    public function addAddress($address)
    {
        $this->addresses[] = $address;
        return $this;
    }

    /**
     * @return TXOutput
     */
    public function build()
    {
        $txOutput = new TXOutput();

        $txOutput->setAddresses($this->addresses);
        $txOutput->setScriptType($this->scryptType);
        $txOutput->setValue($this->value);

        return $txOutput;
    }
}


text:
@interface CommandPatternViewController ()

@property (strong, nonatomic) JobArray *jobArray;
@property (strong, nonatomic) Plumber *plumber;
@property (strong, nonatomic) Exterminator *exterminator;
@property (strong, nonatomic) Gardener *gardener;

@end

@implementation CommandPatternViewController

#pragma mark - Init Methods

- (id)init
{
    self = [super init];
    if (self) {
        self.title = @"Command Pattern";
        self.jobArray = [[JobArray alloc] init];
        self.plumber = [[Plumber alloc] init];
        self.exterminator = [[Exterminator alloc] init];
        self.gardener = [[Gardener alloc] init];
    }
    return self;
}

#pragma mark - View Lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];

    [self setupTextView];
}

#pragma mark - Private Methods

- (void)setupTextView
{
    NSMutableString *textViewText = [[NSMutableString alloc] init];

    [textViewText appendString:@"Creating plumber unclog drain job...\n"];

    PlumberUnclogDrainJob *unclogDrainJob = [[PlumberUnclogDrainJob alloc] initWithPlumber:self.plumber];

    [textViewText appendString:@"Creating exterminator kill roaches job...\n"];

    ExterminatorKillRoachesJob *killRoachesJob = [[ExterminatorKillRoachesJob alloc] initWithExterminator:self.exterminator];

    [textViewText appendString:@"Creating gardener trim bushes job...\n"];

    GardenerTrimBushesJob *trimBushesJob = [[GardenerTrimBushesJob alloc] initWithGardener:self.gardener];

    [textViewText appendString:@"Adding jobs to job array...\n"];

    [self.jobArray addJob:unclogDrainJob atIndex:0];
    [self.jobArray addJob:killRoachesJob atIndex:1];
    [self.jobArray addJob:trimBushesJob  atIndex:2];

    [textViewText appendString:@"Executing jobs...\n"];
    [textViewText appendString:[NSString stringWithFormat:@"%@\n", [self.jobArray runJobAtIndex:0]]];
    [textViewText appendString:[NSString stringWithFormat:@"%@\n", [self.jobArray runJobAtIndex:1]]];
    [textViewText appendString:[NSString stringWithFormat:@"%@\n", [self.jobArray runJobAtIndex:2]]];

    self.textView.text = textViewText;
}

@end


text:
Imports System.Xml
Imports System.IO

Public Class ConfigurationManager

#Region " .Properties "

	Private xmlDoc As XmlDocument

#End Region

#Region " Constructors "

	Public Sub New()
		xmlDoc = New XmlDocument

		Dim xmlProc As XmlProcessingInstruction = xmlDoc.CreateProcessingInstruction("xml",
		                                                                             "version=""1.0"" encoding=""utf-8""")
		xmlDoc.AppendChild(xmlProc)

		Dim xmlRoot As XmlElement = xmlDoc.CreateElement("configuration")
		xmlDoc.AppendChild(xmlRoot)
	End Sub

#End Region

#Region " Load() "

	Public Sub Load(ByVal File As String)
		xmlDoc.Load(File)
	End Sub

#End Region

#Region " LoadXml() "

	Public Sub LoadXml(ByVal Data As String)
		xmlDoc.LoadXml(Data)
	End Sub

#End Region

#Region " Save() "

	Public Sub Save(ByVal File As String)
		xmlDoc.Save(File)
	End Sub

	Public Sub Save(ByVal Stream As Stream)
		xmlDoc.Save(Stream)
	End Sub

#End Region

#Region " .Write() "

	Public Function Write(ByVal Section As String, ByVal PropertyName As String, ByVal PropertyValue As String) As Boolean
		Dim SectionNode As XmlElement = xmlDoc.SelectSingleNode("//" & Section)
		Dim mainNode As XmlElement = XMLDoc.DocumentElement

		If (SectionNode Is Nothing) Then
			Dim newNode As XmlElement = XMLDoc.CreateElement(Section)
			mainNode.AppendChild(newNode)
			newNode.SetAttribute(PropertyName, PropertyValue)
		Else
			SectionNode.SetAttribute(PropertyName, PropertyValue)
		End If

		Return True
	End Function

#End Region

#Region " .Read() "

	Public Function Read(ByVal Section As String, ByVal PropertyName As String) As String
		If xmlDoc.OuterXml = "" Then
			Throw New Exception("Configuration file is empty")
		End If

		Dim SettingNode As XmlElement = xmlDoc.SelectSingleNode("//" & Section)

		If (SettingNode Is Nothing) Then
			'Throw New Exception("Section [" & Section & "] is not exists")
			Return Nothing
		Else
			Dim tmpNode As XmlElement = xmlDoc.SelectSingleNode("//" & Section & "[@" & PropertyName & "!='']")
			If Not (tmpNode Is Nothing) Then
				Return SettingNode.GetAttribute(PropertyName)
			Else
				Return Nothing
			End If
		End If
	End Function

#End Region

#Region " .DeleteProperty()"

	Public Function DeleteProperty(ByVal Section As String, ByVal PropertyName As String) As Boolean
		If xmlDoc.OuterXml = "" Then
			Throw New Exception("The file does not contains any data")
		End If

		Dim SettingNode As XmlElement = xmlDoc.SelectSingleNode("//" & Section)

		If (SettingNode Is Nothing) Then
			Throw New Exception("Section [" & Section & "] not exists")
		Else
			SettingNode.Attributes.RemoveNamedItem(PropertyName)
			Return True
		End If
	End Function

#End Region

#Region " .DeleteSection()"

	Public Function DeleteSection(ByVal Section As String) As Boolean
		If xmlDoc.OuterXml = "" Then
			Throw New Exception("The file does not contains any data")
		End If

		Dim SettingNode As XmlNodeList = xmlDoc.SelectNodes("//" & Section)

		If (SettingNode Is Nothing) Then
			Throw New Exception("Error while trying to delete section " & Section & ". Section is not exists")
		Else
			Dim Node As XmlElement
			For Each Node In SettingNode
				Node.ParentNode.RemoveChild(Node)
			Next

			Return True
		End If
	End Function

#End Region

#Region " OuterXml() "

	Public Function OuterXml() As String
		Return xmlDoc.OuterXml
	End Function

#End Region
End Class


text:
> `npm install --save @types/knex`

# Summary
This package contains type definitions for Knex.js (https://github.com/tgriesser/knex).

# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/knex

Additional Details
 * Last updated: Wed, 08 Feb 2017 00:36:08 GMT
 * Dependencies: events, bluebird, node
 * Global values: none

# Credits
These definitions were written by Qubo <https://github.com/tkQubo>.


text:
package parser.nodes;

import exceptions.BadArgumentException;
import model.State;

public abstract class SyntaxNode {

	/**
	 *
	 * @param myState TODO
	 * @return double that allows another SyntaxNode to interpret node as an int
	 * @throws BadArgumentException
	 */
	public abstract double execute(State myState) throws BadArgumentException;

}


text:
package com.github.danielfelgar.drawreceiptlib;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;

/**
 * Created by daniel on 15/08/2016.
 */
public class DrawImage implements IDrawItem {
    private Paint paint = new Paint();
    private Bitmap bitmap;

    public DrawImage(Bitmap bitmap) {
        this.bitmap = bitmap;
    }

    public void setAlign(Paint.Align align) {
        paint.setTextAlign(align);
    }

    public Paint.Align getAlign() {
        return paint.getTextAlign();
    }

    @Override
    public void drawOnCanvas(Canvas canvas, float x, float y) {
        canvas.drawBitmap(bitmap, getX(canvas, x), getY(y), paint);
    }

    private float getY(float y) {
        float baseline = -paint.ascent();
        return baseline + y;
    }

    private float getX(Canvas canvas, float x) {
        float xPos = x;
        if (paint.getTextAlign().equals(Paint.Align.CENTER)) {
            xPos += (canvas.getWidth() - bitmap.getWidth()) / 2;
        } else if (paint.getTextAlign().equals(Paint.Align.RIGHT)) {
            xPos += canvas.getWidth() - bitmap.getWidth();
        }
        return xPos;
    }

    @Override
    public int getHeight() {
        return bitmap.getHeight();
    }
}


text:
#ifndef _LIBINPUT_INPUT_DEVICE_H
#define _LIBINPUT_INPUT_DEVICE_H

#include <input/Input.h>
#include <input/KeyCharacterMap.h>

namespace android {

/*
 * Identifies a device.
 */
struct InputDeviceIdentifier {
    inline InputDeviceIdentifier() :
            bus(0), vendor(0), product(0), version(0) {
    }

    // Information provided by the kernel.
    String8 name;
    String8 location;
    String8 uniqueId;
    uint16_t bus;
    uint16_t vendor;
    uint16_t product;
    uint16_t version;

    // A composite input device descriptor string that uniquely identifies the device
    // even across reboots or reconnections.  The value of this field is used by
    // upper layers of the input system to associate settings with individual devices.
    // It is hashed from whatever kernel provided information is available.
    // Ideally, the way this value is computed should not change between Android releases
    // because that would invalidate persistent settings that rely on it.
    String8 descriptor;

    // A value added to uniquely identify a device in the absence of a unique id. This
    // is intended to be a minimum way to distinguish from other active devices and may
    // reuse values that are not associated with an input anymore.
    uint16_t nonce;
};

/*
 * Describes the characteristics and capabilities of an input device.
 */
class InputDeviceInfo {
public:
    InputDeviceInfo();
    InputDeviceInfo(const InputDeviceInfo& other);
    ~InputDeviceInfo();

    struct MotionRange {
        int32_t axis;
        uint32_t source;
        float min;
        float max;
        float flat;
        float fuzz;
        float resolution;
    };

    void initialize(int32_t id, int32_t generation, int32_t controllerNumber,
            const InputDeviceIdentifier& identifier, const String8& alias, bool isExternal,
            bool hasMic);

    inline int32_t getId() const { return mId; }
    inline int32_t getControllerNumber() const { return mControllerNumber; }
    inline int32_t getGeneration() const { return mGeneration; }
    inline const InputDeviceIdentifier& getIdentifier() const { return mIdentifier; }
    inline const String8& getAlias() const { return mAlias; }
    inline const String8& getDisplayName() const {
        return mAlias.isEmpty() ? mIdentifier.name : mAlias;
    }
    inline bool isExternal() const { return mIsExternal; }
    inline bool hasMic() const { return mHasMic; }
    inline uint32_t getSources() const { return mSources; }

    const MotionRange* getMotionRange(int32_t axis, uint32_t source) const;

    void addSource(uint32_t source);
    void addMotionRange(int32_t axis, uint32_t source,
            float min, float max, float flat, float fuzz, float resolution);
    void addMotionRange(const MotionRange& range);

    inline void setKeyboardType(int32_t keyboardType) { mKeyboardType = keyboardType; }
    inline int32_t getKeyboardType() const { return mKeyboardType; }

    inline void setKeyCharacterMap(const sp<KeyCharacterMap>& value) {
        mKeyCharacterMap = value;
    }

    inline sp<KeyCharacterMap> getKeyCharacterMap() const {
        return mKeyCharacterMap;
    }

    inline void setVibrator(bool hasVibrator) { mHasVibrator = hasVibrator; }
    inline bool hasVibrator() const { return mHasVibrator; }

    inline void setButtonUnderPad(bool hasButton) { mHasButtonUnderPad = hasButton; }
    inline bool hasButtonUnderPad() const { return mHasButtonUnderPad; }

    inline const Vector<MotionRange>& getMotionRanges() const {
        return mMotionRanges;
    }

private:
    int32_t mId;
    int32_t mGeneration;
    int32_t mControllerNumber;
    InputDeviceIdentifier mIdentifier;
    String8 mAlias;
    bool mIsExternal;
    bool mHasMic;
    uint32_t mSources;
    int32_t mKeyboardType;
    sp<KeyCharacterMap> mKeyCharacterMap;
    bool mHasVibrator;
    bool mHasButtonUnderPad;

    Vector<MotionRange> mMotionRanges;
};

/* Types of input device configuration files. */
enum InputDeviceConfigurationFileType {
    INPUT_DEVICE_CONFIGURATION_FILE_TYPE_CONFIGURATION = 0,     /* .idc file */
    INPUT_DEVICE_CONFIGURATION_FILE_TYPE_KEY_LAYOUT = 1,        /* .kl file */
    INPUT_DEVICE_CONFIGURATION_FILE_TYPE_KEY_CHARACTER_MAP = 2, /* .kcm file */
};

/*
 * Gets the path of an input device configuration file, if one is available.
 * Considers both system provided and user installed configuration files.
 *
 * The device identifier is used to construct several default configuration file
 * names to try based on the device name, vendor, product, and version.
 *
 * Returns an empty string if not found.
 */
extern String8 getInputDeviceConfigurationFilePathByDeviceIdentifier(
        const InputDeviceIdentifier& deviceIdentifier,
        InputDeviceConfigurationFileType type);

/*
 * Gets the path of an input device configuration file, if one is available.
 * Considers both system provided and user installed configuration files.
 *
 * The name is case-sensitive and is used to construct the filename to resolve.
 * All characters except 'a'-'z', 'A'-'Z', '0'-'9', '-', and '_' are replaced by underscores.
 *
 * Returns an empty string if not found.
 */
extern String8 getInputDeviceConfigurationFilePathByName(
        const String8& name, InputDeviceConfigurationFileType type);

} // namespace android

#endif // _LIBINPUT_INPUT_DEVICE_H


text:
package xyz.acmer.service;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

/**
 * Created by hypo on 16-2-19.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration({"classpath*:spring.xml"})
public class UserServiceTest {

    @Autowired
    private IUserService userService;

    @Test
    public void addNew(){

        userService.addNewUser("test3", "test4", "test5@dss.com", "123");
    }
}


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

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>
    <uses-feature
        android:name="android.hardware.location.gps"
        android:required="false"/>
    <uses-feature
        android:name="android.hardware.location.network"
        android:required="false"/>
    <uses-feature
        android:name="android.hardware.location"
        android:required="false"/>

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="com.android.vending.BILLING"/>

    <application>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version"/>
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/maps_api_key"/>

        <activity
            android:name=".Locations"/>
        <activity
            android:name=".Map"
            android:theme="@style/AppTheme.Fullscreen"/>

        <service
            android:name=".GeofenceUpdateService"
            android:exported="false"/>
        <service
            android:name=".GeoFenceService"
            android:exported="false"/>
    </application>

</manifest>