text:
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var core_1 = require('@angular/core');
var core_private_1 = require('../core_private');
var collection_1 = require('../src/facade/collection');
var lang_1 = require('../src/facade/lang');
var exceptions_1 = require('../src/facade/exceptions');
var ast_1 = require('./expression_parser/ast');
var parser_1 = require('./expression_parser/parser');
var html_parser_1 = require('./html_parser');
var html_tags_1 = require('./html_tags');
var parse_util_1 = require('./parse_util');
var template_ast_1 = require('./template_ast');
var selector_1 = require('./selector');
var element_schema_registry_1 = require('./schema/element_schema_registry');
var template_preparser_1 = require('./template_preparser');
var style_url_resolver_1 = require('./style_url_resolver');
var html_ast_1 = require('./html_ast');
var util_1 = require('./util');
var identifiers_1 = require('./identifiers');
var provider_parser_1 = require('./provider_parser');
// Group 1 = "bind-"
// Group 2 = "var-"
// Group 3 = "let-"
// Group 4 = "ref-/#"
// Group 5 = "on-"
// Group 6 = "bindon-"
// Group 7 = the identifier after "bind-", "var-/#", or "on-"
// Group 8 = identifier inside [()]
// Group 9 = identifier inside []
// Group 10 = identifier inside ()
var BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(var-)|(let-)|(ref-|#)|(on-)|(bindon-))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g;
var TEMPLATE_ELEMENT = 'template';
var TEMPLATE_ATTR = 'template';
var TEMPLATE_ATTR_PREFIX = '*';
var CLASS_ATTR = 'class';
var PROPERTY_PARTS_SEPARATOR = '.';
var ATTRIBUTE_PREFIX = 'attr';
var CLASS_PREFIX = 'class';
var STYLE_PREFIX = 'style';
var TEXT_CSS_SELECTOR = selector_1.CssSelector.parse('*')[0];
/**
 * Provides an array of {@link TemplateAstVisitor}s which will be used to transform
 * parsed templates before compilation is invoked, allowing custom expression syntax
 * and other advanced transformations.
 *
 * This is currently an internal-only feature and not meant for general use.
 */
exports.TEMPLATE_TRANSFORMS = new core_1.OpaqueToken('TemplateTransforms');
var TemplateParseError = (function (_super) {
    __extends(TemplateParseError, _super);
    function TemplateParseError(message, span, level) {
        _super.call(this, span, message, level);
    }
    return TemplateParseError;
}(parse_util_1.ParseError));
exports.TemplateParseError = TemplateParseError;
var TemplateParseResult = (function () {
    function TemplateParseResult(templateAst, errors) {
        this.templateAst = templateAst;
        this.errors = errors;
    }
    return TemplateParseResult;
}());
exports.TemplateParseResult = TemplateParseResult;
var TemplateParser = (function () {
    function TemplateParser(_exprParser, _schemaRegistry, _htmlParser, _console, transforms) {
        this._exprParser = _exprParser;
        this._schemaRegistry = _schemaRegistry;
        this._htmlParser = _htmlParser;
        this._console = _console;
        this.transforms = transforms;
    }
    TemplateParser.prototype.parse = function (component, template, directives, pipes, templateUrl) {
        var result = this.tryParse(component, template, directives, pipes, templateUrl);
        var warnings = result.errors.filter(function (error) { return error.level === parse_util_1.ParseErrorLevel.WARNING; });
        var errors = result.errors.filter(function (error) { return error.level === parse_util_1.ParseErrorLevel.FATAL; });
        if (warnings.length > 0) {
            this._console.warn("Template parse warnings:\n" + warnings.join('\n'));
        }
        if (errors.length > 0) {
            var errorString = errors.join('\n');
            throw new exceptions_1.BaseException("Template parse errors:\n" + errorString);
        }
        return result.templateAst;
    };
    TemplateParser.prototype.tryParse = function (component, template, directives, pipes, templateUrl) {
        var htmlAstWithErrors = this._htmlParser.parse(template, templateUrl);
        var errors = htmlAstWithErrors.errors;
        var result;
        if (htmlAstWithErrors.rootNodes.length > 0) {
            var uniqDirectives = removeDuplicates(directives);
            var uniqPipes = removeDuplicates(pipes);
            var providerViewContext = new provider_parser_1.ProviderViewContext(component, htmlAstWithErrors.rootNodes[0].sourceSpan);
            var parseVisitor = new TemplateParseVisitor(providerViewContext, uniqDirectives, uniqPipes, this._exprParser, this._schemaRegistry);
            result = html_ast_1.htmlVisitAll(parseVisitor, htmlAstWithErrors.rootNodes, EMPTY_ELEMENT_CONTEXT);
            errors = errors.concat(parseVisitor.errors).concat(providerViewContext.errors);
        }
        else {
            result = [];
        }
        if (errors.length > 0) {
            return new TemplateParseResult(result, errors);
        }
        if (lang_1.isPresent(this.transforms)) {
            this.transforms.forEach(function (transform) { result = template_ast_1.templateVisitAll(transform, result); });
        }
        return new TemplateParseResult(result, errors);
    };
    TemplateParser.decorators = [
        { type: core_1.Injectable },
    ];
    TemplateParser.ctorParameters = [
        { type: parser_1.Parser, },
        { type: element_schema_registry_1.ElementSchemaRegistry, },
        { type: html_parser_1.HtmlParser, },
        { type: core_private_1.Console, },
        { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [exports.TEMPLATE_TRANSFORMS,] },] },
    ];
    return TemplateParser;
}());
exports.TemplateParser = TemplateParser;
var TemplateParseVisitor = (function () {
    function TemplateParseVisitor(providerViewContext, directives, pipes, _exprParser, _schemaRegistry) {
        var _this = this;
        this.providerViewContext = providerViewContext;
        this._exprParser = _exprParser;
        this._schemaRegistry = _schemaRegistry;
        this.errors = [];
        this.directivesIndex = new Map();
        this.ngContentCount = 0;
        this.selectorMatcher = new selector_1.SelectorMatcher();
        collection_1.ListWrapper.forEachWithIndex(directives, function (directive, index) {
            var selector = selector_1.CssSelector.parse(directive.selector);
            _this.selectorMatcher.addSelectables(selector, directive);
            _this.directivesIndex.set(directive, index);
        });
        this.pipesByName = new Map();
        pipes.forEach(function (pipe) { return _this.pipesByName.set(pipe.name, pipe); });
    }
    TemplateParseVisitor.prototype._reportError = function (message, sourceSpan, level) {
        if (level === void 0) { level = parse_util_1.ParseErrorLevel.FATAL; }
        this.errors.push(new TemplateParseError(message, sourceSpan, level));
    };
    TemplateParseVisitor.prototype._parseInterpolation = function (value, sourceSpan) {
        var sourceInfo = sourceSpan.start.toString();
        try {
            var ast = this._exprParser.parseInterpolation(value, sourceInfo);
            this._checkPipes(ast, sourceSpan);
            if (lang_1.isPresent(ast) &&
                ast.ast.expressions.length > core_private_1.MAX_INTERPOLATION_VALUES) {
                throw new exceptions_1.BaseException("Only support at most " + core_private_1.MAX_INTERPOLATION_VALUES + " interpolation values!");
            }
            return ast;
        }
        catch (e) {
            this._reportError("" + e, sourceSpan);
            return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);
        }
    };
    TemplateParseVisitor.prototype._parseAction = function (value, sourceSpan) {
        var sourceInfo = sourceSpan.start.toString();
        try {
            var ast = this._exprParser.parseAction(value, sourceInfo);
            this._checkPipes(ast, sourceSpan);
            return ast;
        }
        catch (e) {
            this._reportError("" + e, sourceSpan);
            return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);
        }
    };
    TemplateParseVisitor.prototype._parseBinding = function (value, sourceSpan) {
        var sourceInfo = sourceSpan.start.toString();
        try {
            var ast = this._exprParser.parseBinding(value, sourceInfo);
            this._checkPipes(ast, sourceSpan);
            return ast;
        }
        catch (e) {
            this._reportError("" + e, sourceSpan);
            return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);
        }
    };
    TemplateParseVisitor.prototype._parseTemplateBindings = function (value, sourceSpan) {
        var _this = this;
        var sourceInfo = sourceSpan.start.toString();
        try {
            var bindingsResult = this._exprParser.parseTemplateBindings(value, sourceInfo);
            bindingsResult.templateBindings.forEach(function (binding) {
                if (lang_1.isPresent(binding.expression)) {
                    _this._checkPipes(binding.expression, sourceSpan);
                }
            });
            bindingsResult.warnings.forEach(function (warning) { _this._reportError(warning, sourceSpan, parse_util_1.ParseErrorLevel.WARNING); });
            return bindingsResult.templateBindings;
        }
        catch (e) {
            this._reportError("" + e, sourceSpan);
            return [];
        }
    };
    TemplateParseVisitor.prototype._checkPipes = function (ast, sourceSpan) {
        var _this = this;
        if (lang_1.isPresent(ast)) {
            var collector = new PipeCollector();
            ast.visit(collector);
            collector.pipes.forEach(function (pipeName) {
                if (!_this.pipesByName.has(pipeName)) {
                    _this._reportError("The pipe '" + pipeName + "' could not be found", sourceSpan);
                }
            });
        }
    };
    TemplateParseVisitor.prototype.visitExpansion = function (ast, context) { return null; };
    TemplateParseVisitor.prototype.visitExpansionCase = function (ast, context) { return null; };
    TemplateParseVisitor.prototype.visitText = function (ast, parent) {
        var ngContentIndex = parent.findNgContentIndex(TEXT_CSS_SELECTOR);
        var expr = this._parseInterpolation(ast.value, ast.sourceSpan);
        if (lang_1.isPresent(expr)) {
            return new template_ast_1.BoundTextAst(expr, ngContentIndex, ast.sourceSpan);
        }
        else {
            return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceSpan);
        }
    };
    TemplateParseVisitor.prototype.visitAttr = function (ast, contex) {
        return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceSpan);
    };
    TemplateParseVisitor.prototype.visitComment = function (ast, context) { return null; };
    TemplateParseVisitor.prototype.visitElement = function (element, parent) {
        var _this = this;
        var nodeName = element.name;
        var preparsedElement = template_preparser_1.preparseElement(element);
        if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT ||
            preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE) {
            // Skipping <script> for security reasons
            // Skipping <style> as we already processed them
            // in the StyleCompiler
            return null;
        }
        if (preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET &&
            style_url_resolver_1.isStyleUrlResolvable(preparsedElement.hrefAttr)) {
            // Skipping stylesheets with either relative urls or package scheme as we already processed
            // them in the StyleCompiler
            return null;
        }
        var matchableAttrs = [];
        var elementOrDirectiveProps = [];
        var elementOrDirectiveRefs = [];
        var elementVars = [];
        var events = [];
        var templateElementOrDirectiveProps = [];
        var templateMatchableAttrs = [];
        var templateElementVars = [];
        var hasInlineTemplates = false;
        var attrs = [];
        var lcElName = html_tags_1.splitNsName(nodeName.toLowerCase())[1];
        var isTemplateElement = lcElName == TEMPLATE_ELEMENT;
        element.attrs.forEach(function (attr) {
            var hasBinding = _this._parseAttr(isTemplateElement, attr, matchableAttrs, elementOrDirectiveProps, events, elementOrDirectiveRefs, elementVars);
            var hasTemplateBinding = _this._parseInlineTemplateBinding(attr, templateMatchableAttrs, templateElementOrDirectiveProps, templateElementVars);
            if (!hasBinding && !hasTemplateBinding) {
                // don't include the bindings as attributes as well in the AST
                attrs.push(_this.visitAttr(attr, null));
                matchableAttrs.push([attr.name, attr.value]);
            }
            if (hasTemplateBinding) {
                hasInlineTemplates = true;
            }
        });
        var elementCssSelector = createElementCssSelector(nodeName, matchableAttrs);
        var directiveMetas = this._parseDirectives(this.selectorMatcher, elementCssSelector);
        var references = [];
        var directiveAsts = this._createDirectiveAsts(isTemplateElement, element.name, directiveMetas, elementOrDirectiveProps, elementOrDirectiveRefs, element.sourceSpan, references);
        var elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, directiveAsts);
        var isViewRoot = parent.isTemplateElement || hasInlineTemplates;
        var providerContext = new provider_parser_1.ProviderElementContext(this.providerViewContext, parent.providerContext, isViewRoot, directiveAsts, attrs, references, element.sourceSpan);
        var children = html_ast_1.htmlVisitAll(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, ElementContext.create(isTemplateElement, directiveAsts, isTemplateElement ? parent.providerContext : providerContext));
        providerContext.afterElement();
        // Override the actual selector when the `ngProjectAs` attribute is provided
        var projectionSelector = lang_1.isPresent(preparsedElement.projectAs) ?
            selector_1.CssSelector.parse(preparsedElement.projectAs)[0] :
            elementCssSelector;
        var ngContentIndex = parent.findNgContentIndex(projectionSelector);
        var parsedElement;
        if (preparsedElement.type === template_preparser_1.PreparsedElementType.NG_CONTENT) {
            if (lang_1.isPresent(element.children) && element.children.length > 0) {
                this._reportError("<ng-content> element cannot have content. <ng-content> must be immediately followed by </ng-content>", element.sourceSpan);
            }
            parsedElement = new template_ast_1.NgContentAst(this.ngContentCount++, hasInlineTemplates ? null : ngContentIndex, element.sourceSpan);
        }
        else if (isTemplateElement) {
            this._assertAllEventsPublishedByDirectives(directiveAsts, events);
            this._assertNoComponentsNorElementBindingsOnTemplate(directiveAsts, elementProps, element.sourceSpan);
            parsedElement = new template_ast_1.EmbeddedTemplateAst(attrs, events, references, elementVars, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, children, hasInlineTemplates ? null : ngContentIndex, element.sourceSpan);
        }
        else {
            this._assertOnlyOneComponent(directiveAsts, element.sourceSpan);
            var ngContentIndex_1 = hasInlineTemplates ? null : parent.findNgContentIndex(projectionSelector);
            parsedElement = new template_ast_1.ElementAst(nodeName, attrs, elementProps, events, references, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, children, hasInlineTemplates ? null : ngContentIndex_1, element.sourceSpan);
        }
        if (hasInlineTemplates) {
            var templateCssSelector = createElementCssSelector(TEMPLATE_ELEMENT, templateMatchableAttrs);
            var templateDirectiveMetas = this._parseDirectives(this.selectorMatcher, templateCssSelector);
            var templateDirectiveAsts = this._createDirectiveAsts(true, element.name, templateDirectiveMetas, templateElementOrDirectiveProps, [], element.sourceSpan, []);
            var templateElementProps = this._createElementPropertyAsts(element.name, templateElementOrDirectiveProps, templateDirectiveAsts);
            this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectiveAsts, templateElementProps, element.sourceSpan);
            var templateProviderContext = new provider_parser_1.ProviderElementContext(this.providerViewContext, parent.providerContext, parent.isTemplateElement, templateDirectiveAsts, [], [], element.sourceSpan);
            templateProviderContext.afterElement();
            parsedElement = new template_ast_1.EmbeddedTemplateAst([], [], [], templateElementVars, templateProviderContext.transformedDirectiveAsts, templateProviderContext.transformProviders, templateProviderContext.transformedHasViewContainer, [parsedElement], ngContentIndex, element.sourceSpan);
        }
        return parsedElement;
    };
    TemplateParseVisitor.prototype._parseInlineTemplateBinding = function (attr, targetMatchableAttrs, targetProps, targetVars) {
        var templateBindingsSource = null;
        if (attr.name == TEMPLATE_ATTR) {
            templateBindingsSource = attr.value;
        }
        else if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) {
            var key = attr.name.substring(TEMPLATE_ATTR_PREFIX.length); // remove the star
            templateBindingsSource = (attr.value.length == 0) ? key : key + ' ' + attr.value;
        }
        if (lang_1.isPresent(templateBindingsSource)) {
            var bindings = this._parseTemplateBindings(templateBindingsSource, attr.sourceSpan);
            for (var i = 0; i < bindings.length; i++) {
                var binding = bindings[i];
                if (binding.keyIsVar) {
                    targetVars.push(new template_ast_1.VariableAst(binding.key, binding.name, attr.sourceSpan));
                }
                else if (lang_1.isPresent(binding.expression)) {
                    this._parsePropertyAst(binding.key, binding.expression, attr.sourceSpan, targetMatchableAttrs, targetProps);
                }
                else {
                    targetMatchableAttrs.push([binding.key, '']);
                    this._parseLiteralAttr(binding.key, null, attr.sourceSpan, targetProps);
                }
            }
            return true;
        }
        return false;
    };
    TemplateParseVisitor.prototype._parseAttr = function (isTemplateElement, attr, targetMatchableAttrs, targetProps, targetEvents, targetRefs, targetVars) {
        var attrName = this._normalizeAttributeName(attr.name);
        var attrValue = attr.value;
        var bindParts = lang_1.RegExpWrapper.firstMatch(BIND_NAME_REGEXP, attrName);
        var hasBinding = false;
        if (lang_1.isPresent(bindParts)) {
            hasBinding = true;
            if (lang_1.isPresent(bindParts[1])) {
                this._parseProperty(bindParts[7], attrValue, attr.sourceSpan, targetMatchableAttrs, targetProps);
            }
            else if (lang_1.isPresent(bindParts[2])) {
                var identifier = bindParts[7];
                if (isTemplateElement) {
                    this._reportError("\"var-\" on <template> elements is deprecated. Use \"let-\" instead!", attr.sourceSpan, parse_util_1.ParseErrorLevel.WARNING);
                    this._parseVariable(identifier, attrValue, attr.sourceSpan, targetVars);
                }
                else {
                    this._reportError("\"var-\" on non <template> elements is deprecated. Use \"ref-\" instead!", attr.sourceSpan, parse_util_1.ParseErrorLevel.WARNING);
                    this._parseReference(identifier, attrValue, attr.sourceSpan, targetRefs);
                }
            }
            else if (lang_1.isPresent(bindParts[3])) {
                if (isTemplateElement) {
                    var identifier = bindParts[7];
                    this._parseVariable(identifier, attrValue, attr.sourceSpan, targetVars);
                }
                else {
                    this._reportError("\"let-\" is only supported on template elements.", attr.sourceSpan);
                }
            }
            else if (lang_1.isPresent(bindParts[4])) {
                var identifier = bindParts[7];
                this._parseReference(identifier, attrValue, attr.sourceSpan, targetRefs);
            }
            else if (lang_1.isPresent(bindParts[5])) {
                this._parseEvent(bindParts[7], attrValue, attr.sourceSpan, targetMatchableAttrs, targetEvents);
            }
            else if (lang_1.isPresent(bindParts[6])) {
                this._parseProperty(bindParts[7], attrValue, attr.sourceSpan, targetMatchableAttrs, targetProps);
                this._parseAssignmentEvent(bindParts[7], attrValue, attr.sourceSpan, targetMatchableAttrs, targetEvents);
            }
            else if (lang_1.isPresent(bindParts[8])) {
                this._parseProperty(bindParts[8], attrValue, attr.sourceSpan, targetMatchableAttrs, targetProps);
                this._parseAssignmentEvent(bindParts[8], attrValue, attr.sourceSpan, targetMatchableAttrs, targetEvents);
            }
            else if (lang_1.isPresent(bindParts[9])) {
                this._parseProperty(bindParts[9], attrValue, attr.sourceSpan, targetMatchableAttrs, targetProps);
            }
            else if (lang_1.isPresent(bindParts[10])) {
                this._parseEvent(bindParts[10], attrValue, attr.sourceSpan, targetMatchableAttrs, targetEvents);
            }
        }
        else {
            hasBinding = this._parsePropertyInterpolation(attrName, attrValue, attr.sourceSpan, targetMatchableAttrs, targetProps);
        }
        if (!hasBinding) {
            this._parseLiteralAttr(attrName, attrValue, attr.sourceSpan, targetProps);
        }
        return hasBinding;
    };
    TemplateParseVisitor.prototype._normalizeAttributeName = function (attrName) {
        return attrName.toLowerCase().startsWith('data-') ? attrName.substring(5) : attrName;
    };
    TemplateParseVisitor.prototype._parseVariable = function (identifier, value, sourceSpan, targetVars) {
        if (identifier.indexOf('-') > -1) {
            this._reportError("\"-\" is not allowed in variable names", sourceSpan);
        }
        targetVars.push(new template_ast_1.VariableAst(identifier, value, sourceSpan));
    };
    TemplateParseVisitor.prototype._parseReference = function (identifier, value, sourceSpan, targetRefs) {
        if (identifier.indexOf('-') > -1) {
            this._reportError("\"-\" is not allowed in reference names", sourceSpan);
        }
        targetRefs.push(new ElementOrDirectiveRef(identifier, value, sourceSpan));
    };
    TemplateParseVisitor.prototype._parseProperty = function (name, expression, sourceSpan, targetMatchableAttrs, targetProps) {
        this._parsePropertyAst(name, this._parseBinding(expression, sourceSpan), sourceSpan, targetMatchableAttrs, targetProps);
    };
    TemplateParseVisitor.prototype._parsePropertyInterpolation = function (name, value, sourceSpan, targetMatchableAttrs, targetProps) {
        var expr = this._parseInterpolation(value, sourceSpan);
        if (lang_1.isPresent(expr)) {
            this._parsePropertyAst(name, expr, sourceSpan, targetMatchableAttrs, targetProps);
            return true;
        }
        return false;
    };
    TemplateParseVisitor.prototype._parsePropertyAst = function (name, ast, sourceSpan, targetMatchableAttrs, targetProps) {
        targetMatchableAttrs.push([name, ast.source]);
        targetProps.push(new BoundElementOrDirectiveProperty(name, ast, false, sourceSpan));
    };
    TemplateParseVisitor.prototype._parseAssignmentEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {
        this._parseEvent(name + "Change", expression + "=$event", sourceSpan, targetMatchableAttrs, targetEvents);
    };
    TemplateParseVisitor.prototype._parseEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {
        // long format: 'target: eventName'
        var parts = util_1.splitAtColon(name, [null, name]);
        var target = parts[0];
        var eventName = parts[1];
        var ast = this._parseAction(expression, sourceSpan);
        targetMatchableAttrs.push([name, ast.source]);
        targetEvents.push(new template_ast_1.BoundEventAst(eventName, target, ast, sourceSpan));
        // Don't detect directives for event names for now,
        // so don't add the event name to the matchableAttrs
    };
    TemplateParseVisitor.prototype._parseLiteralAttr = function (name, value, sourceSpan, targetProps) {
        targetProps.push(new BoundElementOrDirectiveProperty(name, this._exprParser.wrapLiteralPrimitive(value, ''), true, sourceSpan));
    };
    TemplateParseVisitor.prototype._parseDirectives = function (selectorMatcher, elementCssSelector) {
        var _this = this;
        // Need to sort the directives so that we get consistent results throughout,
        // as selectorMatcher uses Maps inside.
        // Also dedupe directives as they might match more than one time!
        var directives = collection_1.ListWrapper.createFixedSize(this.directivesIndex.size);
        selectorMatcher.match(elementCssSelector, function (selector, directive) {
            directives[_this.directivesIndex.get(directive)] = directive;
        });
        return directives.filter(function (dir) { return lang_1.isPresent(dir); });
    };
    TemplateParseVisitor.prototype._createDirectiveAsts = function (isTemplateElement, elementName, directives, props, elementOrDirectiveRefs, sourceSpan, targetReferences) {
        var _this = this;
        var matchedReferences = new Set();
        var component = null;
        var directiveAsts = directives.map(function (directive) {
            if (directive.isComponent) {
                component = directive;
            }
            var hostProperties = [];
            var hostEvents = [];
            var directiveProperties = [];
            _this._createDirectiveHostPropertyAsts(elementName, directive.hostProperties, sourceSpan, hostProperties);
            _this._createDirectiveHostEventAsts(directive.hostListeners, sourceSpan, hostEvents);
            _this._createDirectivePropertyAsts(directive.inputs, props, directiveProperties);
            elementOrDirectiveRefs.forEach(function (elOrDirRef) {
                if ((elOrDirRef.value.length === 0 && directive.isComponent) ||
                    (directive.exportAs == elOrDirRef.value)) {
                    targetReferences.push(new template_ast_1.ReferenceAst(elOrDirRef.name, identifiers_1.identifierToken(directive.type), elOrDirRef.sourceSpan));
                    matchedReferences.add(elOrDirRef.name);
                }
            });
            return new template_ast_1.DirectiveAst(directive, directiveProperties, hostProperties, hostEvents, sourceSpan);
        });
        elementOrDirectiveRefs.forEach(function (elOrDirRef) {
            if (elOrDirRef.value.length > 0) {
                if (!collection_1.SetWrapper.has(matchedReferences, elOrDirRef.name)) {
                    _this._reportError("There is no directive with \"exportAs\" set to \"" + elOrDirRef.value + "\"", elOrDirRef.sourceSpan);
                }
                ;
            }
            else if (lang_1.isBlank(component)) {
                var refToken = null;
                if (isTemplateElement) {
                    refToken = identifiers_1.identifierToken(identifiers_1.Identifiers.TemplateRef);
                }
                targetReferences.push(new template_ast_1.ReferenceAst(elOrDirRef.name, refToken, elOrDirRef.sourceSpan));
            }
        }); // fix syntax highlighting issue: `
        return directiveAsts;
    };
    TemplateParseVisitor.prototype._createDirectiveHostPropertyAsts = function (elementName, hostProps, sourceSpan, targetPropertyAsts) {
        var _this = this;
        if (lang_1.isPresent(hostProps)) {
            collection_1.StringMapWrapper.forEach(hostProps, function (expression, propName) {
                var exprAst = _this._parseBinding(expression, sourceSpan);
                targetPropertyAsts.push(_this._createElementPropertyAst(elementName, propName, exprAst, sourceSpan));
            });
        }
    };
    TemplateParseVisitor.prototype._createDirectiveHostEventAsts = function (hostListeners, sourceSpan, targetEventAsts) {
        var _this = this;
        if (lang_1.isPresent(hostListeners)) {
            collection_1.StringMapWrapper.forEach(hostListeners, function (expression, propName) {
                _this._parseEvent(propName, expression, sourceSpan, [], targetEventAsts);
            });
        }
    };
    TemplateParseVisitor.prototype._createDirectivePropertyAsts = function (directiveProperties, boundProps, targetBoundDirectiveProps) {
        if (lang_1.isPresent(directiveProperties)) {
            var boundPropsByName = new Map();
            boundProps.forEach(function (boundProp) {
                var prevValue = boundPropsByName.get(boundProp.name);
                if (lang_1.isBlank(prevValue) || prevValue.isLiteral) {
                    // give [a]="b" a higher precedence than a="b" on the same element
                    boundPropsByName.set(boundProp.name, boundProp);
                }
            });
            collection_1.StringMapWrapper.forEach(directiveProperties, function (elProp, dirProp) {
                var boundProp = boundPropsByName.get(elProp);
                // Bindings are optional, so this binding only needs to be set up if an expression is given.
                if (lang_1.isPresent(boundProp)) {
                    targetBoundDirectiveProps.push(new template_ast_1.BoundDirectivePropertyAst(dirProp, boundProp.name, boundProp.expression, boundProp.sourceSpan));
                }
            });
        }
    };
    TemplateParseVisitor.prototype._createElementPropertyAsts = function (elementName, props, directives) {
        var _this = this;
        var boundElementProps = [];
        var boundDirectivePropsIndex = new Map();
        directives.forEach(function (directive) {
            directive.inputs.forEach(function (prop) {
                boundDirectivePropsIndex.set(prop.templateName, prop);
            });
        });
        props.forEach(function (prop) {
            if (!prop.isLiteral && lang_1.isBlank(boundDirectivePropsIndex.get(prop.name))) {
                boundElementProps.push(_this._createElementPropertyAst(elementName, prop.name, prop.expression, prop.sourceSpan));
            }
        });
        return boundElementProps;
    };
    TemplateParseVisitor.prototype._createElementPropertyAst = function (elementName, name, ast, sourceSpan) {
        var unit = null;
        var bindingType;
        var boundPropertyName;
        var parts = name.split(PROPERTY_PARTS_SEPARATOR);
        var securityContext;
        if (parts.length === 1) {
            boundPropertyName = this._schemaRegistry.getMappedPropName(parts[0]);
            securityContext = this._schemaRegistry.securityContext(elementName, boundPropertyName);
            bindingType = template_ast_1.PropertyBindingType.Property;
            if (!this._schemaRegistry.hasProperty(elementName, boundPropertyName)) {
                this._reportError("Can't bind to '" + boundPropertyName + "' since it isn't a known native property", sourceSpan);
            }
        }
        else {
            if (parts[0] == ATTRIBUTE_PREFIX) {
                boundPropertyName = parts[1];
                if (boundPropertyName.toLowerCase().startsWith('on')) {
                    this._reportError(("Binding to event attribute '" + boundPropertyName + "' is disallowed ") +
                        ("for security reasons, please use (" + boundPropertyName.slice(2) + ")=..."), sourceSpan);
                }
                // NB: For security purposes, use the mapped property name, not the attribute name.
                securityContext = this._schemaRegistry.securityContext(elementName, this._schemaRegistry.getMappedPropName(boundPropertyName));
                var nsSeparatorIdx = boundPropertyName.indexOf(':');
                if (nsSeparatorIdx > -1) {
                    var ns = boundPropertyName.substring(0, nsSeparatorIdx);
                    var name_1 = boundPropertyName.substring(nsSeparatorIdx + 1);
                    boundPropertyName = html_tags_1.mergeNsAndName(ns, name_1);
                }
                bindingType = template_ast_1.PropertyBindingType.Attribute;
            }
            else if (parts[0] == CLASS_PREFIX) {
                boundPropertyName = parts[1];
                bindingType = template_ast_1.PropertyBindingType.Class;
                securityContext = core_private_1.SecurityContext.NONE;
            }
            else if (parts[0] == STYLE_PREFIX) {
                unit = parts.length > 2 ? parts[2] : null;
                boundPropertyName = parts[1];
                bindingType = template_ast_1.PropertyBindingType.Style;
                securityContext = core_private_1.SecurityContext.STYLE;
            }
            else {
                this._reportError("Invalid property name '" + name + "'", sourceSpan);
                bindingType = null;
                securityContext = null;
            }
        }
        return new template_ast_1.BoundElementPropertyAst(boundPropertyName, bindingType, securityContext, ast, unit, sourceSpan);
    };
    TemplateParseVisitor.prototype._findComponentDirectiveNames = function (directives) {
        var componentTypeNames = [];
        directives.forEach(function (directive) {
            var typeName = directive.directive.type.name;
            if (directive.directive.isComponent) {
                componentTypeNames.push(typeName);
            }
        });
        return componentTypeNames;
    };
    TemplateParseVisitor.prototype._assertOnlyOneComponent = function (directives, sourceSpan) {
        var componentTypeNames = this._findComponentDirectiveNames(directives);
        if (componentTypeNames.length > 1) {
            this._reportError("More than one component: " + componentTypeNames.join(','), sourceSpan);
        }
    };
    TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate = function (directives, elementProps, sourceSpan) {
        var _this = this;
        var componentTypeNames = this._findComponentDirectiveNames(directives);
        if (componentTypeNames.length > 0) {
            this._reportError("Components on an embedded template: " + componentTypeNames.join(','), sourceSpan);
        }
        elementProps.forEach(function (prop) {
            _this._reportError("Property binding " + prop.name + " not used by any directive on an embedded template", sourceSpan);
        });
    };
    TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives = function (directives, events) {
        var _this = this;
        var allDirectiveEvents = new Set();
        directives.forEach(function (directive) {
            collection_1.StringMapWrapper.forEach(directive.directive.outputs, function (eventName, _) { allDirectiveEvents.add(eventName); });
        });
        events.forEach(function (event) {
            if (lang_1.isPresent(event.target) || !collection_1.SetWrapper.has(allDirectiveEvents, event.name)) {
                _this._reportError("Event binding " + event.fullName + " not emitted by any directive on an embedded template", event.sourceSpan);
            }
        });
    };
    return TemplateParseVisitor;
}());
var NonBindableVisitor = (function () {
    function NonBindableVisitor() {
    }
    NonBindableVisitor.prototype.visitElement = function (ast, parent) {
        var preparsedElement = template_preparser_1.preparseElement(ast);
        if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT ||
            preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE ||
            preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET) {
            // Skipping <script> for security reasons
            // Skipping <style> and stylesheets as we already processed them
            // in the StyleCompiler
            return null;
        }
        var attrNameAndValues = ast.attrs.map(function (attrAst) { return [attrAst.name, attrAst.value]; });
        var selector = createElementCssSelector(ast.name, attrNameAndValues);
        var ngContentIndex = parent.findNgContentIndex(selector);
        var children = html_ast_1.htmlVisitAll(this, ast.children, EMPTY_ELEMENT_CONTEXT);
        return new template_ast_1.ElementAst(ast.name, html_ast_1.htmlVisitAll(this, ast.attrs), [], [], [], [], [], false, children, ngContentIndex, ast.sourceSpan);
    };
    NonBindableVisitor.prototype.visitComment = function (ast, context) { return null; };
    NonBindableVisitor.prototype.visitAttr = function (ast, context) {
        return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceSpan);
    };
    NonBindableVisitor.prototype.visitText = function (ast, parent) {
        var ngContentIndex = parent.findNgContentIndex(TEXT_CSS_SELECTOR);
        return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceSpan);
    };
    NonBindableVisitor.prototype.visitExpansion = function (ast, context) { return ast; };
    NonBindableVisitor.prototype.visitExpansionCase = function (ast, context) { return ast; };
    return NonBindableVisitor;
}());
var BoundElementOrDirectiveProperty = (function () {
    function BoundElementOrDirectiveProperty(name, expression, isLiteral, sourceSpan) {
        this.name = name;
        this.expression = expression;
        this.isLiteral = isLiteral;
        this.sourceSpan = sourceSpan;
    }
    return BoundElementOrDirectiveProperty;
}());
var ElementOrDirectiveRef = (function () {
    function ElementOrDirectiveRef(name, value, sourceSpan) {
        this.name = name;
        this.value = value;
        this.sourceSpan = sourceSpan;
    }
    return ElementOrDirectiveRef;
}());
function splitClasses(classAttrValue) {
    return lang_1.StringWrapper.split(classAttrValue.trim(), /\s+/g);
}
exports.splitClasses = splitClasses;
var ElementContext = (function () {
    function ElementContext(isTemplateElement, _ngContentIndexMatcher, _wildcardNgContentIndex, providerContext) {
        this.isTemplateElement = isTemplateElement;
        this._ngContentIndexMatcher = _ngContentIndexMatcher;
        this._wildcardNgContentIndex = _wildcardNgContentIndex;
        this.providerContext = providerContext;
    }
    ElementContext.create = function (isTemplateElement, directives, providerContext) {
        var matcher = new selector_1.SelectorMatcher();
        var wildcardNgContentIndex = null;
        var component = directives.find(function (directive) { return directive.directive.isComponent; });
        if (lang_1.isPresent(component)) {
            var ngContentSelectors = component.directive.template.ngContentSelectors;
            for (var i = 0; i < ngContentSelectors.length; i++) {
                var selector = ngContentSelectors[i];
                if (lang_1.StringWrapper.equals(selector, '*')) {
                    wildcardNgContentIndex = i;
                }
                else {
                    matcher.addSelectables(selector_1.CssSelector.parse(ngContentSelectors[i]), i);
                }
            }
        }
        return new ElementContext(isTemplateElement, matcher, wildcardNgContentIndex, providerContext);
    };
    ElementContext.prototype.findNgContentIndex = function (selector) {
        var ngContentIndices = [];
        this._ngContentIndexMatcher.match(selector, function (selector, ngContentIndex) { ngContentIndices.push(ngContentIndex); });
        collection_1.ListWrapper.sort(ngContentIndices);
        if (lang_1.isPresent(this._wildcardNgContentIndex)) {
            ngContentIndices.push(this._wildcardNgContentIndex);
        }
        return ngContentIndices.length > 0 ? ngContentIndices[0] : null;
    };
    return ElementContext;
}());
function createElementCssSelector(elementName, matchableAttrs) {
    var cssSelector = new selector_1.CssSelector();
    var elNameNoNs = html_tags_1.splitNsName(elementName)[1];
    cssSelector.setElement(elNameNoNs);
    for (var i = 0; i < matchableAttrs.length; i++) {
        var attrName = matchableAttrs[i][0];
        var attrNameNoNs = html_tags_1.splitNsName(attrName)[1];
        var attrValue = matchableAttrs[i][1];
        cssSelector.addAttribute(attrNameNoNs, attrValue);
        if (attrName.toLowerCase() == CLASS_ATTR) {
            var classes = splitClasses(attrValue);
            classes.forEach(function (className) { return cssSelector.addClassName(className); });
        }
    }
    return cssSelector;
}
var EMPTY_ELEMENT_CONTEXT = new ElementContext(true, new selector_1.SelectorMatcher(), null, null);
var NON_BINDABLE_VISITOR = new NonBindableVisitor();
var PipeCollector = (function (_super) {
    __extends(PipeCollector, _super);
    function PipeCollector() {
        _super.apply(this, arguments);
        this.pipes = new Set();
    }
    PipeCollector.prototype.visitPipe = function (ast, context) {
        this.pipes.add(ast.name);
        ast.exp.visit(this);
        this.visitAll(ast.args, context);
        return null;
    };
    return PipeCollector;
}(ast_1.RecursiveAstVisitor));
exports.PipeCollector = PipeCollector;
function removeDuplicates(items) {
    var res = [];
    items.forEach(function (item) {
        var hasMatch = res.filter(function (r) { return r.type.name == item.type.name && r.type.moduleUrl == item.type.moduleUrl &&
            r.type.runtime == item.type.runtime; })
            .length > 0;
        if (!hasMatch) {
            res.push(item);
        }
    });
    return res;
}
//# sourceMappingURL=template_parser.js.map


