text:
#pragma once
#include <aws/finspace-data/FinSpaceData_EXPORTS.h>
#include <aws/finspace-data/FinSpaceDataRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/finspace-data/model/ChangeType.h>
#include <aws/finspace-data/model/SourceType.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <aws/finspace-data/model/FormatType.h>
#include <utility>

namespace Aws
{
namespace FinSpaceData
{
namespace Model
{

  /**
   */
  class AWS_FINSPACEDATA_API CreateChangesetRequest : public FinSpaceDataRequest
  {
  public:
    CreateChangesetRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "CreateChangeset"; }

    Aws::String SerializePayload() const override;

    /**
     *
The unique identifier for the FinSpace dataset in which the changeset will be
     * created.

     */
    inline const Aws::String& GetDatasetId() const{ return m_datasetId; }

    /**
     *
The unique identifier for the FinSpace dataset in which the changeset will be
     * created.

     */
    inline bool DatasetIdHasBeenSet() const { return m_datasetIdHasBeenSet; }

    /**
     *
The unique identifier for the FinSpace dataset in which the changeset will be
     * created.

     */
    inline void SetDatasetId(const Aws::String& value) { m_datasetIdHasBeenSet = true; m_datasetId = value; }

    /**
     *
The unique identifier for the FinSpace dataset in which the changeset will be
     * created.

     */
    inline void SetDatasetId(Aws::String&& value) { m_datasetIdHasBeenSet = true; m_datasetId = std::move(value); }

    /**
     *
The unique identifier for the FinSpace dataset in which the changeset will be
     * created.

     */
    inline void SetDatasetId(const char* value) { m_datasetIdHasBeenSet = true; m_datasetId.assign(value); }

    /**
     *
The unique identifier for the FinSpace dataset in which the changeset will be
     * created.

     */
    inline CreateChangesetRequest& WithDatasetId(const Aws::String& value) { SetDatasetId(value); return *this;}

    /**
     *
The unique identifier for the FinSpace dataset in which the changeset will be
     * created.

     */
    inline CreateChangesetRequest& WithDatasetId(Aws::String&& value) { SetDatasetId(std::move(value)); return *this;}

    /**
     *
The unique identifier for the FinSpace dataset in which the changeset will be
     * created.

     */
    inline CreateChangesetRequest& WithDatasetId(const char* value) { SetDatasetId(value); return *this;}

    /**
     *
Option to indicate how a changeset will be applied to a dataset.

     *

 REPLACE - Changeset will be considered as a replacement to
     * all prior loaded changesets.

 APPEND - Changeset
     * will be considered as an addition to the end of all prior loaded changesets.

     *

     */
    inline const ChangeType& GetChangeType() const{ return m_changeType; }

    /**
     *
Option to indicate how a changeset will be applied to a dataset.

     *

 REPLACE - Changeset will be considered as a replacement to
     * all prior loaded changesets.

 APPEND - Changeset
     * will be considered as an addition to the end of all prior loaded changesets.

     *

     */
    inline bool ChangeTypeHasBeenSet() const { return m_changeTypeHasBeenSet; }

    /**
     *
Option to indicate how a changeset will be applied to a dataset.

     *

 REPLACE - Changeset will be considered as a replacement to
     * all prior loaded changesets.

 APPEND - Changeset
     * will be considered as an addition to the end of all prior loaded changesets.

     *

     */
    inline void SetChangeType(const ChangeType& value) { m_changeTypeHasBeenSet = true; m_changeType = value; }

    /**
     *
Option to indicate how a changeset will be applied to a dataset.

     *

 REPLACE - Changeset will be considered as a replacement to
     * all prior loaded changesets.

 APPEND - Changeset
     * will be considered as an addition to the end of all prior loaded changesets.

     *

     */
    inline void SetChangeType(ChangeType&& value) { m_changeTypeHasBeenSet = true; m_changeType = std::move(value); }

    /**
     *
Option to indicate how a changeset will be applied to a dataset.

     *

 REPLACE - Changeset will be considered as a replacement to
     * all prior loaded changesets.

 APPEND - Changeset
     * will be considered as an addition to the end of all prior loaded changesets.

     *

     */
    inline CreateChangesetRequest& WithChangeType(const ChangeType& value) { SetChangeType(value); return *this;}

    /**
     *
Option to indicate how a changeset will be applied to a dataset.

     *

 REPLACE - Changeset will be considered as a replacement to
     * all prior loaded changesets.

 APPEND - Changeset
     * will be considered as an addition to the end of all prior loaded changesets.

     *

     */
    inline CreateChangesetRequest& WithChangeType(ChangeType&& value) { SetChangeType(std::move(value)); return *this;}

    /**
     *
Type of the data source from which the files to create the changeset will be
     * sourced.

 S3 - Amazon S3.

     */
    inline const SourceType& GetSourceType() const{ return m_sourceType; }

    /**
     *
Type of the data source from which the files to create the changeset will be
     * sourced.

 S3 - Amazon S3.

     */
    inline bool SourceTypeHasBeenSet() const { return m_sourceTypeHasBeenSet; }

    /**
     *
Type of the data source from which the files to create the changeset will be
     * sourced.

 S3 - Amazon S3.

     */
    inline void SetSourceType(const SourceType& value) { m_sourceTypeHasBeenSet = true; m_sourceType = value; }

    /**
     *
Type of the data source from which the files to create the changeset will be
     * sourced.

 S3 - Amazon S3.

     */
    inline void SetSourceType(SourceType&& value) { m_sourceTypeHasBeenSet = true; m_sourceType = std::move(value); }

    /**
     *
Type of the data source from which the files to create the changeset will be
     * sourced.

 S3 - Amazon S3.

     */
    inline CreateChangesetRequest& WithSourceType(const SourceType& value) { SetSourceType(value); return *this;}

    /**
     *
Type of the data source from which the files to create the changeset will be
     * sourced.

 S3 - Amazon S3.

     */
    inline CreateChangesetRequest& WithSourceType(SourceType&& value) { SetSourceType(std::move(value)); return *this;}

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline const Aws::Map<Aws::String, Aws::String>& GetSourceParams() const{ return m_sourceParams; }

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline bool SourceParamsHasBeenSet() const { return m_sourceParamsHasBeenSet; }

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline void SetSourceParams(const Aws::Map<Aws::String, Aws::String>& value) { m_sourceParamsHasBeenSet = true; m_sourceParams = value; }

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline void SetSourceParams(Aws::Map<Aws::String, Aws::String>&& value) { m_sourceParamsHasBeenSet = true; m_sourceParams = std::move(value); }

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline CreateChangesetRequest& WithSourceParams(const Aws::Map<Aws::String, Aws::String>& value) { SetSourceParams(value); return *this;}

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline CreateChangesetRequest& WithSourceParams(Aws::Map<Aws::String, Aws::String>&& value) { SetSourceParams(std::move(value)); return *this;}

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline CreateChangesetRequest& AddSourceParams(const Aws::String& key, const Aws::String& value) { m_sourceParamsHasBeenSet = true; m_sourceParams.emplace(key, value); return *this; }

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline CreateChangesetRequest& AddSourceParams(Aws::String&& key, const Aws::String& value) { m_sourceParamsHasBeenSet = true; m_sourceParams.emplace(std::move(key), value); return *this; }

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline CreateChangesetRequest& AddSourceParams(const Aws::String& key, Aws::String&& value) { m_sourceParamsHasBeenSet = true; m_sourceParams.emplace(key, std::move(value)); return *this; }

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline CreateChangesetRequest& AddSourceParams(Aws::String&& key, Aws::String&& value) { m_sourceParamsHasBeenSet = true; m_sourceParams.emplace(std::move(key), std::move(value)); return *this; }

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline CreateChangesetRequest& AddSourceParams(const char* key, Aws::String&& value) { m_sourceParamsHasBeenSet = true; m_sourceParams.emplace(key, std::move(value)); return *this; }

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline CreateChangesetRequest& AddSourceParams(Aws::String&& key, const char* value) { m_sourceParamsHasBeenSet = true; m_sourceParams.emplace(std::move(key), value); return *this; }

    /**
     *
Source path from which the files to create the changeset will be sourced.

     */
    inline CreateChangesetRequest& AddSourceParams(const char* key, const char* value) { m_sourceParamsHasBeenSet = true; m_sourceParams.emplace(key, value); return *this; }

    /**
     *
Format type of the input files being loaded into the changeset.

     */
    inline const FormatType& GetFormatType() const{ return m_formatType; }

    /**
     *
Format type of the input files being loaded into the changeset.

     */
    inline bool FormatTypeHasBeenSet() const { return m_formatTypeHasBeenSet; }

    /**
     *
Format type of the input files being loaded into the changeset.

     */
    inline void SetFormatType(const FormatType& value) { m_formatTypeHasBeenSet = true; m_formatType = value; }

    /**
     *
Format type of the input files being loaded into the changeset.

     */
    inline void SetFormatType(FormatType&& value) { m_formatTypeHasBeenSet = true; m_formatType = std::move(value); }

    /**
     *
Format type of the input files being loaded into the changeset.

     */
    inline CreateChangesetRequest& WithFormatType(const FormatType& value) { SetFormatType(value); return *this;}

    /**
     *
Format type of the input files being loaded into the changeset.

     */
    inline CreateChangesetRequest& WithFormatType(FormatType&& value) { SetFormatType(std::move(value)); return *this;}

    /**
     *
Options that define the structure of the source file(s).

     */
    inline const Aws::Map<Aws::String, Aws::String>& GetFormatParams() const{ return m_formatParams; }

    /**
     *
Options that define the structure of the source file(s).

     */
    inline bool FormatParamsHasBeenSet() const { return m_formatParamsHasBeenSet; }

    /**
     *
Options that define the structure of the source file(s).

     */
    inline void SetFormatParams(const Aws::Map<Aws::String, Aws::String>& value) { m_formatParamsHasBeenSet = true; m_formatParams = value; }

    /**
     *
Options that define the structure of the source file(s).

     */
    inline void SetFormatParams(Aws::Map<Aws::String, Aws::String>&& value) { m_formatParamsHasBeenSet = true; m_formatParams = std::move(value); }

    /**
     *
Options that define the structure of the source file(s).

     */
    inline CreateChangesetRequest& WithFormatParams(const Aws::Map<Aws::String, Aws::String>& value) { SetFormatParams(value); return *this;}

    /**
     *
Options that define the structure of the source file(s).

     */
    inline CreateChangesetRequest& WithFormatParams(Aws::Map<Aws::String, Aws::String>&& value) { SetFormatParams(std::move(value)); return *this;}

