text:
(function($, undefined) {
    /**
     * @name kendo.fx
     * @namespace This object contains the fx library that is used by all widgets using animation.
     * If this file is not included, all animations will be disabled but the basic functionality preserved.
     */
    var kendo = window.kendo,
        fx = kendo.fx,
        each = $.each,
        extend = $.extend,
        proxy = $.proxy,
        size = kendo.size,
        support = kendo.support,
        browser = support.browser,
        transforms = support.transforms,
        transitions = support.transitions,
        scaleProperties = { scale: 0, scalex: 0, scaley: 0, scale3d: 0 },
        translateProperties = { translate: 0, translatex: 0, translatey: 0, translate3d: 0 },
        hasZoom = (typeof document.documentElement.style.zoom !== "undefined") && !transforms,
        matrix3dRegExp = /matrix3?d?\s*\(.*,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?/i,
        cssParamsRegExp = /^(-?[\d\.\-]+)?[\w\s]*,?\s*(-?[\d\.\-]+)?[\w\s]*/i,
        translateXRegExp = /translatex?$/i,
        oldEffectsRegExp = /(zoom|fade|expand)(\w+)/,
        singleEffectRegExp = /(zoom|fade|expand)/,
        unitRegExp = /[xy]$/i,
        transformProps = ["perspective", "rotate", "rotatex", "rotatey", "rotatez", "rotate3d", "scale", "scalex", "scaley", "scalez", "scale3d", "skew", "skewx", "skewy", "translate", "translatex", "translatey", "translatez", "translate3d", "matrix", "matrix3d"],
        transform2d = ["rotate", "scale", "scalex", "scaley", "skew", "skewx", "skewy", "translate", "translatex", "translatey", "matrix"],
        transform2units = { "rotate": "deg", scale: "", skew: "px", translate: "px" },
        cssPrefix = transforms.css,
        round = Math.round,
        BLANK = "",
        PX = "px",
        NONE = "none",
        AUTO = "auto",
        WIDTH = "width",
        HEIGHT = "height",
        HIDDEN = "hidden",
        ORIGIN = "origin",
        ABORT_ID = "abortId",
        OVERFLOW = "overflow",
        TRANSLATE = "translate",
        TRANSITION = cssPrefix + "transition",
        TRANSFORM = cssPrefix + "transform",
        PERSPECTIVE = cssPrefix + "perspective",
        BACKFACE = cssPrefix + "backface-visibility";

    kendo.directions = {
        left: {
            reverse: "right",
            property: "left",
            transition: "translatex",
            vertical: false,
            modifier: -1
        },
        right: {
            reverse: "left",
            property: "left",
            transition: "translatex",
            vertical: false,
            modifier: 1
        },
        down: {
            reverse: "up",
            property: "top",
            transition: "translatey",
            vertical: true,
            modifier: 1
        },
        up: {
            reverse: "down",
            property: "top",
            transition: "translatey",
            vertical: true,
            modifier: -1
        },
        top: {
            reverse: "bottom"
        },
        bottom: {
            reverse: "top"
        },
        "in": {
            reverse: "out",
            modifier: -1
        },
        out: {
            reverse: "in",
            modifier: 1
        }
    };

    extend($.fn, {
        kendoStop: function(clearQueue, gotoEnd) {
            if (transitions) {
                return kendo.fx.stopQueue(this, clearQueue || false, gotoEnd || false);
            } else {
                return this.stop(clearQueue, gotoEnd);
            }
        }
    });

    /* jQuery support for all transform animations (FF 3.5/3.6, Opera 10.x, IE9 */

    if (transforms && !transitions) {
        each(transform2d, function(idx, value) {
            $.fn[value] = function(val) {
                if (typeof val == "undefined") {
                    return animationProperty(this, value);
                } else {
                    var that = $(this)[0],
                        transformValue = value + "(" + val + transform2units[value.replace(unitRegExp, "")] + ")";

                    if (that.style.cssText.indexOf(TRANSFORM) == -1) {
                        $(this).css(TRANSFORM, transformValue);
                    } else {
                        that.style.cssText = that.style.cssText.replace(new RegExp(value + "\\(.*?\\)", "i"), transformValue);
                    }
                }
                return this;
            };

            $.fx.step[value] = function (fx) {
                $(fx.elem)[value](fx.now);
            };
        });

        var curProxy = $.fx.prototype.cur;
        $.fx.prototype.cur = function () {
            if (transform2d.indexOf(this.prop) != -1) {
                return parseFloat($(this.elem)[this.prop]());
            }

            return curProxy.apply(this, arguments);
        };
    }

    kendo.toggleClass = function(element, classes, options, add) {
        if (classes) {
            classes = classes.split(" ");

            if (transitions) {
                options = extend({
                    exclusive: "all",
                    duration: 400,
                    ease: "ease-out"
                }, options);

                element.css(TRANSITION, options.exclusive + " " + options.duration + "ms " + options.ease);
                setTimeout(function() {
                    element.css(TRANSITION, "").css(HEIGHT);
                }, options.duration); // TODO: this should fire a kendoAnimate session instead.
            }

            each(classes, function(idx, value) {
                element.toggleClass(value, add);
            });
        }

        return element;
    };

    kendo.parseEffects = function(input, mirror) {
        var effects = {};

        if (typeof input === "string") {
            each(input.split(" "), function(idx, value) {
                var redirectedEffect = !singleEffectRegExp.test(value),
                    resolved = value.replace(oldEffectsRegExp, function(match, $1, $2) {
                        return $1 + ":" + $2.toLowerCase();
                    }), // Support for old zoomIn/fadeOut style, now deprecated.
                    effect = resolved.split(":"),
                    direction = effect[1],
                    effectBody = {};

                if (effect.length > 1) {
                    effectBody.direction = (mirror && redirectedEffect ? kendo.directions[direction].reverse : direction);
                }

                effects[effect[0]] = effectBody;
            });
        } else {
            each(input, function(idx) {
                var direction = this.direction;

                if (direction && mirror && !singleEffectRegExp.test(idx)) {
                    this.direction = kendo.directions[direction].reverse;
                }

                effects[idx] = this;
            });
        }

        return effects;
    };

    function parseInteger(value) {
        return parseInt(value, 10);
    }

    function parseCSS(element, property) {
        return parseInteger(element.css(property));
    }

    function slideToSlideIn(options) {
      options.effects.slideIn = options.effects.slide;
      delete options.effects.slide;
      delete options.complete;
      return options;
    }

    function parseTransitionEffects(options) {
        var effects = options.effects,
            mirror;

        if (effects === "zoom") {
            effects = "zoomIn fadeIn";
        }
        if (effects === "slide") {
            effects = "slide:left";
        }
        if (effects === "fade") {
            effects = "fadeIn";
        }
        if (effects === "overlay") {
            effects = "slideIn:left";
        }
        if (/^overlay:(.+)$/.test(effects)) {
            effects = "slideIn:" + RegExp.$1;
        }

        mirror = options.reverse && /^(slide:)/.test(effects);

        if (mirror) {
            delete options.reverse;
        }

        options.effects = $.extend(kendo.parseEffects(effects, mirror), {show: true});

        return options;
    }

    function keys(obj) {
        var acc = [];
        for (var propertyName in obj) {
            acc.push(propertyName);
        }
        return acc;
    }

    function stopTransition(element, transition) {
        if (element.data(ABORT_ID)) {
            clearTimeout(element.data(ABORT_ID));
            element.removeData(ABORT_ID);
        }

        element.css(TRANSITION, "").css(TRANSITION);
        element.dequeue();
        transition.complete.call(element);
    }

    function activateTask(currentTransition) {
        var element = currentTransition.object, delay = 0;

        if (!currentTransition) {
            return;
        }

        element.css(currentTransition.setup).css(TRANSITION);
        element.css(currentTransition.CSS).css(TRANSFORM);

        if (browser.mozilla) {
            element.one(transitions.event, function () { stopTransition(element, currentTransition); } );
            delay = 50;
        }
        element.data(ABORT_ID, setTimeout(stopTransition, currentTransition.duration + delay, element, currentTransition));
    }

    function strip3DTransforms(properties) {
        for (var key in properties) {
            if (transformProps.indexOf(key) != -1 && transform2d.indexOf(key) == -1) {
                delete properties[key];
            }
        }

        return properties;
    }

    function evaluateCSS(element, properties, options) {
        var key, value;

        for (key in properties) {
            if ($.isFunction(properties[key])) {
                value = properties[key](element, options);
                if (value !== undefined) {
                    properties[key] = value;
                } else {
                    delete properties[key];
                }
            }

        }

        return properties;
    }

    function normalizeCSS(element, properties, options) {
        var transformation = [], cssValues = {}, lowerKey, key, value, exitValue, isTransformed;

        for (key in properties) {
            lowerKey = key.toLowerCase();
            isTransformed = transforms && transformProps.indexOf(lowerKey) != -1;

            if (!support.hasHW3D && isTransformed && transform2d.indexOf(lowerKey) == -1) {
                delete properties[key];
            } else {
                exitValue = false;

                if ($.isFunction(properties[key])) {
                    value = properties[key](element, options);
                    if (value !== undefined) {
                        exitValue = value;
                    }
                } else {
                    exitValue = properties[key];
                }

                if (exitValue !== false) {
                    if (isTransformed) {
                        transformation.push(key + "(" + exitValue + ")");
                    } else {
                        cssValues[key] = exitValue;
                    }
                }
            }
        }

        if (transformation.length) {
            cssValues[TRANSFORM] = transformation.join(" ");
        }

        return cssValues;
    }

    if (transitions) {

        extend(kendo.fx, {
            transition: function(element, properties, options) {

                options = extend({
                        duration: 200,
                        ease: "ease-out",
                        complete: null,
                        exclusive: "all"
                    },
                    options
                );

                options.duration = $.fx ? $.fx.speeds[options.duration] || options.duration : options.duration;

                var css = normalizeCSS(element, properties, options),
                    currentTask = {
                        keys: keys(css),
                        CSS: css,
                        object: element,
                        setup: {},
                        duration: options.duration,
                        complete: options.complete
                    };
                currentTask.setup[TRANSITION] = options.exclusive + " " + options.duration + "ms " + options.ease;

                var oldKeys = element.data("keys") || [];
                $.merge(oldKeys, currentTask.keys);
                element.data("keys", $.unique(oldKeys));

                activateTask(currentTask);
            },

            stopQueue: function(element, clearQueue, gotoEnd) {

                if (element.data(ABORT_ID)) {
                    clearTimeout(element.data(ABORT_ID));
                    element.removeData(ABORT_ID);
                }

                var that = this, cssValues,
                    taskKeys = element.data("keys"),
                    retainPosition = (gotoEnd === false && taskKeys);

                if (retainPosition) {
                    cssValues = kendo.getComputedStyles(element[0], taskKeys);
                }

                element.css(TRANSITION, "").css(TRANSITION);

                if (retainPosition) {
                    element.css(cssValues);
                }

                element.removeData("keys");

                if (that.complete) {
                    that.complete.call(element);
                }

                element.stop(clearQueue);
                return element;
            }

        });
    }

    function animationProperty(element, property) {
        if (transforms) {
            var transform = element.css(TRANSFORM);
            if (transform == NONE) {
                return property == "scale" ? 1 : 0;
            }

            var match = transform.match(new RegExp(property + "\\s*\\(([\\d\\w\\.]+)")),
                computed = 0;

            if (match) {
                computed = parseInteger(match[1]);
            } else {
                match = transform.match(matrix3dRegExp) || [0, 0, 0, 0, 0];
                property = property.toLowerCase();

                if (translateXRegExp.test(property)) {
                    computed = parseFloat(match[3] / match[2]);
                } else if (property == "translatey") {
                    computed = parseFloat(match[4] / match[2]);
                } else if (property == "scale") {
                    computed = parseFloat(match[2]);
                } else if (property == "rotate") {
                    computed = parseFloat(Math.atan2(match[2], match[1]));
                }
            }

            return computed;
        } else {
            return parseFloat(element.css(property));
        }
    }

    function initDirection (element, direction, reverse) {
        var real = kendo.directions[direction],
            dir = reverse ? kendo.directions[real.reverse] : real;

        return { direction: dir, offset: -dir.modifier * (dir.vertical ? element.outerHeight() : element.outerWidth()) };
    }

    kendo.fx.promise = function(element, options) {
        var promises = [], effects;

        effects = kendo.parseEffects(options.effects);
        options.effects = effects;

        element.data("animating", true);

        var props = { keep: [], restore: [] }, css = {}, target,
            methods = { setup: [], teardown: [] }, properties = {},

            // create a promise for each effect
            promise = $.Deferred(function(deferred) {
                if (size(effects)) {
                    var opts = extend({}, options, { complete: deferred.resolve });

                    each(effects, function(effectName, settings) {
                        var effect = kendo.fx[effectName];

                        if (effect) {
                            var dir = kendo.directions[settings.direction];
                            if (settings.direction && dir) {
                                settings.direction = (options.reverse ? dir.reverse : settings.direction);
                            }

                            opts = extend(true, opts, settings);

                            each(methods, function (idx) {
                                if (effect[idx]) {
                                    methods[idx].push(effect[idx]);
                                }
                            });

                            each(props, function(idx) {
                                if (effect[idx]) {
                                    $.merge(props[idx], effect[idx]);
                                }
                            });

                            if (effect.css) {
                                css = extend(css, effect.css);
                            }
                        }
                    });

                    if (methods.setup.length) {
                        each ($.unique(props.keep), function(idx, value) {
                            if (!element.data(value)) {
                                element.data(value, element.css(value));
                            }
                        });

                        if (options.show) {
                            css = extend(css, { display: element.data("olddisplay") || "block" }); // Add show to the set
                        }

                        if (transforms && !options.reset) {
                            css = evaluateCSS(element, css, opts);

                            target = element.data("targetTransform");

                            if (target) {
                                css = extend(target, css);
                            }
                        }
                        css = normalizeCSS(element, css, opts);

                        if (transforms && !transitions) {
                            css = strip3DTransforms(css);
                        }

                        element.css(css)
                               .css(TRANSFORM); // Nudge

                        each (methods.setup, function() { properties = extend(properties, this(element, opts)); });

                        if (kendo.fx.animate) {
                            options.init();
                            element.data("targetTransform", properties);
                            kendo.fx.animate(element, properties, opts);
                        }

                        return;
                    }
                } else if (options.show) {
                    element.css({ display: element.data("olddisplay") || "block" }).css("display");
                    options.init();
                }

                deferred.resolve();
            }).promise();

        promises.push(promise);

        //wait for all effects to complete
        $.when.apply(null, promises).then(function() {
            element
                .removeData("animating")
                .dequeue(); // call next animation from the queue

            if (options.hide) {
                element.data("olddisplay", element.css("display")).hide();
            }

            if (size(effects)) {
                var restore = function() {
                    each ($.unique(props.restore), function(idx, value) {
                        element.css(value, element.data(value));
                    });
                };

                restore();
                if (hasZoom && !transforms) {
                    setTimeout(restore, 0); // Again jQuery callback in IE8-.
                }

                each(methods.teardown, function() { this(element, options); }); // call the internal completion callbacks
            }

            if (options.completeCallback) {
                options.completeCallback(element); // call the external complete callback with the element
            }
        });
    };

    kendo.fx.transitionPromise = function(element, destination, options) {
        kendo.fx.animateTo(element, destination, options);
        return element;
    };

    extend(kendo.fx, {
        animate: function(elements, properties, options) {
            var useTransition = options.transition !== false;
            delete options.transition;

            if (transitions && "transition" in fx && useTransition) {
                fx.transition(elements, properties, options);
            } else {
                if (transforms) {
                    elements.animate(strip3DTransforms(properties), { queue: false, show: false, hide: false, duration: options.duration, complete: options.complete }); // Stop animate from showing/hiding the element to be able to hide it later on.
                } else {
                    elements.each(function() {
                        var element = $(this),
                            multiple = {};

                        each(transformProps, function(idx, value) { // remove transforms to avoid IE and older browsers confusion
                            var params,
                                currentValue = properties ? properties[value]+ " " : null; // We need to match

                            if (currentValue) {
                                var single = properties;

                                if (value in scaleProperties && properties[value] !== undefined) {
                                    params = currentValue.match(cssParamsRegExp);
                                    if (hasZoom) {
                                        var half = (1 - params[1]) / 2;
                                        extend(single, {
                                                           zoom: +params[1],
                                                           marginLeft: element.width() * half,
                                                           marginTop: element.height() * half
                                                       });
                                    } else if (transforms) {
                                        extend(single, {
                                                           scale: +params[0]
                                                       });
                                    }
                                } else {
                                    if (value in translateProperties && properties[value] !== undefined) {
                                        var position = element.css("position"),
                                            isFixed = (position == "absolute" || position == "fixed");

                                        if (!element.data(TRANSLATE)) {
                                            if (isFixed) {
                                                element.data(TRANSLATE, {
                                                    top: parseCSS(element, "top") || 0,
                                                    left: parseCSS(element, "left") || 0,
                                                    bottom: parseCSS(element, "bottom"),
                                                    right: parseCSS(element, "right")
                                                });
                                            } else {
                                                element.data(TRANSLATE, {
                                                    top: parseCSS(element, "marginTop") || 0,
                                                    left: parseCSS(element, "marginLeft") || 0
                                                });
                                            }
                                        }

                                        var originalPosition = element.data(TRANSLATE);

                                        params = currentValue.match(cssParamsRegExp);
                                        if (params) {

                                            var dX = value == TRANSLATE + "y" ? +null : +params[1],
                                                dY = value == TRANSLATE + "y" ? +params[1] : +params[2];

                                            if (isFixed) {
                                                if (!isNaN(originalPosition.right)) {
                                                    if (!isNaN(dX)) { extend(single, { right: originalPosition.right - dX }); }
                                                } else {
                                                    if (!isNaN(dX)) { extend(single, { left: originalPosition.left + dX }); }
                                                }

                                                if (!isNaN(originalPosition.bottom)) {
                                                    if (!isNaN(dY)) { extend(single, { bottom: originalPosition.bottom - dY }); }
                                                } else {
                                                    if (!isNaN(dY)) { extend(single, { top: originalPosition.top + dY }); }
                                                }
                                            } else {
                                                if (!isNaN(dX)) { extend(single, { marginLeft: originalPosition.left + dX }); }
                                                if (!isNaN(dY)) { extend(single, { marginTop: originalPosition.top + dY }); }
                                            }
                                        }
                                    }
                                }

                                if (!transforms && value != "scale" && value in single) {
                                    delete single[value];
                                }

                                if (single) {
                                    extend(multiple, single);
                                }
                            }
                        });

                        if (browser.msie) {
                            delete multiple.scale;
                        }

                        element.animate(multiple, { queue: false, show: false, hide: false, duration: options.duration, complete: options.complete }); // Stop animate from showing/hiding the element to be able to hide it later on.
                    });
                }
            }
        },

        animateTo: function(element, destination, options) {
            var direction,
                commonParent = element.parents().filter(destination.parents()).first(),
                originalOverflow;

            options = parseTransitionEffects(options);
            if (!support.mobileOS.android) {
                originalOverflow = commonParent.css(OVERFLOW);
                commonParent.css(OVERFLOW, "hidden");
            }

            $.each(options.effects, function(name, definition) {
                direction = direction || definition.direction;
            });

            function complete(animatedElement) {
                destination[0].style.cssText = "";
                element[0].style.cssText = ""; // Removing the whole style attribute breaks Android.
                if (!support.mobileOS.android) {
                    commonParent.css(OVERFLOW, originalOverflow);
                }
                if (options.completeCallback) {
                    options.completeCallback.call(element, animatedElement);
                }
            }

            options.complete = browser.msie ? function() { setTimeout(complete, 0); } : complete;
            options.reset = true; // Reset transforms if there are any.

            if ("slide" in options.effects) {
                element.kendoAnimate(options);
                destination.kendoAnimate(slideToSlideIn(options));
            } else {
                (options.reverse ? element : destination).kendoAnimate(options);
            }
        },

        fade: {
            keep: [ "opacity" ],
            css: {
                opacity: function(element, options) {
                    var opacity = element.data("opacity"), direction = options.effects.fade.direction;
                    return direction == "out" && isNaN(opacity) || direction == "in" ? 0 : opacity;
                }
            },
            restore: [ "opacity" ],
            setup: function(element, options) {
                return extend({ opacity: options.effects.fade.direction == "out" ? 0 : 1 }, options.properties);
            }
        },
        zoom: {
            css: {
                scale: function(element, options) {
                    var scale = animationProperty(element, "scale");
                    return options.effects.zoom.direction == "in" ? (scale != 1 ? scale : "0.01") : 1;
                },
                zoom: function(element, options) {
                    var zoom = element[0].style.zoom;
                    return options.effects.zoom.direction == "in" && hasZoom ? (zoom ? zoom : "0.01") : undefined;
                }
            },
            setup: function(element, options) {
                var reverse = options.effects.zoom.direction == "out";

                if (hasZoom) {
                    var version = browser.version,
                        style = element[0].currentStyle,
                        width = style.width.indexOf("%") != -1 ? element.parent().width() : element.width(),
                        height = style.height.indexOf("%") != -1 ? element.parent().height() : parseInteger(style.height),
                        half = version < 9 && options.effects.fade ? 0 : (1 - (parseInteger(element.css("zoom")) / 100)) / 2; // Kill margins in IE7/8 if using fade

                    element.css({
                        marginLeft: width * (version < 8 ? 0 : half),
                        marginTop: height * half
                    });
                }

                return extend({ scale: reverse ? 0.01 : 1 }, options.properties);
            }
        },
        slide: {
            setup: function(element, options) {
                var reverse = options.reverse, extender = {},
                    init = initDirection(element, options.effects.slide.direction, reverse),
                    property = transforms && options.transition !== false ? init.direction.transition : init.direction.property;

                init.offset /= -(options.divisor || 1);
                if (!reverse) {
                    var origin = element.data(ORIGIN);
                    if (!origin && origin !== 0) {
                        element.data(ORIGIN, animationProperty(element, property));
                    }
                }

                extender[property] = reverse ? (element.data(ORIGIN) || 0) : (element.data(ORIGIN) || 0) + init.offset + PX;

                return extend(extender, options.properties);
            }
        },
        slideMargin: {
            setup: function(element, options) {
                var origin = element.data(ORIGIN),
                    offset = options.offset, margin,
                    extender = {}, reverse = options.reverse;

                if (!reverse && !origin && origin !== 0) {
                    element.data(ORIGIN, parseFloat(element.css("margin-" + options.axis)));
                }

                margin = (element.data(ORIGIN) || 0);
                extender["margin-" + options.axis] = !reverse ? margin + offset : margin;
                return extend(extender, options.properties);
            }
        },
        slideTo: {
            setup: function(element, options) {
                var offset = (options.offset+"").split(","),
                    extender = {}, reverse = options.reverse;

                if (transforms && options.transition !== false) {
                    extender.translatex = !reverse ? offset[0] : 0;
                    extender.translatey = !reverse ? offset[1] : 0;
                } else {
                    extender.left = !reverse ? offset[0] : 0;
                    extender.top = !reverse ? offset[1] : 0;
                }
                element.css("left");

                return extend(extender, options.properties);
            }
        },
        slideIn: {
            css: {
                translatex: function (element, options) {
                    var init = initDirection(element, options.effects.slideIn.direction, options.reverse);
                    return init.direction.transition == "translatex" ? (!options.reverse ? init.offset : 0) + PX : undefined;
                },
                translatey: function (element, options) {
                    var init = initDirection(element, options.effects.slideIn.direction, options.reverse);
                    return init.direction.transition == "translatey" ? (!options.reverse ? init.offset : 0) + PX : undefined;
                }
            },
            setup: function(element, options) {
                var reverse = options.reverse,
                    init = initDirection(element, options.effects.slideIn.direction, reverse),
                    extender = {};

                if (transforms && options.transition !== false) {
                    extender[init.direction.transition] = (reverse ? init.offset : 0) + PX;
                } else {
                    if (!reverse) {
                        element.css(init.direction.property, init.offset + PX);
                    }
                    extender[init.direction.property] = (reverse ? init.offset : 0) + PX;
                    element.css(init.direction.property);
                }

                return extend(extender, options.properties);
            }
        },
        expand: {
            keep: [ OVERFLOW ],
            css: { overflow: HIDDEN },
            restore: [ OVERFLOW ],
            setup: function(element, options) {
                var reverse = options.reverse,
                    direction = options.effects.expand.direction,
                    property = (direction ? direction == "vertical" : true) ? HEIGHT : WIDTH,
                    setLength = element[0].style[property],
                    oldLength = element.data(property),
                    length = parseFloat(oldLength || setLength),
                    realLength = round(element.css(property, AUTO)[property]()),
                    completion = {};

                length = options.reset ? realLength || length : length || realLength;

                completion[property] = (reverse ? 0 : length) + PX;
                element.css(property, reverse ? length : 0).css(property);
                if (oldLength === undefined) {
                    element.data(property, setLength);
                }

                return extend(completion, options.properties);
            },
            teardown: function(element, options) {
                var direction = options.effects.expand.direction,
                    property = (direction ? direction == "vertical" : true) ? HEIGHT : WIDTH,
                    length = element.data(property);
                if (length == AUTO || length === BLANK) {
                    setTimeout(function() { element.css(property, AUTO).css(property); }, 0); // jQuery animate complete callback in IE is called before the last animation step!
                }
            }
        },
        flip: {
            css: {
                rotatex: function (element, options) {
                    return options.effects.flip.direction == "vertical" ? options.reverse ? "180deg" : "0deg" : undefined;
                },
                rotatey: function (element, options) {
                    return options.effects.flip.direction == "horizontal" ? options.reverse ? "180deg" : "0deg" : undefined;
                }
            },
            setup: function(element, options) {
                var rotation = options.effects.flip.direction == "horizontal" ? "rotatey" : "rotatex",
                    reverse = options.reverse, parent = element.parent(),
                    degree = options.degree, face = options.face, back = options.back,
                    faceRotation = rotation + (reverse ? "(180deg)" : "(0deg)"),
                    backRotation = rotation + (reverse ? "(0deg)" : "(180deg)"),
                    completion = {};

                if (support.hasHW3D) {
                    if (parent.css(PERSPECTIVE) == NONE) {
                        parent.css(PERSPECTIVE, 500);
                    }

                    element.css(cssPrefix + "transform-style", "preserve-3d");
                    face.css(BACKFACE, HIDDEN).css(TRANSFORM, faceRotation).css("z-index", reverse ? 0 : -1);
                    back.css(BACKFACE, HIDDEN).css(TRANSFORM, backRotation).css("z-index", reverse ? -1 : 0);
                    completion[rotation] = (reverse ? "-" : "") + (degree ? degree : 180) + "deg";
                } else {
                    if (kendo.size(options.effects) == 1) {
                        options.duration = 0;
                    }
                }
                face.show();
                back.show();

                return extend(completion, options.properties);
            },
            teardown: function(element, options) {
                options[options.reverse ? "back" : "face"].hide();

                if (support.hasHW3D) {
                    $().add(options.face).add(options.back).add(element)
                        .css(BACKFACE, "");
                }
            }
        },
        simple: {
            setup: function(element, options) {
                return options.properties;
            }
        }
    });

    kendo.fx.expandVertical = kendo.fx.expand; // expandVertical is deprecated.

    var animationFrame  = window.requestAnimationFrame       ||
                          window.webkitRequestAnimationFrame ||
                          window.mozRequestAnimationFrame    ||
                          window.oRequestAnimationFrame      ||
                          window.msRequestAnimationFrame     ||
                          function(callback){ setTimeout(callback, 1000 / 60); };

    var Animation = kendo.Class.extend({
        init: function() {
            var that = this;
            that._tickProxy = proxy(that._tick, that);
            that._started = false;
        },

        tick: $.noop,
        done: $.noop,
        onEnd: $.noop,
        onCancel: $.noop,

        start: function() {
            this._started = true;
            animationFrame(this._tickProxy);
        },

        cancel: function() {
            this._started = false;
            this.onCancel();
        },

        _tick: function() {
            var that = this;
            if (!that._started) { return; }

            that.tick();

            if (!that.done()) {
                animationFrame(that._tickProxy);
            } else {
                that._started = false;
                that.onEnd();
            }
        }
    });

    var Transition = Animation.extend({
        init: function(options) {
            var that = this;
            extend(that, options);
            Animation.fn.init.call(that);
        },

        done: function() {
            return this.timePassed() >= this.duration;
        },

        timePassed: function() {
            return Math.min(this.duration, (+new Date()) - this.startDate);
        },

        moveTo: function(options) {
            var that = this,
                movable = that.movable;

            that.initial = movable[that.axis];
            that.delta = options.location - that.initial;

            that.duration = options.duration || 300;

            that.tick = that._easeProxy(options.ease);

            that.startDate = +new Date();
            that.start();
        },

        _easeProxy: function(ease) {
            var that = this;

            return function() {
                that.movable.moveAxis(that.axis, ease(that.timePassed(), that.initial, that.delta, that.duration));
            };
        }
    });

    extend(Transition, {
        easeOutExpo: function (t, b, c, d) {
            return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
        },

        easeOutBack: function (t, b, c, d, s) {
            s = 1.70158;
            return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
        }
    });

    fx.Animation = Animation;
    fx.Transition = Transition;
})(jQuery);
;


text:
import logging
import os
from logging.handlers import RotatingFileHandler

from tornado.log import enable_pretty_logging
from tornado.escape import json_encode

from BoPress import settings

C_LOG_SIZE = 1048576
C_LOG_NAME = os.path.join(settings.BASE_DIR, "BoPress.log")
C_LOG_FILES = 3

TAG = "BoPress"
__author__ = 'yezang'

class Logger(object):
    is_inited = False

    @staticmethod
    def init():
        if not settings.LOGGER_LEVEL:
            settings.LOGGER_LEVEL = logging.NOTSET
        rt = RotatingFileHandler(filename=C_LOG_NAME, maxBytes=C_LOG_SIZE, backupCount=C_LOG_FILES)
        rt.setLevel(settings.LOGGER_LEVEL)
        rt.setFormatter(logging.Formatter('[%(asctime)s] %(message)s'))
        log = logging.getLogger()
        enable_pretty_logging()
        log.addHandler(rt)
        Logger.is_inited = True

    @staticmethod
    def error(obj, tag=TAG):
        logging.error("[ERROR] %s: %s" % (tag, json_encode(obj)))

    @staticmethod
    def exception(e, tag=TAG):
        logging.error("[EXCEPTION] %s " % tag, exc_info=e)

    @staticmethod
    def info(obj, tag=TAG):
        logging.info("[INFO] %s: %s" % (tag, json_encode(obj)))

    @staticmethod
    def debug(obj, tag=TAG):
        logging.debug("[DEBUG] %s: %s" % (tag, json_encode(obj)))

    @staticmethod
    def warning(obj, tag=TAG):
        logging.warning("[WARNING] %s: %s" % (tag, json_encode(obj)))

    @staticmethod
    def critical(obj, tag=TAG):
        logging.critical("[CRITICAL] %s: %s" % (tag, json_encode(obj)))

    @staticmethod
    def nothing(e):
        pass

redpajama_set_name: RedPajamaGithub


text:
{% extends "layout.html" %}

{% block page_title %}
  GOV.UK prototype kit
{% endblock %}

{% block main_content %}

Pages

Tom's page

Linda's page

Donna's page

Getting started

Travel and leave

About Leeds One

How we work

Key Contacts

{% endblock %}


text:
#import <IDEKit/IDEInspectorAbstractActionProperty.h>

@class IDEInspectorKeyPath, NSArray, NSPopUpButton, NSString;

@interface IDEInspectorActionMenuProperty : IDEInspectorAbstractActionProperty
{
    NSPopUpButton *_pullDown;
    NSArray *_menuItems;
    IDEInspectorKeyPath *_menuItemsKeyPath;
    NSString *_title;
    IDEInspectorKeyPath *_titleKeyPath;
}

- (void).cxx_destruct;
- (void)setupRefreshTriggersAndConfigure;
- (void)refresh;
- (id)staticMenuItems;
- (void)applyMenuItemsToPullDown:(id)arg1;
- (void)refreshTarget:(id)arg1;
- (void)refreshTitle:(id)arg1;
- (double)baseline;

@end


text:
import h2o
import os
import socket
import threading
import unittest
from six.moves import urllib
from websocket import create_connection

SIMPLE_PATH = b'/simple'
SIMPLE_BODY = b'
It works!
'
PEERNAME_PATH = b'/peername'
HEADER_PATH = b'/header'
HEADER_NAME = b'X-My-Header'
HEADER_VALUE = b'Hello world!'
RES_HEADER_PATH = b'/res_header'
POST_PATH = b'/post'
POST_DATA = b'Post data'
STREAM_PATH = b'/stream'
STREAM_BODIES = [b'
', b'Stream', b'
']
WEBSOCKET_PATH = b'/websocket'
WEBSOCKET_MESSAGE = b'hello'
STATIC_PATH = b'/static'

class SimpleHandler(h2o.Handler):
    def on_req(self):
        self.res_status = 200
        self.send_inline(SIMPLE_BODY)
        return 0

class PeernameHandler(h2o.Handler):
    def on_req(self):
        self.res_status = 200
        peername = self.peername
        self.send_inline(peername[0] + b':' + str(peername[1]).encode())
        return 0

class HeaderHandler(h2o.Handler):
    def on_req(self):
        assert dict(self.headers())[HEADER_NAME.lower()] == HEADER_VALUE
        assert next(self.find_headers(HEADER_NAME.lower())) == HEADER_VALUE
        self.res_status = 200
        self.send_inline(b'')
        return 0

class ResHeaderHandler(h2o.Handler):
    def on_req(self):
        self.res_add_header(HEADER_NAME, HEADER_VALUE)
        self.res_status = 200
        self.send_inline(b'')
        return 0

class PostHandler(h2o.Handler):
    def on_req(self):
        self.res_status = 200
        self.send_inline(self.entity)
        return 0

class StreamHandler(h2o.StreamHandler):
    def on_req(self):
        self.iterator = iter(STREAM_BODIES)
        self.res_status = 200
        self.start_response()
        self.on_proceed()
        return 0

    def on_proceed(self):
        try:
            self.send([next(self.iterator)], h2o.H2O_SEND_STATE_IN_PROGRESS)
        except StopIteration:
            self.send([], h2o.H2O_SEND_STATE_FINAL)

class WebsocketHandler(h2o.WebsocketHandler):
    def on_message(self, opcode, msg):
        self.send(opcode, msg)

class E2eTest(unittest.TestCase):
    def setUp(self):
        config = h2o.Config()
        host = config.add_host(b'default', 65535)
        host.add_path(SIMPLE_PATH).add_handler(SimpleHandler)
        host.add_path(PEERNAME_PATH).add_handler(PeernameHandler)
        host.add_path(HEADER_PATH).add_handler(HeaderHandler)
        host.add_path(RES_HEADER_PATH).add_handler(ResHeaderHandler)
        host.add_path(POST_PATH).add_handler(PostHandler)
        host.add_path(STREAM_PATH).add_handler(StreamHandler)
        host.add_path(WEBSOCKET_PATH).add_handler(WebsocketHandler)
        host.add_path(STATIC_PATH).add_static(os.path.dirname(__file__).encode())

        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True)
        self.sock.bind(('127.0.0.1', 0))
        self.sock.listen(0)

        self.loop = h2o.Loop()
        self.loop.start_accept(self.sock.fileno(), config)
        thread = threading.Thread(target=self.run_loop)
        thread.daemon = True
        thread.start()

    def run_loop(self):
        while self.loop.run() == 0:
            pass

    def format_path(self, scheme, path):
        return '{0}://127.0.0.1:{1}{2}'.format(
            scheme, self.sock.getsockname()[1], path.decode())

    def http_get(self, path, headers={}):
        return urllib.request.urlopen(urllib.request.Request(
            self.format_path('http', path), headers=headers))

    def http_post(self, path, data):
        return urllib.request.urlopen(urllib.request.Request(
            self.format_path('http', path), data=data))

    def ws_connect(self, path):
        return create_connection(self.format_path('ws', path))

    def test_simple(self):
        response = self.http_get(SIMPLE_PATH)
        self.assertEqual(response.read(), SIMPLE_BODY)

    def test_peername(self):
        response = self.http_get(PEERNAME_PATH)
        sock = socket.fromfd(response.fileno(), socket.AF_INET, socket.SOCK_STREAM)
        sockname = sock.getsockname()
        self.assertEqual(response.read(),
                         (sockname[0] + ':' + str(sockname[1])).encode())
        sock.close()

    def test_header(self):
        self.http_get(HEADER_PATH, {HEADER_NAME: HEADER_VALUE})

    def test_res_handler(self):
        response = self.http_get(RES_HEADER_PATH)
        self.assertEqual(response.info()[HEADER_NAME.decode()],
                         HEADER_VALUE.decode())

    def test_post(self):
        response = self.http_post(POST_PATH, POST_DATA)
        self.assertEqual(response.read(), POST_DATA)

    def test_stream(self):
        response = self.http_get(STREAM_PATH)
        self.assertEqual(response.read(), b''.join(STREAM_BODIES))

    def test_websocket(self):
        ws = self.ws_connect(WEBSOCKET_PATH)
        ws.send_binary(WEBSOCKET_MESSAGE)
        self.assertEqual(ws.recv(), WEBSOCKET_MESSAGE)

    def test_static(self):
        response = self.http_get(STATIC_PATH + b'/' + os.path.basename(__file__).encode())
        with open(__file__, 'rb') as f:
            self.assertEqual(response.read(), f.read())

if __name__ == '__main__':
    unittest.main()


text:
{% extends "base.html" %}

{% block title %}VPN management - create new certificate{% endblock %}

{% block content %}

Valid Certificate Signing Request (CSR)

You have created a valid CSR. Please confirm that this information is valid, especially the common name field.

Common name:
{{ fields.common_name }}

City:
{{ fields.city }}

State:
{{ fields.state }}

Country:
{{ fields.country }}

Organization Unit:
{{ fields.organizationunit }}

Organization:
{{ fields.organization }}

Algorithm:
{{ fields.algorithm }}

Key length:
{{ fields.bitlength }}bits

If you click continue, you'll receive a SMS message containing one-time password.
That is the final step before generating a certificate and configuration files for you.
The SMS will be sent to mobile phone number recorded in the LDAP directory.
Delivery time is usually a few seconds, but it might take up to 30 seconds.
If no SMS message is received within 30 seconds, something is broken.

If something is incorrect, please generate new CSR and upload it again.

Continue or upload CSR again

{% endblock %}


text:
package org.jtheque.films.services.impl.utils.search.filters;

/*
 * This file is part of JTheque.
 *
 * JTheque 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.
 *
 * JTheque 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 JTheque.  If not, see <http://www.gnu.org/licenses/>.
 */

import org.jtheque.films.persistence.od.able.Film;
import org.jtheque.utils.collections.Filter;

/**
 * A filter of Duration.
 *
 * @author Baptiste Wicht
 */
public final class DurationFilter implements Filter<Film> {
    private final int from;
    private final int to;

    /**
     * Create a new DurationFilter.
     *
     * @param from The from duration.
     * @param to   The to duration.
     */
    public DurationFilter(int from, int to) {
        super();

        this.from = from;
        this.to = to;
    }

    @Override
    public boolean accept(Film person) {
        return person.getDuration() >= from && person.getDuration() <= to;
    }
}


text:
using Microsoft.AspNetCore.Mvc;
using Signum.Entities.Files;
using Signum.Engine.Files;
using System.IO;
using Signum.Engine.Mailing;
using Signum.Entities.Basics;
using Signum.Utilities.Reflection;
using System.Collections.Concurrent;

namespace Signum.React.Files;

public class FilesController : ControllerBase
{
    [HttpGet("api/files/downloadFile/{fileId}")]
    public FileStreamResult DownloadFile(string fileId)
    {
        var file = Database.Retrieve<FileEntity>(PrimaryKey.Parse(fileId, typeof(FileEntity)));

        return GetFileStreamResult(new MemoryStream(file.BinaryFile), file.FileName);

    }

    [HttpGet("api/files/downloadFilePath/{filePathId}")]
    public FileStreamResult DownloadFilePath(string filePathId)
    {
        var filePath = Database.Retrieve<FilePathEntity>(PrimaryKey.Parse(filePathId, typeof(FilePathEntity)));

        return GetFileStreamResult(filePath.OpenRead(), filePath.FileName);
    }

    [HttpGet("api/files/downloadEmbeddedFilePath/{rootType}/{id}")]
    public FileStreamResult? DownloadFilePathEmbedded(string rootType, string id, string route, string? rowId)
    {
        var type = TypeLogic.GetType(rootType);

        var propertyRoute = PropertyRoute.Parse(type, route);
        var primaryKey = PrimaryKey.Parse(id, type);

        var makeQuery = queryBuilderCache.GetOrAdd(propertyRoute, pr =>
        {
            if (propertyRoute.Type != typeof(FilePathEmbedded))
                throw new InvalidOperationException($"Route {route} doesn't point to a FilePathEmbedded");

            var mlistRoute = propertyRoute.GetMListItemsRoute()!;
            if (mlistRoute == null)
                return giGetSimpleQuery.GetInvoker(type)(propertyRoute);
            else
                return giGetMListQuery.GetInvoker(type, mlistRoute.Type)(propertyRoute, mlistRoute);
        });

        var fpe = makeQuery(primaryKey, rowId);
        if (fpe == null)
            return null;

        return GetFileStreamResult(fpe.OpenRead(), fpe.FileName);
    }

    static ConcurrentDictionary<PropertyRoute, Func<PrimaryKey, string?, FilePathEmbedded?>> queryBuilderCache =
        new ConcurrentDictionary<PropertyRoute, Func<PrimaryKey, string?, FilePathEmbedded?>>();

    static GenericInvoker<Func<PropertyRoute, Func<PrimaryKey, string?, FilePathEmbedded?>>> giGetSimpleQuery =
        new((propertyRoute) => GetSimpleQuery<Entity>(propertyRoute));
    static Func<PrimaryKey, string?, FilePathEmbedded?> GetSimpleQuery<T>(PropertyRoute propertyRoute)
        where T : Entity
    {
        var selector = propertyRoute.GetLambdaExpression<T, FilePathEmbedded?>(false);

        return (pk, rowId) =>
        {
            return Database.Query<T>()
            .Where(a => a.Id == pk)
            .Select(selector)
            .SingleEx();
        };
    }

    static GenericInvoker<Func<PropertyRoute, PropertyRoute, Func<PrimaryKey, string?, FilePathEmbedded?>>> giGetMListQuery =
       new((route, mlistRoute) => GetMListQuery<Entity, EmbeddedEntity>(route, mlistRoute));
    static Func<PrimaryKey, string?, FilePathEmbedded?> GetMListQuery<T, M>(PropertyRoute route, PropertyRoute mlistRoute)
        where T : Entity
    {
        var mlistExpression = mlistRoute.Parent!.GetLambdaExpression<T, MList<M>>(false);
        var elementExpression = route.GetLambdaExpression<M, FilePathEmbedded>(false, mlistRoute);
        var mlistPkType = Schema.Current.TableMList(mlistExpression).PrimaryKey.Type;

        return (pk, rowId) => {
            var rowIdPk = new PrimaryKey((IComparable)ReflectionTools.ChangeType(rowId, mlistPkType)!);

            return Database.MListQuery(mlistExpression)
            .Where(mle => mle.Parent.Id == pk && mle.RowId == rowIdPk)
            .Select(mle => elementExpression.Evaluate(mle.Element))
            .SingleEx();
        };
    }

    /// <param name="stream">No need to close</param
    public static FileStreamResult GetFileStreamResult(Stream stream, string fileName, bool forDownload = true)
    {
        var mime = MimeMapping.GetMimeType(fileName);
        return new FileStreamResult(stream, mime)
        {
            FileDownloadName = forDownload ? Path.GetFileName(fileName) : null
        };
    }

    public static FileStreamResult GetFileStreamResult(FileContent file, bool forDownload = true)
    {
        return GetFileStreamResult(new MemoryStream(file.Bytes), file.FileName);
    }
}


text:
<?php
$_['text_title']                = 'Cartão de crédito ou débito';
$_['text_card_details']         = 'Detalhes do cartão';
$_['text_wait']                 = 'Aguarde...';
$_['text_auth_code']            = 'Código de autorização: %s';
$_['text_postcode_check']       = 'Post code: %s';
$_['text_security_code_check']  = 'Código de segurança: %s';
$_['text_address_check']        = 'Endereço: %s';
$_['text_3d_secure_check']      = '3D Secure: %s';
$_['text_not_given']            = 'Não comunicado';
$_['text_not_checked']          = 'Não verificado';
$_['text_match']                = 'Combina';
$_['text_not_match']            = 'Não combina';
$_['text_authenticated']        = 'Autenticado';
$_['text_not_authenticated']    = 'Não autenticado';
$_['text_authentication_not_completed'] = 'Autenticação não concluída';
$_['text_unable_to_perform']    = 'Não é possível executar';
$_['text_transaction_declined'] = 'Seu banco não aprovou a transação. Por favor, escolha um método de pagamento diferente.';
$_['text_transaction_failed']   = 'Não foi possível processar o pagamento. Por favor verifique as informações que você forneceu.';
$_['text_connection_error']     = 'Por favor, tente novamente mais tarde ou escolha outro método de pagamento.';

$_['entry_type']        = 'Tipo de cartão';
$_['entry_number']      = 'Número do cartão';
$_['entry_expire_date'] = 'Expira em';
$_['entry_cvv2']        = 'Código de segurança (CVV2)';

$_['button_confirm']    = 'Confirmar pedido';

$_['error_failure']     = 'Não foi possível concluir a transação. Tente novamente mais tarde ou utilize outro método de pagamento.';


text:
'use babel'
/** @jsx etch.dom */

import etch from 'etch'
import EtchComponent from './etch-component'
import EtchStoreComponent from './etch-store-component'

import { elementPropInHierarcy, location } from './utils'

export class Goroutines extends EtchComponent {
  render () {
    const { selectedGoroutine, goroutines = [] } = this.props
    const items = goroutines.map((t) => {
      const className = selectedGoroutine === t.id ? 'selected' : null
      return

{t.func}

@ {location(t)}

    })
    if (items.length === 0) {
      return
No goroutines

    }
    return
{items}

  }

  handleGoroutineClick (ev) {
    const id = elementPropInHierarcy(ev.target, 'dataset.id')
    if (id) {
      this.props.dbg.selectGoroutine(+id)
    }
  }
}
Goroutines.bindFns = ['handleGoroutineClick']

export const GoroutinesContainer = EtchStoreComponent.create(
  Goroutines,
  (state) => {
    const { delve } = state
    return {
      goroutines: delve.goroutines,
      selectedGoroutine: delve.selectedGoroutine
    }
  }
)


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/color_ffffff">

    <LinearLayout
        android:id="@+id/lin"
        android:layout_width="match_parent"
        android:orientation="vertical"
        android:layout_height="wrap_content">
        <connect.view.TopToolBar
            android:id="@id/toolbar_top"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>

        <connect.view.HightEqWidthImage
            android:id="@+id/backup_img"
            android:layout_width="@dimen/dp_200"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="@dimen/dp_40"
            android:scaleType="fitXY"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="@dimen/dp_20"
            android:textSize="@dimen/sp_16"
            android:textColor="@color/color_767a82"
            android:text="@string/Login_Decrypted_private_key"/>

        <TextView
            style="@style/BaseTextStyle.14"
            android:layout_marginTop="@dimen/dp_40"
            android:layout_marginLeft="@dimen/dp_20"
            android:layout_marginRight="@dimen/dp_20"
            android:text="@string/Login_export_encrypted_prikey_explain_Set_Account_Security"/>
    </LinearLayout>

    <TextView
        android:id="@+id/backup_private_key"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/lin"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="@dimen/dp_10"
        android:padding="@dimen/dp_10"
        android:textColor="@color/color_007aff"
        android:text="@string/Set_Backup_Private_Key"/>

    <Button
        style="@style/ButtonLongStyle"
        android:id="@id/next_btn"
        android:layout_marginTop="@dimen/dp_15"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="@dimen/dp_35"
        android:text="@string/Login_Next"/>

</RelativeLayout>


text:
package org.squirrelframework.cloud.annotation;

/**
 * Created by kailianghe on 15/12/9.
 */

import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Documented
public @interface RoutingKey {
    String[] value();
    boolean recordRoutingKeys() default false;
}


text:
package br.cefetrj.sagitarii.core.types;

public enum ActivityType {
	MAP, SPLIT_MAP, REDUCE, SELECT, LOADER;

	public boolean isBlocking() {
		// Atividades que precisam aguardar mais de uma atividade ser concluída
		// Dependem de várias tabelas de entrada
		return ( this == ActivityType.REDUCE) || ( this == ActivityType.SELECT );
	}

	public boolean isJoin() {
		// Atividades que serão processadas pelo MainCluster
		return ( this == ActivityType.SELECT );
	}

}


text:
package mireka.forward;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import mireka.address.NullReversePath;
import mireka.address.Recipient;
import mireka.address.ReversePath;
import mireka.destination.Session;
import mireka.destination.SessionDestination;
import mireka.filter.RecipientContext;
import mireka.smtp.RejectExceptionExt;
import mireka.transmission.LocalMailSystemException;
import mireka.transmission.Mail;
import mireka.transmission.Transmitter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * An SrsDestination assigned to a recipient indicates that the mail must be
 * forwarded to a remote address, which is specified in the Sender Rewriting
 * Scheme (SRS) compatible local part of the recipient address. These mails are
 * delivery status notifications related to a mail forwarded by this mail server
 * previously.
 */
public class SrsDestination implements SessionDestination {
    private final Logger logger = LoggerFactory.getLogger(SrsDestination.class);
    private Srs srs;
    /**
     * The transmitter which will be used to redistribute the incoming mail to
     * the encoded original source servers.
     */
    private Transmitter transmitter;

    @Override
    public Session createSession() {
        return new SessionImpl();
    }

    @Override
    public String toString() {
        return "SrsDestination";
    }

    /**
     * @x.category GETSET
     */
    @Inject
    public void setSrs(Srs srs) {
        this.srs = srs;
    }

    /**
     * @x.category GETSET
     */
    public Srs getSrs() {
        return srs;
    }

    /**
     * @x.category GETSET
     */
    public Transmitter getTransmitter() {
        return transmitter;
    }

    /**
     * @x.category GETSET
     */
    @Inject
    public void setTransmitter(Transmitter transmitter) {
        this.transmitter = transmitter;
    }

    private class SessionImpl implements Session {
        private List<Recipient> sourceMailboxes = new ArrayList<Recipient>();

        @Override
        public void from(ReversePath from) throws RejectExceptionExt {
            // do nothing
        }

        @Override
        public void recipient(RecipientContext recipientContext)
                throws RejectExceptionExt {
            try {
                Recipient originalSource =
                        srs.reverse(recipientContext.recipient);
                sourceMailboxes.add(originalSource);
            } catch (InvalidSrsException e) {
                logger.debug("SRS reverse expansion failed. " + e.getMessage());
                throw new RejectExceptionExt(e.getStatus());
            }
        }

        @Override
        public void data(Mail mail) throws RejectExceptionExt, IOException {
            try {
                if (!mail.from.isNull()) {
                    mail.from = new NullReversePath();
                    logger.debug("Valid SRS message is received with "
                            + "non-null reverse path. This contradicts the "
                            + "intended purpose of SRS. Mail will be "
                            + "forwarded with null reverse path anyway.");
                }
                mail.recipients.clear();
                mail.recipients.addAll(sourceMailboxes);
                transmitter.transmit(mail);
                logger.debug("SRS addresses was expanded and mail was "
                        + "submitted to transmitter: {}", mail);
            } catch (LocalMailSystemException e) {
                logger.error("Cannot transmit mail", e);
                throw new RejectExceptionExt(e.errorStatus());
            }
        }

        @Override
        public void done() {
            // nothing to do
        }

    }

}


text:
This repository is a collection of [Grunt](http://www.gruntjs.com) tasks, templates
and static assets that build and serve a Webhook powered site.

[Documentation found here](http://webhook.com/docs/)


text:
/*
 *      File with constants and structures.
 *      Intended for early include into multiple components.
 *  	@author    Petr Svenda
 *  	@version   0.1
 *  	@date      2012-2013
 *
 */
#ifndef PROTECTLAYERGLOBALS_H
#define PROTECTLAYERGLOBALS_H

#include "message.h"

// Define to supress warning from printf function
#define DEBUG_PRINTF
#define NEW_PRINTF_SEMANTICS

#include "printf.h"
#include <stdarg.h>

typedef enum _error_values {
    EDIFFERENTKEY = 100,            /**< different key was used to protect message */
    EINVALIDDECRYPTION = 101,       /**< invalid format of message to be decrypted */
    ENOTALLKEYSDISCOVERED = 102,    /**< not all keys were discovered */
    EKEYNOTFOUND = 103,             /**< requested key was not found */
    EDATANOTFOUND = 104,    	    /**< requested data structure was not found */
    EWRONGMAC = 105		    /**< received mac does not match calculated one */
} _error_values;

/**
        Various contants specified as enum to save stack space
*/
enum {
  AM_PROTECTLAYERRADIO = 128,
  AM_LOG_MSG = 129,
  AM_CON_GET_MSG = 130,
  AM_CON_SD_MSG = 131,
  AM_CON_PPCPD_MSG = 132,
  AM_CON_RPD_MSG = 133,
  AM_CON_KDCPD_MSG = 134,
  AM_FLASH_GET_MSG = 135,
  AM_FLASH_SET_MSG = 136,
  AM_INTRUSION_MSG = 137,
  AM_CON_SD_PART_MSG = 138,
  AM_KEY_MSG = 139,
  POLICEMAN_TIMER_MESSAGE_MILLI = 5000,
  KEY_LENGTH = 16,
  MAX_NEIGHBOR_COUNT = 30,
  RECEIVE_BUFFER_LEN = 5,
  MAGIC_WORD = 0x55,
  LOGGED_SIZE = 20,
  RSSI_THRESHOLD = -73
};
// NOTE: constants should be defined as item in enum above (to save space) #define MAX_NEIGHBOR_COUNT 	20 /**< Maximum number of neighbors - used to allocate static arrays */

enum {
  STATE_INIT = 0,
  STATE_LOADED_FROM_EEPROM = 1,
  STATE_READY_TO_DEPLOY = 2,
  STATE_MAGIC_RECEIVED = 3,
  STATE_ROUTES_READY = 4,
  STATE_READY_FOR_SAVE = 5,
  STATE_READY_FOR_APP = 6,
  STATE_WORKING = 7
};

#define FLAG_STATE_KDP_DISCOVERKEYS 0x0001	/**< neighbor keys discovery in progress */
#define FLAG_STATE_KDP_GETKEYTOBS   0x0002	/**< getting key to BS in progress */
#define FLAG_STATE_KDP_GETKEYTONODE 0x0004	/**< getting key to particular node in progress */

#define FLAG_STATE_CRYPTO_ENCRYPTION 0x0001	/**< encryption in progress (intentionally same as FLAG_STATE_CRYPTO_DECRYPTION) */
#define FLAG_STATE_CRYPTO_DECRYPTION 0x0001	/**< decryption in progress (intentionally same as FLAG_STATE_CRYPTO_ENCRYPTION) */
#define FLAG_STATE_CRYPTO_DERIV      0x0004	/**< key derivation in progress */
#define FLAG_STATE_CRYPTO_GENERATE   0x0008	/**< key generation in progress */

/**
	A structure representing request to send a message
*/
typedef struct _SendRequest {
/*@{*/
	uint16_t addr;	/**< target address */
	message_t* msg; /**< message to be send */
	uint8_t len;	/**< length of message to be send */
/*@}*/
} SendRequest_t;

/**
	A structure used to buffer incoming messages
*/
typedef struct _RecMsg {
/*@{*/
 	uint8_t isEmpty;
	message_t* msg; /**< message to be received */
	void* payload;
	uint8_t len;	/**< length of message */
/*@}*/
} RecMsg_t;

/**
	A structure representing security header
*/
typedef nx_struct SPHeader {
/*@{*/
  nx_uint8_t msgType;	/**< type of message */
  nx_uint8_t privacyLevel;	/**< privacy level applied */
  nx_uint16_t sender;	/**< sender ID */
  nx_uint16_t receiver; /**< receiver ID */
/*@}*/
} SPHeader_t;

/**
	The enumeration of possible message type
*/
typedef enum _MSG_TYPE {
	MSG_OTHER = 0,	/**< message of other (unknown) type */
	MSG_APP = 1,	/**< application message */
	MSG_IDS = 2,	/**< message of intrusion detection component */
	MSG_KDC = 3,	/**< message of key distribution component */
	MSG_ROUTE = 4,	/**< message of routing component */
	MSG_PLEVEL = 5, /**< message specifiying privacy level */
	MSG_FORWARD = 6, /**< message to be forwarded to BS */
	MSG_IDSCOPY = 7, /**< copy of message to be passed to IDS from Privacy component */
	MSG_COUNT = 8   /**< number of message types */
} MSG_TYPE;

typedef enum _SAVED_DATA_KEYS {
        SD_KEY_TYPE = 200,      //nx_uint8_t
        SD_KEY_VALUE,           //KEY_LENGTH * nx_uint8_t
        SD_DBG_KEY_ID,          //nx_uint16_t
        SD_COUNTER,             //nx_uint8_t
        SD_REPUTATION,          //nx_uint8_t
        SD_NB_MESSAGES,          //nx_uint8_t
        SD_NODE_ID		//nx_uint16_t
} SAVED_DATA_KEYS;

/**
	The enumeration of possible privacy levels
*/
typedef enum _PRIVACY_LEVEL {
	PLEVEL_0 = 0, /**< privacy level with no security */
	PLEVEL_1 = 1, /**< privacy level targeting attacker 1 */
	PLEVEL_2 = 2, /**< privacy level targeting attacker 2  */
	PLEVEL_3 = 3, /**< privacy level targeting attacker 3  */
	PLEVEL_4 = 4  /**< privacy level targeting attacker 4  */
} PRIVACY_LEVEL;
/**
	A structure representing a message that changes privacy level
*/
typedef nx_struct PLevelMsg {
	nx_uint8_t newPLevel; /**< new privacy level to be set */
} PLevelMsg_t;

typedef nx_struct AppMsg {
  nx_uint8_t appID;
  nx_uint8_t myType;
  nx_uint8_t info;
} AppMsg_t;

/**
	A structure representing message exchanged between IDSs
*/
typedef nx_struct IDSMsg {
/*@{*/
	// currently all broadcasted (reason for sender and receiver)
	// AM headers may be used instead, it's privacy question...
	nx_uint16_t sender;	/**< sender (TOS_NODE_ID) */
	nx_uint16_t receiver;	/**< receiver of this message */
	nx_uint16_t nodeID;	/**< ID of a node we send the reputation about */
	nx_uint8_t reputation;	/**< reputation */
/*@}*/
} IDSMsg_t;

typedef nx_struct IntrusionMsg {
	nx_uint8_t counter;
} IntrusionMsg_t;

typedef enum _APP_MSG_TYPE {
	APPMSG_MOVEMENT = 1
} APP_MSG_TYPE;

typedef enum _APP_ID {
  APPID_POLICE = 1
} APP_ID;

/*
SavedData_t.txt
  targetID;SavedData.neigborID;KDCData.keyType;KDCData.keyValue;KDCData.dbgKeyID;IDSData.neighbor_reputation;IDSData.nb_messages;

PPCPrivData_t.txt
  targetID;PPCPrivData.priv_level;

RoutePrivData_t.txt
  targetID;RoutePrivData_t.parentNodeId;RoutePrivData_t.savedDataIdx;RoutePrivData_t.isValid;

KDCPrivData_t.txt
  targetID;KDCData.keyType;KDCData.keyValue;KDCData.dbgKeyID;

*/

enum {
	KEY_TOBS = 1,
	KEY_TONODE = 2,
} KEY_TYPE;

typedef nx_struct _key {
  nx_uint8_t    keyType;
  nx_uint8_t    keyValue[KEY_LENGTH];
  nx_uint16_t	dbgKeyID;
} PL_key_t;

typedef uint16_t node_id_t;

// Saved data that are backed up in EEPROM
// nx_struct only cause of the sending it via serial port
typedef nx_struct KDCData {
    PL_key_t shared_key;
    nx_uint8_t counter;
} KDCData_t;

/**
	An IDS record about a neighbor
*/
typedef nx_struct IDSData {
/*@{*/
	nx_uint8_t neighbor_reputation;	/**< reputation of a neighbor */
	nx_uint8_t nb_messages;	/**< number of received messages */
/*@}*/
} IDSData_t;

/**
 * Data structure storing information about a neighbour saved by the protection layer component
 */
typedef nx_struct SavedData {
	nx_uint16_t nodeId; /**< id of the neighbouring node */
	KDCData_t kdcData; /**< information specific to the KDC component about the neighbour */
	IDSData_t idsData; /**< information specific to the IDS component about the neighbour */
} SavedData_t;

/**
 * Private data structure for the PPC component about this node
 */
typedef nx_struct PPCPrivData {
	nx_uint16_t priv_level; /**< current privacy level on this node */
} PPCPrivData_t;

/**
	Private data of the IDS
*/
typedef nx_struct IDSPrivData {
/*@{*/
	//PRIVACY_LEVEL priv_level;
/*@}*/
} IDSPrivData_t;

typedef nx_struct RoutePrivData {
	nx_uint16_t parentNodeId;
	nx_uint8_t savedDataIdx;
	nx_uint8_t isValid;
} RoutePrivData_t;

typedef nx_struct KDCPrivData {
    PL_key_t	keyToBS;
    PL_key_t	preKeys[20];
} KDCPrivData_t;

/**
 * Structure combining all the data that need to be stored on the node by the protection layer
 */
typedef struct CombinedData {
	uint8_t magicWord;
	uint8_t dispatcherState;
	SavedData_t savedData[MAX_NEIGHBOR_COUNT]; /**< an array of information about the node's neighbours, first actualNeighborCount items should be valid */
	uint8_t	actualNeighborCount; /**< number of neighbors at the moment */
	PPCPrivData_t ppcPrivData; /**< private data structure for the PPC component */
    RoutePrivData_t routePrivData;
    KDCPrivData_t kdcPrivData; /**< private data structure for the key distribution component */
} combinedData_t;

/**
 * Message structure for logging messages
 */

typedef nx_struct log_msg {
	nx_uint16_t counter; /**< counter of the log message */
	nx_uint8_t blockLength; /**< length of blocks required to be read from the flash memory at a time */
	nx_uint8_t data[LOGGED_SIZE];
} log_msg_t;

/**
 * Message structure for the configuration get request message
 */
typedef nx_struct con_get_msg {
	nx_uint16_t counter; /**< counter of the configuration get message */
} con_get_msg_t;

/**
 * Message structure for the configuration component setting or announcing saved data structure
 */
typedef nx_struct con_sd_msg {
	nx_uint16_t counter; /**< counter of the configuration setting message */
	nx_uint8_t savedDataIdx; /**< index of the savedData structure in the array */
	SavedData_t savedData; /**< the actual savedData structure with all the data */
} con_sd_msg_t;

/**
 * structure for passing saveddata structure by parts
 */
typedef nx_struct con_sd_part_msg {
        nx_uint8_t len;                 //data length
        nx_uint8_t key;                 //key identificator
        nx_uint8_t data[20];            //item data
} con_sd_part_msg_t;

/**
 * Message structure for the privacy protection layer component settings
 */
typedef nx_struct con_ppcpd_msg {
	nx_uint16_t counter; /**< counter of the privacy protection layer component settings message */
	PPCPrivData_t ppcPrivData; /**< the actual privacy protection layer data */
} con_ppcpd_msg_t;

typedef nx_struct con_rpd_msg {
	nx_uint16_t counter; /**< counter of the privacy protection layer component settings message */
	RoutePrivData_t rPrivData; /**< the actual privacy protection layer data */
} con_rpd_msg_t;

typedef nx_struct con_kdcpd_msg {
	nx_uint16_t counter; /**< counter of the privacy protection layer component settings message */
	KDCPrivData_t kdcPrivData; /**< the actual privacy protection layer data */
} con_kdcpd_msg_t;

/**
 * Message structure for the flash testing
 */
typedef nx_struct flash_get_msg {
	nx_uint16_t counter; /**< counter of the privacy protection layer component settings message */
} flash_get_msg_t;

/**
 * Message structure for the flash testing
 */
typedef nx_struct flash_set_msg {
	nx_uint16_t counter; /**< counter of the privacy protection layer component settings message */
} flash_set_msg_t;

typedef nx_struct intrusion_msg {
	nx_int8_t rssi;
} intrusion_msg_t;

typedef nx_struct key_msg {
	nx_uint32_t counter;
	nx_uint8_t keyValue[KEY_LENGTH];
} key_msg_t;

/**
	Type for reputation of a neighbor
*/
typedef uint8_t NODE_REPUTATION;

/**
 * Enumeration of IDS status
 */
 typedef enum _IDS_STATUS {
	IDS_RESET = 0, //no security
	IDS_ON = 1, //
	IDS_OFF = 2  //
} IDS_STATUS;

void PrintDbg(const char* messageClass, const char* formatString, ...) {
    va_list args;
    va_start(args,formatString);
    dbg(formatString,args);
    va_end(args);

#ifdef DEBUG_PRINTF
    va_start(args,formatString);
    printf("%s: ", messageClass);
    printf(formatString,args);
    va_end(args);
    //printfflush();
#endif

}

#endif


text:
<?php

namespace Weikit\Models;

use Illuminate\Database\Eloquent\Model;

class Menu extends Model
{
    public function items()
    {
        return $this->hasMany(MenuItem::class);
    }
}


text:
package io.reinert.requestor.java.net;

import io.reinert.requestor.core.AsyncRunner;
import io.reinert.requestor.core.DeferredPool;
import io.reinert.requestor.core.RequestDispatcher;
import io.reinert.requestor.core.RequestLogger;
import io.reinert.requestor.core.RequestProcessor;
import io.reinert.requestor.core.ResponseProcessor;

/**
 * Java implementation for {@link io.reinert.requestor.core.RequestDispatcher.Factory} powered by HttpURLConnection.
 *
 * @author Danilo Reinert
 */
public class JavaNetRequestDispatcherFactory implements RequestDispatcher.Factory {

    private static final int DEFAULT_BUFFER_SIZE = 8 * 1024;

    private final int inputBufferSize;
    private final int outputBufferSize;

    // Fields for caching
    private AsyncRunner asyncRunner;
    private RequestProcessor requestProcessor;
    private ResponseProcessor responseProcessor;
    private DeferredPool.Factory deferredPoolFactory;
    private RequestLogger logger;
    private JavaNetRequestDispatcher dispatcher;

    public JavaNetRequestDispatcherFactory() {
        this(DEFAULT_BUFFER_SIZE, DEFAULT_BUFFER_SIZE);
    }

    public JavaNetRequestDispatcherFactory(int inputBufferSize, int outputBufferSize) {
        this.inputBufferSize = inputBufferSize;
        this.outputBufferSize = outputBufferSize;
    }

    public RequestDispatcher create(AsyncRunner asyncRunner,
                                    RequestProcessor requestProcessor,
                                    ResponseProcessor responseProcessor,
                                    DeferredPool.Factory deferredPoolFactory,
                                    RequestLogger logger) {
        if (this.asyncRunner == asyncRunner &&
                this.requestProcessor == requestProcessor &&
                this.responseProcessor == responseProcessor &&
                this.deferredPoolFactory == deferredPoolFactory &&
                this.logger == logger) {
            return dispatcher;
        }

        if (dispatcher == null) {
            this.asyncRunner = asyncRunner;
            this.requestProcessor = requestProcessor;
            this.responseProcessor = responseProcessor;
            this.deferredPoolFactory = deferredPoolFactory;
            this.logger = logger;
            dispatcher = new JavaNetRequestDispatcher(asyncRunner, requestProcessor, responseProcessor,
                    deferredPoolFactory, logger, inputBufferSize, outputBufferSize);
            return dispatcher;
        }

        return new JavaNetRequestDispatcher(asyncRunner, requestProcessor, responseProcessor,
                deferredPoolFactory, logger, inputBufferSize, outputBufferSize);
    }

    public int getInputBufferSize() {
        return inputBufferSize;
    }

    public int getOutputBufferSize() {
        return outputBufferSize;
    }
}


text:
import * as _ from 'lodash';
import * as Bluebird from 'bluebird';
import * as path from 'path';
import * as colors from 'chalk';
import * as fs from 'fs';
import { contains, plain as toJSON, safeOLHM } from 'js-object-tools';

import { args } from './args';
import { build } from './build';
import { login, get, post } from './cloud';
import { configure } from './configure';
import {
  projectNamed, updateProject, updateEnvironment,
  user as userDb, cache
} from './db';
import { Environment } from './environment';
import { fetch, linkSource, destroy as destroySource } from './fetch';
import * as file from './file';
import { createNode, graph } from './graph';
import { installProject, installEnvironment, installHeaders } from './install';
import { Project, ProjectFile, ProjectModifier, resolveName } from './project';
import { prompt } from './prompt';
import { log } from './log';
import { info } from './info';
import { errors } from './errors';

import test from './test';

function isSingleCommand(phase: string) {
  return contains(['parse', 'graph', 'clean'], phase);
}

function singleCommand(project: Project, phase: string, selectedDeps: Project[]) {
  switch (phase) {
    case 'clean':
      return graph(project)
        .then((deps: Project[]) => {
          return <any>Bluebird.each(deps, (node) => {
            return processDep(node, phase);
          });
        });
    case 'graph':
      return graph(project)
        .then((deps: Project[]) => {
          if (args.verbose) {
            log.log(deps);
          } else {
            log.log(_.map(deps, (project) => project.name));
          }
        });
    case 'parse':
      const aspect = args._[2];
      if (aspect) {
        log.verbose(`parse ${aspect} for project ${project.name}`);
        if (project.environments[0][aspect]) {
          log.verbose(`aspect ${aspect} found in environment`);
          log.log(project.environments[0][aspect]);
        }
        else if (project[aspect]) {
          log.log(project[aspect]);
        } else {
          log.error(`${aspect} not found`);
        }
      } else {
        log.log(project.toRegistry());
      }
      break;
  }
  return Promise.resolve();
}

function execute(conf: ProjectFile, phase: string, subProject?: string) {
  let root: Project;
  return graph(conf)
    .then((deps: Project[]) => {
      let selectedDeps = deps;
      root = deps[deps.length - 1];
      if (subProject !== root.name) {
        selectedDeps = []
        let notFound = true;
        for (const project of deps) {
          selectedDeps.push(project);
          if (project.name === subProject) {
            root = project;
            log.warn(`restrict to submodule: ${subProject}`);
            notFound = false;
            break;
          }
        }
        if (notFound) {
          errors.project.notFound(subProject, deps);
        }
      }
      if (isSingleCommand(phase)) {
        return singleCommand(root, phase, selectedDeps);
      }
      if (args.noDeps) {
        return processDep(root, phase);
      }
      if (!args.quiet) {
        log.add(_.map(selectedDeps, d => d.name).join(' >> '));
      }
      return <any>Bluebird.each(selectedDeps, (node) => {
        return processDep(node, phase);
      });
    })
    .then(() => { return Promise.resolve(root); });
}

class ProjectRunner {
  [index: string]: any;
  project: Project;
  constructor(node: Project) {
    this.project = node;
  }
  do(fn: Function, opt?: any) {
    return Bluebird.each(this.project.environments, (env: Environment) => {
      return fn(env, opt);
    })
  }
  fetch() { return fetch(this.project); }
  configure(isTest?: boolean) {
    const doConfigure = () => {
      log.verbose(`  configure`);
      return this.do(configure, isTest)
        .then(() => {
          log.verbose('install headers');
          return installHeaders(this.project);
        });
    }
    return this.fetch().then(() => {
      return doConfigure();
    });
  }
  build(isTest?: boolean) {
    return this.configure(isTest)
      .then(() => {
        log.verbose(`  build`);
        return this.do(build, isTest);
      });
  }
  all() {
    return this.install();
  }
  install() {
    return this.build()
      .then(() => {
        log.verbose(`  install`);
        return installProject(this.project).then(() => {
          return this.do(installEnvironment);
        });
      });
  }
  test() { return this.build(true).then(() => test(this)); }
  link() {
    const root = this.project;
    return this.install()
      .then(() => {
        return graph(this.project).then((deps) => {
          return Bluebird.each(deps, (project) => {
            if (!project.tree) {
              const doc = project.toRegistry();
              const query = { name: doc.name, tag: doc.tag || 'master' };
              return userDb.update(query, { $set: doc }, { upsert: true });
            }
          })
        });
      });
  }
  clean() {
    log.quiet(`cleaning ${this.project.name}`);
    _.each(this.project.cache.libs.value(), (libFile) => {
      log.verbose(`rm ${libFile}`);
      if (fs.existsSync(libFile)) {
        fs.unlinkSync(libFile);
      }
    });
    return Bluebird.each(this.project.environments, (env) => {
      if (fs.existsSync(env.d.build)) {
        log.verbose(`rm -R ${env.d.build}`);
        file.nuke(env.d.build);
      }
      if (env.cache.generatedBuildFilePath.value()) {
        const filePath =
          path.join(env.d.project, env.cache.generatedBuildFilePath.value());
        try {
          if (fs.existsSync(filePath)) {
            log.verbose(`clean generatedBuildFile ${filePath}`);
            if (fs.lstatSync(filePath).isDirectory()) {
              file.nuke(filePath);
            } else {
              fs.unlinkSync(filePath);
            }
          }
        } catch (err) {
          log.error(err.message || err);
        }
        const unsetter = { $set: { 'cache': {} } };
        const hash = env.hash();
        return cache.remove({ hash: hash });
      }
    }).then(() => {
      log.verbose('clean environment caches');
      return cache.remove({ project: this.project.name })
    }).then(() => {
      log.verbose('clean project cache');
      return cache.remove({ name: this.project.name })
    })
  }
}

function processDep(node: Project, phase: string) {
  if (!args.quiet) {
    log.log(`${node.name}`);
  }
  process.chdir(args.runDir);
  return new ProjectRunner(node)[phase]();
}

function unlink(config: ProjectFile) {
  const query = { name: config.name, tag: config.tag || 'master' };
  return userDb.findOne(query).then((doc: ProjectFile) => {
    if (doc) {
      return userDb.remove(query);
    }
    return Promise.resolve();
  });
}

function push(config: ProjectFile) {
  prompt
    .ask(colors.green(
      `push will do a clean, full build, test and if successful will upload to the ${colors.yellow('public repository')}\n${colors.yellow('do that now?')} ${colors.gray('(yy = disable this warning)')}`))
    .then((res: boolean) => {
      if (res) {
        return execute(config, 'install');
      }
      return Promise.reject('user aborted push command');
    })
    .then(() => { return projectNamed(config.name); })
    .then((json: any) => {
      if (json.cache.bin || json.cache.libs) {
        return post(json).then((res) => {
          if (args.v) {
            log.quiet(`<< ${JSON.stringify(res, [], 2)}`, 'magenta');
          }
          return Promise.resolve(res);
        });
      }
      return Promise.reject(
        new Error('link failed because build or test failed'));
    });
}

function list(repo: string, selector: Object) {
  switch (repo) {
    default:
    case 'cache':
      return cache.find(selector) as Promise<ProjectFile[]>;
    case 'user':
      return userDb.find(selector) as Promise<ProjectFile[]>;
  }
}

function findAndClean(depName: string): PromiseLike<ProjectFile> {
  return projectNamed(depName)
    .then((config: ProjectFile) => {
      if (config) {
        return createNode(config, undefined)
          .then((project) => {
            return new ProjectRunner(project).clean();
          })
          .then(() => {
            return projectNamed(depName)
              .then((cleaned: ProjectFile) => {
                log.verbose('cleaned project', cleaned);
                return Promise.resolve(cleaned);
              })
          })
      }
      return Promise.reject(new Error(`didn't find project with name: ${depName}`));
    });
}

export {
  ProjectRunner,
  execute,
  list,
  push,
  unlink,
  findAndClean,
};


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Class gov.nasa.worldwind.geom.coords.TMCoord (NASA World Wind)
</TITLE>

<META NAME="date" CONTENT="2010-01-14">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Index
      Help

NASA World Wind

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
gov.nasa.worldwind.geom.coords.TMCoord

Packages that use TMCoord

gov.nasa.worldwind.geom.coords

Uses of TMCoord in gov.nasa.worldwind.geom.coords

Methods in gov.nasa.worldwind.geom.coords that return TMCoord

static TMCoord
TMCoord.fromLatLon(Angle latitude,
           Angle longitude,
           Globe globe,
           Angle originLatitude,
           Angle centralMeridian,
           double falseEasting,
           double falseNorthing,
           double scale)

          Create a set of Transverse Mercator coordinates from a pair of latitude and longitude,
 for the given Globe and projection parameters.

static TMCoord
TMCoord.fromTM(double easting,
       double northing,
       Globe globe,
       Angle originLatitude,
       Angle centralMeridian,
       double falseEasting,
       double falseNorthing,
       double scale)

          Create a set of Transverse Mercator coordinates for the given Globe,
 easting, northing and projection parameters.

      Overview
      Package
      Class
    Use
      Tree
      Index
      Help

NASA World Wind

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
import sys
from inspect import getsourcefile
from os import path

CURRENT_DIR = path.dirname(path.abspath(getsourcefile(lambda: 0)))
sys.path.insert(0, CURRENT_DIR[: CURRENT_DIR.rfind(path.sep)])

import click # pylint: disable=wrong-import-position
from ghlint import config # pylint: disable=wrong-import-position
from ghlint import lint # pylint: disable=wrong-import-position

@click.command()
def main():
    settings = config.settings()
    lint.run(settings)
    return

if __name__ == '__main__':
    main()


text:
#include "stdafx.h"

/*-----------------------------------------------------------------------------
include
*/
#include "glsMacro.h"
#include "GlsMat.h"
#include "glsShader.h"

#include "glsCartToPolar.h"

namespace gls
{

//-----------------------------------------------------------------------------
// glsShaderCartToPolar
class glsShaderCartToPolarBase : public glsShaderBase
{
protected:
	list<string> UniformNameList(void){
		list<string> lst;
		lst.push_back("texSrcX");
		lst.push_back("texSrcY");
		lst.push_back("angleInDegrees");
		return lst;
	}
public:
	glsShaderCartToPolarBase(const string& _name) :glsShaderBase(_name){}

};

//-----------------------------------------------------------------------------
// glsShaderCartToPolar
class glsShaderCartToPolar : public glsShaderCartToPolarBase
{
protected:
	string FragmentShaderCode(void);

public:
	glsShaderCartToPolar(void) : glsShaderCartToPolarBase(__FUNCTION__){}

};

//-----------------------------------------------------------------------------
//global
glsShaderCartToPolar ShaderCartToPolar;

//-----------------------------------------------------------------------------
//glsShaderCartToPolar
string glsShaderCartToPolar::FragmentShaderCode(void){
	const char fragmentShaderCode[] = TO_STR(
#version 330 core\n
precision highp float; \n
uniform sampler2D	texSrcX; \n
uniform sampler2D	texSrcY; \n
uniform int	angleInDegrees; \n
layout(location = 0) out float magnitude; \n
layout(location = 1) out float angle; \n
#define M_PI 3.1415926535897932384626433832795 \n
void main(void)\n
{ \n
	float x = texelFetch(texSrcX, ivec2(gl_FragCoord.xy), 0).r; \n
	float y = texelFetch(texSrcY, ivec2(gl_FragCoord.xy), 0).r; \n
	magnitude = sqrt(x*x + y*y); \n
	if (y < x) angle = atan(y, x); \n
	else angle = 0.5* M_PI - atan(x, y); \n
	angle = mod(angle + 2.0 * M_PI, 2.0 * M_PI);
	if (angleInDegrees!=0) angle = 360.0 * angle / (2.0*M_PI);\n
}\n
);
	return fragmentShaderCode;
}

static
glsShaderBase* selectShader(int type){
	glsShaderBase* shader = 0;
	switch (CV_MAT_DEPTH(type)){
	case(CV_32F) : shader = &ShaderCartToPolar; break;
	//case(CV_8U) :
	//case(CV_16U) : shader = &ShaderCartToPolarU; break;
	//case(CV_8S) :
	//case(CV_16S) :
	//case(CV_32S) : shader = &ShaderCartToPolarS; break;
	default: GLS_Assert(0);		//not implement
	}
	return shader;
}

void cartToPolar(const GlsMat& x, const GlsMat& y, GlsMat& magnitude, GlsMat& angle, bool angleInDegrees){
	GLS_Assert(x.type() == CV_32FC1);
	GLS_Assert(y.type() == CV_32FC1);

	magnitude = GlsMat(x.size(), x.type());
	angle = GlsMat(x.size(), x.type());

	glsShaderBase* shader = selectShader(x.type());
	shader->Execute(x, y, (int)angleInDegrees, magnitude, angle);
}

}//namespace gls


text:
import { app, BrowserWindow } from 'electron';

app.commandLine.appendSwitch('inspect', '5858');

/**
 * Set `__static` path to static files in production
 * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
 */
if (process.env.NODE_ENV !== 'development') {
    global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\');
}

let mainWindow;
const winURL = process.env.NODE_ENV === 'development'
    ? `http://localhost:9080`
    : `file://${__dirname}/index.html`;

console.log('Win rul : ', winURL);

function createWindow () {
    /**
     * Initial window options
     */
    mainWindow = new BrowserWindow({
        height        : 563,
        minWidth      : 720,
        minHeight     : 600,
        useContentSize: true,
        width         : 1000,
        icon          : 'assets/icons/github/icon.png'
    });

    mainWindow.loadURL(winURL);
    mainWindow.maximize();
    mainWindow.webContents.openDevTools();

    mainWindow.on('closed', () => {
        mainWindow = null;
    });
}

app.on('ready', createWindow);

app.on('window-all-closed', () => {
    if (process.platform !== 'darwin') {
        app.quit();
    }
});

app.on('activate', () => {
    if (mainWindow === null) {
        createWindow();
    }
});

/**
 * Auto Updater
 *
 * Uncomment the following code below and install `electron-updater` to
 * support auto updating. Code Signing with a valid certificate is required.
 * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-electron-builder.html#auto-updating
 */

/*
import { autoUpdater } from 'electron-updater'

autoUpdater.on('update-downloaded', () => {
  autoUpdater.quitAndInstall()
})

app.on('ready', () => {
  if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates()
})
 */


text:
export default (x1, x2) =>
  typeof window !== 'undefined' &&
  window.devicePixelRatio != null &&
  window.devicePixelRatio >= 1.5
    ? x2
    : x1


text:
export const getLocalizedFieldSequenceGeneratorFunction = (fieldValue, locales = ['en', 'fi', 'sv']) => {
  return (i) => {
    const value = {};
    locales.forEach((locale) => {
      value[locale] = `${fieldValue} (${locale}) - ${i}`;
    });
    return value;
  };
};


text:
static-metalsmith
=================
http://www.metalsmith.io/