text:
define(function(require, exports, module) {
	var BitSet = require('./../Utils').BitSet;
	var ErrorListener = require('./ErrorListener').ErrorListener;
	var Interval = require('./../IntervalSet').Interval;

	function DiagnosticErrorListener(exactOnly) {
		ErrorListener.call(this);
		exactOnly = exactOnly || true;
		// whether all ambiguities or only exact ambiguities are reported.
		this.exactOnly = exactOnly;
		return this;
	}

	DiagnosticErrorListener.prototype = Object.create(ErrorListener.prototype);
	DiagnosticErrorListener.prototype.constructor = DiagnosticErrorListener;

	DiagnosticErrorListener.prototype.reportAmbiguity = function (recognizer, dfa,
																  startIndex, stopIndex, exact, ambigAlts, configs) {
		if (this.exactOnly && !exact) {
			return;
		}
		var msg = "reportAmbiguity d=" +
			this.getDecisionDescription(recognizer, dfa) +
			": ambigAlts=" +
			this.getConflictingAlts(ambigAlts, configs) +
			", input='" +
			recognizer.getTokenStream().getText(new Interval(startIndex, stopIndex)) + "'";
		recognizer.notifyErrorListeners(msg);
	};

	DiagnosticErrorListener.prototype.reportAttemptingFullContext = function (recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) {
		var msg = "reportAttemptingFullContext d=" +
			this.getDecisionDescription(recognizer, dfa) +
			", input='" +
			recognizer.getTokenStream().getText(new Interval(startIndex, stopIndex)) + "'";
		recognizer.notifyErrorListeners(msg);
	};

	DiagnosticErrorListener.prototype.reportContextSensitivity = function (recognizer, dfa, startIndex, stopIndex, prediction, configs) {
		var msg = "reportContextSensitivity d=" +
			this.getDecisionDescription(recognizer, dfa) +
			", input='" +
			recognizer.getTokenStream().getText(new Interval(startIndex, stopIndex)) + "'";
		recognizer.notifyErrorListeners(msg);
	};

	DiagnosticErrorListener.prototype.getDecisionDescription = function (recognizer, dfa) {
		var decision = dfa.decision;
		var ruleIndex = dfa.atnStartState.ruleIndex;

		var ruleNames = recognizer.ruleNames;
		if (ruleIndex < 0 || ruleIndex >= ruleNames.length) {
			return "" + decision;
		}
		var ruleName = ruleNames[ruleIndex] || null;
		if (ruleName === null || ruleName.length === 0) {
			return "" + decision;
		}
		return "" + decision + " (" + ruleName + ")";
	};

//
// Computes the set of conflicting or ambiguous alternatives from a
// configuration set, if that information was not already provided by the
// parser.
//
// @param reportedAlts The set of conflicting or ambiguous alternatives, as
// reported by the parser.
// @param configs The conflicting or ambiguous configuration set.
// @return Returns {@code reportedAlts} if it is not {@code null}, otherwise
// returns the set of alternatives represented in {@code configs}.
//
	DiagnosticErrorListener.prototype.getConflictingAlts = function (reportedAlts, configs) {
		if (reportedAlts !== null) {
			return reportedAlts;
		}
		var result = new BitSet();
		for (var i = 0; i < configs.items.length; i++) {
			result.add(configs.items[i].alt);
		}
		return "{" + result.values().join(", ") + "}";
	};

	module.exports.DiagnosticErrorListener = DiagnosticErrorListener;
});

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:aop="http://www.springframework.org/schema/aop"
  xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:util="http://www.springframework.org/schema/util"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">

  <context:component-scan base-package="jp.co.ctc_g.jse.log.showcase" />
  <context:property-placeholder location="classpath:Jdbc.properties" ignore-unresolvable="true"
    ignore-resource-not-found="true" />
   <aop:config>
    <aop:pointcut id="daoPointcut" expression="execution(* jp.co.ctc_g.jse.log.showcase..*Dao.*(..))" />
    <aop:advisor pointcut-ref="daoPointcut" advice-ref="transactionAdvice" />
  </aop:config>

  <tx:advice id="transactionAdvice" transaction-manager="transactionManager">
    <tx:attributes>
      <tx:method name="find*" propagation="SUPPORTS" isolation="READ_COMMITTED" rollback-for="java.lang.Throwable" />
      <tx:method name="list*" propagation="SUPPORTS" isolation="READ_COMMITTED" rollback-for="java.lang.Throwable" />
      <tx:method name="create*" propagation="REQUIRED" isolation="READ_COMMITTED" rollback-for="java.lang.Throwable" />
      <tx:method name="update*" propagation="REQUIRED" isolation="READ_COMMITTED" rollback-for="java.lang.Throwable" />
      <tx:method name="delete*" propagation="REQUIRED" isolation="READ_COMMITTED" rollback-for="java.lang.Throwable" />
    </tx:attributes>
  </tx:advice>

  <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource" />
  </bean>

  <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
    <constructor-arg index="0" ref="sqlSessionFactory" />
  </bean>

  <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="sqlSessionFactoryBuilder" ref="jxSqlSessionFactoryBuilder" />
    <property name="dataSource" ref="dataSource" />
    <property name="configLocation" value="classpath:MyBatis.xml" />
    <property name="mapperLocations" value="classpath:jp/co/ctc_g/jse/log/showcase/logging/audit/AuditSqlLoggingTestDaoImpl.xml" />
    <property name="typeAliasesPackage" value="jp.co.ctc_g.jse.log.showcase.business.domain" />
    <property name="plugins">
      <list>
        <ref bean="queryLoggingPlugin" />
      </list>
    </property>
  </bean>

  <bean id="queryLoggingPlugin" class="jp.co.ctc_g.jfw.core.jdbc.mybatis.QueryLoggingInterceptor" />

  <bean id="loggingStrategy" class="jp.co.ctc_g.jse.log.showcase.logging.audit.AuditSqlLoggingStrategy">
    <constructor-arg name="marker" value="AUDIT" />
    <constructor-arg name="category" value="jp.co.ctc_g.jse.log.showcase.logging.audit.AuditSqlLoggingStrategy" />
  </bean>

  <bean id="jxSqlSessionFactoryBuilder" class="jp.co.ctc_g.jfw.core.jdbc.JxSqlSessionFactoryBuilder" />

  <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="${jdbc.driver}" />
    <property name="url" value="${jdbc.url}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />
    <property name="initialSize" value="3" />
    <property name="maxActive" value="10" />
    <property name="maxIdle" value="10" />
    <property name="maxWait" value="10000" />
    <property name="minIdle" value="3" />
  </bean>