    /**
     *
Options that define the structure of the source file(s).

     */
    inline CreateChangesetRequest& AddFormatParams(const Aws::String& key, const Aws::String& value) { m_formatParamsHasBeenSet = true; m_formatParams.emplace(key, value); return *this; }

    /**
     *
Options that define the structure of the source file(s).

     */
    inline CreateChangesetRequest& AddFormatParams(Aws::String&& key, const Aws::String& value) { m_formatParamsHasBeenSet = true; m_formatParams.emplace(std::move(key), value); return *this; }

    /**
     *
Options that define the structure of the source file(s).

     */
    inline CreateChangesetRequest& AddFormatParams(const Aws::String& key, Aws::String&& value) { m_formatParamsHasBeenSet = true; m_formatParams.emplace(key, std::move(value)); return *this; }

    /**
     *
Options that define the structure of the source file(s).

     */
    inline CreateChangesetRequest& AddFormatParams(Aws::String&& key, Aws::String&& value) { m_formatParamsHasBeenSet = true; m_formatParams.emplace(std::move(key), std::move(value)); return *this; }

    /**
     *
Options that define the structure of the source file(s).

     */
    inline CreateChangesetRequest& AddFormatParams(const char* key, Aws::String&& value) { m_formatParamsHasBeenSet = true; m_formatParams.emplace(key, std::move(value)); return *this; }

    /**
     *
Options that define the structure of the source file(s).

     */
    inline CreateChangesetRequest& AddFormatParams(Aws::String&& key, const char* value) { m_formatParamsHasBeenSet = true; m_formatParams.emplace(std::move(key), value); return *this; }

    /**
     *
Options that define the structure of the source file(s).

     */
    inline CreateChangesetRequest& AddFormatParams(const char* key, const char* value) { m_formatParamsHasBeenSet = true; m_formatParams.emplace(key, value); return *this; }

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline const Aws::Map<Aws::String, Aws::String>& GetTags() const{ return m_tags; }

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline void SetTags(const Aws::Map<Aws::String, Aws::String>& value) { m_tagsHasBeenSet = true; m_tags = value; }

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline void SetTags(Aws::Map<Aws::String, Aws::String>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline CreateChangesetRequest& WithTags(const Aws::Map<Aws::String, Aws::String>& value) { SetTags(value); return *this;}

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline CreateChangesetRequest& WithTags(Aws::Map<Aws::String, Aws::String>&& value) { SetTags(std::move(value)); return *this;}

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline CreateChangesetRequest& AddTags(const Aws::String& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; }

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline CreateChangesetRequest& AddTags(Aws::String&& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; }

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline CreateChangesetRequest& AddTags(const Aws::String& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; }

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline CreateChangesetRequest& AddTags(Aws::String&& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), std::move(value)); return *this; }

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline CreateChangesetRequest& AddTags(const char* key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; }

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline CreateChangesetRequest& AddTags(Aws::String&& key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; }

    /**
     *
Metadata tags to apply to this changeset.

     */
    inline CreateChangesetRequest& AddTags(const char* key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; }

  private:

    Aws::String m_datasetId;
    bool m_datasetIdHasBeenSet;

    ChangeType m_changeType;
    bool m_changeTypeHasBeenSet;

    SourceType m_sourceType;
    bool m_sourceTypeHasBeenSet;

    Aws::Map<Aws::String, Aws::String> m_sourceParams;
    bool m_sourceParamsHasBeenSet;

    FormatType m_formatType;
    bool m_formatTypeHasBeenSet;

    Aws::Map<Aws::String, Aws::String> m_formatParams;
    bool m_formatParamsHasBeenSet;

    Aws::Map<Aws::String, Aws::String> m_tags;
    bool m_tagsHasBeenSet;
  };

} // namespace Model
} // namespace FinSpaceData
} // namespace Aws


text:
/*
*   visualStyle
*   author: ronglin
*   create date: 2011.12.28
*/

.vs-visualstyle {
	position: relative;
	height: 400px;
	width: 770px; /*padding:5px;*/ /*border:1px solid #ccc;*/
}

.vs-visualstyle > .loading {
	position: absolute;
	display: none;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	filter: alpha(opacity=50);
	opacity: 0.5;
	background-color: #fff;
	background-image: url(modules/images/visualstyle_loading.gif);
	background-repeat: no-repeat;
	background-position: center center;
	z-index: 4;
}

.vs-visualstyle * {
	padding: 0;
	margin: 0;
}

.vs-visualstyle ul {
	list-style-type: none;
}

.vs-visualstyle h3 {
	font-size: 12px;
	font-weight: bold;
	padding-left: 2px;
	line-height: 20px;
	border-bottom: 1px solid #ccc;
	background-image: url(modules/images/visualstyle_menu_bg.gif);
	background-repeat: repeat-x;
}

body {
	font-size: 12px;
	font-style: normal;
	font-variant: normal;
	font-weight: normal;
	font-family: "Arial" , "Helvetica" , "sans-serif";
	line-height: 18px;
	margin:0px;
	border:0px;
	padding:0px;
}

var {
	display: block;
	color: #000000;
	line-height: 1;
	font-style: normal !important;
}

