text:
package chapter34;

import javax.swing.*;
import java.awt.*;

public class ToolBarDemo extends JApplet {
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private JButton jbtNew = new JButton(new ImageIcon(getClass().getResource(
			"/image/new.gif")));
	private JButton jbtOpen = new JButton(new ImageIcon(getClass().getResource(
			"/image/open.gif")));
	private JButton jbPrint = new JButton(new ImageIcon(getClass().getResource(
			"/image/print.gif")));

	public ToolBarDemo() {
		JToolBar jToolBar1 = new JToolBar("My Tool Bar");
		jToolBar1.setFloatable(false);
		jToolBar1.setBorder(BorderFactory.createLineBorder(Color.BLACK));
		jToolBar1.add(jbtNew);
		jToolBar1.add(jbtOpen);
		jToolBar1.add(jbPrint);

		jbtNew.setToolTipText("New");
		jbtOpen.setToolTipText("Open");
		jbPrint.setToolTipText("Print");

		jbtNew.setBorderPainted(false);
		jbtOpen.setBorderPainted(false);
		jbPrint.setBorderPainted(false);

		add(jToolBar1, BorderLayout.NORTH);
	}

	public static void main(String[] args) {
		ToolBarDemo applet = new ToolBarDemo();
		JFrame frame = new JFrame();
		// EXIT_ON_CLOSE == 3
		frame.setDefaultCloseOperation(3);
		frame.setTitle("ToolBarDemo");
		frame.getContentPane().add(applet, BorderLayout.CENTER);
		applet.init();
		applet.start();
		frame.setSize(400, 320);
		frame.setLocationRelativeTo(null);
		frame.setVisible(true);
	}
}


text:
actions :create, :delete
default_action :create

attribute :name, kind_of: String, default: nil, name_attribute: true
attribute :config, kind_of: Hash, default: nil

redpajama_set_name: RedPajamaGithub


text:
import React              from "react";
import CardListing        from "./card_listing";
import NewCardForm        from "./new_card_form";

export default class CardList extends React.Component {

  buildCardList() {
    const currentSite = this.props.currentSite;
    const siteId = currentSite.id;
    return(this.props.cards.cardList.map((card) => {
      return(<CardListing key={card.id}
                  card={card}
                  currentSite={currentSite}
                  deleteCard={this.props.deleteCard.bind(this, siteId, card.id)} />);
    }));
  }

  render() {
    return(

        <NewCardForm onSubmit={this.props.addNewCard}/>

              Path

            {this.buildCardList()}

    )
  }
}