</beans>


text:
import { ColumnGroupChild } from "../entities/columnGroupChild";
import { OriginalColumnGroupChild } from "../entities/originalColumnGroupChild";
import { OriginalColumnGroup } from "../entities/originalColumnGroup";
import { Column } from "../entities/column";
export declare class ColumnUtils {
    private gridOptionsWrapper;
    calculateColInitialWidth(colDef: any): number;
    getOriginalPathForColumn(column: Column, originalBalancedTree: OriginalColumnGroupChild[]): OriginalColumnGroup[];
    depthFirstOriginalTreeSearch(tree: OriginalColumnGroupChild[], callback: (treeNode: OriginalColumnGroupChild) => void): void;
    depthFirstAllColumnTreeSearch(tree: ColumnGroupChild[], callback: (treeNode: ColumnGroupChild) => void): void;
    depthFirstDisplayedColumnTreeSearch(tree: ColumnGroupChild[], callback: (treeNode: ColumnGroupChild) => void): void;
}


text:
/**
 * Implement Gatsby's Node APIs in this file.
 *
 * See: https://www.gatsbyjs.com/docs/node-apis/
 */
// You can delete this file if you're not using it

/**
 * You can uncomment the following line to verify that
 * your plugin is being loaded in your site.
 *
 * See: https://www.gatsbyjs.com/docs/creating-a-local-plugin/#developing-a-local-plugin-that-is-outside-your-project
 */