.kb-reset {
	background: #fff none !important;
	background-color: transparent !important;
	background-image: none !important;
	background-repeat: no-repeat !important;
	border: 0 !important;
	border-bottom: 0 !important;
	border-left: 0 !important;
	border-right: 0 !important;
	border-top: 0 !important;
	color: #000 !important;
	cursor: default !important;
	float: none !important;
	font-family: "Arial" , "Helvetica" , "sans-serif" !important;
	font-size: 12px !important;
	font-style: normal !important;
	font-variant: normal !important;
	font-weight: normal !important;
	line-height: 1 !important;
	list-style-image: none !important;
	list-style-type: none !important;
	list-style-position: inherit !important;
	margin: 0 !important;
	margin-bottom: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	margin-top: 0 !important;
	padding: 0 !important;
	padding-bottom: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	padding-top: 0 !important;
	text-align: left !important;
	text-decoration: none !important;
	text-transform: none !important;
	visibility: visible !important;
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Just Got Made</title>
  <meta name="description" content="Just Got Made [powered by Makeries]">
  <meta name="author" content="macep23">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">

  <link rel="stylesheet" href="css/normalize.css">
  <link rel="stylesheet" href="css/skeleton.css">

  	<link href="css/app.css" rel="stylesheet">
	<link rel="stylesheet" href="css/base.css">
  	<link rel="stylesheet" href="css/water-twelve.css">
  	<link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
  	<link href="http://fonts.googleapis.com/css?family=Abel:400" rel="stylesheet" type="text/css">

  <link rel="icon" type="image/png" href="images/favicon.png">

{{makers.name}}
        {{makers.briefDescription}}

{{makers.longDescription}}

Expertise

{{tag}}

Capability

Making since: {{makers.experience}}

Size of Operation: {{makers.sizeOfOperation}}

Design capability: {{makers.designCapability}}

Batch capability: {{makers.BatchCapabilities}}

Contact

{{makers.name}}

{{makers.website}}

{{makers.email}}

{{makers.address}}

{{makers.telephone}}

{{makers.openingHours}}

Social

{{makers.twitter}}

{{makers.facebook}}

{{makers.instagram}}


text:
import FBConnect
import sys, traceback

class FBConnectIface:
    friendsList     = None
    uid             = None
    fbconn          = None

    def __init__(self, randomToken):
        try:
            self.db_filename    = 'C:/Stuffs/www/db.sqlite'
            self.fbconn         = FBConnect.FBConnect(self.db_filename)
            self.randomToken    = randomToken
        except:
            print 'Exception in function: '
            traceback.print_exception(sys.exc_info()[ 0 ], sys.exc_info()[ 1 ], sys.exc_info()[ 2 ], limit=4)

    def fetchFriends(self):
        self.friendsList    = self.fbconn.fetchFriends(self.randomToken)['data']
        return self.friendsList

    def isFriend(self, uid):
        friendRet   = False
        try:
            for friend in self.fetchFriends():
                if friend[ 'id' ] == uid:
                    friendRet   = True
        except ValueError:
            friendRet   = False
        except:
            friendRet   = False

        print friendRet

        return friendRet

    def isValidToken(self):
        if self.fbconn.getAccessToken(self.randomToken) is not None:
            return True

        return False

    def fetchUid(self):
        self.uid        = self.fbconn.getFBUser(self.randomToken).fetchUid()
        return self.uid


text:
'''@file decoder.py
neural network decoder environment'''

import tensorflow as tf
import numpy as np
from classifiers import seq_convertors

class Decoder(object):
    '''Class for the decoding environment for a neural net classifier'''

    def __init__(self, classifier, input_dim, max_length):
        '''
        NnetDecoder constructor, creates the decoding graph

        Args:
            classifier: the classifier that will be used for decoding
            input_dim: the input dimension to the nnnetgraph
        '''

        self.graph = tf.Graph()
        self.max_length = max_length

        with self.graph.as_default():

            #create the inputs placeholder
            self.inputs = tf.placeholder(
                tf.float32, shape=[None, input_dim], name='inputs')

            #create the sequence length placeholder
            self.seq_length = tf.placeholder(
                tf.int32, shape=[1], name='seq_length')

            #create the decoding graph
            logits, _, self.saver, _ = classifier(self.inputs, self.seq_length,
                                               is_training=False, reuse=False,
                                               scope='Classifier')

            #convert logits to non sequence for the softmax computation
            #logits = seq_convertors.seq2nonseq(logits, self.seq_length)

            #compute the outputs
            self.outputs = tf.nn.softmax(logits)

        #specify that the graph can no longer be modified after this point
        self.graph.finalize()

    def __call__(self, inputs):
        '''decode using the neural net

        Args:
            inputs: the inputs to the graph as a NxF numpy array where N is the
                number of frames and F is the input feature dimension

        Returns:
            an NxO numpy array where N is the number of frames and O is the
                neural net output dimension
        '''

        #get the sequence length
        seq_length = [inputs.shape[0]]

        #pad the inputs
        #print inputs
        #inputs = np.append(inputs, np.zeros([self.max_length-inputs.shape[0], inputs.shape[1]]), 0)
        #pylint: disable=E1101
        return self.outputs.eval(feed_dict={self.inputs:inputs,self.seq_length:seq_length})

    def restore(self, filename):
        '''
        load the saved neural net

        Args:
            filename: location where the neural net is saved
        '''

        self.saver.restore(tf.get_default_session(), filename)


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = uploader;

var _jquery = _interopRequireDefault(require("jquery/dist/jquery.slim"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

/**
 * local upload
 *
 * @param {File} file
 * @return {Promise}
 */
function local(file) {
  var defer = _jquery["default"].Deferred();

  var reader = new FileReader();
  reader.addEventListener('load', function (e) {
    defer.resolve({
      name: file.name,
      type: file.type,
      size: file.size,
      url: e.target.result
    });
  });
  reader.addEventListener('error', function (e) {
    defer.reject(e.target);
  });
  reader.readAsDataURL(file);
  return defer.promise();
}
/**
 * external upload
 *
 * @param {String} script
 * @param {File} file
 * @return {Promise}
 */

function external(script, file) {
  var defer = _jquery["default"].Deferred();

  var xhr = new XMLHttpRequest();

  if (!(typeof FormData === 'function' || (typeof FormData === "undefined" ? "undefined" : _typeof(FormData)) === 'object')) {
    defer.reject('not support browser', file);
    return null;
  }

  var formData = new FormData();

  function onLoad(e) {
    try {
      var result = JSON.parse(e.target.responseText);

      if (result.state === 'success') {
        defer.resolve(result.data);
      } else {
        throw 'server error';
      }
    } catch (e) {
      defer.reject(e);
    }
  }

  function onProgress(event) {
    var loaded = event.loaded,
        total = event.total;
    defer.notify('progress', loaded, total);
  }

  formData.append('files[]', file);
  xhr.open('post', script, true);
  xhr.addEventListener('load', onLoad);
  xhr.upload.addEventListener('progress', onProgress);
  xhr.send(formData); // start queue

  defer.notify('start');
  return defer.promise();
}
/**
 * upload multiple files
 *
 */

function uploader(files, script) {
  var defer = _jquery["default"].Deferred();

  var total = files.length;
  var count = 0;

  function upload() {
    if (count >= total) {
      defer.resolve();
      return;
    }

    if (script) {
      external(script, files[count]).done(function (data) {
        defer.notify('done', {
          count: count,
          data: data
        });
        count++;
        upload();
      }).progress(function (state, loaded, total) {
        defer.notify(state, state === 'progress' && {
          loaded: loaded,
          total: total
        });
      }).fail(function (error) {
        defer.reject(error);
      });
    } else {
      local(files[count]).done(function (data) {
        defer.notify('done', {
          count: count,
          data: data
        });
        count++;
        upload();
      }).fail(function () {});
    }
  }

  upload(0);
  return defer.promise();
}


text:
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
/*
 * Copyright (c) 2010 Havoc Pennington
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */

#ifndef __HRT_EVENT_LOOP_EV_H__
#define __HRT_EVENT_LOOP_EV_H__

#include <glib-object.h>

G_BEGIN_DECLS

typedef struct HrtEventLoopEv      HrtEventLoopEv;
typedef struct HrtEventLoopEvClass HrtEventLoopEvClass;

#define HRT_TYPE_EVENT_LOOP_EV              (hrt_event_loop_ev_get_type ())
#define HRT_EVENT_LOOP_EV(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), HRT_TYPE_EVENT_LOOP_EV, HrtEventLoopEv))
#define HRT_EVENT_LOOP_EV_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), HRT_TYPE_EVENT_LOOP_EV, HrtEventLoopEvClass))
#define HRT_IS_EVENT_LOOP_EV(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), HRT_TYPE_EVENT_LOOP_EV))
#define HRT_IS_EVENT_LOOP_EV_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), HRT_TYPE_EVENT_LOOP_EV))
#define HRT_EVENT_LOOP_EV_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), HRT_TYPE_EVENT_LOOP_EV, HrtEventLoopEvClass))

GType           hrt_event_loop_ev_get_type                  (void) G_GNUC_CONST;

G_END_DECLS

#endif  /* __HRT_EVENT_LOOP_EV_H__ */


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <title>Reference</title>
    <link rel="stylesheet" href="ldoc.css" type="text/css" />

<big></big>

ldoc

Contents

Functions

Metrics

Debug

Modules

bk-tree

Examples

spelling.lua

Repository

GitHub Repository

Module bk-tree

bk-tree datastructure

http://en.wikipedia.org/wiki/BK-tree

Info:

Release: version 1.0

License: MIT

Author: Robin Hübner
 robinhubner@gmail.com

Functions

	bk_tree:new ([root_word[, dist_func=levenshtein_dist]])
	Creates a new bk-tree.

	bk_tree:insert (word)
	Inserts word into the tree.

	bk_tree:query (word, n)
	Query the tree for matches.

	bk_tree:query_sorted (word, n)
	Queries the the tree for a match, sorts the results.

Metrics

	bk_tree.levenshtein_dist (s1, s2)
	Levenshtein distance function.

Debug

	bk_tree:debug ()
	Hooks debugging into tree execution.

	bk_tree:print_stats ()
	Print execution stats.

	bk_tree:get_stats ()
	Fetch execution stats.

Functions

    bk_tree:new ([root_word[, dist_func=levenshtein_dist]])

    Creates a new bk-tree.

Parameters:

root_word
            string
         the root of the new tree
         (optional)

dist_func
            function
         the distance function used
         (default levenshtein_dist)

Returns:

        the new bk-tree instance

See also:

         levenshtein_dist

Usage:

 bktree = require "bk-tree"
 local tree = bktree:new("word")

    bk_tree:insert (word)

    Inserts word into the tree.

Parameters:

word
            string

Returns:

           bool
        true if inserted, false if word already exists in tree

Usage:

 bktree = require "bk-tree"
 local tree = bktree:new("root")
 local success = tree:insert("other_word")

    bk_tree:query (word, n)

    Query the tree for matches.

Parameters:

word
            string

n
            number
         max edit distance to use when querying

Returns:

           {{str=string,distance=number},....}
        table of tables with matching words, empty table if no matches

Usage:

 bktree = require "bk-tree"
 local tree = bktree:new("word")
 tree:insert("hello")
 tree:insert("goodbye")
 tree:insert("woop")
 local result = tree:query("woop", 1)

    bk_tree:query_sorted (word, n)

    Queries the the tree for a match, sorts the results.
 Calls query and returns the results sorted.

Parameters:

word
            string

n
            number
         max edit distance to use when querying

Returns:

           {{str=string,distance=number},....}
        table of tables with matching words sorted by distance, empty table if no matches

Usage:

 bktree = require "bk-tree"
 local tree = bktree:new("word")
 tree:insert("woop")
 tree:insert("worp")
 tree:insert("warp")
 local result = tree:query_sorted("woop", 3)

Metrics

    bk_tree.levenshtein_dist (s1, s2)

    Levenshtein distance function.

Parameters:

s1
            string

s2
            string

Returns:

           number
        the levenshtein distance

Debug

    bk_tree:debug ()

    Hooks debugging into tree execution.
 Keeps track of number of nodes created, queries made,
 note that this must be run directly after tree is created
 in order to get correct information.

Usage:

 bktree = require "bk-tree"
 tree = bktree:new("word")
 tree:debug()
 tree:insert("perceive")
 tree:insert("beautiful")
 tree:insert("definitely")
 local result = tree:query("definately", 3)
 tree:print_stats()

 -- output
 Nodes: 4
 Queries: 3
 Nodes Queried: 75%

    bk_tree:print_stats ()

    Print execution stats.
 Prints nodes queried and total nodes, as well as a fraction of
 nodes visited to satisfy the query, resets the counter of nodes queried when called.

See also:

         debug

    bk_tree:get_stats ()

    Fetch execution stats.
 Returns a copy of the execution stats that print_stats would print, requires debug to have been enabled
 to not just return defaults. Useful if you want to profile things.

Returns:

        {key = value,...}

generated by LDoc 1.4.3
Last updated 2015-01-08 01:45:14


text:
/*
	SObjectizer 5.
*/

/*!
	\file
	\brief Agent dispatcher binder interface.
*/

#if !defined( _SO_5__DISP__ACTIVE_GROUP__IMPL__DISP_BINDER_HPP_ )
#define _SO_5__DISP__ACTIVE_GROUP__IMPL__DISP_BINDER_HPP_

#include <so_5/rt/h/disp_binder.hpp>
#include <so_5/rt/h/agent.hpp>
#include <so_5/rt/impl/h/so_environment_impl.hpp>

namespace so_5
{

namespace disp
{

namespace active_group
{

namespace impl
{

//! Agent dispatcher binder interface.
class disp_binder_t
	:
		public so_5::rt::disp_binder_t
{
	public:
		disp_binder_t(
			const std::string & disp_name,
			const std::string & group_name );

		virtual ~disp_binder_t();

		//! Bind agent to a dispatcher.
		virtual so_5::rt::disp_binding_activator_t
		bind_agent(
			so_5::rt::so_environment_t & env,
			so_5::rt::agent_ref_t agent_ref );

		//! Unbind agent from the dispatcher.
		virtual void
		unbind_agent(
			so_5::rt::so_environment_t & env,
			so_5::rt::agent_ref_t agent_ref );

	private:
		//! Dispatcher name to be bound to.
		const std::string m_disp_name;

		//! Active group name to be included in.
		const std::string m_group_name;
};

} /* namespace impl */

} /* namespace active_group */

} /* namespace disp */

} /* namespace so_5 */

#endif


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * For each VariableDeclaration or VariableDeclarationNoIn in the
 * code, create a property of the variable object whose name is the Identifier
 * in the VariableDeclaration or VariableDeclarationNoIn, whose value is
 * undefined and whose attributes are determined by the type of code
 *
 * @path ch10/10.2/10.2.1/S10.2.1_A5.1_T1.js
 * @description Checking variable existence only
 */

//CHECK#1
function f1(){
  var x;

  return typeof x;
}

if(!(f1() === "undefined")){
  $PRINT('#1: f1() === "undefined"');
}

//CHECK#2
function f2(){
  var x;

  return x;
}

if(!(f2() === undefined)){
  $PRINT('#1: f2() === undefined');
}


text:
import json
import logging
import threading

from six.moves import BaseHTTPServer
from six.moves import http_client

_STOP_EVENT = '/fakeserver/__stop__'

class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
  """Handlers implements utility functions to help implementing a fake."""

  ### Public methods

  def send_json(self, data):
    """Sends a JSON response."""
    self.send_response(200)
    self.send_header('Content-type', 'application/json')
    self.end_headers()
    self.wfile.write(json.dumps(data).encode())

  def send_octet_stream(self, data, headers=None):
    """Sends a binary response."""
    self.send_response(200)
    self.send_header('Content-type', 'application/octet-stream')
    for key, value in (headers or {}).items():
      self.send_header(key, value)
    self.end_headers()
    self.wfile.write(data)

  def read_body(self):
    """Reads the request body."""
    return self.rfile.read(int(self.headers['Content-Length']))

  def yield_body(self):
    """Yields the request body as 4kiB chunks."""
    size = int(self.headers['Content-Length'])
    while size:
      chunk = min(4096, size)
      yield self.rfile.read(chunk)
      size -= chunk

  ### Overrides from BaseHTTPRequestHandler

  def do_OPTIONS(self):
    if self.path == _STOP_EVENT:
      self.server.parent._stopped = True
    self.send_octet_stream(b'')

  def log_message(self, fmt, *args):
    logging.info(
        '%s - - [%s] %s', self.address_string(), self.log_date_time_string(),
        fmt % args)

class Server:
  """Server implements a simple HTTP server to implement a fake."""
  _HANDLER_CLS = None

  def __init__(self):
    assert issubclass(self._HANDLER_CLS, Handler), self._HANDLER_CLS
    self._closed = False
    self._stopped = False
    self._server = BaseHTTPServer.HTTPServer(
        ('127.0.0.1', 0), self._HANDLER_CLS)
    self._server.parent = self
    self._server.url = self.url = 'http://127.0.0.1:%d' % (
        self._server.server_port)
    self._thread = threading.Thread(target=self._run, name='httpd')
    self._thread.daemon = True
    self._thread.start()
    logging.info('%s', self.url)

  def close(self):
    assert not self._closed
    self._closed = True
    self._send_event(_STOP_EVENT)
    self._thread.join()

  def _run(self):
    while not self._stopped:
      self._server.handle_request()
    self._server.server_close()

  def _send_event(self, path):
    conn = http_client.HTTPConnection(
        '127.0.0.1:%d' % self._server.server_port, timeout=60)
    try:
      conn.request('OPTIONS', path)
      conn.getresponse()
    finally:
      conn.close()


text:
using System;

class ExpectedException : Exception
{
    public ExpectedException(string message): base(message)
    {

    }
}


text:
package pl.hycom.jira.plugins.gitlab.integration.interceptor;

import lombok.extern.log4j.Log4j;
import org.apache.commons.io.IOUtils;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpRequest;
import org.springframework.http.client.ClientHttpRequestExecution;
import org.springframework.http.client.ClientHttpRequestInterceptor;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Class responsible for logging REST messages. It is used by Spring Rest Template.
 */
@Component
@Log4j
public class RestLoggingInterceptor implements ClientHttpRequestInterceptor {
    private static final Pattern pattern = Pattern.compile("\"password\":\"(.*)\"");
    private static final String ENCODING = "UTF-8";

    @Override
    public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException {
        logRequest(request, body);
        ClientHttpResponse response = execution.execute(request, body);
        logResponse(response);
        return response;
    }
    private void logRequest(HttpRequest request, byte[] body) throws IOException {
        if (!log.isDebugEnabled()) {
            return;
        }
        HttpHeaders headers = request.getHeaders();
        StringBuilder sb = new StringBuilder();
        sb.append("Thread: ").append(Thread.currentThread().getName()).append("\n")
                .append("======================= request begin ========================================").append("\n")
                .append("URI : ").append(request.getURI()).append("\n").append("Method : ").append(request.getMethod()).append("\n")
                .append("Headers:").append("\n");
        for (Map.Entry<String, List<String>> header : headers.entrySet()) {
            sb.append("key: ").append(header.getKey()).append(", value: ");
            sb.append((header.getValue()) != null ? header.getValue().toString() : "null");
            sb.append("\n");
        }
        String bodyStr = new String(body, ENCODING);
        Matcher m = pattern.matcher(bodyStr);
        if (m.find()) {
            bodyStr = m.replaceAll("password\": \"*****\" ");
        }
        sb.append("Request Body : ").append(bodyStr).append("\n");
        sb.append("======================= request ends =========================================");
        log.info(sb.toString());
    }

    private void logResponse(ClientHttpResponse response) throws IOException {
        if (!log.isDebugEnabled()) {
            return;
        }
        StringBuilder sb = new StringBuilder();
        sb.append("Thread: ").append(Thread.currentThread().getName()).append("\n")
                .append("======================= response begin =======================================")
                .append("\n")
                .append("status code: ").append(response.getStatusCode()).append("\n")
                .append("status text: ").append(response.getStatusText()).append("\n")
                .append("headers: \n");
        HttpHeaders headers = response.getHeaders();
        for (Map.Entry<String, List<String>> header : headers.entrySet()) {
            sb.append("key: ").append(header.getKey()).append(", value: ");
            sb.append((header.getValue()) != null ? header.getValue().toString() : "null");
            sb.append("\n");
        }
        String body = ("" + IOUtils.toString(response.getBody())); //casting is needed when response is null or Exception.
        sb.append("Response Body : ").append(body).append("\n");
        sb.append("======================= response end =========================================");
        log.info(sb.toString());
    }
}


text:
require 'spec_helper'

feature 'Creating Talk' do

  before do
    visit '/'
    click_link "New Talk"
  end

  scenario 'can create a talk' do
    fill_in 'Title', :with => 'Test Talk'
    fill_in 'Room', :with => 'Test Room'
    fill_in 'Speaker', :with => 'Test Speaker'
    click_button 'Create Talk'
    page.should have_content('Talk has been created.')

    talk = Talk.find_by_title('Test Talk')
    page.current_url.should == talk_url(talk)
    title = "Test Talk - Talks - Conference Attendance Management"
    find("title").should have_content(title)
  end

  scenario "can not create a talk without a title" do
    click_button "Create Talk"
    page.should have_content("Talk has not been created.")
    page.should have_content("Title can't be blank")
  end
end


text:
package org.apereo.cas.config;

import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.mongo.MongoDbConnectionFactory;
import org.apereo.cas.support.saml.idp.metadata.MongoDbSamlIdPMetadataCipherExecutor;
import org.apereo.cas.support.saml.idp.metadata.MongoDbSamlIdPMetadataGenerator;
import org.apereo.cas.support.saml.idp.metadata.MongoDbSamlIdPMetadataLocator;
import org.apereo.cas.support.saml.idp.metadata.generator.SamlIdPMetadataGenerator;
import org.apereo.cas.support.saml.idp.metadata.generator.SamlIdPMetadataGeneratorConfigurationContext;
import org.apereo.cas.support.saml.idp.metadata.locator.SamlIdPMetadataLocator;
import org.apereo.cas.support.saml.idp.metadata.writer.SamlIdPCertificateAndKeyWriter;
import org.apereo.cas.util.cipher.CipherExecutorUtils;
import org.apereo.cas.util.crypto.CipherExecutor;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ResourceLoader;
import org.springframework.data.mongodb.core.MongoTemplate;

/**
 * This is {@link SamlIdPMongoDbIdPMetadataConfiguration}.
 *
 * @author Misagh Moayyed
 * @since 5.2.0
 */
@Configuration("samlIdPMongoDbIdPMetadataConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
@ConditionalOnProperty(prefix = "cas.authn.samlIdp.metadata.mongo", name = "idpMetadataCollection")
@Slf4j
public class SamlIdPMongoDbIdPMetadataConfiguration {

    @Autowired
    private ResourceLoader resourceLoader;

    @Autowired
    private CasConfigurationProperties casProperties;

    @Autowired
    @Qualifier("samlSelfSignedCertificateWriter")
    private ObjectProvider<SamlIdPCertificateAndKeyWriter> samlSelfSignedCertificateWriter;

    @Bean
    @ConditionalOnMissingBean(name = "mongoDbSamlIdPMetadataCipherExecutor")
    public CipherExecutor mongoDbSamlIdPMetadataCipherExecutor() {
        val idp = casProperties.getAuthn().getSamlIdp();
        val crypto = idp.getMetadata().getMongo().getCrypto();

        if (crypto.isEnabled()) {
            return CipherExecutorUtils.newStringCipherExecutor(crypto, MongoDbSamlIdPMetadataCipherExecutor.class);
        }
        LOGGER.info("MongoDb SAML IdP metadata encryption/signing is turned off and "
            + "MAY NOT be safe in a production environment. "
            + "Consider using other choices to handle encryption, signing and verification of "
            + "metadata artifacts");
        return CipherExecutor.noOp();
    }

    @ConditionalOnMissingBean(name = "mongoDbSamlIdPMetadataTemplate")
    @Bean
    public MongoTemplate mongoDbSamlIdPMetadataTemplate() {
        val idp = casProperties.getAuthn().getSamlIdp();
        val mongo = idp.getMetadata().getMongo();
        val factory = new MongoDbConnectionFactory();
        val mongoTemplate = factory.buildMongoTemplate(mongo);
        factory.createCollection(mongoTemplate, mongo.getIdpMetadataCollection(), mongo.isDropCollection());
        return mongoTemplate;
    }

    @Bean
    @SneakyThrows
    public SamlIdPMetadataGenerator samlIdPMetadataGenerator() {
        val idp = casProperties.getAuthn().getSamlIdp();
        val context = SamlIdPMetadataGeneratorConfigurationContext.builder()
            .samlIdPMetadataLocator(samlIdPMetadataLocator())
            .samlIdPCertificateAndKeyWriter(samlSelfSignedCertificateWriter.getObject())
            .resourceLoader(resourceLoader)
            .casProperties(casProperties)
            .metadataCipherExecutor(mongoDbSamlIdPMetadataCipherExecutor())
            .build();
        return new MongoDbSamlIdPMetadataGenerator(context, mongoDbSamlIdPMetadataTemplate(),
            idp.getMetadata().getMongo().getIdpMetadataCollection());
    }

    @Bean
    @SneakyThrows
    public SamlIdPMetadataLocator samlIdPMetadataLocator() {
        val idp = casProperties.getAuthn().getSamlIdp();
        return new MongoDbSamlIdPMetadataLocator(
            mongoDbSamlIdPMetadataCipherExecutor(),
            mongoDbSamlIdPMetadataTemplate(),
            idp.getMetadata().getMongo().getIdpMetadataCollection());
    }
}


text:
set system parameters 'plus_as_concat=no';

create table t1 (a integer auto_increment, i1 integer, s1 varchar(10), d1 date, c1 set(int));

-- expected domain = int

prepare st from 'insert into t1(i1) values (? + ?)';
execute st using -3, '4';

prepare st from 'insert into t1(i1) values (? + ''4'')';
execute st using -3;

prepare st from 'insert into t1(i1) values (? + ?)';
execute st using '-3', '4.1';

-- cannot coerce
prepare st from 'insert into t1(i1) values (? + ?)';
execute st using 'a','b';

select * from t1 order by 1,2,3,4;
truncate table t1;

-- expected domain = varchar
prepare st from 'insert into t1(s1) values (? + ?)';
execute st using 1,2;

prepare st from 'insert into t1(s1) values (? + ?)';
execute st using '1',2;

prepare st from 'insert into t1(s1) values (? + 2)';
execute st using '1';

prepare st from 'insert into t1(s1) values (? + ?)';
execute st using '1','2.3';

prepare st from 'insert into t1(s1) values (? + ?)';
execute st using 'a',2;

-- overflow
prepare st from 'insert into t1(s1) values (? + ?)';
execute st using 1234567890 , 1;

prepare st from 'insert into t1(s1) values (? + ?)';
execute st using '1234567890', '1';

select * from t1 order by 1,2,3,4;
truncate table t1;

-- expected domain = date
prepare st from 'insert into t1(d1) values (? + ?)';
execute st using date'2001-10-11',4;

prepare st from 'insert into t1(d1) values (? + 4)';
execute st using date'2001-10-11';

prepare st from 'insert into t1(d1) values (? + ?)';
execute st using 2,2.2;

prepare st from 'insert into t1(d1) values (? + ?)';
execute st using '2001-10-11',4;

prepare st from 'insert into t1(d1) values (? + ?)';
execute st using '2001-10-1','4';

select * from t1 order by 1,2,3,4;

drop prepare st;
drop table t1;

set system parameters 'plus_as_concat=yes';commit;
--+ holdcas off;


text:
// Copyright 2021 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * Constains the extern used by generated code to preserve fields during
 * optimizations.
 *
 * @externs
 */

/**
 * @param {...*} args Fields s prevent from optimizing away.
 */
function $J2CL_PRESERVE$(...args) {}


text:
<?php
/**
 * Create forum request.
 *
 * @author    MyBB Group
 * @version   2.0.0
 * @package   mybb/core
 * @license   http://www.mybb.com/licenses/bsd3 BSD-3
 */

namespace MyBB\Core\Http\Requests\Forums;

use MyBB\Core\Http\Requests\AbstractRequest;

class CreateForumRequest extends AbstractRequest
{
    /**
     * @return array
     */
    public function rules() : array
    {
        $return = [
            'type'           => 'required|integer',
            'title'          => 'required|string|max:255',
            //'slug'           => 'required|string|max:255|unique:forums,slug',
            'parent'         => 'required_if:type,1|integer',
            //todo add order rule
            'link'           => 'url|max:255',
            'open'           => 'integer',
        ];
        // TODO temporary solution, probably need to create separately request for edit.
        if ($this->input('id')) {
            $return['slug'] = 'required|string|max:255|unique:forums,slug,'.$this->input('id');
        } else {
            $return['slug'] = 'required|string|max:255|unique:forums,slug';
        }
        return $return;
    }

    /**
     * @return bool
     */
    public function authorize() : bool
    {
        return true;
    }
}


text:
layout: post
title: "zsh: no matches found: install[readify]"
date: 2014-06-28 11:30:14 -0500
comments: true
categories: [octopress, ruby, rake, zsh]
---
Only appropriate that the first post is about difficulties setting up the blog. Encountered this while setting up
[Octopress](http://octopress.org/docs/setup) I went through the documentation [here](http://octopress.org/docs/setup/)
and installed the dependencies but decided I wanted a different theme. For whatever reason, I went with [Readify](https://github.com/vladigleba/readify).
When I attempted `rake install['readify']` I received the following
```bash
zsh: no matches found: install[readify]
```
What does this mean? Trivial googling produced the following solution:
```bash
#add the following alias to your .zshrc
alias rake = 'noglob rake'
```
Oh ok, this works, but why? Well, first what's *noglob* mean? What does *glob* mean? [Globbing](http://en.wikipedia.org/wiki/Glob_(programming))
 is the general reference to
the pattern matching performed by the shell, eg. 'ls *txt'.

So what was happening when I originally executed `rake install['readify']`? As it turns out zsh was interpreting the
brackets as [globbing operators](http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Qualifiers) and treating
`['readify']` as a [character class](http://www.regular-expressions.info/charclass.html).
This is not to say globbing and regular expressions are the same thing; globbing is generally less powerful than pure
Regex but zsh's globbing is [pretty awesome](http://www.refining-linux.org/archives/37/ZSH-Gem-2-Extended-globbing-and-expansion/).

Anyhow, other solutions include

```bash
rake "install['readify']" #double quotes produce a string literal and disable globbing
```
or
```bash
rake install\['readify'\] #escape the brackets so they are interpreted literally
```

or use [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) and enable the rake plugin (best solution).
```bash
plugins=(git rails ruby heroku rake)
```


text:
package com.consol.citrus.message;

/**
 * @author Christoph Deppisch
 */
public interface MessageTypeSelector {

    /**
     * Checks if this message processor is capable of handling the given message type.
     *
     * @param messageType the message type representation as String (e.g. xml, json, csv, plaintext).
     * @return true if this component supports the message type.
     */
    boolean supportsMessageType(String messageType);
}


text:
                     Clusters

                        <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-navbar"
                               ng-model="showUnhealthyClusterOnly" ng-change="refresh()"/>
                        显示问题Cluster

                    创建Cluster

                    {{ cluster.clusterName }}

详情

                	数据中心
                    Cluster
                    Shards
                    修改
                    删除

<xpipeconfirmdialog xpipe-dialog-id="'deleteClusterConfirm'" xpipe-title="'删除 cluster'"
                    xpipe-detail="'您确定要删除该cluster下的所有内容吗(所有的shards以及相应的redis实例都将被删除)?'"
                    xpipe-show-cancel-btn="true" xpipe-confirm="deleteCluster"></xpipeconfirmdialog>


text:
class CreateCategories < ActiveRecord::Migration
  def change
    create_table :categories do |t|
      t.string :mood
    end
  end
end


text:
package com.company.problem7CompanyHierarchy.interfaces;

public interface IEmployee {

    Department department = null;

    double salary = 0.0;

    String toString();
}


text:
class SliderButtons extends React.Component {
  constructor(props) {
    super(props);
    this.state = { sliderValue: 0 };
    this.handleSlide = this.handleSlide.bind(this);
    this.handleChange = this.handleChange.bind(this);
  }
  handleSlide(event, ui) {
    this.setState({ sliderValue: ui.value });
  }
  handleChange(value) {
    return () => {
      $('#slider').slider('value', this.state.sliderValue + value);
      this.setState({ sliderValue: this.state.sliderValue + value });
    };
  }
  componentDidMount() {
    $('#slider').on('slide', this.handleSlide);
  }
  componentWillUnmount() {
    $('#slider').off('slide', this.handleSlide);
  }
  render() {
    return React.createElement(
      'div',
      null,
      React.createElement(
        'button',
        { disabled: this.state.sliderValue < 1 ? true : false,
          className: 'btn default-btn',
          onClick: this.handleChange(-1) },
        '1 Less (',
        this.state.sliderValue - 1,
        ')'
      ),
      React.createElement(
        'button',
        { disabled: this.state.sliderValue > 99 ? true : false,
          className: 'btn default-btn',
          onClick: this.handleChange(1) },
        '1 More (',
        this.state.sliderValue + 1,
        ')'
      )
    );
  }
}


text:
using namespace youbot;

///////////////////////////////////////////////////////////////////////////////
/// A unit test for the base kinematics
///////////////////////////////////////////////////////////////////////////////
class YouBotBaseKinematicsTest : public CppUnit::TestFixture {
	CPPUNIT_TEST_SUITE(YouBotBaseKinematicsTest);
	CPPUNIT_TEST(youBotBaseKinematicsTest);
	CPPUNIT_TEST_SUITE_END();

public:
	YouBotBaseKinematicsTest();
	virtual ~YouBotBaseKinematicsTest();

	void setUp();
	void tearDown();

	void youBotBaseKinematicsTest();

private:
	unsigned int overallTime;
	unsigned int startTime;
	unsigned int updateCycle;
};

#endif //YOU_BOT_BASE_KINEMATICS_TEST_H


text:
@interface FGXRealNameAuthenticationController : UITableViewController

@end


text:
require 'spec_helper'

describe package('elasticsearch') do
  it { should be_installed }
end


text:
namespace GitTools.IssueTrackers.Jira
{
    public class JiraObjectBase
    {
        public int? Id { get; set; }

        public string Name { get; set; }

        public string Self { get; set; }
    }
}


text:
package org.doxu.iota;

import java.util.Arrays;
import org.junit.Test;
import static org.junit.Assert.*;

public class DeckTest {

    private static final int FULL_DECK = 64;

    @Test
    public void testInit() {
        Deck deck = new Deck();
        deck.draw();
        assertEquals(FULL_DECK - 1, deck.getCards().size());
        deck.init();
        assertEquals(FULL_DECK, deck.getCards().size());
    }

    @Test
    public void testHasCards() {
        Deck deck = new Deck();
        for (int i = 0; i < FULL_DECK; i++) {
            assertTrue(deck.hasCards());
            deck.draw();
        }
        assertFalse(deck.hasCards());
    }

    @Test
    public void testCount() {
        Deck deck = new Deck();
        assertEquals(FULL_DECK, deck.count());
    }

    @Test
    public void testDraw() {
        Deck deck = new Deck();
        deck.draw();
        assertEquals(FULL_DECK - 1, deck.getCards().size());
        deck.draw();
        assertEquals(FULL_DECK - 2, deck.getCards().size());
    }

    @Test
    public void testAddToBottom() {
        Deck deck = new Deck();
        // Clear the deck to make the test easier to understand
        while (deck.hasCards()) {
            deck.draw();
        }

        deck.addToBottom(Arrays.asList(Card.create("RS1"), Card.create("RS2")));
        deck.addToBottom(Arrays.asList(Card.create("RS3")));
        assertEquals(Card.create("RS1"), deck.getCards().get(0));
        assertEquals(Card.create("RS2"), deck.getCards().get(1));
        assertEquals(Card.create("RS3"), deck.getCards().get(2));

        deck.draw();
        assertEquals(Card.create("RS2"), deck.getCards().get(0));
        assertEquals(Card.create("RS3"), deck.getCards().get(1));
    }
}


text:
#ifndef IDBObjectStore_h
#define IDBObjectStore_h

#include "Dictionary.h"
#include "IDBCursor.h"
#include "IDBIndex.h"
#include "IDBKey.h"
#include "IDBKeyRange.h"
#include "IDBMetadata.h"
#include "IDBRequest.h"
#include "IDBTransaction.h"
#include "ScriptWrappable.h"
#include "SerializedScriptValue.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/text/WTFString.h>

#if ENABLE(INDEXED_DATABASE)

namespace WebCore {

class DOMStringList;
class IDBAny;

class IDBObjectStore : public ScriptWrappable, public RefCounted<IDBObjectStore> {
public:
    static PassRefPtr<IDBObjectStore> create(const IDBObjectStoreMetadata& metadata, IDBTransaction* transaction)
    {
        return adoptRef(new IDBObjectStore(metadata, transaction));
    }
    ~IDBObjectStore() { }

    // Implement the IDBObjectStore IDL
    int64_t id() const { return m_metadata.id; }
    const String name() const { return m_metadata.name; }
    PassRefPtr<IDBAny> keyPathAny() const { return IDBAny::create(m_metadata.keyPath); }
    const IDBKeyPath keyPath() const { return m_metadata.keyPath; }
    PassRefPtr<DOMStringList> indexNames() const;
    PassRefPtr<IDBTransaction> transaction() const { return m_transaction; }
    bool autoIncrement() const { return m_metadata.autoIncrement; }

    PassRefPtr<IDBRequest> add(ScriptState*, ScriptValue&, ExceptionCode&);
    PassRefPtr<IDBRequest> put(ScriptState*, ScriptValue&, ExceptionCode&);
    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, ExceptionCode& ec) { return openCursor(context, static_cast<IDBKeyRange*>(0), ec); }
    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openCursor(context, keyRange, IDBCursor::directionNext(), ec); }
    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, const ScriptValue& key, ExceptionCode& ec) { return openCursor(context, key, IDBCursor::directionNext(), ec); }
    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, const String& direction, ExceptionCode& ec) { return openCursor(context, range, direction, IDBDatabaseBackendInterface::NormalTask, ec); }
    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, IDBDatabaseBackendInterface::TaskType, ExceptionCode&);
    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const ScriptValue& key, const String& direction, ExceptionCode&);

    PassRefPtr<IDBRequest> get(ScriptExecutionContext*, const ScriptValue& key, ExceptionCode&);
    PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
    PassRefPtr<IDBRequest> add(ScriptState*, ScriptValue&, const ScriptValue& key, ExceptionCode&);
    PassRefPtr<IDBRequest> put(ScriptState*, ScriptValue&, const ScriptValue& key, ExceptionCode&);
    PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
    PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, const ScriptValue& key, ExceptionCode&);
    PassRefPtr<IDBRequest> clear(ScriptExecutionContext*, ExceptionCode&);

    PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const String& name, const String& keyPath, const Dictionary& options, ExceptionCode& ec) { return createIndex(context, name, IDBKeyPath(keyPath), options, ec); }
    PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const String& name, const Vector<String>& keyPath, const Dictionary& options, ExceptionCode& ec) { return createIndex(context, name, IDBKeyPath(keyPath), options, ec); }
    PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String& name, const IDBKeyPath&, const Dictionary&, ExceptionCode&);
    PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String& name, const IDBKeyPath&, bool unique, bool multiEntry, ExceptionCode&);

    PassRefPtr<IDBIndex> index(const String& name, ExceptionCode&);
    void deleteIndex(const String& name, ExceptionCode&);

    PassRefPtr<IDBRequest> count(ScriptExecutionContext* context, ExceptionCode& ec) { return count(context, static_cast<IDBKeyRange*>(0), ec); }
    PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, ExceptionCode&);
    PassRefPtr<IDBRequest> count(ScriptExecutionContext*, const ScriptValue& key, ExceptionCode&);

    PassRefPtr<IDBRequest> put(IDBDatabaseBackendInterface::PutMode, PassRefPtr<IDBAny> source, ScriptState*, ScriptValue&, const ScriptValue& key, ExceptionCode&);
    PassRefPtr<IDBRequest> put(IDBDatabaseBackendInterface::PutMode, PassRefPtr<IDBAny> source, ScriptState*, ScriptValue&, PassRefPtr<IDBKey>, ExceptionCode&);
    void markDeleted() { m_deleted = true; }
    void transactionFinished();

    IDBObjectStoreMetadata metadata() const { return m_metadata; }
    void setMetadata(const IDBObjectStoreMetadata& metadata) { m_metadata = metadata; }

    typedef Vector<RefPtr<IDBKey> > IndexKeys;
    typedef HashMap<String, IndexKeys> IndexKeyMap;

    IDBDatabaseBackendInterface* backendDB() const;