CardList.propTypes = {
  deleteCard: React.PropTypes.func.isRequired,
  cards: React.PropTypes.object.isRequired
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>
SOAP Add-on
</TITLE>

SOAP Add-on

This add-on imports and scans WSDL files containing SOAP endpoints.

Importing

The add-on will automatically detect any SOAP definitions and spider them as long as they are in scope.

2 menu items are also added to the Import menu:

Import a WSDL file from local file system

Import a WSDL file from a URL

These operations are also available via the API.

Scanning

The scan rules added by this add-on are:

Action Spoofing : http://www.ws-attacks.org/index.php/SOAPAction_Spoofing

XML Injection : http://www.ws-attacks.org/index.php/XML_Injection


text:
/*
 * winnojmp.c: stub jump list functions for Windows executables that
 * don't update the jump list.
 */

void add_session_to_jumplist(const char * const sessionname) {}
void remove_session_from_jumplist(const char * const sessionname) {}
void clear_jumplist(void) {}


text:
require 'test_helper'

class CanLoginTest < FeatureTest
  setup do
    @admin = create(:admin_user)
  end

  test 'sanity' do
    sign_in_user(@admin)
    assert_content page, 'Create new conference'
  end
end


text:
/* Author: Ioan Sucan */

#ifndef OMPL_BASE_SPACES_SO3_STATE_SPACE_
#define OMPL_BASE_SPACES_SO3_STATE_SPACE_

#include "ompl/base/StateSpace.h"

namespace ompl
{
    namespace base
    {
        /** \brief State space sampler for SO(3), using quaternion representation  */
        class SO3StateSampler : public StateSampler
        {
        public:
            /** \brief Constructor */
            SO3StateSampler(const StateSpace *space) : StateSampler(space)
            {
            }

            void sampleUniform(State *state) override;
            /** \brief To sample unit quaternions uniformly within some given
                distance, we sample a 3-vector from the R^3 tangent space.
                This vector is drawn uniformly random from a 3D ball centered at
                the origin with radius distance. The vector is then "wrapped"
                around S^3 to obtain a unit quaternion uniformly distributed
                around the identity quaternion within given distance. We
                pre-multiply this quaternion with the quaternion near
                to center the distribution around near. */
            void sampleUniformNear(State *state, const State *near, const double distance) override;
            /** \brief Sample a state such that the expected distance between
                mean and state is stdDev.

                To sample a unit quaternion from a Gaussian
                distribution, we sample a 3-vector from the R^3 tangent space
                using a 3D Gaussian with zero mean and covariance matrix equal
                to diag(stdDev^2, stdDev^2, stdDev^2). This vector is "wrapped"
                around S^3 to obtain a Gaussian quaternion with zero mean.
                We pre-multiply this quaternion with the quaternion mean
                to get the desired mean. */
            void sampleGaussian(State *state, const State *mean, const double stdDev) override;
        };

        /** \brief A state space representing SO(3). The internal
            representation is done with quaternions. The distance
            between states is the angle between quaternions and
            interpolation is done with slerp. */
        class SO3StateSpace : public StateSpace
        {
        public:
            /** \brief The definition of a state in SO(3) represented as a unit quaternion

                \note The order of the elements matters in this
                definition for the SO3StateUniformSampler::sample()
                function. */
            class StateType : public State
            {
            public:
                /** \brief Set the quaternion from axis-angle representation.  The angle is given in radians. */
                void setAxisAngle(double ax, double ay, double az, double angle);

                /** \brief Set the state to identity -- no rotation */
                void setIdentity();

                /** \brief X component of quaternion vector */
                double x;

                /** \brief Y component of quaternion vector */
                double y;

                /** \brief Z component of quaternion vector */
                double z;

                /** \brief scalar component of quaternion */
                double w;
            };

            SO3StateSpace() : StateSpace()
            {
                setName("SO3" + getName());
                type_ = STATE_SPACE_SO3;
            }

            ~SO3StateSpace() override = default;

            /** \brief Compute the norm of a state */
            double norm(const StateType *state) const;

            unsigned int getDimension() const override;

            double getMaximumExtent() const override;

            double getMeasure() const override;

            void enforceBounds(State *state) const override;

            bool satisfiesBounds(const State *state) const override;

            void copyState(State *destination, const State *source) const override;

            unsigned int getSerializationLength() const override;

            void serialize(void *serialization, const State *state) const override;

            void deserialize(State *state, const void *serialization) const override;

            double distance(const State *state1, const State *state2) const override;

            bool equalStates(const State *state1, const State *state2) const override;

            void interpolate(const State *from, const State *to, const double t, State *state) const override;

            StateSamplerPtr allocDefaultStateSampler() const override;

            State *allocState() const override;

            void freeState(State *state) const override;

            double *getValueAddressAtIndex(State *state, const unsigned int index) const override;

            void printState(const State *state, std::ostream &out) const override;

            void printSettings(std::ostream &out) const override;

            void registerProjections() override;
        };
    }
}

#endif


text:
package com.sebastian_daschner.scalable_coffee_shop.events.entity;

import javax.json.JsonObject;
import java.time.Instant;

public class BeansFetched extends CoffeeEvent {

    private final String beanOrigin;

    public BeansFetched(final String beanOrigin) {
        this.beanOrigin = beanOrigin;
    }

    public BeansFetched(final String beanOrigin, final Instant instant) {
        super(instant);
        this.beanOrigin = beanOrigin;
    }

    public BeansFetched(final JsonObject jsonObject) {
        this(jsonObject.getString("beanOrigin"), Instant.parse(jsonObject.getString("instant")));

    }

    public String getBeanOrigin() {
        return beanOrigin;
    }

}


text:
/**
 * @fileoverview Build file
 * @author nzakas
 */
/* global cat, cd, cp, echo, exec, exit, find, ls, mkdir, mv, pwd, rm, target, test*/
/* eslint no-use-before-define: 0*/
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

require("shelljs/make");

var checker = require("npm-license"),
    dateformat = require("dateformat"),
    fs = require("fs"),
    glob = require("glob"),
    markdownlint = require("markdownlint"),
    nodeCLI = require("shelljs-nodecli"),
    os = require("os"),
    path = require("path"),
    semver = require("semver"),
    ejs = require("ejs"),
    loadPerf = require("load-perf");

//------------------------------------------------------------------------------
// Settings
//------------------------------------------------------------------------------

/*
 * A little bit fuzzy. My computer has a first CPU speed of 3392 and the perf test
 * always completes in < 3800ms. However, Travis is less predictable due to
 * multiple different VM types. So I'm fudging this for now in the hopes that it
 * at least provides some sort of useful signal.
 */
var PERF_MULTIPLIER = 13e6;

var OPEN_SOURCE_LICENSES = [
    /MIT/, /BSD/, /Apache/, /ISC/, /WTF/, /Public Domain/
];

//------------------------------------------------------------------------------
// Data
//------------------------------------------------------------------------------

var NODE = "node ", // intentional extra space
    NODE_MODULES = "./node_modules/",
    TEMP_DIR = "./tmp/",
    BUILD_DIR = "./build/",
    DOCS_DIR = "../eslint.github.io/docs",
    SITE_DIR = "../eslint.github.io/",
    PERF_TMP_DIR = path.join(os.tmpdir(), "eslint", "performance"),

    // Utilities - intentional extra space at the end of each string
    MOCHA = NODE_MODULES + "mocha/bin/_mocha ",
    ESLINT = NODE + " bin/eslint.js ",

    // Files
    MAKEFILE = "./Makefile.js",
    PACKAGE = "./package.json",
    JS_FILES = find("lib/").filter(fileType("js")).join(" "),
    JSON_FILES = find("conf/").filter(fileType("json")).join(" ") + " .eslintrc",
    MARKDOWN_FILES_ARRAY = find("docs/").concat(ls(".")).filter(fileType("md")),
    TEST_FILES = getTestFilePatterns(),
    PERF_ESLINTRC = path.join(PERF_TMP_DIR, "eslintrc.yml"),
    PERF_MULTIFILES_TARGET_DIR = path.join(PERF_TMP_DIR, "eslint"),
    PERF_MULTIFILES_TARGETS = PERF_MULTIFILES_TARGET_DIR + path.sep + "{lib,tests" + path.sep + "lib}" + path.sep + "**" + path.sep + "*.js",

    // Regex
    TAG_REGEX = /^(?:Fix|Update|Breaking|Docs|Build|New|Upgrade):/,
    ISSUE_REGEX = /\((?:fixes|refs) #\d+(?:.*(?:fixes|refs) #\d+)*\)$/,

    // Settings
    MOCHA_TIMEOUT = 10000;

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Generates file patterns for test files
 * @returns {string} test file patterns
 * @private
 */
function getTestFilePatterns() {
    var testLibPath = "tests/lib/";

    return ls(testLibPath).filter(function(pathToCheck) {
        return test("-d", testLibPath + pathToCheck);
    }).reduce(function(initialValue, currentValues) {
        if (currentValues !== "rules") {
            initialValue.push(testLibPath + currentValues + "/**/*.js");
        }
        return initialValue;
    }, [testLibPath + "rules/**/*.js", testLibPath + "*.js"]).join(" ");
}

/**
 * Generates a function that matches files with a particular extension.
 * @param {string} extension The file extension (i.e. "js")
 * @returns {Function} The function to pass into a filter method.
 * @private
 */
function fileType(extension) {
    return function(filename) {
        return filename.substring(filename.lastIndexOf(".") + 1) === extension;
    };
}

/**
 * Returns package.json contents as a JavaScript object
 * @returns {Object} Contents of package.json for the project
 * @private
 */
function getPackageInfo() {
    return JSON.parse(fs.readFileSync(PACKAGE));
}

/**
 * Generates a static file that includes each rule by name rather than dynamically
 * looking up based on directory. This is used for the browser version of ESLint.
 * @param {string} basedir The directory in which to look for code.
 * @returns {void}
 */
function generateRulesIndex(basedir) {
    var output = "module.exports = function() {\n";
    output += "    var rules = Object.create(null);\n";

    find(basedir + "rules/").filter(fileType("js")).forEach(function(filename) {
        var basename = path.basename(filename, ".js");
        output += "    rules[\"" + basename + "\"] = require(\"./rules/" + basename + "\");\n";
    });

    output += "\n    return rules;\n};";
    output.to(basedir + "load-rules.js");
}

/**
 * Executes a command and returns the output instead of printing it to stdout.
 * @param {string} cmd The command string to execute.
 * @returns {string} The result of the executed command.
 */
function execSilent(cmd) {
    return exec(cmd, { silent: true }).output;
}

/**
 * Generates a release blog post for eslint.org
 * @param {Object} releaseInfo The release metadata.
 * @returns {void}
 * @private
 */
function generateBlogPost(releaseInfo) {
    var output = ejs.render(cat("./templates/blogpost.md.ejs"), releaseInfo),
        now = new Date(),
        month = now.getMonth() + 1,
        day = now.getDate(),
        filename = "../eslint.github.io/_posts/" + now.getFullYear() + "-" +
            (month < 10 ? "0" + month : month) + "-" +
            (day < 10 ? "0" + day : day) + "-eslint-" + releaseInfo.version +
            "-released.md";

    output.to(filename);
}

/**
 * Generates a doc page with formatter result examples
 * @param  {Object} formatterInfo Linting results from each formatter
 * @param  {string} [prereleaseVersion] The version used for a prerelease. This
 *      changes where the output is stored.
 * @returns {void}
 */
function generateFormatterExamples(formatterInfo, prereleaseVersion) {
    var output = ejs.render(cat("./templates/formatter-examples.md.ejs"), formatterInfo),
        filename = "../eslint.github.io/docs/user-guide/formatters/index.md",
        htmlFilename = "../eslint.github.io/docs/user-guide/formatters/html-formatter-example.html";

    if (prereleaseVersion) {
        filename = filename.replace("/docs", "/docs/" + prereleaseVersion);
        htmlFilename = htmlFilename.replace("/docs", "/docs/" + prereleaseVersion);
    }

    output.to(filename);
    formatterInfo.formatterResults.html.result.to(htmlFilename);
}

/**
 * Gets all changes since the last tag that represents a version.
 * @returns {Object} An object containing all the changes since the last version.
 * @private
 */
function calculateReleaseInfo() {

    // get most recent tag
    var tags = getVersionTags(),
        lastTag = tags[tags.length - 1],
        commitFlagPattern = /([a-z]+):/i,
        releaseInfo = {};

    // get log statements
    var logs = execSilent("git log --no-merges --pretty=format:\"* %h %s (%an)\" " + lastTag + "..HEAD").split(/\n/g);

    // arrange change types into categories
    logs.forEach(function(log) {
        var flag = log.match(commitFlagPattern)[1].toLowerCase();

        if (!releaseInfo["changelog_" + flag]) {
            releaseInfo["changelog_" + flag] = [];
        }

        releaseInfo["changelog_" + flag].push(log);
    });

    var output = logs.join("\n"); // and join it into a string
    releaseInfo.raw = output;

    if (releaseInfo.changelog_breaking) {
        releaseInfo.releaseType = "major";
    } else if (releaseInfo.changelog_new || releaseInfo.changelog_update) {
        releaseInfo.releaseType = "minor";
    } else {
        releaseInfo.releaseType = "patch";
    }

    // increment version from current version
    releaseInfo.version = "v" + semver.inc(require("./package.json").version, releaseInfo.releaseType);

    return releaseInfo;
}

/**
 * Outputs the changelog to disk.
 * @param {Object} releaseInfo The information about the release.
 * @param {string} releaseInfo.version The release version.
 * @param {Object} releaseInfo.changelog The changelog information.
 * @returns {void}
 */
function writeChangelog(releaseInfo) {

    // get most recent two tags
    var now = new Date(),
        timestamp = dateformat(now, "mmmm d, yyyy");

    // output header
    (releaseInfo.version + " - " + timestamp + "\n").to("CHANGELOG.tmp");

    // output changelog
    ("\n" + releaseInfo.raw + "\n").toEnd("CHANGELOG.tmp");

    // switch-o change-o
    cat("CHANGELOG.tmp", "CHANGELOG.md").to("CHANGELOG.md.tmp");
    rm("CHANGELOG.tmp");
    rm("CHANGELOG.md");
    mv("CHANGELOG.md.tmp", "CHANGELOG.md");
}

/**
 * Creates a release version tag and pushes to origin.
 * @returns {void}
 */
function release() {

    echo("Updating dependencies");
    exec("npm install && npm prune");

    echo("Running tests");
    target.test();

    echo("Calculating changes for release");
    var releaseInfo = calculateReleaseInfo();

    echo("Release is " + releaseInfo.version);

    echo("Generating changelog");
    writeChangelog(releaseInfo);
    exec("git add .");
    exec("git commit -m \"Docs: Autogenerated changelog for " + releaseInfo.version + "\"");

    echo("Generating " + releaseInfo.version);
    execSilent("npm version " + releaseInfo.version);

    // push all the things
    echo("Publishing to git");
    exec("git push origin master --tags");

    echo("Publishing to npm");
    getPackageInfo().files.filter(function(dirPath) {
        return fs.lstatSync(dirPath).isDirectory();
    }).forEach(nodeCLI.exec.bind(nodeCLI, "linefix"));
    exec("npm publish");

    echo("Generating site");
    target.gensite();
    generateBlogPost(releaseInfo);
    target.publishsite();
}

/**
 * Creates a prerelease version tag and pushes to origin.
 * @param {string} version The prerelease version to create (i.e. 2.0.0-alpha-1).
 * @returns {void}
 */
function prerelease(version) {

    if (!version) {
        echo("Missing prerelease version.");
        exit(1);
    }

    echo("Updating dependencies");
    exec("npm install && npm prune");

    echo("Running tests");
    target.test();

    echo("Calculating changes for release");
    var releaseInfo = calculateReleaseInfo();

    // override the version for prereleases
    releaseInfo.version = version[0] === "v" ? version : "v" + version;
    echo("Release is " + releaseInfo.version);

    echo("Generating changelog");
    writeChangelog(releaseInfo);
    exec("git add .");
    exec("git commit -m \"Docs: Autogenerated changelog for " + releaseInfo.version + "\"");

    echo("Generating " + releaseInfo.version);
    execSilent("npm version " + version);

    // push all the things
    echo("Publishing to git");
    exec("git push origin master --tags");

    // publish to npm
    echo("Publishing to npm");
    getPackageInfo().files.filter(function(dirPath) {
        return fs.lstatSync(dirPath).isDirectory();
    }).forEach(nodeCLI.exec.bind(nodeCLI, "linefix"));
    exec("npm publish --tag next");

    echo("Generating site");
    target.gensite(semver.inc(version, "major"));
    generateBlogPost(releaseInfo);
    echo("Site has not been pushed, please update blog post and push manually.");
}

/**
 * Splits a command result to separate lines.
 * @param {string} result The command result string.
 * @returns {array} The separated lines.
 */
function splitCommandResultToLines(result) {
    return result.trim().split("\n");
}

/**
 * Gets the first commit sha of the given file.
 * @param {string} filePath The file path which should be checked.
 * @returns {string} The commit sha.
 */
function getFirstCommitOfFile(filePath) {
    var commits = execSilent("git rev-list HEAD -- " + filePath);

    commits = splitCommandResultToLines(commits);
    return commits[commits.length - 1].trim();
}

/**
 * Gets the tag name where a given file was introduced first.
 * @param {string} filePath The file path to check.
 * @returns {string} The tag name.
 */
function getTagOfFirstOccurrence(filePath) {
    var firstCommit = getFirstCommitOfFile(filePath),
        tags = execSilent("git tag --contains " + firstCommit);

    tags = splitCommandResultToLines(tags);
    return tags.reduce(function(list, version) {
        version = semver.valid(version.trim());
        if (version) {
            list.push(version);
        }
        return list;
    }, []).sort(semver.compare)[0];
}

/**
 * Gets the version number where a given file was introduced first.
 * @param {string} filePath The file path to check.
 * @returns {string} The version number.
 */
function getFirstVersionOfFile(filePath) {
    return getTagOfFirstOccurrence(filePath);
}

/**
 * Gets the commit that deleted a file.
 * @param {string} filePath The path to the deleted file.
 * @returns {string} The commit sha.
 */
function getCommitDeletingFile(filePath) {
    var commits = execSilent("git rev-list HEAD -- " + filePath);

    return splitCommandResultToLines(commits)[0];
}

/**
 * Gets the first version number where a given file is no longer present.
 * @param {string} filePath The path to the deleted file.
 * @returns {string} The version number.
 */
function getFirstVersionOfDeletion(filePath) {
    var deletionCommit = getCommitDeletingFile(filePath),
        tags = execSilent("git tag --contains " + deletionCommit);

    return splitCommandResultToLines(tags)
        .map(function(version) {
            return semver.valid(version.trim());
        })
        .filter(function(version) {
            return version;
        })
        .sort(semver.compare)[0];
}

/**
 * Returns the version tags
 * @returns {string[]} Tags
 * @private
 */
function getVersionTags() {
    var tags = splitCommandResultToLines(execSilent("git tag"));

    return tags.reduce(function(list, tag) {
        if (semver.valid(tag)) {
            list.push(tag);
        }
        return list;
    }, []).sort(semver.compare);
}

/**
 * Returns all the branch names
 * @returns {string[]} branch names
 * @private
 */
function getBranches() {
    var branchesRaw = splitCommandResultToLines(execSilent("git branch --list")),
        branches = [],
        branchName;

    for (var i = 0; i < branchesRaw.length; i++) {
        branchName = branchesRaw[i].replace(/^\*(.*)/, "$1").trim();
        branches.push(branchName);
    }
    return branches;
}

/**
 * Lints Markdown files.
 * @param {array} files Array of file names to lint.
 * @returns {object} exec-style exit code object.
 * @private
 */
function lintMarkdown(files) {
    var config = {
            default: true,
            // Exclusions for deliberate/widespread violations
            MD001: false, // Header levels should only increment by one level at a time
            MD002: false, // First header should be a h1 header
            MD007: {      // Unordered list indentation
                indent: 4
            },
            MD012: false, // Multiple consecutive blank lines
            MD013: false, // Line length
            MD014: false, // Dollar signs used before commands without showing output
            MD019: false, // Multiple spaces after hash on atx style header
            MD021: false, // Multiple spaces inside hashes on closed atx style header
            MD024: false, // Multiple headers with the same content
            MD026: false, // Trailing punctuation in header
            MD029: false, // Ordered list item prefix
            MD030: false, // Spaces after list markers
            MD034: false, // Bare URL used
            MD040: false, // Fenced code blocks should have a language specified
            MD041: false  // First line in file should be a top level header
        },
        result = markdownlint.sync({
            files: files,
            config: config
        }),
        resultString = result.toString(),
        returnCode = resultString ? 1 : 0;
    if (resultString) {
        console.error(resultString);
    }
    return { code: returnCode };
}

/**
 * Check if the branch name is valid
 * @param {string} branchName Branch name to check
 * @returns {boolean} true is branch exists
 * @private
 */
function hasBranch(branchName) {
    var branches = getBranches();
    return branches.indexOf(branchName) !== -1;
}

/**
 * Gets linting results from every formatter, based on a hard-coded snippet and config
 * @returns {Object} Output from each formatter
 */
function getFormatterResults() {
    var CLIEngine = require("./lib/cli-engine"),
        chalk = require("chalk");

    var formatterFiles = fs.readdirSync("./lib/formatters/"),
        cli = new CLIEngine({
            useEslintrc: false,
            baseConfig: { "extends": "eslint:recommended" },
            rules: {
                "no-else-return": 1,
                "indent": [1, 4],
                "space-unary-ops": 2,
                "semi": [1, "always"],
                "consistent-return": 2
            }
        }),
        codeString = [
            "function addOne(i) {",
            "    if (i != NaN) {",
            "        return i ++",
            "    } else {",
            "      return",
            "    }",
            "};"
        ].join("\n"),
        rawMessages = cli.executeOnText(codeString, "fullOfProblems.js");

    return formatterFiles.reduce(function(data, filename) {
        var fileExt = path.extname(filename),
            name = path.basename(filename, fileExt);
        if (fileExt === ".js") {
            data.formatterResults[name] = {
                result: chalk.stripColor(cli.getFormatter(name)(rawMessages.results))
            };
        }
        return data;
    }, { formatterResults: {} });
}

//------------------------------------------------------------------------------
// Tasks
//------------------------------------------------------------------------------

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

target.lint = function() {
    var errors = 0,
        makeFileCache = " ",
        jsCache = " ",
        testCache = " ",
        lastReturn;

    // using the cache locally to speed up linting process
    if (!process.env.TRAVIS) {
        makeFileCache = " --cache --cache-file .cache/makefile_cache ";
        jsCache = " --cache --cache-file .cache/js_cache ";
        testCache = " --cache --cache-file .cache/test_cache ";
    }

    echo("Validating Makefile.js");
    lastReturn = exec(ESLINT + makeFileCache + MAKEFILE);
    if (lastReturn.code !== 0) {
        errors++;
    }

    echo("Validating JSON Files");
    lastReturn = nodeCLI.exec("jsonlint", "-q -c", JSON_FILES);
    if (lastReturn.code !== 0) {
        errors++;
    }

    echo("Validating Markdown Files");
    lastReturn = lintMarkdown(MARKDOWN_FILES_ARRAY);
    if (lastReturn.code !== 0) {
        errors++;
    }

    echo("Validating JavaScript files");
    lastReturn = exec(ESLINT + jsCache + JS_FILES);
    if (lastReturn.code !== 0) {
        errors++;
    }

    echo("Validating JavaScript test files");
    lastReturn = exec(ESLINT + testCache + TEST_FILES);
    if (lastReturn.code !== 0) {
        errors++;
    }

    if (errors) {
        exit(1);
    }
};

target.test = function() {
    target.lint();
    target.checkRuleFiles();
    var errors = 0,
        lastReturn;

    // exec(ISTANBUL + " cover " + MOCHA + "-- -c " + TEST_FILES);
    lastReturn = nodeCLI.exec("istanbul", "cover", MOCHA, "-- -R progress -t " + MOCHA_TIMEOUT, "-c", TEST_FILES);
    if (lastReturn.code !== 0) {
        errors++;
    }

    // exec(ISTANBUL + "check-coverage --statement 99 --branch 98 --function 99 --lines 99");
    lastReturn = nodeCLI.exec("istanbul", "check-coverage", "--statement 99 --branch 98 --function 99 --lines 99");
    if (lastReturn.code !== 0) {
        errors++;
    }

    target.browserify();

    lastReturn = nodeCLI.exec("mocha-phantomjs", "-R dot", "tests/tests.htm");
    if (lastReturn.code !== 0) {
        errors++;
    }

    if (errors) {
        exit(1);
    }

    target.checkLicenses();
};

target.docs = function() {
    echo("Generating documentation");
    nodeCLI.exec("jsdoc", "-d jsdoc lib");
    echo("Documentation has been output to /jsdoc");
};

target.gensite = function(prereleaseVersion) {
    echo("Generating eslint.org");

    var docFiles = [
        "/rules/",
        "/user-guide/command-line-interface.md",
        "/user-guide/configuring.md",
        "/developer-guide/code-path-analysis.md",
        "/developer-guide/nodejs-api.md",
        "/developer-guide/working-with-plugins.md",
        "/developer-guide/working-with-rules.md"
    ];

    // append version
    if (prereleaseVersion) {
        docFiles = docFiles.map(function(docFile) {
            return "/" + prereleaseVersion + docFile;
        });
    }

    // 1. create temp and build directory
    if (!test("-d", TEMP_DIR)) {
        mkdir(TEMP_DIR);
    }

    // 2. remove old files from the site
    docFiles.forEach(function(filePath) {
        var fullPath = path.join(DOCS_DIR, filePath),
            htmlFullPath = fullPath.replace(".md", ".html");

        if (test("-f", fullPath)) {

            rm("-r", fullPath);

            if (filePath.indexOf(".md") >= 0 && test("-f", htmlFullPath)) {
                rm("-r", htmlFullPath);
            }
        }
    });

    // 3. Copy docs folder to a temporary directory
    cp("-rf", "docs/*", TEMP_DIR);

    var versions = test("-f", "./versions.json") ? JSON.parse(cat("./versions.json")) : {};
    if (!versions.added) {
        versions = {
            added: versions,
            removed: {}
        };
    }

    // 4. Loop through all files in temporary directory
    find(TEMP_DIR).forEach(function(filename) {
        if (test("-f", filename) && path.extname(filename) === ".md") {

            var rulesUrl = "https://github.com/eslint/eslint/tree/master/lib/rules/";
            var docsUrl = "https://github.com/eslint/eslint/tree/master/docs/rules/";

            var text = cat(filename);

            var baseName = path.basename(filename);
            var sourceBaseName = path.basename(filename, ".md") + ".js";
            var sourcePath = path.join("lib/rules", sourceBaseName);
            var ruleName = path.basename(filename, ".md");

            // 5. Prepend page title and layout variables at the top of rules
            if (path.dirname(filename).indexOf("rules") >= 0) {
                text = "---\ntitle: " + (ruleName === "README" ? "List of available rules" : "Rule " + ruleName) + "\nlayout: doc\n---\n<!-- Note: No pull requests accepted for this file. See README.md in the root directory for details. -->\n" + text;
            } else {
                text = "---\ntitle: Documentation\nlayout: doc\n---\n<!-- Note: No pull requests accepted for this file. See README.md in the root directory for details. -->\n" + text;
            }

            // 6. Remove .md extension for links and change README to empty string
            text = text.replace(/\.md(.*?\))/g, ")").replace("README.html", "");

            // 7. Check if there's a trailing white line at the end of the file, if there isn't one, add it
            if (!/\n$/.test(text)) {
                text = text + "\n";
            }

            // 8. Append first version of ESLint rule was added at.
            if (filename.indexOf("rules/") !== -1 && baseName !== "README.md") {
                var added, removed;

                if (!versions.added[baseName]) {
                    versions.added[baseName] = getFirstVersionOfFile(sourcePath);
                }
                added = versions.added[baseName];

                if (!versions.removed[baseName] && !fs.existsSync(sourcePath)) {
                    versions.removed[baseName] = getFirstVersionOfDeletion(sourcePath);
                }
                removed = versions.removed[baseName];

                text += "\n## Version\n\n";
                text += removed
                    ? "This rule was introduced in ESLint " + added + " and removed in " + removed + ".\n"
                    : "This rule was introduced in ESLint " + added + ".\n";

                text += "\n## Resources\n\n";
                if (!removed) {
                    text += "* [Rule source](" + rulesUrl + sourceBaseName + ")\n";
                }
                text += "* [Documentation source](" + docsUrl + baseName + ")\n";
            }

            // 9. Update content of the file with changes
            text.to(filename.replace("README.md", "index.md"));
        }
    });
    JSON.stringify(versions).to("./versions.json");

    // 10. Copy temorary directory to site's docs folder
    var outputDir = DOCS_DIR;
    if (prereleaseVersion) {
        outputDir += "/" + prereleaseVersion;
    }
    cp("-rf", TEMP_DIR + "*", outputDir);

    // 11. Delete temporary directory
    rm("-r", TEMP_DIR);

    // 12. Update demos, but only for non-prereleases
    if (!prereleaseVersion) {
        cp("-f", "build/eslint.js", SITE_DIR + "js/app/eslint.js");
        cp("-f", "conf/eslint.json", SITE_DIR + "js/app/eslint.json");
    }

    // 13. Create Example Formatter Output Page
    generateFormatterExamples(getFormatterResults(), prereleaseVersion);
};

target.publishsite = function() {
    var currentDir = pwd();

    cd(SITE_DIR);
    exec("git add -A .");
    exec("git commit -m \"Autogenerated new docs and demo at " + dateformat(new Date()) + "\"");
    exec("git fetch origin && git rebase origin/master");
    exec("git push origin master");
    cd(currentDir);
};

target.browserify = function() {

    // 1. create temp and build directory
    if (!test("-d", TEMP_DIR)) {
        mkdir(TEMP_DIR);
    }

    if (!test("-d", BUILD_DIR)) {
        mkdir(BUILD_DIR);
    }

    // 2. copy files into temp directory
    cp("-r", "lib/*", TEMP_DIR);

    // 3. delete the load-rules.js file
    rm(TEMP_DIR + "load-rules.js");

    // 4. create new load-rule.js with hardcoded requires
    generateRulesIndex(TEMP_DIR);

    // 5. browserify the temp directory
    nodeCLI.exec("browserify", "-x espree", TEMP_DIR + "eslint.js", "-o", BUILD_DIR + "eslint.js", "-s eslint");

    // 6. Browserify espree
    nodeCLI.exec("browserify", "-r espree", "-o", TEMP_DIR + "espree.js");

    // 7. Concatenate the two files together
    cat(TEMP_DIR + "espree.js", BUILD_DIR + "eslint.js").to(BUILD_DIR + "eslint.js");

    // 8. remove temp directory
    rm("-r", TEMP_DIR);
};

target.checkRuleFiles = function() {

    echo("Validating rules");

    var eslintConf = require("./conf/eslint.json").rules;

    var ruleFiles = find("lib/rules/").filter(fileType("js")),
        rulesIndexText = cat("docs/rules/README.md"),
        errors = 0;

    ruleFiles.forEach(function(filename) {
        var basename = path.basename(filename, ".js");
        var docFilename = "docs/rules/" + basename + ".md";

        var indexLine = new RegExp("\\* \\[" + basename + "\\].*").exec(rulesIndexText);
        indexLine = indexLine ? indexLine[0] : "";

        /**
         * Check if basename is present in eslint conf
         * @returns {boolean} true if present
         * @private
         */
        function isInConfig() {
            return eslintConf.hasOwnProperty(basename);
        }

        /**
         * Check if rule is off in eslint conf
         * @returns {boolean} true if off
         * @private
         */
        function isOffInConfig() {
            var rule = eslintConf[basename];
            return rule === 0 || (rule && rule[0] === 0);
        }

        /**
         * Check if rule is on in eslint conf
         * @returns {boolean} true if on
         * @private
         */
        function isOnInConfig() {
            return !isOffInConfig();
        }

        /**
         * Check if rule is not recommended by eslint
         * @returns {boolean} true if not recommended
         * @private
         */
        function isNotRecommended() {
            return indexLine.indexOf("(recommended)") === -1;
        }

        /**
         * Check if rule is recommended by eslint
         * @returns {boolean} true if recommended
         * @private
         */
        function isRecommended() {
            return !isNotRecommended();
        }

        /**
         * Check if id is present in title
         * @param {string} id id to check for
         * @returns {boolean} true if present
         * @private
         */
        function hasIdInTitle(id) {
            var docText = cat(docFilename);
            var idInTitleRegExp = new RegExp("^# (.*?) \\(" + id + "\\)");
            return idInTitleRegExp.test(docText);
        }

        // check for docs
        if (!test("-f", docFilename)) {
            console.error("Missing documentation for rule %s", basename);
            errors++;
        } else {

            // check for entry in docs index
            if (rulesIndexText.indexOf("(" + basename + ".md)") === -1) {
                console.error("Missing link to documentation for rule %s in index", basename);
                errors++;
            }

            // check for proper doc format
            if (!hasIdInTitle(basename)) {
                console.error("Missing id in the doc page's title of rule %s", basename);
                errors++;
            }
        }

        // check for default configuration
        if (!isInConfig()) {
            console.error("Missing default setting for %s in eslint.json", basename);
            errors++;
        }

        // check that rule is not recommended in docs but off in default config
        if (isRecommended() && isOffInConfig()) {
            console.error("Rule documentation says that %s is recommended, but it is disabled in eslint.json.", basename);
            errors++;
        }

        //  check that rule is not on in default config but not recommended
        if (isOnInConfig("default") && isNotRecommended("default")) {
            console.error("Missing '(recommended)' for rule %s in index", basename);
            errors++;
        }

        // check for tests
        if (!test("-f", "tests/lib/rules/" + basename + ".js")) {
            console.error("Missing tests for rule %s", basename);
            errors++;
        }

    });

    if (errors) {
        exit(1);
    }

};

target.checkLicenses = function() {

    /**
     * Check if a dependency is eligible to be used by us
     * @param {object} dependency dependency to check
     * @returns {boolean} true if we have permission
     * @private
     */
    function isPermissible(dependency) {
        var licenses = dependency.licenses;

        if (Array.isArray(licenses)) {
            return licenses.some(function(license) {
                return isPermissible({
                    name: dependency.name,
                    licenses: license
                });
            });
        }

        return OPEN_SOURCE_LICENSES.some(function(license) {
            return license.test(licenses);
        });
    }

    echo("Validating licenses");

    checker.init({
        start: __dirname
    }, function(deps) {
        var impermissible = Object.keys(deps).map(function(dependency) {
            return {
                name: dependency,
                licenses: deps[dependency].licenses
            };
        }).filter(function(dependency) {
            return !isPermissible(dependency);
        });

        if (impermissible.length) {
            impermissible.forEach(function(dependency) {
                console.error("%s license for %s is impermissible.",
                    dependency.licenses,
                    dependency.name
                );
            });
            exit(1);
        }
    });
};

target.checkGitCommit = function() {
    var commitMsgs,
        failed;

    if (hasBranch("master")) {
        commitMsgs = splitCommandResultToLines(execSilent("git log HEAD --not master --format=format:%s --no-merges"));
    } else {
        commitMsgs = [execSilent("git log -1 --format=format:%s --no-merges")];
    }

    echo("Validating Commit Message");

    // No commit since master should not cause test to fail
    if (commitMsgs[0] === "") {
        return;
    }

    // Check for more than one commit
    if (commitMsgs.length > 1) {
        echo(" - More than one commit found, please squash.");
        failed = true;
    }

    // Only check non-release messages
    if (!semver.valid(commitMsgs[0]) && !/^Revert /.test(commitMsgs[0])) {
        if (commitMsgs[0].slice(0, commitMsgs[0].indexOf("\n")).length > 72) {
            echo(" - First line of commit message must not exceed 72 characters");
            failed = true;
        }

        // Check for tag at start of message
        if (!TAG_REGEX.test(commitMsgs[0])) {
            echo([" - Commit summary must start with one of:",
                "    'Fix:'",
                "    'Update:'",
                "    'Breaking:'",
                "    'Docs:'",
                "    'Build:'",
                "    'New:'",
                "    'Upgrade:'",
                "   Please refer to the contribution guidelines for more details."].join("\n"));
            failed = true;
        }

        // Check for an issue reference at end (unless it's a documentation commit)
        if (!/^Docs:/.test(commitMsgs[0])) {
            if (!ISSUE_REGEX.test(commitMsgs[0])) {
                echo([" - Commit summary must end with with one of:",
                    "    '(fixes #1234)'",
                    "    '(refs #1234)'",
                    "   Where '1234' is the issue being addressed.",
                    "   Please refer to the contribution guidelines for more details."].join("\n"));
                failed = true;
            }
        }
    }

    if (failed) {
        exit(1);
    }
};

/**
 * Downloads a repository which has many js files to test performance with multi files.
 * Here, it's eslint@1.10.3 (450 files)
 * @param {function} cb - A callback function.
 * @returns {void}
 */
function downloadMultifilesTestTarget(cb) {
    if (test("-d", PERF_MULTIFILES_TARGET_DIR)) {
        process.nextTick(cb);
    } else {
        mkdir("-p", PERF_MULTIFILES_TARGET_DIR);
        echo("Downloading the repository of multi-files performance test target.");
        exec("git clone -b v1.10.3 --depth 1 https://github.com/eslint/eslint.git \"" + PERF_MULTIFILES_TARGET_DIR + "\"", {silent: true}, cb);
    }
}

/**
 * Creates a config file to use performance tests.
 * This config is turning all core rules on.
 * @returns {void}
 */
function createConfigForPerformanceTest() {
    var content = [
        "root: true",
        "env:",
        "    node: true",
        "    es6: true",
        "rules:"
    ];
    content.push.apply(
        content,
        ls("lib/rules").map(function(fileName) {
            return "    " + path.basename(fileName, ".js") + ": 2";
        })
    );

    content.join("\n").to(PERF_ESLINTRC);
}

/**
 * Calculates the time for each run for performance
 * @param {string} cmd cmd
 * @param {int} runs Total number of runs to do
 * @param {int} runNumber Current run number
 * @param {int[]} results Collection results from each run
 * @param {function} cb Function to call when everything is done
 * @returns {int[]} calls the cb with all the results
 * @private
 */
function time(cmd, runs, runNumber, results, cb) {
    var start = process.hrtime();
    exec(cmd, { silent: true }, function() {
        var diff = process.hrtime(start),
            actual = (diff[0] * 1e3 + diff[1] / 1e6); // ms

        results.push(actual);
        echo("  Performance Run #" + runNumber + ":  %dms", actual);
        if (runs > 1) {
            return time(cmd, runs - 1, runNumber + 1, results, cb);
        } else {
            return cb(results);
        }
    });

}

/**
 * Run a performance test.
 *
 * @param {string} title - A title.
 * @param {string} targets - Test targets.
 * @param {number} multiplier - A multiplier for limitation.
 * @param {function} cb - A callback function.
 * @returns {void}
 */
function runPerformanceTest(title, targets, multiplier, cb) {
    var cpuSpeed = os.cpus()[0].speed,
        max = multiplier / cpuSpeed,
        cmd = ESLINT + "--config \"" + PERF_ESLINTRC + "\" --no-eslintrc --no-ignore " + targets;

    echo("");
    echo(title);
    echo("  CPU Speed is %d with multiplier %d", cpuSpeed, multiplier);

    time(cmd, 5, 1, [], function(results) {
        results.sort(function(a, b) {
            return a - b;
        });

        var median = results[~~(results.length / 2)];

        echo("");
        if (median > max) {
            echo("  Performance budget exceeded: %dms (limit: %dms)", median, max);
        } else {
            echo("  Performance budget ok:  %dms (limit: %dms)", median, max);
        }
        echo("");
        cb();
    });
}

/**
 * Run the load performance for eslint
 * @returns {void}
 * @private
 */
function loadPerformance() {
    echo("");
    echo("Loading:");

    var results = [];
    for (var cnt = 0; cnt < 5; cnt++) {
        var loadPerfData = loadPerf({
            checkDependencies: false
        });

        echo("  Load performance Run #" + (cnt + 1) + ":  %dms", loadPerfData.loadTime);
        results.push(loadPerfData.loadTime);
    }

    results.sort(function(a, b) {
        return a - b;
    });
    var median = results[~~(results.length / 2)];
    echo("");
    echo("  Load Performance median:  %dms", median);
    echo("");
}

target.perf = function() {
    downloadMultifilesTestTarget(function() {
        createConfigForPerformanceTest();

        loadPerformance();

        runPerformanceTest(
            "Single File:",
            "tests/performance/jshint.js",
            PERF_MULTIPLIER,
            function() {
                // Count test target files.
                var count = glob.sync(
                    process.platform === "win32"
                        ? PERF_MULTIFILES_TARGETS.slice(2).replace("\\", "/")
                        : PERF_MULTIFILES_TARGETS
                ).length;

                runPerformanceTest(
                    "Multi Files (" + count + " files):",
                    PERF_MULTIFILES_TARGETS,
                    3 * PERF_MULTIPLIER,
                    function() {}
                );
            }
        );
    });
};

target.patch = function() {
    release("patch");
};

target.minor = function() {
    release("minor");
};

target.major = function() {
    release("major");
};

target.prerelease = function(args) {
    prerelease(args[0]);
};


text:
year: 4
title: PA
course-acronym: pa
archived: false
---

- [PA Past Papers](https://betterinformatics.com/drive?next=0B2AAOQQZ_8BxREwxWTliN3FaQ1U)
- [PA Notes](https://docs.google.com/document/d/1iV8CFAp3prkEk5QFQntPdYlNkRcP1fdHL-r9TJPjb5Q)

<!--
Old past papers links:

May 2011 & 2014 past papers has been copied to the PA Past Papers drive above.
- [May 2014](https://docs.google.com/document/d/1V00XVFtGpsdTUA1AjgG5tHnajuRtPFLGR2FyRV7D9Tc/edit?usp=sharing)
- [May 2011](https://docs.google.com/document/d/16OCjhr6TuovVmFVFN2sAao_lxTRo-980xqPluEKeUkE)
-->


text:
package com.alibaba.druid.bvt.sql.mysql;

import java.util.List;

import org.junit.Assert;
import junit.framework.TestCase;

import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser;
import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor;
import com.alibaba.druid.sql.parser.SQLStatementParser;

public class CastFunctionsAndOperatorsTest extends TestCase {

    public void test_0() throws Exception {
        String sql = "SELECT 'a' = 'A'";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT 'a' = 'A';", text);
    }

    public void test_1() throws Exception {
        String sql = "SELECT BINARY 'a' = 'A'";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT BINARY 'a' = 'A';", text);
    }

    public void test_2() throws Exception {
        String sql = "SELECT CONVERT('abc' USING utf8)";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT CONVERT('abc' USING utf8);", text);
    }

    public void test_3() throws Exception {
        String sql = "SELECT 'A' LIKE CONVERT(blob_col USING latin1) FROM tbl_name;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT 'A' LIKE CONVERT(blob_col USING latin1)\nFROM tbl_name;", text);
    }

    public void test_4() throws Exception {
        String sql = "SELECT 'A' LIKE CONVERT(blob_col USING latin1) COLLATE latin1_german1_ci FROM tbl_name;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT 'A' LIKE CONVERT(blob_col USING latin1) COLLATE latin1_german1_ci\nFROM tbl_name;",
                            text);
    }

    public void test_5() throws Exception {
        String sql = "SET @str = BINARY 'New York';";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SET @str = BINARY 'New York';", text);
    }

    public void test_6() throws Exception {
        String sql = "SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1))";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));", text);
    }

    public void test_7() throws Exception {
        String sql = "SELECT enum_col FROM tbl_name ORDER BY CAST(enum_col AS CHAR);";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT enum_col\nFROM tbl_name\nORDER BY CAST(enum_col AS CHAR);", text);
    }

    public void test_8() throws Exception {
        String sql = "SELECT CONCAT('hello you ',2);";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT CONCAT('hello you ', 2);", text);
    }

    public void test_9() throws Exception {
        String sql = "SELECT CAST(1-2 AS UNSIGNED);";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT CAST(1 - 2 AS UNSIGNED);", text);
    }

    public void test_10() throws Exception {
        String sql = "SELECT CAST(CAST(1-2 AS UNSIGNED) AS SIGNED);";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT CAST(CAST(1 - 2 AS UNSIGNED) AS SIGNED);", text);
    }

    public void test_11() throws Exception {
        String sql = "SELECT CAST(1 AS UNSIGNED) - 2.0;";

        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList();

        String text = output(stmtList);

        Assert.assertEquals("SELECT CAST(1 AS UNSIGNED) - 2.0;", text);
    }

    private String output(List<SQLStatement> stmtList) {
        StringBuilder out = new StringBuilder();

        for (SQLStatement stmt : stmtList) {
            stmt.accept(new MySqlOutputVisitor(out));
            out.append(";");
        }

        return out.toString();
    }
}


text:
Update Audio Translations

    Would you like to flag all existing translations and voice-over audio as 'may not match content'?

    This informs the voice artists to re-translate and record new audio that reflects any changes in text.

  <button class="btn btn-secondary" ng-click="cancel()">No</button>
  <button class="btn btn-secondary" ng-click="confirm()">Yes</button>


text:
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])