exports.onPreInit = () => console.log("Loaded gatsby-starter-plugin")


text:
package com.ebay.xcelite.reader;

import com.ebay.xcelite.Xcelite;
import com.ebay.xcelite.exceptions.XceliteException;
import com.ebay.xcelite.model.AnyColumnBean;
import com.ebay.xcelite.model.AnyColumnBeanDoneWrong;
import com.ebay.xcelite.model.AnyColumnBeanDoneWrongNotUsingMap;
import com.ebay.xcelite.model.AnyColumnEmployeeBean;
import com.ebay.xcelite.options.XceliteOptions;
import com.ebay.xcelite.policies.MissingCellPolicy;
import com.ebay.xcelite.reader.SheetReader;
import com.ebay.xcelite.sheet.XceliteSheet;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.Executable;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import static org.junit.jupiter.api.Assertions.assertThrows;

/**
 *
 * @author Thanthathon.b
 */
class AnyColumnTest {

    private String[] columnNames = new String[]{
            "NAME", "SURNAME", "BIRTHDATE", "SEXID", "SEX"
    };

    private static Object[][] testData = {
            {"Crystal", "Maiden", "01/02/1990", 2.0, "Female"},
            {"Witch", "Doctor", "01/01/1990", 1.0, "Male"}
    };