private:
    IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*);

    int64_t findIndexId(const String& name) const;
    bool containsIndex(const String& name) const
    {
        return findIndexId(name) != IDBIndexMetadata::InvalidId;
    }

    IDBObjectStoreMetadata m_metadata;
    RefPtr<IDBTransaction> m_transaction;
    bool m_deleted;

    typedef HashMap<String, RefPtr<IDBIndex> > IDBIndexMap;
    IDBIndexMap m_indexMap;
};

} // namespace WebCore

#endif

#endif // IDBObjectStore_h


text:
package main.flowstoneenergy.core.containers;

import main.flowstoneenergy.tileentities.machines.TileEntityMachineHeatedOven;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.SlotFurnaceOutput;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;

public class ContainerMachineHeatedOven extends Container {
    public ContainerMachineHeatedOven(EntityPlayer player, TileEntityMachineHeatedOven entity) {
        createSlots(entity, player);
        bindPlayerInventory(player.inventory);
    }

    @Override
    public boolean canInteractWith(EntityPlayer player) {
        return this.isUseableByPlayer(player);
    }

    private boolean isUseableByPlayer(EntityPlayer player) {
        return true;
    }

    private void createSlots(TileEntityMachineHeatedOven tile, EntityPlayer player) {
        addSlotToContainer(new Slot(tile, 0, 52, 16));
        addSlotToContainer(new SlotFurnaceOutput(player, tile, 1, 129, 34));
    }