# Load the custom environment variables.
begin
  File.open(File.expand_path('../../.env', __FILE__), 'r') do |f|
    f.each_line do |line|
      next if line == "\n" || line.match(/^#/) || line.match(/^PATH/)

      line = line.gsub("\n", '').split('=')

      ENV[line.first] = line.last
    end
  end
rescue Errno::ENOENT; end


text:
export default class footerController {
  static get UID(){
    return "footerController"
  }

  /* @ngInject */
  constructor() {
  	this.copyright = "Copyright © 2016 cDemo Mobile Solutions";
  	this.terms = "Terms of Use";
  	this.privacy = "Privacy Policy";
  	this.contact = "Contact Us";
  }
}


text: select ts, dur from experimental_counter_dur where track_id in (1, 2, 3) order by dur limit 10;


text:
/*	$NetBSD: headers.c,v 1.54 2014/03/07 01:27:14 matt Exp $	 */

/*
 * Copyright 1996 John D. Polstra.
 * Copyright 1996 Matt Thomas <matt@3am-software.com>
 * Copyright 2002 Charles M. Hannum <root@ihack.net>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed by John Polstra.
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Dynamic linker for ELF.
 *
 * John Polstra <jdp@polstra.com>.
 */

#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: headers.c,v 1.54 2014/03/07 01:27:14 matt Exp $");
#endif /* not lint */

#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/bitops.h>
#include <dirent.h>

#include "debug.h"
#include "rtld.h"

/*
 * Process a shared object's DYNAMIC section, and save the important
 * information in its Obj_Entry structure.
 */
void
_rtld_digest_dynamic(const char *execname, Obj_Entry *obj)
{
	Elf_Dyn        *dynp;
	Needed_Entry  **needed_tail = &obj->needed;
	const Elf_Dyn  *dyn_soname = NULL;
	const Elf_Dyn  *dyn_rpath = NULL;
	bool		use_pltrel = false;
	bool		use_pltrela = false;
	Elf_Addr        relsz = 0, relasz = 0;
	Elf_Addr	pltrel = 0, pltrelsz = 0;
	Elf_Addr	init = 0, fini = 0;

	dbg(("headers: digesting PT_DYNAMIC at %p", obj->dynamic));
	for (dynp = obj->dynamic; dynp->d_tag != DT_NULL; ++dynp) {
		dbg(("  d_tag %ld at %p", (long)dynp->d_tag, dynp));
		switch (dynp->d_tag) {

		case DT_REL:
			obj->rel = (const Elf_Rel *)
			    (obj->relocbase + dynp->d_un.d_ptr);
			break;

		case DT_RELSZ:
			relsz = dynp->d_un.d_val;
			break;

		case DT_RELENT:
			assert(dynp->d_un.d_val == sizeof(Elf_Rel));
			break;

		case DT_JMPREL:
			pltrel = dynp->d_un.d_ptr;
			break;

		case DT_PLTRELSZ:
			pltrelsz = dynp->d_un.d_val;
			break;

		case DT_RELA:
			obj->rela = (const Elf_Rela *)
			    (obj->relocbase + dynp->d_un.d_ptr);
			break;

		case DT_RELASZ:
			relasz = dynp->d_un.d_val;
			break;

		case DT_RELAENT:
			assert(dynp->d_un.d_val == sizeof(Elf_Rela));
			break;

		case DT_PLTREL:
			use_pltrel = dynp->d_un.d_val == DT_REL;
			use_pltrela = dynp->d_un.d_val == DT_RELA;
			assert(use_pltrel || use_pltrela);
			break;

		case DT_SYMTAB:
			obj->symtab = (const Elf_Sym *)
				(obj->relocbase + dynp->d_un.d_ptr);
			break;

		case DT_SYMENT:
			assert(dynp->d_un.d_val == sizeof(Elf_Sym));
			break;

		case DT_STRTAB:
			obj->strtab = (const char *)
			    (obj->relocbase + dynp->d_un.d_ptr);
			break;

		case DT_STRSZ:
			obj->strsize = dynp->d_un.d_val;
			break;

		case DT_VERNEED:
			obj->verneed = (const Elf_Verneed *)
			    (obj->relocbase + dynp->d_un.d_ptr);
			break;

		case DT_VERNEEDNUM:
			obj->verneednum = dynp->d_un.d_val;
			break;

		case DT_VERDEF:
			obj->verdef = (const Elf_Verdef *)
			    (obj->relocbase + dynp->d_un.d_ptr);
			break;

		case DT_VERDEFNUM:
			obj->verdefnum = dynp->d_un.d_val;
			break;

		case DT_VERSYM:
			obj->versyms = (const Elf_Versym *)
			    (obj->relocbase + dynp->d_un.d_ptr);
			break;

		case DT_HASH:
			{
				const Elf_Symindx *hashtab = (const Elf_Symindx *)
				    (obj->relocbase + dynp->d_un.d_ptr);

				if (hashtab[0] > UINT32_MAX)
					obj->nbuckets = UINT32_MAX;
				else
					obj->nbuckets = hashtab[0];
				obj->nchains = hashtab[1];
				obj->buckets = hashtab + 2;
				obj->chains = obj->buckets + obj->nbuckets;
				/*
				 * Should really be in _rtld_relocate_objects,
				 * but _rtld_symlook_obj might be used before.
				 */
				if (obj->nbuckets) {
					fast_divide32_prepare(obj->nbuckets,
					    &obj->nbuckets_m,
					    &obj->nbuckets_s1,
					    &obj->nbuckets_s2);
				}
			}
			break;

		case DT_NEEDED:
			{
				Needed_Entry *nep = NEW(Needed_Entry);

				nep->name = dynp->d_un.d_val;
				nep->obj = NULL;
				nep->next = NULL;

				*needed_tail = nep;
				needed_tail = &nep->next;
			}
			break;

		case DT_PLTGOT:
			obj->pltgot = (Elf_Addr *)
			    (obj->relocbase + dynp->d_un.d_ptr);
			break;

		case DT_TEXTREL:
			obj->textrel = true;
			break;

		case DT_SYMBOLIC:
			obj->symbolic = true;
			break;

		case DT_RPATH:
			/*
		         * We have to wait until later to process this, because
			 * we might not have gotten the address of the string
			 * table yet.
		         */
			dyn_rpath = dynp;
			break;

		case DT_SONAME:
			dyn_soname = dynp;
			break;

		case DT_INIT:
			init = dynp->d_un.d_ptr;
			break;

#ifdef HAVE_INITFINI_ARRAY
		case DT_INIT_ARRAY:
			obj->init_array =
			    (fptr_t *)(obj->relocbase + dynp->d_un.d_ptr);
			dbg(("headers: DT_INIT_ARRAY at %p",
			    obj->init_array));
			break;

		case DT_INIT_ARRAYSZ:
			obj->init_arraysz = dynp->d_un.d_val / sizeof(fptr_t);
			dbg(("headers: DT_INIT_ARRAYZ %zu",
			    obj->init_arraysz));
			break;
#endif

		case DT_FINI:
			fini = dynp->d_un.d_ptr;
			break;

#ifdef HAVE_INITFINI_ARRAY
		case DT_FINI_ARRAY:
			obj->fini_array =
			    (fptr_t *)(obj->relocbase + dynp->d_un.d_ptr);
			dbg(("headers: DT_FINI_ARRAY at %p",
			    obj->fini_array));
			break;

		case DT_FINI_ARRAYSZ:
			obj->fini_arraysz = dynp->d_un.d_val / sizeof(fptr_t);
			dbg(("headers: DT_FINI_ARRAYZ %zu",
			    obj->fini_arraysz));
			break;
#endif

		/*
		 * Don't process DT_DEBUG on MIPS as the dynamic section
		 * is mapped read-only. DT_MIPS_RLD_MAP is used instead.
		 * XXX: n32/n64 may use DT_DEBUG, not sure yet.
		 */
#ifndef __mips__
		case DT_DEBUG:
#ifdef RTLD_LOADER
			dynp->d_un.d_ptr = (Elf_Addr)&_rtld_debug;
#endif
			break;
#endif

#ifdef __mips__
		case DT_MIPS_LOCAL_GOTNO:
			obj->local_gotno = dynp->d_un.d_val;
			break;

		case DT_MIPS_SYMTABNO:
			obj->symtabno = dynp->d_un.d_val;
			break;

		case DT_MIPS_GOTSYM:
			obj->gotsym = dynp->d_un.d_val;
			break;

		case DT_MIPS_RLD_MAP:
#ifdef RTLD_LOADER
			*((Elf_Addr *)(dynp->d_un.d_ptr)) = (Elf_Addr)
			    &_rtld_debug;
#endif
			break;
#endif
#ifdef __powerpc__
#ifdef _LP64
		case DT_PPC64_GLINK:
			obj->glink = (Elf_Addr)(uintptr_t)obj->relocbase + dynp->d_un.d_ptr;
			break;
#else
		case DT_PPC_GOT:
			obj->gotptr = (Elf_Addr *)(obj->relocbase + dynp->d_un.d_ptr);
			break;
#endif
#endif
		case DT_FLAGS_1:
			obj->z_now =
			    ((dynp->d_un.d_val & DF_1_BIND_NOW) != 0);
			obj->z_nodelete =
			    ((dynp->d_un.d_val & DF_1_NODELETE) != 0);
			obj->z_initfirst =
			    ((dynp->d_un.d_val & DF_1_INITFIRST) != 0);
			obj->z_noopen =
			    ((dynp->d_un.d_val & DF_1_NOOPEN) != 0);
			break;
		}
	}

	obj->rellim = (const Elf_Rel *)((const uint8_t *)obj->rel + relsz);
	obj->relalim = (const Elf_Rela *)((const uint8_t *)obj->rela + relasz);
	if (use_pltrel) {
		obj->pltrel = (const Elf_Rel *)(obj->relocbase + pltrel);
		obj->pltrellim = (const Elf_Rel *)(obj->relocbase + pltrel + pltrelsz);
		obj->pltrelalim = 0;
		/* On PPC and SPARC, at least, REL(A)SZ may include JMPREL.
		   Trim rel(a)lim to save time later. */
		if (obj->rellim && obj->pltrel &&
		    obj->rellim > obj->pltrel &&
		    obj->rellim <= obj->pltrellim)
			obj->rellim = obj->pltrel;
	} else if (use_pltrela) {
		obj->pltrela = (const Elf_Rela *)(obj->relocbase + pltrel);
		obj->pltrellim = 0;
		obj->pltrelalim = (const Elf_Rela *)(obj->relocbase + pltrel + pltrelsz);
		/* On PPC and SPARC, at least, REL(A)SZ may include JMPREL.
		   Trim rel(a)lim to save time later. */
		if (obj->relalim && obj->pltrela &&
		    obj->relalim > obj->pltrela &&
		    obj->relalim <= obj->pltrelalim)
			obj->relalim = obj->pltrela;
	}

#if defined(RTLD_LOADER) && defined(__HAVE_FUNCTION_DESCRIPTORS)
	if (init != 0)
		obj->init = (void (*)(void))
		    _rtld_function_descriptor_alloc(obj, NULL, init);
	if (fini != 0)
		obj->fini = (void (*)(void))
		    _rtld_function_descriptor_alloc(obj, NULL, fini);
#else
	if (init != 0)
		obj->init = (void (*)(void))
		    (obj->relocbase + init);
	if (fini != 0)
		obj->fini = (void (*)(void))
		    (obj->relocbase + fini);
#endif

	if (dyn_rpath != NULL) {
		_rtld_add_paths(execname, &obj->rpaths, obj->strtab +
		    dyn_rpath->d_un.d_val);
	}
	if (dyn_soname != NULL) {
		_rtld_object_add_name(obj, obj->strtab +
		    dyn_soname->d_un.d_val);
	}
}

/*
 * Process a shared object's program header.  This is used only for the
 * main program, when the kernel has already loaded the main program
 * into memory before calling the dynamic linker.  It creates and
 * returns an Obj_Entry structure.
 */
Obj_Entry *
_rtld_digest_phdr(const Elf_Phdr *phdr, int phnum, caddr_t entry)
{
	Obj_Entry      *obj;
	const Elf_Phdr *phlimit = phdr + phnum;
	const Elf_Phdr *ph;
	int             nsegs = 0;
	Elf_Addr	vaddr;

	obj = _rtld_obj_new();

	for (ph = phdr; ph < phlimit; ++ph) {
		if (ph->p_type != PT_PHDR)
			continue;

		obj->phdr = (void *)(uintptr_t)ph->p_vaddr;
		obj->phsize = ph->p_memsz;
		obj->relocbase = (caddr_t)((uintptr_t)phdr - (uintptr_t)ph->p_vaddr);
		dbg(("headers: phdr %p (%p) phsize %zu relocbase %p",
		    obj->phdr, phdr, obj->phsize, obj->relocbase));
		break;
	}

	for (ph = phdr; ph < phlimit; ++ph) {
		vaddr = (Elf_Addr)(uintptr_t)(obj->relocbase + ph->p_vaddr);
		switch (ph->p_type) {

		case PT_INTERP:
			obj->interp = (const char *)(uintptr_t)vaddr;
			dbg(("headers: %s %p phsize %" PRImemsz,
			    "PT_INTERP", (void *)(uintptr_t)vaddr,
			     ph->p_memsz));
			break;

		case PT_LOAD:
			assert(nsegs < 2);
			if (nsegs == 0) {	/* First load segment */
				obj->vaddrbase = round_down(vaddr);
				obj->mapbase = (caddr_t)(uintptr_t)obj->vaddrbase;
				obj->textsize = round_up(vaddr + ph->p_memsz) -
				    obj->vaddrbase;
			} else {		/* Last load segment */
				obj->mapsize = round_up(vaddr + ph->p_memsz) -
				    obj->vaddrbase;
			}
			++nsegs;
			dbg(("headers: %s %p phsize %" PRImemsz,
			    "PT_LOAD", (void *)(uintptr_t)vaddr,
			     ph->p_memsz));
			break;

		case PT_DYNAMIC:
			obj->dynamic = (Elf_Dyn *)(uintptr_t)vaddr;
			dbg(("headers: %s %p phsize %" PRImemsz,
			    "PT_DYNAMIC", (void *)(uintptr_t)vaddr,
			     ph->p_memsz));
			break;

#if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
		case PT_TLS:
			obj->tlsindex = 1;
			obj->tlssize = ph->p_memsz;
			obj->tlsalign = ph->p_align;
			obj->tlsinitsize = ph->p_filesz;
			obj->tlsinit = (void *)(uintptr_t)ph->p_vaddr;
			dbg(("headers: %s %p phsize %" PRImemsz,
			    "PT_TLS", (void *)(uintptr_t)vaddr,
			     ph->p_memsz));
			break;
#endif
#ifdef __ARM_EABI__
		case PT_ARM_EXIDX:
			obj->exidx_start = (void *)(uintptr_t)vaddr;
			obj->exidx_sz = ph->p_memsz;
			dbg(("headers: %s %p phsize %" PRImemsz,
			    "PT_ARM_EXIDX", (void *)(uintptr_t)vaddr,
			     ph->p_memsz));
			break;
#endif
		}
	}
	assert(nsegs == 2);

	obj->entry = entry;
	return obj;
}


text:
@class WSPPFileRemovedEventArgs, WSPPFileOpenPickerUI, WSPPPickerClosingEventArgs, WSPPPickerClosingOperation, WSPPPickerClosingDeferral,
    WSPPFileSavePickerUI, WSPPTargetFileRequestedEventArgs, WSPPTargetFileRequest, WSPPTargetFileRequestDeferral;
@protocol WSPPIFileRemovedEventArgs
, WSPPIFileOpenPickerUI, WSPPIPickerClosingEventArgs, WSPPIPickerClosingOperation, WSPPIPickerClosingDeferral, WSPPIFileSavePickerUI,
    WSPPITargetFileRequestedEventArgs, WSPPITargetFileRequest, WSPPITargetFileRequestDeferral;

// Windows.Storage.Pickers.Provider.AddFileResult
enum _WSPPAddFileResult {
    WSPPAddFileResultAdded = 0,
    WSPPAddFileResultAlreadyAdded = 1,
    WSPPAddFileResultNotAllowed = 2,
    WSPPAddFileResultUnavailable = 3,
};
typedef unsigned WSPPAddFileResult;

// Windows.Storage.Pickers.Provider.FileSelectionMode
enum _WSPPFileSelectionMode {
    WSPPFileSelectionModeSingle = 0,
    WSPPFileSelectionModeMultiple = 1,
};
typedef unsigned WSPPFileSelectionMode;

// Windows.Storage.Pickers.Provider.SetFileNameResult
enum _WSPPSetFileNameResult {
    WSPPSetFileNameResultSucceeded = 0,
    WSPPSetFileNameResultNotAllowed = 1,
    WSPPSetFileNameResultUnavailable = 2,
};
typedef unsigned WSPPSetFileNameResult;

#include "WindowsStorage.h"
#include "WindowsFoundationCollections.h"
#include "WindowsFoundation.h"

#import <Foundation/Foundation.h>

// Windows.Storage.Pickers.Provider.FileRemovedEventArgs
#ifndef __WSPPFileRemovedEventArgs_DEFINED__
#define __WSPPFileRemovedEventArgs_DEFINED__

WINRT_EXPORT
@interface WSPPFileRemovedEventArgs : RTObject
@property (readonly) NSString* id;
@end

#endif // __WSPPFileRemovedEventArgs_DEFINED__

// Windows.Storage.Pickers.Provider.FileOpenPickerUI
#ifndef __WSPPFileOpenPickerUI_DEFINED__
#define __WSPPFileOpenPickerUI_DEFINED__

WINRT_EXPORT
@interface WSPPFileOpenPickerUI : RTObject
@property (copy) NSString* title;
@property (readonly) NSArray* allowedFileTypes;
@property (readonly) WSPPFileSelectionMode selectionMode;
@property (readonly) NSString* settingsIdentifier;
- (EventRegistrationToken)addClosingEvent:(void (^)(WSPPFileOpenPickerUI*, WSPPPickerClosingEventArgs*))del;
- (void)removeClosingEvent:(EventRegistrationToken)tok;
- (EventRegistrationToken)addFileRemovedEvent:(void (^)(WSPPFileOpenPickerUI*, WSPPFileRemovedEventArgs*))del;
- (void)removeFileRemovedEvent:(EventRegistrationToken)tok;
- (WSPPAddFileResult)addFile:(NSString*)id file:(RTObject<WSIStorageFile>*)file;
- (void)removeFile:(NSString*)id;
- (BOOL)containsFile:(NSString*)id;
- (BOOL)canAddFile:(RTObject<WSIStorageFile>*)file;
@end

#endif // __WSPPFileOpenPickerUI_DEFINED__

// Windows.Storage.Pickers.Provider.PickerClosingEventArgs
#ifndef __WSPPPickerClosingEventArgs_DEFINED__
#define __WSPPPickerClosingEventArgs_DEFINED__

WINRT_EXPORT
@interface WSPPPickerClosingEventArgs : RTObject
@property (readonly) WSPPPickerClosingOperation* closingOperation;
@property (readonly) BOOL isCanceled;
@end

#endif // __WSPPPickerClosingEventArgs_DEFINED__

// Windows.Storage.Pickers.Provider.PickerClosingOperation
#ifndef __WSPPPickerClosingOperation_DEFINED__
#define __WSPPPickerClosingOperation_DEFINED__

WINRT_EXPORT
@interface WSPPPickerClosingOperation : RTObject
@property (readonly) WFDateTime* deadline;
- (WSPPPickerClosingDeferral*)getDeferral;
@end

#endif // __WSPPPickerClosingOperation_DEFINED__

// Windows.Storage.Pickers.Provider.PickerClosingDeferral
#ifndef __WSPPPickerClosingDeferral_DEFINED__
#define __WSPPPickerClosingDeferral_DEFINED__

WINRT_EXPORT
@interface WSPPPickerClosingDeferral : RTObject
- (void)complete;
@end

#endif // __WSPPPickerClosingDeferral_DEFINED__

// Windows.Storage.Pickers.Provider.FileSavePickerUI
#ifndef __WSPPFileSavePickerUI_DEFINED__
#define __WSPPFileSavePickerUI_DEFINED__

WINRT_EXPORT
@interface WSPPFileSavePickerUI : RTObject
@property (copy) NSString* title;
@property (readonly) NSArray* allowedFileTypes;
@property (readonly) NSString* fileName;
@property (readonly) NSString* settingsIdentifier;
- (EventRegistrationToken)addFileNameChangedEvent:(void (^)(WSPPFileSavePickerUI*, RTObject*))del;
- (void)removeFileNameChangedEvent:(EventRegistrationToken)tok;
- (EventRegistrationToken)addTargetFileRequestedEvent:(void (^)(WSPPFileSavePickerUI*, WSPPTargetFileRequestedEventArgs*))del;
- (void)removeTargetFileRequestedEvent:(EventRegistrationToken)tok;
- (WSPPSetFileNameResult)trySetFileName:(NSString*)value;
@end

#endif // __WSPPFileSavePickerUI_DEFINED__

// Windows.Storage.Pickers.Provider.TargetFileRequestedEventArgs
#ifndef __WSPPTargetFileRequestedEventArgs_DEFINED__
#define __WSPPTargetFileRequestedEventArgs_DEFINED__

WINRT_EXPORT
@interface WSPPTargetFileRequestedEventArgs : RTObject
@property (readonly) WSPPTargetFileRequest* request;
@end

#endif // __WSPPTargetFileRequestedEventArgs_DEFINED__

// Windows.Storage.Pickers.Provider.TargetFileRequest
#ifndef __WSPPTargetFileRequest_DEFINED__
#define __WSPPTargetFileRequest_DEFINED__

WINRT_EXPORT
@interface WSPPTargetFileRequest : RTObject
@property (copy) RTObject<WSIStorageFile>* targetFile;
- (WSPPTargetFileRequestDeferral*)getDeferral;
@end

#endif // __WSPPTargetFileRequest_DEFINED__

// Windows.Storage.Pickers.Provider.TargetFileRequestDeferral
#ifndef __WSPPTargetFileRequestDeferral_DEFINED__
#define __WSPPTargetFileRequestDeferral_DEFINED__

WINRT_EXPORT
@interface WSPPTargetFileRequestDeferral : RTObject
- (void)complete;
@end

#endif // __WSPPTargetFileRequestDeferral_DEFINED__


text:
<?php
namespace backend\controllers\org;

use backend\models\AttributeOption;
use backend\models\org\Attribute;
use backend\models\Organization as Entity;
use backend\models\org\Block;
use backend\controllers\AttributeController as ParentAttributeController;

class AttributeController extends ParentAttributeController
{
	protected function getAttributeClassName(){
		return Attribute::className();
	}

	protected function getAttributeOptionClassName(){
		return AttributeOption::className();
	}

	protected function getBlockClassName(){
		return Block::className();
	}

	protected function getEntityClassName(){
		return Entity::className();
	}
}


text:
<PackageItem xmlns:tcm="http://www.tridion.com/ContentManager/5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.sdltridion.com/ContentManager/ImportExport/Package/2013">
  <Data>
    <tcm:Data>
      <tcm:Title>Test Article For XPM</tcm:Title>
      <tcm:Type>Normal</tcm:Type>
      <tcm:Schema xlink:type="simple" xlink:title="News Article" xlink:href="/webdav/401%20Automated%20Test%20Parent/Building%20Blocks/Modules/Core/Editor/Schemas/News%20Article.xsd" IsMandatory="false" />
      <tcm:Content>
        <NewsArticle xmlns="http://www.sdl.com/web/schemas/core">
          <headline>Lorem ipsum dolor sit amet, consectetur adipiscing elit</headline>
          <articleBody>
            <subheading>Sed dapibus tempus nunc, id sollicitudin ligula mattis in</subheading>
            <content>
              Cras vel justo semper, bibendum odio in, fringilla elit. Cras at nunc fringilla, porttitor mauris eget, pharetra purus. Sed elementum consectetur massa id auctor. Mauris sed orci nec diam condimentum fermentum id eget erat. Nulla facilisi. In venenatis mauris dolor, iaculis lobortis libero porttitor sit amet. Aliquam quis egestas turpis. Morbi dolor nulla, volutpat ut nisi sed, mollis lacinia sapien.
            </content>
            <media xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/webdav/401%20Automated%20Test%20Parent/Building%20Blocks/Content/Images/Large/planes.jpg" xlink:title="planes" />

Praesent facilisis consectetur neque

          </articleBody>
        </NewsArticle>
      </tcm:Content>
      <tcm:Metadata>
        <Metadata xmlns="http://www.sdl.com/web/schemas/core">
          <standardMeta>
            <dateCreated>2014-08-18T09:34:00</dateCreated>
            <description>Praesent facilisis consectetur neque, quis varius justo dapibus at. Fusce ullamcorper tellus in neque dictum commodo. Duis pretium rhoncus est non scelerisque. Nam placerat lectus augue, a lacinia lectus aliquam id.</description>
            <name>Cras vel justo semp</name>
            <introText>Praesent facilisis consectetur neque, quis varius justo dapibus at. Fusce ullamcorper tellus in neque dictum commodo. Duis pretium rhoncus est non scelerisque. Nam placerat lectus augue, a lacinia lectus aliquam id.</introText>
          </standardMeta>
        </Metadata>
      </tcm:Metadata>
      <tcm:IsBasedOnTridionWebSchema>true</tcm:IsBasedOnTridionWebSchema>
      <tcm:MultimediaType xlink:type="simple" xlink:title="" xlink:href="tcm:0-0-0" />
    </tcm:Data>
  </Data>
  <Dependencies>
    <Dependency dependencyType="Publication" itemUrl="/webdav/401%20Automated%20Test%20Parent" linkName="LocationInfo/ContextRepository" />
    <Dependency dependencyType="OrganizationalItemFolder" itemUrl="/webdav/401%20Automated%20Test%20Parent/Building%20Blocks/Content/XPM%20tests" linkName="LocationInfo/OrganizationalItem" />
    <Dependency dependencyType="LinkedComponent" itemUrl="/webdav/401%20Automated%20Test%20Parent/Building%20Blocks/Content/Images/Large/planes.jpg" linkName="Content" xpath="*[local-name() = 'NewsArticle'][1]/*[local-name() = 'articleBody'][1]/*[local-name() = 'media'][1]/@xlink:href" />
    <Dependency dependencyType="Schema" itemUrl="/webdav/401%20Automated%20Test%20Parent/Building%20Blocks/Modules/Core/Editor/Schemas/News%20Article.xsd" linkName="Schema" />
  </Dependencies>
</PackageItem>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Asterostromella olivaceo-oxydata var. anomala Rick

### Remarks
null


text:
title: 'bíogo/hts: high throughput sequence handling for the Go language'
tags:
  - bioinformatics
  - toolkit
  - golang
authors:
 - name: R Daniel Kortschak
   orcid: 0000-0001-8295-2301
   affiliation: 1
 - name: Brent S Pedersen
   orcid: 0000-0003-1786-2216
   affiliation: 2
 - name: David L Adelson
   orcid: 0000-0003-2404-5636
   affiliation: 1
affiliations:
 - name: School of Biological Sciences, The University of Adelaide
   index: 1
 - name: Department of Human Genetics, University of Utah
   index: 2
date: 6 January 2017
bibliography: paper.bib
---

# Summary

bíogo/hts provides a Go native implementation of the SAM specification [@SAMspec] for SAM and BAM alignment formats [@li] commonly used for representation of high throughput genomic data, the BAI, CSI and tabix indexing formats, and the BGZF blocked compression format. The bíogo/hts packages perform parallelized read and write operations and are able to cache recent reads according to user-specified caching methods. The parallelisation approach used by the bíogo/hts package is influenced by the approach of the D implementation, sambamba by Tarazov et al. [@tarasov].
The bíogo/hts APIs have been constructed to provide a consistent interface to sequence alignment data and the underlying compression system in order to aid ease of use and tool development.

# References


text:
class HgtQfuncStat < ActiveRecord::Base
  belongs_to :hgt_qfunc_cond
  attr_accessible :false_neg, :false_pos, :lrt_neg, :lrt_pos, :npv, :ppv, :rbo, :sensit, :specif, :true_neg, :true_pos
end


text:
package com.navercorp.pinpoint.test;

import com.google.inject.Injector;
import com.google.inject.Module;
import com.navercorp.pinpoint.bootstrap.AgentOption;
import com.navercorp.pinpoint.bootstrap.DefaultAgentOption;
import com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig;
import com.navercorp.pinpoint.bootstrap.config.ProfilerConfig;
import com.navercorp.pinpoint.bootstrap.config.Profiles;
import com.navercorp.pinpoint.profiler.AgentInfoSender;
import com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext;
import com.navercorp.pinpoint.profiler.context.module.ModuleFactory;
import com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;

import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.Instrumentation;
import java.net.URL;
import java.util.Collections;

import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;

/**
 * @author Woonduk Kang(emeroad)
 */
public class MockApplicationContextModuleTest {

    @Test
    public void test() {
        ProfilerConfig profilerConfig = spy(new DefaultProfilerConfig());
        when(profilerConfig.getStaticResourceCleanup()).thenReturn(true);
        URL resource = getClass().getResource("/");
        when(profilerConfig.readString(Profiles.LOG_CONFIG_LOCATION_KEY, null)).thenReturn(resource.getPath());
        Instrumentation instrumentation = Mockito.mock(Instrumentation.class);

        AgentOption agentOption = new DefaultAgentOption(instrumentation,
                "mockAgentId", "mockAgentName", "mockApplicationName", false,
                profilerConfig, Collections.<String>emptyList(), Collections.<String>emptyList());

        PluginTestAgent pluginTestAgent = new PluginTestAgent(agentOption);
        try {
            pluginTestAgent.start();
        } finally {
            pluginTestAgent.stop();
        }
    }

    @Test
    public void testMockApplicationContext() {
        ProfilerConfig profilerConfig = spy(new DefaultProfilerConfig());
        when(profilerConfig.getStaticResourceCleanup()).thenReturn(true);
        Instrumentation instrumentation = Mockito.mock(Instrumentation.class);

        AgentOption agentOption = new DefaultAgentOption(instrumentation,
                "mockAgentId", "mockAgentName", "mockApplicationName", false,
                profilerConfig, Collections.<String>emptyList(), Collections.<String>emptyList());

        Module pluginModule = new PluginApplicationContextModule();
        InterceptorRegistryBinder interceptorRegistryBinder = new TestInterceptorRegistryBinder();
        Module testInterceptorRegistryModule = InterceptorRegistryModule.wrap(interceptorRegistryBinder);
        ModuleFactory moduleFactory = new OverrideModuleFactory(pluginModule, testInterceptorRegistryModule);

        DefaultApplicationContext applicationContext = new DefaultApplicationContext(agentOption, moduleFactory);

        Injector injector = applicationContext.getInjector();
        // singleton check
        AgentInfoSender instance1 = injector.getInstance(AgentInfoSender.class);
        AgentInfoSender instance2 = injector.getInstance(AgentInfoSender.class);
        Assert.assertSame(instance1, instance2);

        ClassFileTransformer instance4 = injector.getInstance(ClassFileTransformer.class);

        applicationContext.close();
    }

}


text:
/*
 * Dto key class
 * Created on 17 déc. 2012 ( Time 15:40:00 )
 */

package org.demo.review.bean;

import java.io.Serializable;

import javax.persistence.*;

import javax.validation.constraints.* ;
import org.hibernate.validator.constraints.* ;

import java.util.Date;

import javax.persistence.*;

@Embeddable
public class ReviewKey implements Serializable
{
    private static final long serialVersionUID = 1L;

    //----------------------------------------------------------------------
    // ENTITY KEY ATTRIBUTES
    //----------------------------------------------------------------------
    @Column(name="CUSTOMER_CODE", nullable=false, length=5)
    private String     customerCode ;

    @Column(name="BOOK_ID", nullable=false)
    private int        bookId       ;

    //----------------------------------------------------------------------
    // CONSTRUCTOR(S)
    //----------------------------------------------------------------------
    public ReviewKey()
    {
        super();
    }

    //----------------------------------------------------------------------
    // GETTERS & SETTERS FOR KEY FIELDS
    //----------------------------------------------------------------------
    public void setCustomerCode( String value )
    {
        this.customerCode = value;
    }
    public String getCustomerCode()
    {
        return this.customerCode;
    }

    public void setBookId( int value )
    {
        this.bookId = value;
    }
    public int getBookId()
    {
        return this.bookId;
    }

}


text:
layout: page
title: Sky Warden Software Executive Retreat
date: 2016-05-24
author: Lawrence Hatfield
tags: weekly links, java
status: published
summary: Nulla rutrum urna id rutrum ornare.
banner: images/banner/wedding.jpg
booking:
  startDate: 12/11/2018
  endDate: 12/12/2018
  ctyhocn: INDSTHX
  groupCode: SWSER
published: true
---
Ut hendrerit nibh ac leo vehicula luctus. Pellentesque ut sem ut sem dapibus cursus. Aliquam diam mauris, ultricies vel felis ut, sagittis molestie enim. Ut ut venenatis nunc. Ut ultrices ex vitae nisi scelerisque iaculis. Suspendisse ut laoreet libero. Curabitur ac aliquet justo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras venenatis augue ac facilisis ullamcorper. In viverra sit amet lorem non ultricies. Quisque urna justo, consectetur a accumsan vel, ultricies et tortor.
Phasellus orci turpis, aliquam pretium auctor id, auctor ac sem. Fusce nunc dui, dignissim ac odio a, posuere lacinia enim. Sed et tortor elit. Curabitur sed blandit massa, sed scelerisque libero. Donec in urna sit amet velit iaculis cursus. Vivamus ultrices ante est, et lobortis urna euismod dictum. Etiam ac felis dapibus, tincidunt tortor quis, ornare tellus. Phasellus suscipit auctor velit, non volutpat velit vehicula vitae. Pellentesque vitae ipsum arcu. Aenean vel ipsum quis enim fermentum viverra. Mauris dignissim neque sed quam imperdiet, sit amet vestibulum turpis interdum. Sed orci libero, porttitor id blandit et, tristique eu urna.

* Duis sagittis odio nec euismod pellentesque
* In eu sapien id sem sagittis ultricies
* Donec sit amet ipsum ac lorem malesuada interdum.

Donec interdum nunc purus, sed lobortis lectus mattis vel. Vestibulum dapibus neque non leo laoreet, et vulputate mi ultricies. Sed vel tellus vitae ex volutpat dictum at eu quam. Suspendisse a faucibus nulla, in volutpat augue. Sed sit amet velit ac ipsum mollis posuere quis ac urna. Etiam porttitor sem lorem, ut bibendum ligula pellentesque vel. Vestibulum nec est nisi. Morbi vitae dolor sem. Curabitur ut dolor vitae lectus efficitur efficitur. Integer posuere ornare sapien, quis porta tortor scelerisque sit amet. Mauris ornare eget magna eget dictum.


text:
<?php

/**
 * @file
 * Contains \Drupal\shortcut\Entity\Shortcut.
 */

namespace Drupal\shortcut\Entity;

use Drupal\Core\Cache\Cache;
use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Url;
use Drupal\shortcut\ShortcutInterface;
use Symfony\Component\HttpFoundation\Request;

/**
 * Defines the shortcut entity class.
 *
 * @ContentEntityType(
 *   id = "shortcut",
 *   label = @Translation("Shortcut link"),
 *   handlers = {
 *     "access" = "Drupal\shortcut\ShortcutAccessControlHandler",
 *     "form" = {
 *       "default" = "Drupal\shortcut\ShortcutForm",
 *       "add" = "Drupal\shortcut\ShortcutForm",
 *       "edit" = "Drupal\shortcut\ShortcutForm",
 *       "delete" = "Drupal\shortcut\Form\ShortcutDeleteForm"
 *     },
 *     "translation" = "Drupal\content_translation\ContentTranslationHandler"
 *   },
 *   base_table = "shortcut",
 *   data_table = "shortcut_field_data",
 *   translatable = TRUE,
 *   entity_keys = {
 *     "id" = "id",
 *     "uuid" = "uuid",
 *     "bundle" = "shortcut_set",
 *     "label" = "title"
 *   },
 *   links = {
 *     "canonical" = "entity.shortcut.canonical",
 *     "delete-form" = "entity.shortcut.delete_form",
 *     "edit-form" = "entity.shortcut.canonical",
 *   },
 *   list_cache_tags = { "shortcut_set_list" },
 *   bundle_entity_type = "shortcut_set"
 * )
 */
class Shortcut extends ContentEntityBase implements ShortcutInterface {

  /**
   * {@inheritdoc}
   */
  public function getTitle() {
    return $this->get('title')->value;
  }

  /**
   * {@inheritdoc}
   */
  public function setTitle($link_title) {
    $this->set('title', $link_title);
   return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getWeight() {
    return $this->get('weight')->value;
  }

  /**
   * {@inheritdoc}
   */
  public function setWeight($weight) {
    $this->set('weight', $weight);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getUrl() {
    return new Url($this->getRouteName(), $this->getRouteParameters());
  }

  /**
   * {@inheritdoc}
   */
  public function getRouteName() {
    return $this->get('route_name')->value;
  }

  /**
   * {@inheritdoc}
   */
  public function setRouteName($route_name) {
    $this->set('route_name', $route_name);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getRouteParameters() {
    return $this->get('route_parameters')->first()->getValue();
  }

  /**
   * {@inheritdoc}
   */
  public function setRouteParameters($route_parameters) {
    $this->set('route_parameters', $route_parameters);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public static function preCreate(EntityStorageInterface $storage, array &$values) {
    parent::preCreate($storage, $values);

    if (!isset($values['shortcut_set'])) {
      $values['shortcut_set'] = 'default';
    }
  }

  /**
   * {@inheritdoc}
   */
  public function preSave(EntityStorageInterface $storage) {
    parent::preSave($storage);

    // @todo fix PathValidatorInterface::getUrlIfValid() so we can use it
    //   here. The problem is that we need an exception, not a FALSE
    //   return value. https://www.drupal.org/node/2346695
    if ($this->path->value == '<front>') {
      $url = new Url($this->path->value);
    }
    else {
      $url = Url::createFromRequest(Request::create("/{$this->path->value}"));
    }
    $this->setRouteName($url->getRouteName());
    $this->setRouteParameters($url->getRouteParameters());
  }

  /**
   * {@inheritdoc}
   */
  public function postSave(EntityStorageInterface $storage, $update = TRUE) {
    parent::postSave($storage, $update);

    // Entity::postSave() calls Entity::invalidateTagsOnSave(), which only
    // handles the regular cases. The Shortcut entity has one special case: a
    // newly created shortcut is *also* added to a shortcut set, so we must
    // invalidate the associated shortcut set's cache tag.
    if (!$update) {
      Cache::invalidateTags($this->getCacheTags());
    }
  }

  /**
   * {@inheritdoc}
   */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields['id'] = BaseFieldDefinition::create('integer')
      ->setLabel(t('ID'))
      ->setDescription(t('The ID of the shortcut.'))
      ->setReadOnly(TRUE)
      ->setSetting('unsigned', TRUE);

    $fields['uuid'] = BaseFieldDefinition::create('uuid')
      ->setLabel(t('UUID'))
      ->setDescription(t('The UUID of the shortcut.'))
      ->setReadOnly(TRUE);

    $fields['shortcut_set'] = BaseFieldDefinition::create('entity_reference')
      ->setLabel(t('Shortcut set'))
      ->setDescription(t('The bundle of the shortcut.'))
      ->setSetting('target_type', 'shortcut_set')
      ->setRequired(TRUE);

    $fields['title'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Name'))
      ->setDescription(t('The name of the shortcut.'))
      ->setRequired(TRUE)
      ->setTranslatable(TRUE)
      ->setDefaultValue('')
      ->setSetting('max_length', 255)
      ->setDisplayOptions('form', array(
        'type' => 'string_textfield',
        'weight' => -10,
        'settings' => array(
          'size' => 40,
        ),
      ));

    $fields['weight'] = BaseFieldDefinition::create('integer')
      ->setLabel(t('Weight'))
      ->setDescription(t('Weight among shortcuts in the same shortcut set.'));

    $fields['route_name'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Route name'))
      ->setDescription(t('The machine name of a defined Route this shortcut represents.'));

    $fields['route_parameters'] = BaseFieldDefinition::create('map')
      ->setLabel(t('Route parameters'))
      ->setDescription(t('A serialized array of route parameters of this shortcut.'));

    $fields['langcode'] = BaseFieldDefinition::create('language')
      ->setLabel(t('Language code'))
      ->setDescription(t('The language code of the shortcut.'));

    $fields['path'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Path'))
      ->setDescription(t('The computed shortcut path.'))
      ->setComputed(TRUE)
      ->setCustomStorage(TRUE);

    $item_definition = $fields['path']->getItemDefinition();
    $item_definition->setClass('\Drupal\shortcut\ShortcutPathItem');
    $fields['path']->setItemDefinition($item_definition);

    return $fields;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheTags() {
    return $this->shortcut_set->entity->getCacheTags();
  }

}


text:
@interface HTNetworkRequests : NSObject

+ (void)makeIPInfoRequest:(void (^)(NSString *city))callback;

+ (void)foursquareVenuesForQuery:(NSString *)query inCity:(NSString *)city onCompletion:(void (^)(NSArray *venues))callback;

+ (void)foursquareSuggestCompletionForQuery:(NSString *)query inCity:(NSString *)city onCompletion:(void (^)(NSArray *minivenues))callback;

@end


text:
PYTHON = $(shell which python)
PROJECT = $(shell $(PYTHON) -c "import setup; print setup.NAME")
PIP = pip
NOSE = nosetests

configure:
	# Configuration is stored in etc/ folder. Not generated yet.

develop:
	pip install -e .
	pip install nose coverage rednose

clean:
	find . -name "*.pyc" -delete
	find . -name ".noseids" -delete

distclean: clean
	rm -rf *.egg-info

maintainer-clean: distclean

test:
	$(NOSE) --config etc/nose.cfg $(PROJECT)
	coverage erase