    private static String[] employeeProjects1 = {
            null,
            "Testing",
            "Website Relaunch",
            null,
            null
    };
    private static String[][] employeeProjects2 = {
            {"Website Relaunch", "Testing", null},
            {null, "Migration", "Testing"},
            {"Testing", null, "Website Relaunch"},
            {null, null, null},
            {null, "Website Relaunch", null}
    };

    @Test
    @DisplayName("Must correctly parse header row with @AnyColumn annotated column headers")
    void mustReadColumnHeadersOK() {
        List<String> testColNames = new ArrayList<>(Arrays.asList(columnNames));
        Xcelite xcelite = new Xcelite(new File("src/test/resources/UPPERCASE.xlsx"));
        XceliteSheet sheet = xcelite.getSheet(0);
        SheetReader<AnyColumnBean> beanReader = sheet.getBeanReader(AnyColumnBean.class);
        Collection<AnyColumnBean> datasets = beanReader.read();
        for (AnyColumnBean row : datasets) {
            List<String> dataColNames = new ArrayList<>(row.getColumns().keySet());
            Assertions.assertEquals(testColNames.size(), dataColNames.size(), "mismatching number of columns");
            Assertions.assertEquals(testColNames, dataColNames, "mismatching columns");
        }
    }

    @Test
    @DisplayName("Must correctly parse data with @AnyColumn annotated column headers")
    @SuppressWarnings("unchecked")
    void mustReadDataOK() {
        Xcelite xcelite = new Xcelite(new File("src/test/resources/UPPERCASE.xlsx"));
        XceliteSheet sheet = xcelite.getSheet(0);
        SheetReader<AnyColumnBean> beanReader = sheet.getBeanReader(AnyColumnBean.class);
        Collection<AnyColumnBean> datasets = beanReader.read();
        int cnt = 0;
        for (AnyColumnBean row : datasets) {
            List<Object> testColNames = new ArrayList<>(Arrays.asList(testData[cnt++]));
            List<Object> dataColNames = new ArrayList(row.getColumns().values());
            Assertions.assertEquals(testColNames.size(), dataColNames.size(), "mismatching number of columns");
            Assertions.assertEquals(testColNames, dataColNames, "mismatching columns");
        }
    }

    @Test
    @DisplayName("Must throw an exception because of multiple @AnyColumn annotations")
    @SuppressWarnings("unchecked")
    void mustThrowOnInvalidBean() {
        Executable testClosure = () -> {
            Xcelite xcelite = new Xcelite(new File("src/test/resources/UPPERCASE.xlsx"));
            XceliteSheet sheet = xcelite.getSheet(0);
            SheetReader<AnyColumnBeanDoneWrong> beanReader = sheet.getBeanReader(AnyColumnBeanDoneWrong.class);
            Collection<AnyColumnBeanDoneWrong> datasets = beanReader.read();
            int cnt = 0;
            for (AnyColumnBeanDoneWrong row : datasets) {
                new ArrayList<>(Arrays.asList(testData[cnt++]));
                new ArrayList(row.getColumns().values());
            }
        };

        assertThrows(XceliteException.class, testClosure, "Should have thrown an exception" +
                " because of multiple @AnyColumn annotations");

    }

    /**
     * When `anyColumnCreatesCollection` from XceliteOptions is `false`, must correctly
     * overwrite fields with @AnyColumn and repeated column headers
     * @since 1.3
     */
    @Test
    @DisplayName("Must correctly overwrite fields with @AnyColumn and repeated column headers")
    @SuppressWarnings("unchecked")
    void mustReadAnyColumnDataOkNoCollections() {
        XceliteOptions options = new XceliteOptions();
        options.setAnyColumnCreatesCollection(false);
        Xcelite xcelite = new Xcelite(new File("src/test/resources/employees.xlsx"));
        xcelite.setOptions(options);
        XceliteSheet sheet = xcelite.getSheet(0);
        SheetReader<AnyColumnEmployeeBean> beanReader = sheet.getBeanReader(AnyColumnEmployeeBean.class);
        Collection<AnyColumnEmployeeBean> datasets = beanReader.read();
        int cnt = 0;
        for (AnyColumnEmployeeBean row : datasets) {
            List<Object> dataColValues = new ArrayList(row.getProjects().values());
            Assertions.assertEquals(1, dataColValues.size(), "mismatching number of columns");
            Assertions.assertEquals(employeeProjects1[cnt], dataColValues.get(0), "mismatching columns");
            cnt++;
        }
    }

    /**
     * When `anyColumnCreatesCollection` from XceliteOptions is `true`, must correctly
     * create Collections for fields with @AnyColumn and repeated column headers
     * @since 1.3
     */
    @Test
    @DisplayName("Must correctly create collections for fields with @AnyColumn and repeated column headers")
    @SuppressWarnings("unchecked")
    void mustReadAnyColumnDataOkWithCollections() {
        XceliteOptions options = new XceliteOptions();
        options.setAnyColumnCreatesCollection(true);
        options.setMissingCellPolicy(MissingCellPolicy.RETURN_BLANK_AS_NULL);
        Xcelite xcelite = new Xcelite(new File("src/test/resources/employees.xlsx"));
        xcelite.setOptions(options);
        XceliteSheet sheet = xcelite.getSheet(0);
        SheetReader<AnyColumnEmployeeBean> beanReader = sheet.getBeanReader(AnyColumnEmployeeBean.class);
        Collection<AnyColumnEmployeeBean> datasets = beanReader.read();
        int cnt = 0;
        for (AnyColumnEmployeeBean row : datasets) {
            List<Object> dataColValues = new ArrayList(row.getProjects().values().iterator().next());
            List<String> testRow = Arrays.asList(employeeProjects2[cnt]);
            Assertions.assertEquals(testRow, dataColValues, "mismatching columns");
            cnt++;
        }
    }
    @Test
    @DisplayName("Must throw an exception because of @AnyColumn annotation on wrong type")
    @SuppressWarnings("unchecked")
    public void mustThrowOnInvalidBean2() {
        Executable testClosure = () -> {
            Xcelite xcelite = new Xcelite(new File("src/test/resources/UPPERCASE.xlsx"));
            XceliteSheet sheet = xcelite.getSheet(0);
            SheetReader<AnyColumnBeanDoneWrongNotUsingMap> beanReader = sheet.getBeanReader(AnyColumnBeanDoneWrongNotUsingMap.class);
            Collection<AnyColumnBeanDoneWrongNotUsingMap> datasets = beanReader.read();
            int cnt = 0;
            for (AnyColumnBeanDoneWrongNotUsingMap row : datasets) {
                new ArrayList<>(Arrays.asList(testData[cnt++]));
                new ArrayList(row.getColumns());
            }
        };

        assertThrows(XceliteException.class, testClosure, "Should have thrown an exception" +
                " because of @AnyColumn annotation on `Set` member");
    }
}