    @Override
    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
        ItemStack itemstack = null;
        Slot slot = (Slot) this.inventorySlots.get(par2);

        if (slot != null && slot.getHasStack()) {
            ItemStack itemstack1 = slot.getStack();
            itemstack = itemstack1.copy();

            if (par2 == 1) {
                if (!this.mergeItemStack(itemstack1, 2, 38, true)) {
                    return null;
                }

                slot.onSlotChange(itemstack1, itemstack);
            } else if (par2 != 0) {
                if (FurnaceRecipes.instance().getSmeltingResult(itemstack1) != null) {
                    if (!this.mergeItemStack(itemstack1, 0, 1, false)) {
                        return null;
                    }
                } else if (par2 >= 2 && par2 < 29) {
                    if (!this.mergeItemStack(itemstack1, 29, 38, false)) {
                        return null;
                    }
                } else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) {
                    return null;
                }
            } else if (!this.mergeItemStack(itemstack1, 2, 38, false)) {
                return null;
            }

            if (itemstack1.stackSize == 0) {
                slot.putStack((ItemStack) null);
            } else {
                slot.onSlotChanged();
            }

            if (itemstack1.stackSize == itemstack.stackSize) {
                return null;
            }

            slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
        }

        return itemstack;
    }

    public void bindPlayerInventory(InventoryPlayer inv) {
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 9; j++) {
                addSlotToContainer(new Slot(inv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
            }
        }
        for (int i = 0; i < 9; i++) {
            addSlotToContainer(new Slot(inv, i, 8 + i * 18, 142));
        }
    }
}