text:
var Cloud = require('ti.cloud');
	Cloud.debug = true;

exports.init = function() {
  	loadNav();
  	Alloy.Globals.toggleAI(false);
  	//TODO: for test
  	loadCurrentUser();
};

function loadNav() {
  	var btnMenu = Alloy.createController('elements/button', {
		icon: { width: Alloy.CFG.size_16, height: Alloy.CFG.size_15, backgroundImage: '/images/nav/btn-menu.png' },
		callback: function() {
		  	Alloy.Globals.SlidingMenu.toggleLeftDrawer();
		}
	}).getView();

  	$.nav.init({
  		title: 'App Settings',
		left: btnMenu,
	});
}

function logout() {
	Alloy.Globals.toggleAI(true);
	// stop tracking location
	Ti.App.fireEvent('location:stopTracking');

	Cloud.Users.logout(function (e) {
		Alloy.Globals.toggleAI(false);

	    if (e.success) {
	    	var fb = require('facebook');
				fb.logout();

			Ti.App.Properties.setString('deviceToken', '');
	    	Ti.App.Properties.setObject('currentUser', false );
	    	Ti.App.currentUser = false;
	    	Alloy.Globals.loggedIn = false;

	        Alloy.Globals.WinManager.load({
	        	url: 'analyzing'
	        });
	    } else {
	        Alloy.Globals.Common.showDialog({
	        	title:		'Logout Error',
	            message:	((e.error && e.message) || JSON.stringify(e))
	        });
	    }
	});
}
//TODO: for test
function loadCurrentUser () {
    if ( Ti.App.currentUser ) {
        var user = Ti.App.currentUser;

        $.name.text     = user.custom_fields['name'];
        $.userId.text   = user.id;
        $.email.text    = user.email;
    }
}


text:
$Title = 'Account Lock Failures'

# Test description: How New-VesterConfig explains this value to the user
$Description = '0 (off) or maximum number of failed logon attempts before the account is locked out'

# The config entry stating the desired values
$Desired = $cfg.host.accountlockfailures

# The test value's data type, to help with conversion: bool/string/int
$Type = 'int'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
    (Get-AdvancedSetting -Entity $Object | Where-Object -FilterScript {
        $_.Name -eq 'Security.AccountLockFailures'
    }).Value
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and $Desired to set the correct value
[ScriptBlock]$Fix = {
    Get-AdvancedSetting -Entity $Object | Where-Object -FilterScript {
            $_.Name -eq 'Security.AccountLockFailures'
        } | Set-AdvancedSetting -Value $Desired -Confirm:$false -ErrorAction Stop
}


text:
import os

from setuptools import setup

root = os.path.abspath(os.path.dirname(__file__))

version = __import__('durations').__version__

setup(
    name='durations',
    version=version,
    license='MIT',

    author='Oleiade',
    author_email='tcrevon@gmail.com',
    url='http://github.com/oleiade/durations',
    keywords='',

    packages=[
        'durations',
    ],
)


text:
package akka.contrib.persistence.mongodb

class RxMongoJournalLoadSpec extends JournalLoadSpec(classOf[RxMongoPersistenceExtension])


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LilyPath.Utility;
using Microsoft.Xna.Framework;

namespace LilyPath
{
    internal abstract class LineCapInfo
    {
        protected readonly float _width;
        protected readonly Vector2[] _xyBuffer;
        protected readonly Vector2[] _uvBuffer;
        protected readonly short[] _indexBuffer;
        protected readonly short[] _outlineBuffer;

        protected LineCapInfo (float width, int vertexCount, int polyCount)
        {
            _width = width;
            _xyBuffer = new Vector2[vertexCount];
            _indexBuffer = new short[polyCount * 3];
            _outlineBuffer = new short[vertexCount];
        }

        protected LineCapInfo (float width, Vector2[] xyBuffer, Vector2[] uvBuffer, short[] indexBuffer, short[] outlineBuffer)
        {
            _width = width;
            _xyBuffer = xyBuffer;
            _uvBuffer = uvBuffer;
            _indexBuffer = indexBuffer;
            _outlineBuffer = outlineBuffer;
        }

        public int VertexCount
        {
            get { return _xyBuffer.Length; }
        }

        public int IndexCount
        {
            get { return _indexBuffer.Length; }
        }

        public void Calculate (Vector2 p, Vector2 edgeAB, PenWorkspace ws, PenAlignment alignment, bool start)
        {
            edgeAB.Normalize();

            // [  eAB.X  -eAB.Y ]
            // [  eAB.Y   eAB.X ]

            float tC = edgeAB.X * _width;
            float tS = edgeAB.Y * _width;

            float tX = p.X;
            float tY = p.Y;

            switch (alignment) {
                case PenAlignment.Center:
                    break;

                case PenAlignment.Inset:
                    if (start) {
                        tX = p.X + (-.5f * tS);
                        tY = p.Y - (-.5f * tC);
                    }
                    else {
                        tX = p.X - (-.5f * tS);
                        tY = p.Y + (-.5f * tC);
                    }
                    break;

                case PenAlignment.Outset:
                    if (start) {
                        tX = p.X + (.5f * tS);
                        tY = p.Y - (.5f * tC);
                    }
                    else {
                        tX = p.X - (.5f * tS);
                        tY = p.Y + (.5f * tC);
                    }
                    break;
            }

            for (int i = 0; i < _xyBuffer.Length; i++)
                ws.XYBuffer[i] = new Vector2(_xyBuffer[i].X * tC - _xyBuffer[i].Y * tS + tX, _xyBuffer[i].X * tS + _xyBuffer[i].Y * tC + tY);

            for (int i = 0; i < _uvBuffer.Length; i++)
                ws.UVBuffer[i] = _uvBuffer[i];

            for (int i = 0; i < _indexBuffer.Length; i++)
                ws.IndexBuffer[i] = _indexBuffer[i];

            for (int i = 0; i < _outlineBuffer.Length; i++)
                ws.OutlineIndexBuffer[i] = _outlineBuffer[i];

            ws.XYBuffer.Index = _xyBuffer.Length;
            ws.UVBuffer.Index = _uvBuffer.Length;
            ws.IndexBuffer.Index = _indexBuffer.Length;
            ws.OutlineIndexBuffer.Index = _outlineBuffer.Length;
        }
    }

    internal class LineCapFlat : LineCapInfo
    {
        private static readonly Vector2[] XYBuffer = new Vector2[] { new Vector2(0, -.5f), new Vector2(0, .5f) };
        private static readonly Vector2[] UVBuffer = new Vector2[] { new Vector2(1, 0), new Vector2(0, 0) };
        private static readonly short[] IndexBuffer = new short[] { };
        private static readonly short[] OutlineBuffer = new short[] { 0, 1 };

        public LineCapFlat (float width)
            : base(width, XYBuffer, UVBuffer, IndexBuffer, OutlineBuffer)
        { }
    }

    internal class LineCapSquare : LineCapInfo
    {
        private static readonly Vector2[] XYBuffer = new Vector2[] { new Vector2(-.5f, -.5f), new Vector2(-.5f, .5f) };
        private static readonly Vector2[] UVBuffer = new Vector2[] { new Vector2(1, 0), new Vector2(0, 0) };
        private static readonly short[] IndexBuffer = new short[] { };
        private static readonly short[] OutlineBuffer = new short[] { 0, 1 };

        public LineCapSquare (float width)
            : base(width, XYBuffer, UVBuffer, IndexBuffer, OutlineBuffer)
        { }
    }

    internal class LineCapTriangle : LineCapInfo
    {
        private static readonly Vector2[] XYBuffer = new Vector2[] { new Vector2(0, -.5f), new Vector2(-.5f, 0), new Vector2(0, .5f) };
        private static readonly Vector2[] UVBuffer = new Vector2[] { new Vector2(1, 0), new Vector2(.5f, 0), new Vector2(0, 0) };
        private static readonly short[] IndexBuffer = new short[] { 2, 1, 0 };
        private static readonly short[] OutlineBuffer = new short[] { 0, 1, 2 };

        public LineCapTriangle (float width)
            : base(width, XYBuffer, UVBuffer, IndexBuffer, OutlineBuffer)
        { }
    }

    internal class LineCapInvTriangle : LineCapInfo
    {
        private static readonly Vector2[] XYBuffer = new Vector2[] { new Vector2(0, -.5f), new Vector2(-.5f, -.5f),
            new Vector2(0, 0), new Vector2(-.5f, .5f), new Vector2(0, .5f) };
        private static readonly Vector2[] UVBuffer = new Vector2[] { new Vector2(1, 0), new Vector2(1, 0),
            new Vector2(.5f, 0), new Vector2(0, 0), new Vector2(0, 0) };
        private static readonly short[] IndexBuffer = new short[] { 4, 3, 2, 2, 1, 0 };
        private static readonly short[] OutlineBuffer = new short[] { 0, 1, 2, 3, 4 };

        public LineCapInvTriangle (float width)
            : base(width, XYBuffer, UVBuffer, IndexBuffer, OutlineBuffer)
        { }
    }

    internal class LineCapArrow : LineCapInfo
    {
        private static readonly Vector2[] XYBuffer = new Vector2[] { new Vector2(1f, -.5f), new Vector2(1f, -.75f),
            new Vector2(-.5f, 0), new Vector2(1f, .75f), new Vector2(1f, .5f) };
        private static readonly Vector2[] UVBuffer = new Vector2[] { new Vector2(1, 0), new Vector2(1, 0),
            new Vector2(.5f, 0), new Vector2(0, 0), new Vector2(0, 0) };
        private static readonly short[] IndexBuffer = new short[] { 0, 2, 1, 4, 2, 0, 3, 2, 4 };
        private static readonly short[] OutlineBuffer = new short[] { 0, 1, 2, 3, 4 };

        public LineCapArrow (float width)
            : base(width, XYBuffer, UVBuffer, IndexBuffer, OutlineBuffer)
        { }
    }
}


text:
* Reduce logging with production debug settings

### 0.13.0 [May 10th, 2018]
* Add new certificates that will work after the current intermediate certs expire later this year
* Add a configuration option to enable custom certificates
* Add the ability to use included node certs, and make it the default (with included certs as a fallback)

### 0.12.4 [March 23rd, 2017]
* Revert to string.match from regex.test.  String.match is available in more environments.

### 0.12.3 [March 21st, 2017]
* Remove some logging that snuck in to production

### 0.12.2 [March 21st, 2017]
* Make metric whitelisting functionality (`metricFiltersInclude`) more efficient in the no-op case

### 0.12.1 [March 21st, 2017]
* Introduce metric whitelist/blacklist via `metricFiltersInclude` and `metricFiltersExclude` options

### 0.11.4 [December 9th, 2016]
* Fix a bug that caused `metricPrefix` to not always be applied.

### 0.11.3 [December 8th, 2016]
* Add `metricPrefix` option, which will be added to all of your metrics (with a "." to seperate them)

### 0.11.2 [March 28th, 2016]
* Add recordCounterRates option for users who wish to ignore .rate metrics on counters

### 0.11.1 [June 24th, 2015]
* Send reporting host information in transport greeting
* Better buffered data handling

### 0.11.0 [June 2nd, 2015]
* Add support for encrypted transport (TLS)
* Transition ownership to Expected Behavior


text:
/* ###################################################################
**     Filename    : Events.h
**     Project     : MC9S08LL64
**     Processor   : MC9S08LL64CLK
**     Component   : Events
**     Version     : Driver 01.02
**     Compiler    : CodeWarrior HCS08 C Compiler
**     Date/Time   : 2015-03-27, 22:24, # CodeGen: 0
**     Abstract    :
**         This is user's event module.
**         Put your event handler code here.
**     Settings    :
**     Contents    :
**         No public methods
**
** ###################################################################*/
/*!
** @file Events.h
** @version 01.02
** @brief
**         This is user's event module.
**         Put your event handler code here.
*/
/*!
**  @addtogroup Events_module Events module documentation
**  @{
*/

#ifndef __Events_H
#define __Events_H
/* MODULE Events */

#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include "PE_Timer.h"
#include "LED1.h"
#include "LED2.h"
#include "LED3.h"
#include "MyTimer.h"

void MyTimerInterrupt(void);
/*
** ===================================================================
**     Event       :  MyTimerInterrupt (module Events)
**
**     Component   :  MyTimer [TimerInt]
**     Description :
**         When a timer interrupt occurs this event is called (only
**         when the component is enabled - <Enable> and the events are
**         enabled - <EnableEvent>). This event is enabled only if a
**         <interrupt service/event> is enabled.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/

/* END Events */
#endif /* __Events_H*/

/*!
** @}
*/
/*
** ###################################################################
**
**     This file was created by Processor Expert 10.3 [05.09]
**     for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/


text:
package com.leetcode.algorithms.problem2;

public class ListNode {
    int val;
    ListNode next;

    ListNode(int x) {
        val = x;
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>reglang: Error</title>
    <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
    <link href="../../../../../bootstrap.min.css" rel="stylesheet">
    <link href="../../../../../bootstrap-custom.css" rel="stylesheet">
    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

             Coq bench

clean / released

8.7.1+1 / reglang - 1

            « Up

              reglang

                1
                Error

 (2020-02-23 18:19:53 UTC)

Context

# Packages matching: installed
# Name              # Installed # Synopsis
base-bigarray       base
base-threads        base
base-unix           base
camlp5              7.11        Preprocessor-pretty-printer of OCaml
conf-findutils      1           Virtual package relying on findutils
conf-m4             1           Virtual package relying on m4
coq                 8.7.1+1     Formal proof management system.
num                 1.3         The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml               4.06.1      The OCaml compiler (virtual package)
ocaml-base-compiler 4.06.1      Official 4.06.1 release
ocaml-config        1           OCaml Switch Configuration
ocamlfind           1.8.1       A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Christian Doczkal <christian.doczkal@ens-lyon.fr>"
homepage: "https://github.com/chdoc/coq-reglang"
dev-repo: "git+https://github.com/chdoc/coq-reglang.git"
bug-reports: "https://github.com/chdoc/coq-reglang/issues"
license: "CeCILL-B"
build: [make "-j%{jobs}%" "-C" "theories"]
install: [make "-C" "theories" "install"]
depends: [
  "coq" {>= "8.6" & < "8.10~"}
  "coq-mathcomp-ssreflect" {>= "1.6" & < "1.8~"}
]
tags: [
  "keyword:regular languages"
  "keyword:regular expressions"
  "keyword:finite automata"
  "keyword:two-way automata"
  "keyword:monadic second-order logic"
  "category:Computer Science/Formal Languages Theory and Automata"
  "logpath:RegLang"
  "date:2018-09-18"
]
authors: [
  "Christian Doczkal <christian.doczkal@ens-lyon.fr>"
  "Gert Smolka"
]
synopsis:
  "Regular Language Representations in the Constructive Type Theory of Coq"
description: """
We verify translations between different representations of regular
languages: various forms of automata (deterministic, nondeterministic,
one-way, two-way), regular expressions, and the logic WS1S. We also
show various decidability results and closure properties."""
url {
  src: "https://github.com/chdoc/coq-reglang/archive/v1.0.tar.gz"
  checksum: "md5=3e4be5fe3ab7bbaaa73016d5e81a8193"
}

Lint

Command

true

Return code

0

Dry install

Dry install with the current Coq version:

Command

opam install -y --show-action coq-reglang.1 coq.8.7.1+1

Return code

0

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

Command

true

Return code

0

Install dependencies

Command

opam list; echo; ulimit -Sv 4000000; timeout 2h opam install -y --deps-only coq-reglang.1 coq.8.7.1+1

Return code

0

Duration

1 m 16 s

Install

Command

opam list; echo; ulimit -Sv 16000000; timeout 2h opam install -y -v coq-reglang.1 coq.8.7.1+1

Return code

10240

Duration

7 s

Output

# Packages matching: installed
# Name                 # Installed # Synopsis
base-bigarray          base
base-threads           base
base-unix              base
camlp5                 7.11        Preprocessor-pretty-printer of OCaml
conf-findutils         1           Virtual package relying on findutils
conf-m4                1           Virtual package relying on m4
coq                    8.7.1+1     Formal proof management system.
coq-mathcomp-ssreflect 1.7.0       The Mathematical Components library
num                    1.3         The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml                  4.06.1      The OCaml compiler (virtual package)
ocaml-base-compiler    4.06.1      Official 4.06.1 release
ocaml-config           1           OCaml Switch Configuration
ocamlfind              1.8.1       A library manager for OCaml
[NOTE] Package coq is already installed (current version is 8.7.1+1).
The following actions will be performed:
  - install coq-reglang 1
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Processing  1/1: [coq-reglang.1: http]
[ERROR] The sources of the following couldn't be obtained, aborting:
          - coq-reglang.1:
            https://github.com/chdoc/coq-reglang/archive/v1.0.tar.gz (Bad checksum, expected md5=3e4be5fe3ab7bbaaa73016d5e81a8193)
'opam install -y -v coq-reglang.1 coq.8.7.1+1' failed.

Installation size

No files were installed.

Uninstall

Command

true

Return code

0

Missing removes

                none

Wrong removes

                none

          Sources are on GitHub. © Guillaume Claret.


text:
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using StructureMap.Configuration.DSL.Expressions;
using StructureMap.Graph;
using StructureMap.Pipeline;

namespace StructureMap
{
    internal static class HelperExtensions
    {
        public static bool IsGenericEnumerable(this Type type)
        {
            return type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>);
        }

        public static GenericFamilyExpression LifecycleIs(this GenericFamilyExpression instance, ServiceLifetime lifetime)
        {
            switch (lifetime)
            {
                case ServiceLifetime.Singleton:
                    return instance.LifecycleIs(Lifecycles.Singleton);
                case ServiceLifetime.Scoped:
                    return instance.LifecycleIs(Lifecycles.Container);
                case ServiceLifetime.Transient:
                    return instance.LifecycleIs(Lifecycles.Unique);
                default:
                    throw new ArgumentOutOfRangeException(nameof(lifetime), lifetime, null);
            }
        }

        public static bool HasFamily<TPlugin>(this PluginGraph graph)
        {
            return graph.HasFamily(typeof(TPlugin));
        }
    }
}


text:
/* @flow */

import React from 'react';
import router from 'utils/router';
import AppBar from 'material-ui/AppBar';
import FlatButton from 'material-ui/FlatButton';
import ExitIcon from 'material-ui/svg-icons/action/exit-to-app';
import Drawer from 'material-ui/Drawer';
import Menu from 'material-ui/Menu';
import MenuItem from 'material-ui/MenuItem';
import { t } from 'i18n';

const links = {
  login: () => router.push('/auth/login'),
  register: () => router.push('/auth/register'),
  account: () => router.push('/account'),
  about: () => router.push('/about'),
  help: () => router.push('/help'),
};

const NotLoggedIn = ({ ...props }) => (
  <div>
    <FlatButton {...props} onTouchTap={links.login} label={t('auth.form.loginBtn')} />
    <FlatButton {...props} onTouchTap={links.register} label={t('auth.form.registerBtn')} />
  </div>
);
NotLoggedIn.muiName = 'FlatButton';

const LoggedIn = ({ ...buttonProps }) => {
  const { logout, ...props } = buttonProps;
  return (
    <FlatButton
      {...props}
      label={t('auth.form.logoutBtn')}
      onTouchTap={logout}
      icon={<ExitIcon />}
    />
  );
};
LoggedIn.muiName = 'FlatButton';

const LoggedInMenuItems = [
  <MenuItem key="account" onTouchTap={links.account}>{t('pageAccount')}</MenuItem>,
];

type Props = {
  isLoggedIn: bool,
  logout: Function,
};

class Header extends React.Component {
  props: Props;
  state: {
    drawer: bool,
  } = {
    drawer: false,
  }

  goToMain = () => {
    // if not logged
    router.push('/');
  }

  showDrawer = () => {
    this.setState({ drawer: true });
  }

  hideDrawer = () => {
    this.setState({ drawer: false });
  }

  render() {
    return (
      <AppBar
        title={t('appName')}
        iconElementRight={
          this.props.isLoggedIn ? <LoggedIn logout={this.props.logout} /> : <NotLoggedIn />
        }
        onLeftIconButtonTouchTap={this.showDrawer}
        onTitleTouchTap={this.goToMain}
        style={styles.container}
        titleStyle={{ cursor: 'pointer', flex: '0 1 auto' }}
      >
        <Drawer
          open={this.state.drawer}
          docked={false}
          onRequestChange={this.hideDrawer}
        >
          <Menu>
            {this.props.isLoggedIn ? LoggedInMenuItems : null}
            <MenuItem onTouchTap={links.about}>{t('pageAbout')}</MenuItem>
            <MenuItem onTouchTap={links.help}>{t('pageHelp')}</MenuItem>
          </Menu>
        </Drawer>
      </AppBar>
    );
  }
}

const styles = {
  container: {
    flexShrink: '0',
  },
};

export default Header;


text:
var express = require('express')
var bodyParser = require('body-parser')
var MC = require('mongo-control')

var databaseUri = 'mongodb://localhost:27017/test'; // don't forget to change when copy-paste

var router = express.Router()

router.use(bodyParser.urlencoded({extended: false}))
router.use(bodyParser.json())

var i = 0
var helperNames = Object.keys(MC)
var l = helperNames.length

;(function iter () {
  var funcName = helperNames[i]
  var func = MC[funcName]
  var route = '/' + funcName.toLowerCase()

  router.post(route, function (req, res) {
    var params = req.body || {}
    params.db = databaseUri

    func(params).then(function (r) {
      res.json(r)
    }).catch(function (e) {
      res.json(e)
    })
  })

  i++
  if (i < l) iter()
})()