text:
Concept prototype for Civic Data Challenge (using Meteor)

## Credits and Acknowledgments

The background image for this app was used with the permission of its owner Natalie Chyi for
the express use of creating the Sevak App prototype. The original image may be found on
[Flickr](http://www.flickr.com/photos/52006717@N06/5173598413/). All rights and licenses to
that image are retained by its owner and it may not be copied, distributed or reproduced
without her permission.

The templates for this application are part of the Bootstrap 3 compliant kit purchased from
[Bootstraptor](http://bootstraptor.com). The related assets (including HTML, JS, CSS and images)
cannot be distributed, modified or extracted for use in other projects but instead require a
valid license to be purchased or obtained from the original author.


text:
import {Component} from '@angular/core';
import {DomSanitizer} from '@angular/platform-browser';
import {MdIconRegistry} from '@angular/material';

/**
 * @title SVG icons
 */
@Component({
  selector: 'icon-svg-example',
  templateUrl: 'icon-svg-example.html',
})
export class IconSvgExample {
  constructor(iconRegistry: MdIconRegistry, sanitizer: DomSanitizer) {
    iconRegistry.addSvgIcon(
        'thumbs-up',
        sanitizer.bypassSecurityTrustResourceUrl('assets/img/examples/thumbup-icon.svg'));
  }
}


text:
\echo --start_ignore
set gp_enable_column_oriented_table=on;
\echo --end_ignore
DROP TABLE IF EXISTS mpp21090_defpt_dropcol_addcol_dml_text;
CREATE TABLE mpp21090_defpt_dropcol_addcol_dml_text
(
    col1 text,
    col2 text,
    col3 char,
    col4 int
)
DISTRIBUTED by (col1)
PARTITION BY LIST(col2)
(
default partition def
);

INSERT INTO mpp21090_defpt_dropcol_addcol_dml_text VALUES('abcdefghijklmnop','abcdefghijklmnop','a',0);

ALTER TABLE mpp21090_defpt_dropcol_addcol_dml_text DROP COLUMN col4;

INSERT INTO mpp21090_defpt_dropcol_addcol_dml_text SELECT 'xyz','xyz','b';
SELECT * FROM mpp21090_defpt_dropcol_addcol_dml_text ORDER BY 1,2,3;

ALTER TABLE mpp21090_defpt_dropcol_addcol_dml_text ADD COLUMN col5 text;

INSERT INTO mpp21090_defpt_dropcol_addcol_dml_text SELECT 'abcdefghijklmnop','abcdefghijklmnop','c','abcdefghijklmnop';
SELECT * FROM mpp21090_defpt_dropcol_addcol_dml_text ORDER BY 1,2,3;

UPDATE mpp21090_defpt_dropcol_addcol_dml_text SET col1 = 'qrstuvwxyz' WHERE col2 = 'xyz' AND col1 = 'xyz';
SELECT * FROM mpp21090_defpt_dropcol_addcol_dml_text ORDER BY 1,2,3;

-- Update partition key
UPDATE mpp21090_defpt_dropcol_addcol_dml_text SET col2 = 'qrstuvwxyz' WHERE col2 = 'xyz' AND col1 = 'qrstuvwxyz';
SELECT * FROM mpp21090_defpt_dropcol_addcol_dml_text ORDER BY 1,2,3;

DELETE FROM mpp21090_defpt_dropcol_addcol_dml_text WHERE col2 = 'qrstuvwxyz';
SELECT * FROM mpp21090_defpt_dropcol_addcol_dml_text ORDER BY 1,2,3;


text:
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Collections;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Dynamic;
using System.Reflection;
using System.IO;
using System.Web;
using System.Web.Script.Serialization;
using CsQuery.ExtensionMethods;
using CsQuery.HtmlParser;
using CsQuery.StringScanner;
using CsQuery.Implementation;
using CsQuery.Engine;
using CsQuery.ExtensionMethods.Internal;
using CsQuery.Utility;

namespace CsQuery
{
    /// <summary>
    /// The CQ object is analogus to the basic jQuery object. It has instance methods that mirror the
    /// methods of a jQuery object, and static methods that mirror utility methods such as "$.map".
    ///
    /// Most methods return a new jQuery object that is bound to the same document, but a different
    /// selection set. In a web browser, you genally only have a single context (the browser DOM).
    /// Here, you could have many, though most of the time you will only be working with one.
    /// </summary>
    ///
    /// <remarks>
    /// Document is an IDomDocument object, referred to sometimes as the "DOM", and represents the
    /// DOM that this CsQuery objects applies to. When CQ methods are run, the resulting CQ object
    /// will refer to the same Document as the original. Selectors always run against this DOM.
    ///
    /// Creating a CQ object from something that is not bound to a DOM (such as an HTML string, or an
    /// unbound IDomObject or IDomElement object) will result in a new Document being created, that
    /// is unrelated to any other active objects you may have. Adding unbound elements using methods
    /// such as Append will cause them to become part of the target DOM. They will be removed from
    /// whatever DOM they previously belonged to. (Elements cannot be part of more than one DOM). If
    /// you don't want to remove something while adding to a CQ object from a different DOM, then you
    /// should clone the elements.
    ///
    /// Selection is a set of DOM nodes matching the selector.
    ///
    /// Elements is a set of IDomElement nodes matching the selector. This is a subset of Selection -
    /// it excludes non-Element nodes.
    ///
    /// The static Create() methods create new DOMs. To create a CsQuery object based on an existing
    /// dom, use new CQ() (similar to jQuery() methods).
    /// </remarks>
    ///
    /// <implementation>
    /// Most of the jQuery methods are implemented in separate files under the "CQ_jQuery" folder.
    /// Methods which are not part of the jQuery API are found under the "CQ_CsQuery" folder.
    /// </implementation>

    public partial class CQ : IEnumerable<IDomObject>
    {

        #region private properties

        private Selector _Selector;
        private IDomDocument _Document;

        #endregion

        #region public properties

        /// <summary>
        /// The number of elements in the CQ object.
        /// </summary>
        ///
        /// <url>
        /// http://api.jquery.com/length/
        /// </url>

        public int Length
        {
            get
            {
                return SelectionSet.Count;
            }
        }

        /// <summary>
        /// Represents the full, parsed DOM for an object created with an HTML parameter. The Document is
        /// the equivalent of the "document" in a browser. The Document node for a complete HTML document
        /// should have only two children, the DocType node and the HTML node.
        /// </summary>
        ///
        /// <value>
        /// Returns the Document for this CQ object. This can also be an IDomFragment type, which is a
        /// derived type of IDomDocument. This is mostly a useful distinction to determine
        /// programatically how the CQ object was created and whether it's intended to represent a
        /// complete HTML document, or only a partial fragment.
        /// </value>

        public IDomDocument Document
        {
            get
            {
                if (_Document == null)
                {
                    CreateNewFragment();
                }
                return _Document;
            }
            protected set
            {
                _Document = value;
            }
        }

        /// <summary>
        /// The selector (parsed) used to create this instance.
        /// </summary>
        ///
        /// <remarks>
        /// This is not guaranteed to have useful data, since CQ objects can be created indirectly and
        /// not represent a selector. If this object was created directly from a selector, this will
        /// contain the Selector object. The ToString() overload will show how the selector was parsed.
        /// </remarks>

        public Selector Selector
        {
            get
            {
                return _Selector;
            }
            protected set
            {
                _Selector = value;
            }
        }

        /// <summary>
        /// The entire selection set as a sequence of elements. This is the default enumerator for a CQ
        /// object as well.
        /// </summary>

        public IEnumerable<IDomObject> Selection
        {
            get
            {
                return SelectionSet;
            }
        }

        /// <summary>
        /// Returns only IDomElement objects from the current selection.
        /// </summary>

        public IEnumerable<IDomElement> Elements
        {
            get
            {
                return OnlyElements(SelectionSet);
            }
        }

        /// <summary>
        /// Gets or sets the order in which the selection set is returned. Usually, this is the order
        /// that elements appear in the DOM. Some operations could result in a selection set that's in an
        /// arbitrary order, though.
        /// </summary>

        public SelectionSetOrder Order
        {
            get
            {
                return SelectionSet.OutputOrder;
            }
            set
            {
                SelectionSet.OutputOrder= value;
            }
        }

        #endregion

        #region public methods

        /// <summary>
        /// Returns the HTML of each selected element in order. <see cref="CQ.SelectionHtml()"/>
        /// </summary>
        ///
        /// <returns>
        /// A string of HTML
        /// </returns>

        public override string ToString()
        {
            return SelectionHtml();
        }

        #endregion

        #region interface members

        /// <summary>
        /// Returns an enumeration of the current selection set for this CQ object
        /// </summary>
        ///
        /// <returns>
        /// The enumerator.
        /// </returns>

        public IEnumerator<IDomObject> GetEnumerator()
        {
            return SelectionSet.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return SelectionSet.GetEnumerator();
        }

        #endregion

        #region private properties

        private CQ _CsQueryParent;
        private SelectionSet<IDomObject> _Selection;

        /// <summary>
        /// The object from which this CsQuery was created.
        /// </summary>

        protected CQ CsQueryParent
        {
            get
            {

                {
                    return _CsQueryParent;
                }
            }
            set
            {
                _CsQueryParent = value;

                // only rebind Document when it's missing; e.g. upon creating a new document.

                if (value != null && _Document==null)
                {
                    Document = value.Document;
                }

                //ClearSelections();
            }
        }

        /// <summary>
        /// The current selection set including all node types.
        /// </summary>
        protected SelectionSet<IDomObject> SelectionSet
        {
            get
            {
                if (_Selection == null)
                {
                    _Selection = new SelectionSet<IDomObject>(SelectionSetOrder.OrderAdded);
                }
                return _Selection;
            }
            set
            {
                _Selection = value;
            }
        }

        #endregion

        #region private methods

        /// <summary>
        /// Clear the entire object.
        /// </summary>

        protected void Clear()
        {
            CsQueryParent = null;
            Document = null;
            ClearSelections();
        }

        /// <summary>
        /// Clears the current selection set.
        /// </summary>

        protected void ClearSelections()
        {
            SelectionSet.Clear();
        }

        /// <summary>
        /// Sets the selection set for this object, and asserts that the order in which it as assigned is
        /// the order passed. This allows most operations to return the original set directly; if it is
        /// requested in a different order then it will be sorted.
        /// </summary>
        ///
        /// <param name="selectionSet">
        /// The current selection set including all node types.
        /// </param>
        /// <param name="inputOrder">
        /// The order in which the elements appear in selectionSet. If omitted, Ascending is the default.
        /// </param>
        /// <param name="outputOrder">
        /// The default output order, if different from the inputOrder. If omitted, the same as the input
        /// order is the default.
        /// </param>
        ///
        /// <returns>
        /// The current CQ object.
        /// </returns>

        protected CQ SetSelection(IEnumerable<IDomObject> selectionSet,
            SelectionSetOrder inputOrder = SelectionSetOrder.Ascending,
            SelectionSetOrder outputOrder=0)
        {
            SelectionSet = new SelectionSet<IDomObject>(selectionSet, inputOrder, outputOrder);
            return this;
        }

        /// <summary>
        /// Sets the selection set for this object to a single element..
        /// </summary>
        ///
        /// <param name="element">
        /// The element to add.
        /// </param>
        /// <param name="outputOrder">
        /// The default output order. If omitted, Ascending (DOM) order is the default.
        /// </param>
        ///
        /// <returns>
        /// The current CQ object
        /// </returns>

        protected CQ SetSelection(IDomObject element,
            SelectionSetOrder outputOrder = SelectionSetOrder.Ascending)
        {
            SelectionSet = new SelectionSet<IDomObject>(Objects.Enumerate(element), outputOrder,outputOrder);
            return this;
        }

        /// <summary>
        /// Map a CSV or enumerable object to a hashset.
        /// </summary>
        ///
        /// <param name="value">
        /// the object or sequence to map
        /// </param>
        ///
        /// <returns>
        /// A new hashset
        /// </returns>

        protected HashSet<string> MapMultipleValues(object value)
        {
            var values = new HashSet<string>();
            if (value is string)
            {
                values.AddRange(value.ToString().Split(','));

            }
            if (value is IEnumerable)
            {
                foreach (object obj in (IEnumerable)value)
                {
                    values.Add(obj.ToString());
                }
            }

            if (values.Count == 0)
            {
                if (value != null)
                {
                    values.Add(value.ToString());
                }
            }
            return values;

        }

        /// <summary>
        /// Helper function for option groups to set multiple options when passed a CSV of values.
        /// </summary>
        ///
        /// <param name="elements">
        /// .
        /// </param>
        /// <param name="value">
        /// .
        /// </param>
        /// <param name="multiple">
        /// true to multiple.
        /// </param>

        protected void SetOptionSelected(IEnumerable<IDomElement> elements, object value, bool multiple)
        {
            HashSet<string> values = MapMultipleValues(value);
            SetOptionSelected(elements, values, multiple);
        }

        /// <summary>
        /// Helper function for option groups to set multiple options when passed a CSV of values.
        /// </summary>
        ///
        /// <param name="elements">
        /// .
        /// </param>
        /// <param name="values">
        /// The values.
        /// </param>
        /// <param name="multiple">
        /// true to multiple.
        /// </param>

        protected void SetOptionSelected(IEnumerable<IDomElement> elements, HashSet<string> values, bool multiple)
        {
            bool setOne = false;
            string attribute;

            foreach (IDomElement e in elements)
            {
                attribute = String.Empty;
                switch (e.NodeNameID)
                {
                    case HtmlData.tagOPTION:
                        attribute = "selected";
                        break;
                    case HtmlData.tagINPUT:
                        switch (e["type"])
                        {
                            case "checkbox":
                            case "radio":
                                attribute = "checked";
                                break;
                        }
                        break;
                    case HtmlData.tagOPTGROUP:
                        SetOptionSelected(e.ChildElements, values, multiple);
                        break;
                }
                if (attribute != String.Empty && !setOne && values.Contains(e["value"]))
                {
                    e.SetAttribute(attribute);
                    if (!multiple)
                    {
                        setOne = true;
                    }
                }
                else
                {
                    e.RemoveAttribute(attribute);
                }

            }
        }

        /// <summary>
        /// Add an item to the list of selected elements. It should be part of this DOM.
        /// </summary>
        ///
        /// <param name="element">
        /// The element to add
        /// </param>
        ///
        /// <returns>
        /// true if the element was added.
        /// </returns>

        protected bool AddSelection(IDomObject element)
        {
            //if (!ReferenceEquals(element.Dom, Dom))
            //{
            //    throw new InvalidOperationException("Cannot add unbound elements or elements bound to another DOM directly to a selection set.");
            //}
            return SelectionSet.Add(element);
        }

        /// <summary>
        /// Adds each element to the current selection set.
        /// </summary>
        ///
        /// <param name="elements">
        /// The elements to add
        /// </param>
        ///
        /// <returns>
        /// true if any elements were added.
        /// </returns>

        protected bool AddSelection(IEnumerable<IDomObject> elements)
        {
            bool result = false;
            foreach (IDomObject elm in elements)
            {
                result = true;
                AddSelection(elm);
            }
            return result;
        }

        /// <summary>
        /// Map range of elements to a new CQ object using a function delegate to populate it.
        /// </summary>
        ///
        /// <param name="source">
        /// Source elements
        /// </param>
        /// <param name="del">
        /// Delegate to the mapping function
        /// </param>
        ///
        /// <returns>
        /// A new CQ object
        /// </returns>

        protected CQ MapRangeToNewCQ(IEnumerable<IDomObject> source, Func<IDomObject, IEnumerable<IDomObject>> del)
        {
            CQ output = NewCqInDomain();
            foreach (var item in source)
            {
                output.SelectionSet.AddRange(del(item));
            }
            return output;
        }

        /// <summary>
        /// Runs a set of selectors and returns the combined result as a single enumerable.
        /// </summary>
        ///
        /// <param name="selectors">
        /// A sequence of strings that area each selectors
        /// </param>
        ///
        /// <returns>
        /// An enumerator that allows foreach to be used to process merge selections in this collection.
        /// </returns>

        protected IEnumerable<IDomObject> MergeSelections(IEnumerable<string> selectors)
        {
            SelectionSet<IDomObject> allContent = new SelectionSet<IDomObject>(SelectionSetOrder.Ascending);

            Each(selectors, item => allContent.AddRange(Select(item)));
            return allContent;
        }

        /// <summary>
        /// Runs a set of HTML creation selectors and returns result as a single enumerable.
        /// </summary>
        ///
        /// <param name="content">
        /// A sequence of strings that are each valid HTML
        /// </param>
        ///
        /// <returns>
        /// A new sequence containing all the elements from all the selectors.
        /// </returns>

        protected IEnumerable<IDomObject> MergeContent(IEnumerable<string> content)
        {
            List<IDomObject> allContent = new List<IDomObject>();
            foreach (var item in content)
            {
                allContent.AddRange(CQ.Create(item));
            }
            return allContent;
        }

        /// <summary>
        /// Enumerates only the IDomElements in the sequence provided. Any other elemnent types are excluded..
        /// </summary>
        ///
        /// <param name="objects">
        /// The objects.
        /// </param>
        ///
        /// <returns>
        /// An enumerator that allows foreach to be used to process only elements in this collection.
        /// </returns>

        protected IEnumerable<IDomElement> OnlyElements(IEnumerable<IDomObject> objects)
        {
            foreach (var item in objects)
            {
                IDomElement el = item as IDomElement;
                if (el != null)
                {
                    yield return el;
                }
            }
        }

        /// <summary>
        /// Filter a sequence using a selector if the selector is not empty. If it's empty, return a new
        /// CQ object containing the original list.
        /// </summary>
        ///
        /// <param name="selector">
        /// The selector.
        /// </param>
        /// <param name="list">
        /// The source sequence.
        /// </param>
        ///
        /// <returns>
        /// A new CQ object.
        /// </returns>

        protected CQ FilterIfSelector(string selector, IEnumerable<IDomObject> list)
        {
            return FilterIfSelector(selector, list, SelectionSetOrder.OrderAdded);
        }

        /// <summary>
        /// Filter a sequence using a selector if the selector is not empty. If it's empty, return a new CQ object
        /// containing the original list.
        /// </summary>
        ///
        /// <param name="selector">
        /// The selector.
        /// </param>
        /// <param name="list">
        /// The source sequence
        /// </param>
        /// <param name="order">
        /// The order in which the elements of the new CQ object should be returned
        /// </param>
        ///
        /// <returns>
        /// A new CQ object
        /// </returns>

        protected CQ FilterIfSelector(string selector, IEnumerable<IDomObject> list, SelectionSetOrder order)
        {
            CQ output;
            if (String.IsNullOrEmpty(selector))
            {
                output = NewInstance(list, this);
            }
            else
            {
                output = NewInstance(FilterElements(list, selector), this);
            }
            output.Order = order;
            return output;
        }

        /// <summary>
        /// Filter a sequence using a selector, ignoring missing selectors
        /// </summary>
        ///
        /// <param name="elements">
        /// The sequence to filter
        /// </param>
        /// <param name="selector">
        /// The selector.
        /// </param>
        ///
        /// <returns>
        /// An enumerator that allows foreach to be used to process filter elements in this collection.
        /// </returns>

        protected IEnumerable<IDomObject> FilterElements(IEnumerable<IDomObject> elements, string selector)
        {
            return FilterElementsIgnoreNull(elements, selector ?? "");
        }

        /// <summary>
        /// Filter an element list using another selector. A null selector results in no filtering; an
        /// empty string selector results in an empty list being return.
        /// </summary>
        ///
        /// <param name="elements">
        /// The sequence to filter.
        /// </param>
        /// <param name="selector">
        /// The selector.
        /// </param>
        ///
        /// <returns>
        /// The filtered list.
        /// </returns>

        protected IEnumerable<IDomObject> FilterElementsIgnoreNull(IEnumerable<IDomObject> elements, string selector)
        {
            if (selector == "")
            {
                return Objects.EmptyEnumerable<IDomObject>();
            }
            else if (selector == null)
            {
                return elements;
            }
            else
            {
                Selector selectors = new Selector(selector).ToFilterSelector();
                return selectors.Filter(Document, elements);
            }
        }

        #endregion

    }
}


text:
HTML render: codespan
--SKIPIF--
--FILE--
<?php
$text =<<<EOT
`hoge`
EOT;

$hoedown = new Hoedown;

echo "== closure: codespan ==\n";
$hoedown->addRender('codespan', function($text, $attr) {
        return 'closure:'.$text;
    });

echo $hoedown->parse($text), "\n";

echo "== function: codespan ==\n";
function codespan($text, $attr) {
    return 'function:'.$text;
}

$hoedown->addRender('codespan', 'codespan');

echo $hoedown->parse($text), "\n";

echo "== static closure: codespan ==\n";
echo Hoedown::ofString($text, array(
                           Hoedown::RENDERS => array(
                               'codespan' => function($text, $attr) {
                                   return 'static-closure:'.$text;
                               }))), "\n";

echo "== static function: codespan ==\n";
echo Hoedown::ofString($text, array(
                           Hoedown::RENDERS => array(
                               'codespan' => 'codespan'))), "\n";

--EXPECTF--
== closure: codespan ==

closure:hoge

== function: codespan ==

function:hoge

== static closure: codespan ==

static-closure:hoge

== static function: codespan ==

function:hoge


text:
package ozmi.lambda_core
package lib

import org.kiama.rewriting.Strategy
import org.kiama.rewriting.Rewriter._

object Library {

    val typeClasses : Seq[TypeClass] = Seq (Eq, Num, Ord, Row)
    val typeInstances : Seq[TypeInstance] = Seq (Bool, Coll, Decimal, Integer)

    lazy val evalRules : Strategy =
        reduce ((typeClasses map {_.evalRules}) ++ (typeInstances map {_.evalRules}) reduceLeft {_ + _})

    def eval (expr : Expr) : Expr =
        rewrite (Library.evalRules) (expr)

}


text:
#include "tensorflow/compiler/xla/service/gpu/llvm_gpu_backend/utils.h"

#include "tensorflow/core/platform/logging.h"

#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/Support/SourceMgr.h"
#include "tensorflow/compiler/xla/types.h"
#include "tensorflow/core/lib/core/stringpiece.h"
#include "tensorflow/core/lib/strings/strcat.h"

namespace {

static void DieWithSMDiagnosticError(llvm::SMDiagnostic* diagnostic) {
  LOG(FATAL) << diagnostic->getFilename().str() << ":"
             << diagnostic->getLineNo() << ":" << diagnostic->getColumnNo()
             << ": " << diagnostic->getMessage().str();
}

}  // namespace

namespace xla {
namespace gpu {

std::unique_ptr<llvm::Module> LoadIRModule(const string& filename,
                                           llvm::LLVMContext* llvm_context) {
  llvm::SMDiagnostic diagnostic_err;
  std::unique_ptr<llvm::Module> module(
      llvm::parseIRFile(llvm::StringRef(filename.data(), filename.size()),
                        diagnostic_err, *llvm_context));

  if (module == nullptr) {
    DieWithSMDiagnosticError(&diagnostic_err);
  }

  return module;
}

string ReplaceFilenameExtension(tensorflow::StringPiece filename,
                                tensorflow::StringPiece new_extension) {
  auto pos = filename.rfind('.');
  tensorflow::StringPiece stem =
      pos == tensorflow::StringPiece::npos
          ? filename
          : tensorflow::StringPiece(filename.data(), pos);
  return tensorflow::strings::StrCat(stem, ".", new_extension);
}

}  // namespace gpu
}  // namespace xla