module.exports = router


text:
package com.asakusafw.yaess.flowlog;

import static com.asakusafw.yaess.flowlog.FlowLoggerProfile.*;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import com.asakusafw.yaess.core.ProfileContext;
import com.asakusafw.yaess.core.ServiceProfile;
import com.asakusafw.yaess.core.VariableResolver;

/**
 * Test for {@link FlowLoggerProfile}.
 */
public class FlowLoggerProfileTest {

    /**
     * Temporary folder.
     */
    @Rule
    public final TemporaryFolder folder = new TemporaryFolder();

    /**
     * Converts simple profile.
     * @throws Exception if failed
     */
    @Test
    public void convert() throws Exception {
        Map<String, String> conf = map(KEY_DIRECTORY, folder.getRoot().getAbsolutePath());
        Map<String, String> vars = map();
        ServiceProfile<FlowLoggerProvider> sp = profile(conf, vars);
        FlowLoggerProfile profile = FlowLoggerProfile.convert(sp);

        assertThat(profile.getDirectory().getCanonicalFile(), is(folder.getRoot().getCanonicalFile()));
        assertThat(profile.getEncoding(), is(Charset.forName(DEFAULT_ENCODING)));
        assertThat(profile.getDateFormat(), is((DateFormat) new SimpleDateFormat(DEFAULT_DATE_FORMAT)));
        assertThat(profile.getStepUnit(), closeTo(Double.parseDouble(DEFAULT_STEP_UNIT), 0.00001));
        assertThat(profile.isReportJob(), is(Boolean.parseBoolean(DEFAULT_REPORT_JOB)));
        assertThat(profile.isDeleteOnSetup(), is(Boolean.parseBoolean(DEFAULT_DELETE_ON_SETUP)));
        assertThat(profile.isDeleteOnCleanup(), is(Boolean.parseBoolean(DEFAULT_DELETE_ON_CLEANUP)));
    }

    /**
     * Converts full profile.
     * @throws Exception if failed
     */
    @Test
    public void convert_all() throws Exception {
        Map<String, String> conf = map(
                KEY_DIRECTORY, folder.getRoot().getAbsolutePath(),
                KEY_ENCODING, "ASCII",
                KEY_DATE_FORMAT, "yyyy",
                KEY_STEP_UNIT, "0.50",
                KEY_REPORT_JOB, "false",
                KEY_DELETE_ON_SETUP, "false",
                KEY_DELETE_ON_CLEANUP, "false");
        Map<String, String> vars = map();
        ServiceProfile<FlowLoggerProvider> sp = profile(conf, vars);
        FlowLoggerProfile profile = FlowLoggerProfile.convert(sp);

        assertThat(profile.getDirectory().getCanonicalFile(), is(folder.getRoot().getCanonicalFile()));
        assertThat(profile.getEncoding(), is(Charset.forName("ASCII")));
        assertThat(profile.getDateFormat(), is((DateFormat) new SimpleDateFormat("yyyy")));
        assertThat(profile.getStepUnit(), closeTo(Double.parseDouble("0.50"), 0.00001));
        assertThat(profile.isReportJob(), is(Boolean.parseBoolean("false")));
        assertThat(profile.isDeleteOnSetup(), is(Boolean.parseBoolean("false")));
        assertThat(profile.isDeleteOnCleanup(), is(Boolean.parseBoolean("false")));
    }

    /**
     * Converts parameterized profile.
     * @throws Exception if failed
     */
    @Test
    public void convert_param() throws Exception {
        Map<String, String> conf = map(
                KEY_DIRECTORY, "${dir}",
                KEY_ENCODING, "${enc}");
        Map<String, String> vars = map(
                "dir", folder.getRoot().getAbsolutePath(),
                "enc", "ASCII");
        ServiceProfile<FlowLoggerProvider> sp = profile(conf, vars);
        FlowLoggerProfile profile = FlowLoggerProfile.convert(sp);

        assertThat(profile.getDirectory().getCanonicalFile(), is(folder.getRoot().getCanonicalFile()));
        assertThat(profile.getEncoding(), is(Charset.forName("ASCII")));
    }

    /**
     * Converts empty profile.
     */
    @Test(expected = IllegalArgumentException.class)
    public void convert_empty() {
        Map<String, String> conf = map();
        Map<String, String> vars = map();
        ServiceProfile<FlowLoggerProvider> sp = profile(conf, vars);
        FlowLoggerProfile.convert(sp);
    }

    ServiceProfile<FlowLoggerProvider> profile(Map<String, String> conf, Map<String, String> vars) {
        ServiceProfile<FlowLoggerProvider> profile = new ServiceProfile<>(
                "testing",
                FlowLoggerProvider.class,
                conf,
                new ProfileContext(getClass().getClassLoader(), new VariableResolver(vars)));
        return profile;
    }

    private Map<String, String> map(String... keyValuePairs) {
        assert keyValuePairs.length % 2 == 0;
        Map<String, String> results = new HashMap<>();
        for (int i = 0; i < keyValuePairs.length; i += 2) {
            results.put(keyValuePairs[i + 0], keyValuePairs[i + 1]);
        }
        return results;
    }
}


text:
NTL_OPEN_NNS

class FileList {
private:
   Vec< Vec<char> > data;

   FileList(const FileList&); // disable
   void operator=(const FileList&); // disable

public:
   FileList() { }
   void AddFile(const char *name);
   void RemoveLast();

   ~FileList();

};

void OpenWrite(NTL_SNS ofstream& s, const char *name);
// opens file for writing...aborts if fails

void OpenWrite(NTL_SNS ofstream& s, const char *name, FileList& flist);
// opens file for writing and adds name to flist

void OpenRead(NTL_SNS ifstream& s, const char *name);
// opens file for reading

void CloseWrite(NTL_SNS ofstream& s);
// closes s, checks for failure

const char *FileName(const char* stem, long d);
// builds the name from stem-DDDDD, returns pointer to buffer

const NTL_SNS string& UniqueID();
// ideally, a unique ID (across all processes and threads),
// but it may not be perfect (useful for generating unique
// file names and seeding PRG).

NTL_CLOSE_NNS

#endif


text:
/**
 * This file is part of Support Bot.
 *
 *     Foobar is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     Foobar is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.telegram.api.update;

import org.telegram.api.peer.TLAbsPeer;
import org.telegram.tl.StreamingUtils;
import org.telegram.tl.TLBytes;
import org.telegram.tl.TLContext;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * The type TL update channel group
 */
public class TLUpdateBotCallbackQuery extends TLAbsUpdate {
    /**
     * The constant CLASS_ID.
     */
    public static final int CLASS_ID = 0xe73547e1;

    private static final int FLAG_DATA    = 0x00000001; // 0
    private static final int FLAG_GAMEID  = 0x00000002; // 1

    private int flags;
    private long queryId;
    private int userId;
    private TLAbsPeer peer;
    private int msgId;
    private long chatInstance;
    private TLBytes data;
    private String gameShortName;

    /**
     * Instantiates a new TL update channel group
     */
    public TLUpdateBotCallbackQuery() {
        super();
    }

    public int getClassId() {
        return CLASS_ID;
    }

    public long getQueryId() {
        return queryId;
    }

    public int getUserId() {
        return userId;
    }

    public TLAbsPeer getPeer() {
        return peer;
    }

    public int getMsgId() {
        return msgId;
    }

    public TLBytes getData() {
        return data;
    }

    public long getChatInstance() {
        return chatInstance;
    }

    public String getGameShortName() {
        return gameShortName;
    }

    public void serializeBody(OutputStream stream)
            throws IOException {
        StreamingUtils.writeInt(flags, stream);
        StreamingUtils.writeLong(this.queryId, stream);
        StreamingUtils.writeInt(this.userId, stream);
        StreamingUtils.writeTLObject(this.peer, stream);
        StreamingUtils.writeInt(msgId, stream);
        StreamingUtils.writeLong(chatInstance, stream);
        if ((flags & FLAG_DATA) != 0) {
            StreamingUtils.writeTLBytes(data, stream);
        }
        if ((flags & FLAG_GAMEID) != 0) {
            StreamingUtils.writeTLString(gameShortName, stream);
        }
    }

    public void deserializeBody(InputStream stream, TLContext context)
            throws IOException {
        flags = StreamingUtils.readInt(stream);
        this.queryId = StreamingUtils.readLong(stream);
        this.userId = StreamingUtils.readInt(stream);
        this.peer = (TLAbsPeer) StreamingUtils.readTLObject(stream, context);
        this.msgId = StreamingUtils.readInt(stream);
        this.chatInstance = StreamingUtils.readLong(stream);
        if ((flags & FLAG_DATA) != 0) {
            data = StreamingUtils.readTLBytes(stream, context);
        }
        if ((flags & FLAG_GAMEID) != 0) {
            gameShortName = StreamingUtils.readTLString(stream);
        }
    }

    public String toString() {
        return "updateBotCallbackQuery#e73547e1";
    }
}


text:
#region Foreign-License

#endregion
using System;
using System.IO;
namespace Tcl.Lang
{

    /// <summary> This class implements the built-in "flush" command in Tcl.</summary>

    class FlushCmd : ICommand
    {

        /// <summary> This procedure is invoked to process the "flush" Tcl command.
        /// See the user documentation for details on what it does.
        ///
        /// </summary>
        /// <param name="interp">the current interpreter.
        /// </param>
        /// <param name="argv">command arguments.
        /// </param>

        public TCL.CompletionCode CmdProc(Interp interp, TclObject[] argv)
        {

            Channel chan; /* The channel being operated on this method */

            if (argv.Length != 2)
            {
                throw new TclNumArgsException(interp, 1, argv, "channelId");
            }

            chan = TclIO.getChannel(interp, argv[1].ToString());
            if (chan == null)
            {

                throw new TclException(interp, "can not find channel named \"" + argv[1].ToString() + "\"");
            }

            try
            {
                chan.Flush(interp);
            }
            catch (IOException e)
            {
                throw new TclRuntimeError("FlushCmd.cmdProc() Error: IOException when flushing " + chan.ChanName);
            }
            return TCL.CompletionCode.RETURN;
        }
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Aptroot & Umaña, Chaves & Trest, J. Hattori bot. Lab. 100: 618 (2006)

#### Original name
Aciculopsora salmonea Aptroot & Trest

### Remarks
null


text:
package com.github.wz2cool.dynamic.model;

import javax.persistence.Column;
import javax.persistence.Table;

@Table(name = "bug")
public class Bug {
    @Column(name = "id")
    private Integer id;
    @Column(name = "title")
    private String title;
    @Column(name = "assignTo")
    private String assignTo;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAssignTo() {
        return assignTo;
    }

    public void setAssignTo(String assignTo) {
        this.assignTo = assignTo;
    }
}