text:
;
(function () {

// ************************** SVG utility methods ********************************************

    "use strict";
    var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;

    var svgAttributeMap = {
            "stroke-linejoin": "stroke-linejoin",
            "stroke-dashoffset": "stroke-dashoffset",
            "stroke-linecap": "stroke-linecap"
        },
        STROKE_DASHARRAY = "stroke-dasharray",
        DASHSTYLE = "dashstyle",
        LINEAR_GRADIENT = "linearGradient",
        RADIAL_GRADIENT = "radialGradient",
        DEFS = "defs",
        FILL = "fill",
        STOP = "stop",
        STROKE = "stroke",
        STROKE_WIDTH = "stroke-width",
        STYLE = "style",
        NONE = "none",
        JSPLUMB_GRADIENT = "jsplumb_gradient_",
        LINE_WIDTH = "lineWidth",
        ns = {
            svg: "http://www.w3.org/2000/svg",
            xhtml: "http://www.w3.org/1999/xhtml"
        },
        _attr = function (node, attributes) {
            for (var i in attributes)
                node.setAttribute(i, "" + attributes[i]);
        },
        _node = function (name, attributes) {
            attributes = attributes || {};
            attributes.version = "1.1";
            attributes.xmlns = ns.xhtml;
            return jsPlumb.createElementNS(ns.svg, name, null, null, attributes);
        },
        _pos = function (d) {
            return "position:absolute;left:" + d[0] + "px;top:" + d[1] + "px";
        },
        _clearGradient = function (parent) {
            var els = parent.querySelectorAll(" defs,linearGradient,radialGradient");
            for (var i = 0; i < els.length; i++)
                els[i].parentNode.removeChild(els[i]);
        },
        _updateGradient = function (parent, node, style, dimensions, uiComponent) {
            var id = JSPLUMB_GRADIENT + uiComponent._jsPlumb.instance.idstamp();
            // first clear out any existing gradient
            _clearGradient(parent);
            // this checks for an 'offset' property in the gradient, and in the absence of it, assumes
            // we want a linear gradient. if it's there, we create a radial gradient.
            // it is possible that a more explicit means of defining the gradient type would be
            // better. relying on 'offset' means that we can never have a radial gradient that uses
            // some default offset, for instance.
            // issue 244 suggested the 'gradientUnits' attribute; without this, straight/flowchart connectors with gradients would
            // not show gradients when the line was perfectly horizontal or vertical.
            var g;
            if (!style.gradient.offset)
                g = _node(LINEAR_GRADIENT, {id: id, gradientUnits: "userSpaceOnUse"});
            else
                g = _node(RADIAL_GRADIENT, { id: id });

            var defs = _node(DEFS);
            parent.appendChild(defs);
            defs.appendChild(g);

            // the svg radial gradient seems to treat stops in the reverse
            // order to how canvas does it.  so we want to keep all the maths the same, but
            // iterate the actual style declarations in reverse order, if the x indexes are not in order.
            for (var i = 0; i < style.gradient.stops.length; i++) {
                var styleToUse = uiComponent.segment == 1 || uiComponent.segment == 2 ? i : style.gradient.stops.length - 1 - i,
                    //stopColor = _ju.convertStyle(style.gradient.stops[styleToUse][1], true),
                    stopColor = style.gradient.stops[styleToUse][1],
                    s = _node(STOP, {"offset": Math.floor(style.gradient.stops[i][0] * 100) + "%", "stop-color": stopColor});

                g.appendChild(s);
            }
            var applyGradientTo = style.strokeStyle ? STROKE : FILL;
            node.setAttribute(applyGradientTo, "url(#" + id + ")");
        },
        _applyStyles = function (parent, node, style, dimensions, uiComponent) {

            node.setAttribute(FILL, style.fillStyle ? style.fillStyle : NONE);
            node.setAttribute(STROKE, style.strokeStyle ? style.strokeStyle : NONE);

            if (style.gradient) {
                _updateGradient(parent, node, style, dimensions, uiComponent);
            }
            else {
                // make sure we clear any existing gradient
                _clearGradient(parent);
                node.setAttribute(STYLE, "");
            }

            if (style.lineWidth) {
                node.setAttribute(STROKE_WIDTH, style.lineWidth);
            }

            // in SVG there is a stroke-dasharray attribute we can set, and its syntax looks like
            // the syntax in VML but is actually kind of nasty: values are given in the pixel
            // coordinate space, whereas in VML they are multiples of the width of the stroked
            // line, which makes a lot more sense.  for that reason, jsPlumb is supporting both
            // the native svg 'stroke-dasharray' attribute, and also the 'dashstyle' concept from
            // VML, which will be the preferred method.  the code below this converts a dashstyle
            // attribute given in terms of stroke width into a pixel representation, by using the
            // stroke's lineWidth.
            if (style[DASHSTYLE] && style[LINE_WIDTH] && !style[STROKE_DASHARRAY]) {
                var sep = style[DASHSTYLE].indexOf(",") == -1 ? " " : ",",
                    parts = style[DASHSTYLE].split(sep),
                    styleToUse = "";
                parts.forEach(function (p) {
                    styleToUse += (Math.floor(p * style.lineWidth) + sep);
                });
                node.setAttribute(STROKE_DASHARRAY, styleToUse);
            }
            else if (style[STROKE_DASHARRAY]) {
                node.setAttribute(STROKE_DASHARRAY, style[STROKE_DASHARRAY]);
            }

            // extra attributes such as join type, dash offset.
            for (var i in svgAttributeMap) {
                if (style[i]) {
                    node.setAttribute(svgAttributeMap[i], style[i]);
                }
            }
        },
        _appendAtIndex = function (svg, path, idx) {
            if (svg.childNodes.length > idx) {
                svg.insertBefore(path, svg.childNodes[idx]);
            }
            else svg.appendChild(path);
        };

    /**
     utility methods for other objects to use.
     */
    _ju.svg = {
        node: _node,
        attr: _attr,
        pos: _pos
    };

    // ************************** / SVG utility methods ********************************************

    /*
     * Base class for SVG components.
     */
    var SvgComponent = function (params) {
        var pointerEventsSpec = params.pointerEventsSpec || "all", renderer = {};

        _jp.jsPlumbUIComponent.apply(this, params.originalArgs);
        this.canvas = null;
        this.path = null;
        this.svg = null;
        this.bgCanvas = null;

        var clazz = params.cssClass + " " + (params.originalArgs[0].cssClass || ""),
            svgParams = {
                "style": "",
                "width": 0,
                "height": 0,
                "pointer-events": pointerEventsSpec,
                "position": "absolute"
            };

        this.svg = _node("svg", svgParams);

        if (params.useDivWrapper) {
            this.canvas = jsPlumb.createElement("div", { position : "absolute" });
            _ju.sizeElement(this.canvas, 0, 0, 1, 1);
            this.canvas.className = clazz;
        }
        else {
            _attr(this.svg, { "class": clazz });
            this.canvas = this.svg;
        }

        params._jsPlumb.appendElement(this.canvas, params.originalArgs[0].parent);
        if (params.useDivWrapper) this.canvas.appendChild(this.svg);

        var displayElements = [ this.canvas ];
        this.getDisplayElements = function () {
            return displayElements;
        };

        this.appendDisplayElement = function (el) {
            displayElements.push(el);
        };

        this.paint = function (style, anchor, extents) {
            if (style != null) {

                var xy = [ this.x, this.y ], wh = [ this.w, this.h ], p;
                if (extents != null) {
                    if (extents.xmin < 0) xy[0] += extents.xmin;
                    if (extents.ymin < 0) xy[1] += extents.ymin;
                    wh[0] = extents.xmax + ((extents.xmin < 0) ? -extents.xmin : 0);
                    wh[1] = extents.ymax + ((extents.ymin < 0) ? -extents.ymin : 0);
                }

                if (params.useDivWrapper) {
                    _ju.sizeElement(this.canvas, xy[0], xy[1], wh[0], wh[1]);
                    xy[0] = 0;
                    xy[1] = 0;
                    p = _pos([ 0, 0 ]);
                }
                else
                    p = _pos([ xy[0], xy[1] ]);

                renderer.paint.apply(this, arguments);

                _attr(this.svg, {
                    "style": p,
                    "width": wh[0] || 0,
                    "height": wh[1] || 0
                });
            }
        };

        return {
            renderer: renderer
        };
    };

    _ju.extend(SvgComponent, _jp.jsPlumbUIComponent, {
        cleanup: function (force) {
            if (force || this.typeId == null) {
                if (this.canvas) this.canvas._jsPlumb = null;
                if (this.svg) this.svg._jsPlumb = null;
                if (this.bgCanvas) this.bgCanvas._jsPlumb = null;

                if (this.canvas && this.canvas.parentNode)
                    this.canvas.parentNode.removeChild(this.canvas);
                if (this.bgCanvas && this.bgCanvas.parentNode)
                    this.canvas.parentNode.removeChild(this.canvas);

                this.svg = null;
                this.canvas = null;
                this.path = null;
                this.group = null;
            }
            else {
                // if not a forced cleanup, just detach from DOM for now.
                if (this.canvas && this.canvas.parentNode) this.canvas.parentNode.removeChild(this.canvas);
                if (this.bgCanvas && this.bgCanvas.parentNode) this.bgCanvas.parentNode.removeChild(this.bgCanvas);
            }
        },
        reattach:function(instance) {
            var c = instance.getContainer();
            if (this.canvas && this.canvas.parentNode == null) c.appendChild(this.canvas);
            if (this.bgCanvas && this.bgCanvas.parentNode == null) c.appendChild(this.bgCanvas);
        },
        setVisible: function (v) {
            if (this.canvas) {
                this.canvas.style.display = v ? "block" : "none";
            }
        }
    });

    /*
     * Base class for SVG connectors.
     */
    _jp.ConnectorRenderers.svg = function (params) {
        var self = this,
            _super = SvgComponent.apply(this, [
                {
                    cssClass: params._jsPlumb.connectorClass + (this.isEditable() ? " " + params._jsPlumb.editableConnectorClass : ""),
                    originalArgs: arguments,
                    pointerEventsSpec: "none",
                    _jsPlumb: params._jsPlumb
                }
            ]);

        var _superSetEditable = this.setEditable;
        this.setEditable = function(e) {
            var result = _superSetEditable.apply(this, [e]);
            jsPlumb[result ? "addClass" : "removeClass"](this.canvas, this._jsPlumb.instance.editableConnectorClass);
        };

        _super.renderer.paint = function (style, anchor, extents) {

            var segments = self.getSegments(), p = "", offset = [0, 0];
            if (extents.xmin < 0) offset[0] = -extents.xmin;
            if (extents.ymin < 0) offset[1] = -extents.ymin;

            if (segments.length > 0) {

                // create path from segments.
                for (var i = 0; i < segments.length; i++) {
                    p += _jp.Segments.svg.SegmentRenderer.getPath(segments[i]);
                    p += " ";
                }

                var a = {
                        d: p,
                        transform: "translate(" + offset[0] + "," + offset[1] + ")",
                        "pointer-events": params["pointer-events"] || "visibleStroke"
                    },
                    outlineStyle = null,
                    d = [self.x, self.y, self.w, self.h];

                // outline style.  actually means drawing an svg object underneath the main one.
                if (style.outlineColor) {
                    var outlineWidth = style.outlineWidth || 1,
                        outlineStrokeWidth = style.lineWidth + (2 * outlineWidth);
                    outlineStyle = _jp.extend({}, style);
                    delete outlineStyle.gradient;
                    outlineStyle.strokeStyle = style.outlineColor;
                    outlineStyle.lineWidth = outlineStrokeWidth;

                    if (self.bgPath == null) {
                        self.bgPath = _node("path", a);
                        _jp.addClass(self.bgPath, _jp.connectorOutlineClass);
                        _appendAtIndex(self.svg, self.bgPath, 0);
                    }
                    else {
                        _attr(self.bgPath, a);
                    }

                    _applyStyles(self.svg, self.bgPath, outlineStyle, d, self);
                }

                if (self.path == null) {
                    self.path = _node("path", a);
                    _appendAtIndex(self.svg, self.path, style.outlineColor ? 1 : 0);
                }
                else {
                    _attr(self.path, a);
                }

                _applyStyles(self.svg, self.path, style, d, self);
            }
        };
    };
    _ju.extend(_jp.ConnectorRenderers.svg, SvgComponent);

// ******************************* svg segment renderer *****************************************************

    _jp.Segments.svg = {
        SegmentRenderer: {
            getPath: function (segment) {
                return ({
                    "Straight": function () {
                        var d = segment.getCoordinates();
                        return "M " + d.x1 + " " + d.y1 + " L " + d.x2 + " " + d.y2;
                    },
                    "Bezier": function () {
                        var d = segment.params;
                        return "M " + d.x1 + " " + d.y1 +
                            " C " + d.cp1x + " " + d.cp1y + " " + d.cp2x + " " + d.cp2y + " " + d.x2 + " " + d.y2;
                    },
                    "Arc": function () {
                        var d = segment.params,
                            laf = segment.sweep > Math.PI ? 1 : 0,
                            sf = segment.anticlockwise ? 0 : 1;

                        return "M" + segment.x1 + " " + segment.y1 + " A " + segment.radius + " " + d.r + " 0 " + laf + "," + sf + " " + segment.x2 + " " + segment.y2;
                    }
                })[segment.type]();
            }
        }
    };

// ******************************* /svg segments *****************************************************

    /*
     * Base class for SVG endpoints.
     */
    var SvgEndpoint = _jp.SvgEndpoint = function (params) {
        var _super = SvgComponent.apply(this, [
            {
                cssClass: params._jsPlumb.endpointClass,
                originalArgs: arguments,
                pointerEventsSpec: "all",
                useDivWrapper: true,
                _jsPlumb: params._jsPlumb
            }
        ]);

        _super.renderer.paint = function (style) {
            var s = _jp.extend({}, style);
            if (s.outlineColor) {
                s.strokeWidth = s.outlineWidth;
                s.strokeStyle = s.outlineColor;
            }

            if (this.node == null) {
                this.node = this.makeNode(s);
                this.svg.appendChild(this.node);
            }
            else if (this.updateNode != null) {
                this.updateNode(this.node);
            }
            _applyStyles(this.svg, this.node, s, [ this.x, this.y, this.w, this.h ], this);
            _pos(this.node, [ this.x, this.y ]);
        }.bind(this);

    };
    _ju.extend(SvgEndpoint, SvgComponent);

    /*
     * SVG Dot Endpoint
     */
    _jp.Endpoints.svg.Dot = function () {
        _jp.Endpoints.Dot.apply(this, arguments);
        SvgEndpoint.apply(this, arguments);
        this.makeNode = function (style) {
            return _node("circle", {
                "cx": this.w / 2,
                "cy": this.h / 2,
                "r": this.radius
            });
        };
        this.updateNode = function (node) {
            _attr(node, {
                "cx": this.w / 2,
                "cy": this.h / 2,
                "r": this.radius
            });
        };
    };
    _ju.extend(_jp.Endpoints.svg.Dot, [_jp.Endpoints.Dot, SvgEndpoint]);

    /*
     * SVG Rectangle Endpoint
     */
    _jp.Endpoints.svg.Rectangle = function () {
        _jp.Endpoints.Rectangle.apply(this, arguments);
        SvgEndpoint.apply(this, arguments);
        this.makeNode = function (style) {
            return _node("rect", {
                "width": this.w,
                "height": this.h
            });
        };
        this.updateNode = function (node) {
            _attr(node, {
                "width": this.w,
                "height": this.h
            });
        };
    };
    _ju.extend(_jp.Endpoints.svg.Rectangle, [_jp.Endpoints.Rectangle, SvgEndpoint]);

    /*
     * SVG Image Endpoint is the default image endpoint.
     */
    _jp.Endpoints.svg.Image = _jp.Endpoints.Image;
    /*
     * Blank endpoint in svg renderer is the default Blank endpoint.
     */
    _jp.Endpoints.svg.Blank = _jp.Endpoints.Blank;
    /*
     * Label overlay in svg renderer is the default Label overlay.
     */
    _jp.Overlays.svg.Label = _jp.Overlays.Label;
    /*
     * Custom overlay in svg renderer is the default Custom overlay.
     */
    _jp.Overlays.svg.Custom = _jp.Overlays.Custom;

    var AbstractSvgArrowOverlay = function (superclass, originalArgs) {
        superclass.apply(this, originalArgs);
        _jp.jsPlumbUIComponent.apply(this, originalArgs);
        this.isAppendedAtTopLevel = false;
        var self = this;
        this.path = null;
        this.paint = function (params, containerExtents) {
            // only draws on connections, not endpoints.
            if (params.component.svg && containerExtents) {
                if (this.path == null) {
                    this.path = _node("path", {
                        "pointer-events": "all"
                    });
                    params.component.svg.appendChild(this.path);
                    if (this.elementCreated) {
                        this.elementCreated(this.path, params.component);
                    }

                    this.canvas = params.component.svg; // for the sake of completeness; this behaves the same as other overlays
                }
                var clazz = originalArgs && (originalArgs.length == 1) ? (originalArgs[0].cssClass || "") : "",
                    offset = [0, 0];

                if (containerExtents.xmin < 0) offset[0] = -containerExtents.xmin;
                if (containerExtents.ymin < 0) offset[1] = -containerExtents.ymin;

                _attr(this.path, {
                    "d": makePath(params.d),
                    "class": clazz,
                    stroke: params.strokeStyle ? params.strokeStyle : null,
                    fill: params.fillStyle ? params.fillStyle : null,
                    transform: "translate(" + offset[0] + "," + offset[1] + ")"
                });
            }
        };
        var makePath = function (d) {
            return (isNaN(d.cxy.x) || isNaN(d.cxy.y)) ? "" : "M" + d.hxy.x + "," + d.hxy.y +
                " L" + d.tail[0].x + "," + d.tail[0].y +
                " L" + d.cxy.x + "," + d.cxy.y +
                " L" + d.tail[1].x + "," + d.tail[1].y +
                " L" + d.hxy.x + "," + d.hxy.y;
        };
        this.transfer = function(target) {
            if (target.canvas && this.path && this.path.parentNode) {
                this.path.parentNode.removeChild(this.path);
                target.canvas.appendChild(this.path);
            }
        };
    };
    _ju.extend(AbstractSvgArrowOverlay, [_jp.jsPlumbUIComponent, _jp.Overlays.AbstractOverlay], {
        cleanup: function (force) {
            if (this.path != null) {
                if (force)
                    this._jsPlumb.instance.removeElement(this.path);
                else
                    if (this.path.parentNode)
                        this.path.parentNode.removeChild(this.path);
            }
        },
        reattach:function(instance) {
            if (this.path && this.canvas && this.path.parentNode == null)
                this.canvas.appendChild(this.path);
        },
        setVisible: function (v) {
            if (this.path != null) (this.path.style.display = (v ? "block" : "none"));
        }
    });

    _jp.Overlays.svg.Arrow = function () {
        AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Arrow, arguments]);
    };
    _ju.extend(_jp.Overlays.svg.Arrow, [ _jp.Overlays.Arrow, AbstractSvgArrowOverlay ]);

    _jp.Overlays.svg.PlainArrow = function () {
        AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.PlainArrow, arguments]);
    };
    _ju.extend(_jp.Overlays.svg.PlainArrow, [ _jp.Overlays.PlainArrow, AbstractSvgArrowOverlay ]);

    _jp.Overlays.svg.Diamond = function () {
        AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Diamond, arguments]);
    };
    _ju.extend(_jp.Overlays.svg.Diamond, [ _jp.Overlays.Diamond, AbstractSvgArrowOverlay ]);

    // a test
    _jp.Overlays.svg.GuideLines = function () {
        var path = null, self = this, p1_1, p1_2;
        _jp.Overlays.GuideLines.apply(this, arguments);
        this.paint = function (params, containerExtents) {
            if (path == null) {
                path = _node("path");
                params.connector.svg.appendChild(path);
                self.attachListeners(path, params.connector);
                self.attachListeners(path, self);

                p1_1 = _node("path");
                params.connector.svg.appendChild(p1_1);
                self.attachListeners(p1_1, params.connector);
                self.attachListeners(p1_1, self);

                p1_2 = _node("path");
                params.connector.svg.appendChild(p1_2);
                self.attachListeners(p1_2, params.connector);
                self.attachListeners(p1_2, self);
            }

            var offset = [0, 0];
            if (containerExtents.xmin < 0) offset[0] = -containerExtents.xmin;
            if (containerExtents.ymin < 0) offset[1] = -containerExtents.ymin;

            _attr(path, {
                "d": makePath(params.head, params.tail),
                stroke: "red",
                fill: null,
                transform: "translate(" + offset[0] + "," + offset[1] + ")"
            });

            _attr(p1_1, {
                "d": makePath(params.tailLine[0], params.tailLine[1]),
                stroke: "blue",
                fill: null,
                transform: "translate(" + offset[0] + "," + offset[1] + ")"
            });

            _attr(p1_2, {
                "d": makePath(params.headLine[0], params.headLine[1]),
                stroke: "green",
                fill: null,
                transform: "translate(" + offset[0] + "," + offset[1] + ")"
            });
        };

        var makePath = function (d1, d2) {
            return "M " + d1.x + "," + d1.y +
                " L" + d2.x + "," + d2.y;
        };
    };
    _ju.extend(_jp.Overlays.svg.GuideLines, _jp.Overlays.GuideLines);
}).call(typeof window !== 'undefined' ? window : this);


text:
PlSharer -- Research
====================================================
*Proyecto 2 -- Research and Write your Own Tutorial*
*Herramientas de Programación en Internet (CI-5644)*

En éste documento podrá encontrar una investigación acerca del framework
Symfony2.

Tabla de contenidos
--------------------

- [Una breve introducción al lenguaje base (PHP).][a]
- [Datos históricos.][b]
- [Filosofía del framework: inspiración, conceptos principales, valores principales perseguidos por el framework.][c]
- [División de responsabilidades, usando el patrón MVC.][d]
- [Sistema de directorios usado por el framework.][e]
- [Configuración.][f]
- [Definiciones de vistas (páginas HTML) y acciones (lógica de la app).][g]
- [Interacción con la base de datos (que librería usa, como se definen los modelos, como se definen las conexiones, el lenguaje de consulta, etc.)][h]
- [Facilidades provistas por el framework (servidores web, frameworks de pruebas, cónsola para ejecución de código, etc).][i]
- [Mecanismos de seguridad provistos por el framework, como desplegar una aplicación del framework en algún servidor web, etc.][j]

[a]: #
[b]: #
[c]: #
[d]: #
[e]: #
[f]: #
[g]: #
[h]: #
[i]: #
[j]: #

redpajama_set_name: RedPajamaGithub


text:
namespace SharedKernel
{
    using System;

    public static class Guard
    {
        public static void ForLessEqualZero(int value, string parameterName)
        {
            if (value <= 0)
            {
                throw new ArgumentOutOfRangeException(parameterName);
            }
        }

        public static void ForNullOrEmpty(string value, string parameterName)
        {
            if (string.IsNullOrEmpty(value))
            {
                throw new ArgumentOutOfRangeException(parameterName);
            }
        }
    }
}


text:
package org.ripple.power.txns;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import com.ripple.core.enums.TransactionFlag;

public class TransactionFlagMap {

	private final static HashMap<Long, String> _flags = new HashMap<Long, String>(30);
	static {
		// Constraints flags:
		_flags.put(TransactionFlag.FullyCanonicalSig, "FullyCanonicalSig");
		_flags.put(TransactionFlag.Universal, "Universal");
		_flags.put(TransactionFlag.UniversalMask, "UniversalMask");
		_flags.put(TransactionFlag.RequireDestTag, "RequireDestTag");
		_flags.put(TransactionFlag.OptionalDestTag, "OptionalDestTag");
		_flags.put(TransactionFlag.RequireAuth, "RequireAuth");
		_flags.put(TransactionFlag.OptionalAuth, "OptionalAuth");
		_flags.put(TransactionFlag.DisallowXRP, "DisallowXRP");
		_flags.put(TransactionFlag.AllowXRP, "AllowXRP");
		_flags.put(TransactionFlag.AccountSetMask, "AccountSetMask");
		_flags.put(TransactionFlag.asfRequireDest, "asfRequireDest");
		_flags.put(TransactionFlag.asfRequireAuth, "asfRequireAuth");
		_flags.put(TransactionFlag.asfDisallowXRP, "asfDisallowXRP");
		_flags.put(TransactionFlag.asfDisableMaster, "asfDisableMaster");
		_flags.put(TransactionFlag.asfAccountTxnID, "asfAccountTxnID");
		_flags.put(TransactionFlag.asfNoFreeze, "asfNoFreeze");
		_flags.put(TransactionFlag.asfGlobalFreeze, "asfGlobalFreeze");
		// OfferCreate flags:
		_flags.put(TransactionFlag.Passive, "Passive");
		_flags.put(TransactionFlag.ImmediateOrCancel, "ImmediateOrCancel");
		_flags.put(TransactionFlag.FillOrKill, "FillOrKill");
		_flags.put(TransactionFlag.Sell, "Sell");
		_flags.put(TransactionFlag.OfferCreateMask, "OfferCreateMask");
		// Payment flags:
		_flags.put(TransactionFlag.NoRippleDirect, "NoRippleDirect");
		_flags.put(TransactionFlag.PartialPayment, "PartialPayment");
		_flags.put(TransactionFlag.LimitQuality, "LimitQuality");
		_flags.put(TransactionFlag.PaymentMask, "PaymentMask");
		// TrustSet flags:
		_flags.put(TransactionFlag.SetAuth, "SetAuth");
		_flags.put(TransactionFlag.SetNoRipple, "SetNoRipple");
		_flags.put(TransactionFlag.ClearNoRipple, "ClearNoRipple");
		_flags.put(TransactionFlag.SetFreeze, "SetFreeze");
		_flags.put(TransactionFlag.ClearFreeze, "ClearFreeze");
		_flags.put(TransactionFlag.TrustSetMask, "TrustSetMask");
		// Special flags:
		_flags.put(0x30000L, "Cheater");
		_flags.put(0L, "Empty");
	}

	public final static String getString(long flag) {
		String result = _flags.get(flag);
		return result == null ? "Unkown" : result;
	}

	public final static long getFlag(String name) {
		Set<Map.Entry<Long, String>> set = _flags.entrySet();
		for (Iterator<Map.Entry<Long, String>> it = set.iterator(); it.hasNext();) {
			Entry<Long, String> result = it.next();
			if (result.getValue().equalsIgnoreCase(name)) {
				return result.getKey();
			}
		}
		return 0;
	}

	public final static ArrayList<String> values() {
		ArrayList<String> list = new ArrayList<String>(_flags.size());
		for (String v : _flags.values()) {
			list.add(v);
		}
		return list;
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://maven.apache.org/POM/4.0.0"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>com.f2prateek.rx.android.preferences</groupId>
    <artifactId>rx-preferences-parent</artifactId>
    <version>0.1.0-SNAPSHOT</version>
  </parent>

  <artifactId>rx-preferences</artifactId>
  <name>rx-preferences</name>

  <dependencies>
    <dependency>
      <groupId>io.reactivex</groupId>
      <artifactId>rxjava</artifactId>
    </dependency>
    <dependency>
      <groupId>io.reactivex</groupId>
      <artifactId>rxandroid</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.robolectric</groupId>
      <artifactId>robolectric</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.google.android</groupId>
      <artifactId>android</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>


text:
<!DOCTYPE HTML>

	<meta charset="UTF-8">
	<title>Paperboy Unit Tests</title>

	<link rel="stylesheet" type="text/css" href="lib/qunit.css">


text:
var myApp;
(function (myApp) {
    var InMemoryProductDataService = (function () {
        function InMemoryProductDataService(products) {
            this.products = products;
            this.productListSeedData = [
                { Id: 1, Name: "Batman Action Figure", ListPrice: 14.95, Category: "Action Figures", Description: "A super hero who sometimes plays the role of a dark knight.", ProductImageUrl: "WP0001.jpg" },
                { Id: 2, Name: "Captain America Action Figure", ListPrice: 12.95, Category: "Action Figures", Description: "A super action figure that protects freedom and the American way of life.", ProductImageUrl: "WP0002.jpg" },
                { Id: 3, Name: "Easel with Supply Trays", ListPrice: 49.95, Category: "Arts and Crafts", Description: "A serious easel for serious young artists.", ProductImageUrl: "WP0003.jpg" },
                { Id: 4, Name: "Crate o' Crayons", ListPrice: 14.95, Category: "Arts and Crafts", Description: "More crayons that you can shake a stick at.", ProductImageUrl: "WP0004.jpg" },
                { Id: 5, Name: "Green Stomper Bully", ListPrice: 24.95, Category: "Remote Control", Description: "A green alternative to crush and destroy the Red Stomper Bully.", ProductImageUrl: "WP0005.jpg" },
                { Id: 6, Name: "Indy Race Car", ListPrice: 19.95, Category: "Remote Control", Description: "The fastest remote control race car on the market today.", ProductImageUrl: "WP0006.jpg" },
                { Id: 7, Name: "Twitter Follower Action Figure", ListPrice: 1.00, Category: "Action Figures", Description: "An inexpensive action figure you can never have too many of.", ProductImageUrl: "WP0007.jpg" },
                { Id: 8, Name: "Sandpiper Prop Plane", ListPrice: 24.95, Category: "Remote Control", Description: "A simple RC prop plane for younger pilots.", ProductImageUrl: "WP0008.jpg" },
                { Id: 9, Name: "Etch A Sketch", ListPrice: 12.95, Category: "Arts and Crafts", Description: "A strategic planning tool for the Romney campaign.", ProductImageUrl: "WP0009.jpg" },
                { Id: 10, Name: "Flying Squirrel", ListPrice: 69.95, Category: "Remote Control", Description: "A stealthy remote control plane that flies on the down-low and under the radar.", ProductImageUrl: "WP0010.jpg" },
                { Id: 11, Name: "FOX News Chopper", ListPrice: 29.95, Category: "Remote Control", Description: "A new chopper which can generate new events on demand.", ProductImageUrl: "WP0011.jpg" },
                { Id: 12, Name: "Godzilla Action Figure", ListPrice: 19.95, Category: "Action Figures", Description: "The classic and adorable action figure from those old Japanese movies.", ProductImageUrl: "WP0012.jpg" },
                { Id: 13, Name: "Perry the Platypus Action Figure", ListPrice: 21.95, Category: "Action Figures", Description: "A platypus who plays an overly intelligent detective sleuth on TV.", ProductImageUrl: "WP0013.jpg" },
                { Id: 14, Name: "Seal Team 6 Helicopter", ListPrice: 59.95, Category: "Remote Control", Description: "A serious helicopter that can open up a can of whoop-ass when required.", ProductImageUrl: "WP0014.jpg" },
                { Id: 15, Name: "Crayloa Crayon Set", ListPrice: 2.49, Category: "Arts and Crafts", Description: "A very fun set of crayons in every color.", ProductImageUrl: "WP0015.jpg" }
            ];
            this.products = this.productListSeedData;
        }
        InMemoryProductDataService.prototype.GetAllProducts = function () {
            return this.products;
        };
        ;
        InMemoryProductDataService.prototype.GetProduct = function (id) {
            var products = this.products.filter(function (product) { return product.Id === id; });
            var product = products[0];
            return product;
        };
        ;
        InMemoryProductDataService.prototype.AddProduct = function (product) {
            var Ids = this.products.map(function (p) { return p.Id; });
            var newId = Math.max.apply(Math, Ids) + 1;
            product.Id = newId;
            this.products.push(product);
        };
        ;
        InMemoryProductDataService.prototype.DeleteProduct = function (id) {
            var index = this.products.map(function (product) { return product.Id; }).indexOf(id);
            this.products.splice(index, 1);
        };
        ;
        InMemoryProductDataService.prototype.UpdateProduct = function (product) {
            var index = this.products.map(function (product) { return product.Id; }).indexOf(product.Id);
            this.products[index] = product;
        };
        ;
        InMemoryProductDataService.prototype.GetProductCategories = function () {
            return ["Action Figures", "Arts and Crafts", "Remote Control"];
        };
        ;
        InMemoryProductDataService.prototype.GetProductsByCategory = function (category) {
            return this.products.filter(function (product) { return product.Category === category; });
        };
        return InMemoryProductDataService;
    }());
    InMemoryProductDataService.$inject = [];
    myApp.InMemoryProductDataService = InMemoryProductDataService;
    angular.module('myApp').service('ProductDataService', InMemoryProductDataService);
})(myApp || (myApp = {}));
//# sourceMappingURL=services.js.map


text:
<!DOCTYPE html>

<html>
    <head>
        <title>d3 Pictorial Statistics</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="author" content="Thomas Treml (datadonk23@gmail.com)">

        <!-- d3 -->
        <script src="js/d3.js"></script>

        <!-- jQuery -->
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
        <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css" />
        <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>
        <script src="//cdn.jsdelivr.net/jquery.ui.touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script>

        <!-- d3 Style CSS -->
        <link rel="stylesheet" href="css/d3CSS.css">

    </head>

    <body>
        <!-- d3 JavaScript -->
        <script src="js/d3Code.js"></script>

    </body>
</html>


text:
(function($) {

    //add batch operation
    $.fn.editableRecord = function( options ) {
        var $this = $.extend(this, defaultSetting, options);

        initialize($this);

        return this;
    };

    var defaultSetting = {
        //attributes
        idName: null,
        multiple: true,
        addable: true,

        //buttons
        saveButton: '
Save
',
        cancellButton: '
Cancel
',
        newButton: '
New
',
        deleteButton: '

',
        detailButton: '

',
        orButton: '

',
        buttonGroup: '

',
        saveButtonLocation: '',

        //urls
        createUrl: null,
        updateUrl: null,
        saveUlr: null,
        deleteUrl: null,

        //events
        preCreate: jQuery.noop,
        preUpdate: jQuery.noop,
        preSave: jQuery.noop,
        preDelete: jQuery.noop,
        postCreate: jQuery.noop,
        postUpdate: jQuery.noop,
        postSave: jQuery.noop,
        postDelete: jQuery.noop,
        detailButtonClicked: jQuery.noop,
        errorHandler: jQuery.noop
    };

    function initialize(editableRecord){
        if(editableRecord.addable){
            appendNewButton(editableRecord);
        }
        appendButtons(editableRecord);
        appendTableHeadForDeleteButton(editableRecord);
        initButtons(editableRecord);
        makeTableEditable(editableRecord);
        getValidation(editableRecord);
    }

    function getKeys(editableRecord){
        var keys = [];
        editableRecord.find('thead th').each(function (i, th) {
            var key = $(th).attr('name');
            if(key !== 'action') keys.push(key);
        });
        return keys;
    }

    function makeTableEditable(editableRecord){
        editableRecord.find('tbody tr').each(function (i, tr) {
            makeFieldsEditable(editableRecord, tr);
        });
    }

    function getPostData(editableRecord, keys, row){
        var fields = row.find('td');
        var tmp = {};
        if(row.attr('id') !== undefined){
            tmp[editableRecord.idName] = row.attr('id');
        }
        for(var i = 0; i < keys.length; i++){
            if($(fields[i]).data('type') == 'select'){
                tmp[keys[i]] = $(fields[i]).find('select').val();
            }else {
                tmp[keys[i]] = $(fields[i]).find('input').val();
            }
        }
        return tmp;
    }

    function appendButtons(editableRecord){

        editableRecord.buttonGroup = $(editableRecord.buttonGroup).append(editableRecord.cancellButton + editableRecord.orButton + editableRecord.saveButton);
        editableRecord.buttonGroup.css('float', 'right').insertAfter(editableRecord);
        editableRecord.buttonGroup.find('div[name=save]').on('click.editableRecord', function(){
            saveButtonClicked(editableRecord);
        });
        editableRecord.buttonGroup.find('div[name=cancel]').on('click.editableRecord', function(){
            cancelButtonClicked(editableRecord);
        });
    }

    function appendNewButton(editableRecord){
        editableRecord.newButton = $(editableRecord.newButton);
        editableRecord.newButton.css('float', 'left').insertAfter(editableRecord).on('click.editableRecord', function(){
            newButtonClicked(editableRecord);
        });
    }

    function appendTableHeadForDeleteButton(editableRecord){
        editableRecord.find('thead tr').append('Action	')
    }

    function hideButtons(editableRecord){
        editableRecord.buttonGroup.hide();
    }

    function hideNewButton(editableRecord){
        editableRecord.newButton.hide();
    }

    function showButtons(editableRecord){
        editableRecord.buttonGroup.show();
    }

    function showNewButton(editableRecord){
        editableRecord.newButton.show();
    }

    function initButtons(editableRecord){
        hideButtons(editableRecord);
        hideNewButton(editableRecord);

        if(editableRecord.multiple) {
            showNewButton(editableRecord);
        }
    }

    function makeFieldsEditable(editableRecord, row){
        var $row = $(row);

        if(!$row.find('td').last().hasClass('action')){
            $row.append('	');
        }

        $row.find('td').each(function(i, td){
            var $field = $(td);
            if(!$field.hasClass('action')) {
                var typePlugin = getTypePlugin(td);
                var input = typePlugin.makeEditable(td);
                input.on('change.editableRecord keyup.editableRecord click.editableRecord', function(){
                    if(typePlugin.isChanged($field)){
                        showButtons(editableRecord);
                    }
                });
                $field.empty();
                $field.append(input);
            }else{
                $(editableRecord.detailButton).appendTo($field).on('click.editableRecord', function () {
                    if($(this).closest('tr').attr('id') === undefined) return;
                    editableRecord.detailButtonClicked($(this).closest('tr'));
                });
                $(editableRecord.deleteButton).appendTo($field).on('click.editableRecord', function () {
                    deleteButtonClicked(editableRecord, $row);
                });
            }
        });
    }

    function newButtonClicked(editableRecord){
        var rowTemplate = getRowTemplate(editableRecord);
        $(rowTemplate).appendTo(editableRecord);
    }

    function saveButtonClicked(editableRecord){
        var keys = getKeys(editableRecord);
        var postDatas = [];
        editableRecord.find('tbody tr').each(function (i, tr) {
            var $row = $(tr);
            var postData = {};

            if(isChanged($row)){
                if(doValidate(editableRecord, $row)){
                    postData = getPostData(editableRecord, keys, $row);
                    postDatas.push({data:postData, row: $row});
                }else {
                    $row.addClass('negative');
                    $row.find('div.ui.input').addClass('error');
                }
            }
        });

        saveAll(editableRecord, postDatas);
    }

    function cancelButtonClicked(editableRecord){
        editableRecord.find('tbody tr').each(function (i, tr) {
            var $row = $(tr);

            if($row.attr('id') === 'new'){
                $row.remove();
            }else{
                $row.find('td').each(function(i, td){
                    var $field = $(td);
                    $field.find('input').val($field.data('value'));
                });
            }
        });
        hideButtons(editableRecord);
    }

    function deleteButtonClicked(editableRecord, row){
        if($(row).attr('id') == undefined){
            $(row).remove();
        }else{
            var postData = {};
            postData[editableRecord.idName] = row.attr('id');
            editableRecord.preDelete(row);
            $.ajax({
                url: editableRecord.deleteUrl,
                type: 'POST',
                data: postData,
                cache: false,
                dataType: 'json',
                success: function(result){
                    row.remove();
                    editableRecord.postDelete(result);
                }
            });
        }
    }

    function saving(editableRecord){
        $(editableRecord.saveButton).addClass('loading');
        $(editableRecord.cancellButton).addClass('loading');
        $(editableRecord.newButton).addClass('loading');
        editableRecord.find('tbody tr').each(function (i, tr) {
            $(tr).removeClass('positive');
        });
    }

    function saveAll(editableRecord, postDatas){
        if($.isEmptyObject(postDatas)) return;

        saving(editableRecord);

        var requests = [];
        $.each(postDatas, function (i, postData) {
            var isNew = isNewRecord(editableRecord, postData.data);

            if(isNew){
                editableRecord.preCreate(postData.data);
            }else{
                editableRecord.preUpdate(postData.data);
            }
            editableRecord.preSave(postData);

            var request = $.ajax({
                url: isNew ? (editableRecord.createUrl ? editableRecord.createUrl : editableRecord.saveUrl) : (editableRecord.updateUrl ? editableRecord.updateUrl : editableRecord.saveUrl),
                type : 'POST',
                data: postData.data,
                cache : false,
                dataType : 'json',
                success: function(result){
                    postData.row.removeClass('negative').addClass('positive');
                    postData.row.find('div.ui.input').removeClass('error');
                    postData.row.attr('id', result[editableRecord.idName]);
                    postData.row.find('td').each(function(idx, td){
                        var typePlugin = getTypePlugin(td);
                        typePlugin.fieldSaved(td);
                    });
                    if(isNew){
                        editableRecord.postCreate(result);
                    }else{
                        editableRecord.postUpdate(result);
                    }
                    editableRecord.postSave(result);
                },
                error: function(result){
                    postData.row.removeClass('positive').addClass('negative');
                    editableRecord.errorHandler(result);
                    saveComplete(editableRecord);
                }
            });
            requests.push(request);
        });

        $.when.apply($, requests).then(function(){
            //todo: add error handler
            saveComplete(editableRecord);
        });
    }

    function saveComplete(editableRecord){
        $(editableRecord.saveButton).removeClass('loading');
        $(editableRecord.cancellButton).removeClass('loading');
        $(editableRecord.newButton).removeClass('loading');
        hideButtons(editableRecord);
    }

    function isNewRecord(editableRecord, postData){
        return postData[editableRecord.idName] === undefined;
    }

    function isChanged(row){
        var result = false;
        row.find('td').each(function(i, td){
            var $field = $(td);
            if(!$field.hasClass('action')){
                var typePlugin = getTypePlugin(td);
                if(typePlugin.isChanged($field)){
                    result = true;
                }
            }
        });
        return result;
    }

    function getRowTemplate(editableRecord){
        var rowTemplate = editableRecord.find('thead tr').clone();
        rowTemplate.find('th').each(function (i, th) {
            var $td = $('	');
            $.each($(th).data(), function(key, value){
                $td.attr('data-'+key, value);
            });

            if($(th).attr('name') == 'action'){
                $(th).remove();
            }else{
                $(th).replaceWith($td);
            }
        });
        makeFieldsEditable(editableRecord, rowTemplate);
        return rowTemplate;
    }

    function getTypePlugin(td){
        var type = $(td).data('type');
        if(type === undefined){
            type = 'text';
        }

        var typePlugin = $.fn.editableRecord.typePlugins[type];
        if(typePlugin === undefined){
            console.error('No avaliable plugin found for "' + type + '"');
        }

        return typePlugin;
    }

    function getValidation(editableRecord){
        editableRecord.validation = {};
        editableRecord.find('thead th').each(function(i, th){
            var $th = $(th), keyName = $th.attr('name');
            if($th.attr('name') !== 'action') {
                var validation = $th.data('validation');
                if(validation != undefined) {
                    validation = validation.split(',');
                    editableRecord.validation[keyName] = validation;
                }
            }
        });
    }

    function doValidate(editableRecord, row){
        var result = true;
        var keys = getKeys(editableRecord);
        $(row).find('td').each(function(idx, td){
            if (!$(td).hasClass('action')){
                var typePlugin = getTypePlugin(td);
                var name = keys[idx];
                if(editableRecord.validation.hasOwnProperty(name)){
                    result = result && typePlugin.validate(editableRecord.validation[name], td);
                }else {
                    result = result && true;
                }
            }
        });
        return result;
    }

    //data types
    $.fn.editableRecord.typePlugins = {};

    $.fn.editableRecord.typePlugins.text = {

        makeEditable : function (field) {
            var $field = $(field),
                value = $field.text();

            $field.attr('data-value', value);
            var inputWrapper = $('

');
            var inputField = inputWrapper.append($('<input type="text" />').val(value));

            return inputField;
        },

        isChanged : function (field){
            return field.attr('data-value') !== field.find('input').val();
        },

        fieldSaved: function (field){
            var value = $(field).find('input').val();
            $(field).attr('data-value', value);
        },

        validate: function (conditions, field) {
            var result = true;
            $.each(conditions, function(idx, condition){
                switch (condition) {
                    case 'notnull' :
                        var $input = $(field).find('input');
                        result = $input.val() != '';
                        break;
                    default :
                        result = false;
                        break;
                }
            });
            return result;
        }
    };

    $.fn.editableRecord.typePlugins.email = $.extend({}, $.fn.editableRecord.typePlugins.text, {
        makeEditable : function (field) {
            var $field = $(field),
                value = $field.text();

            $field.attr('data-value', value);
            var inputWrapper = $('

');
            var inputField = inputWrapper.append($('<input type="email" />').val(value));
            return inputField
        }
    });

    $.fn.editableRecord.typePlugins.number = $.extend({}, $.fn.editableRecord.typePlugins.text, {
        makeEditable : function (field) {
            var $field = $(field),
                value = $field.text();

            $field.attr('data-value', value);
            var inputWrapper = $('

');
            var inputField = inputWrapper.append($('<input type="number" />').val(value));
            return inputField
        }
    });

    $.fn.editableRecord.typePlugins.date = $.extend({}, $.fn.editableRecord.typePlugins.text, {
        makeEditable: function(field){
            var $field = $(field),
                value = $field.text();

            $field.attr('data-value', value);
            var inputWrapper = $('

');
            var inputField = inputWrapper.append($('<input type="date"/>').val(value));
            return inputField
        }
    });

    $.fn.editableRecord.typePlugins.checkbox = $.extend({}, $.fn.editableRecord.typePlugins.text, {
        makeEditable : function (field) {
            var $field = $(field),
                value = $field.text(),
                checkedValue = $field.data('checked'),
                uncheckedValue = $field.data('unchecked');

            $field.attr('data-value', value);
            var inputWrapper = $('

');
            var inputField = inputWrapper.append($('<input type="checkbox"/>').attr('checked', checkedValue === value).val(value))
                                         .append(''+value+'');
            inputField.checkbox({
                onChecked: function(){
                    var $this = $(this);
                    $this.val(checkedValue);
                    $this.next().html(checkedValue);
                },
                onUnchecked: function(){
                    var $this = $(this);
                    $this.val(uncheckedValue);
                    $this.next().html(uncheckedValue);
                }
            });
            return inputField
        },

        isChanged: function(field){
            return field.data('value') !== field.find('input').val();
        }
    });

    $.fn.editableRecord.typePlugins.color = $.extend({}, $.fn.editableRecord.typePlugins.text,{
        makeEditable : function (field) {
            var $field = $(field),
                value = $field.text();

            $field.attr('data-value', value);
            var inputWrapper = $('

');
            var inputField = inputWrapper.append($('<input type="color" />').val(value));

            return inputField
        }
    });

    //todo load value from text
    $.fn.editableRecord.typePlugins.select = $.extend({}, $.fn.editableRecord.typePlugins.text, {
        makeEditable: function (field) {
            var $field = $(field),
                value = $field.text(),
                defaultValue = $field.data('defaultvalue'),
                defaultLable = $field.data('defaultlable'),
                optionsFunction = $field.data('options');

            var options = window[optionsFunction]();

            $field.attr('data-value', value);
            var inputField = $('<select class="ui dropdown"></select>'),
                defaultOption = $('<option></option>');
            defaultOption.val(defaultValue);
            defaultOption.text(defaultLable);
            inputField.append(defaultOption);

            $.each(options, function(idx, elem){

                var option = $('<option></option>');
                option.val(elem.value);
                option.text(elem.text);
                if(elem.value === value){
                    option.attr('selected', true);
                }
                inputField.append(option);
            });

            inputField.dropdown();
            return inputField;
        },

        isChanged: function(field) {
            return field.data('value') !== field.find('select').val();
        },

        validate: function (conditions, field) {
            var result = true;
            $.each(conditions, function(idx, condition){
                switch (condition) {
                    case 'notnull' :
                        var $input = $(field).find('select');
                        result = $input.val() != '';
                        break;
                    default :
                        result = false;
                        break;
                }
            });
            return result;
        }
    })

}(jQuery));


text:
package net.vz.mongodb.jackson.internal;

import net.vz.mongodb.jackson.DBRef;
import net.vz.mongodb.jackson.Id;
import net.vz.mongodb.jackson.ObjectId;
import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.introspect.*;
import org.codehaus.jackson.type.JavaType;

import java.lang.annotation.Annotation;

/**
 * Annotation introspector that supports @ObjectId's
 *
 * @author James Roper
 * @since 1.0
 */
public class MongoAnnotationIntrospector extends NopAnnotationIntrospector {
    private final DeserializationConfig deserializationConfig;

    public MongoAnnotationIntrospector(DeserializationConfig deserializationConfig) {
        this.deserializationConfig = deserializationConfig;
    }

    @Override
    public boolean isHandled(Annotation ann) {
        return ann.annotationType() == ObjectId.class
                || ann.annotationType() == Id.class
                || ann.annotationType() == javax.persistence.Id.class;
    }

    // Handling of javax.persistence.Id
    @Override
    public String findGettablePropertyName(AnnotatedMethod am) {
        return findPropertyName(am);
    }

    @Override
    public String findSettablePropertyName(AnnotatedMethod am) {
        return findPropertyName(am);
    }

    @Override
    public String findDeserializablePropertyName(AnnotatedField af) {
        return findPropertyName(af);
    }

    @Override
    public String findSerializablePropertyName(AnnotatedField af) {
        return findPropertyName(af);
    }

    @Override
    public String findPropertyNameForParam(AnnotatedParameter param) {
        return findPropertyName(param);
    }

    private String findPropertyName(Annotated annotated) {

        if (annotated.hasAnnotation(Id.class) || annotated.hasAnnotation(javax.persistence.Id.class)) {
            return "_id";
        }
        return null;
    }

    // Handling of ObjectId annotated properties
    @Override
    public Object findSerializer(Annotated am) {
        if (am.hasAnnotation(ObjectId.class)) {
            return ObjectIdSerializer.class;
        }
        return null;
    }

    @Override
    public Object findDeserializer(Annotated am) {
        if (am.hasAnnotation(ObjectId.class)) {
            return findObjectIdDeserializer(deserializationConfig.getTypeFactory().constructType(am.getGenericType()));
        }
        return null;
    }

    @Override
    public Class findContentDeserializer(Annotated am) {
        if (am.hasAnnotation(ObjectId.class)) {
            JavaType type = deserializationConfig.getTypeFactory().constructType(am.getGenericType());
            if (type.isCollectionLikeType()) {
                return findObjectIdDeserializer(type.containedType(0));
            } else if (type.isMapLikeType()) {
                return findObjectIdDeserializer(type.containedType(1));
            }
        }
        return null;
    }

    public Class findObjectIdDeserializer(JavaType type) {
        if (type.getRawClass() == String.class) {
            return ObjectIdDeserializers.ToStringDeserializer.class;
        } else if (type.getRawClass() == byte[].class) {
            return ObjectIdDeserializers.ToByteArrayDeserializer.class;
        } else if (type.getRawClass() == DBRef.class) {
            return DBRefDeserializer.class;
        } else if (type.getRawClass() == org.bson.types.ObjectId.class) {
            // Don't know why someone would annotated an ObjectId with @ObjectId, but handle it
            return ObjectIdDeserializers.ToObjectIdDeserializer.class;
        }
        return null;
    }

}


text:
* Name      : Matthew Bergman
* Twitter   : [@fotoverite](https://twitter.com/fotoverite)
* GitHub    : [FotoVerite](https://github.com/FotoVerite)

##Abstract

The 10x programmer is a unicorn. We love to lionize the amount of dedication, time, and thought that goes into creating great software -- but we forget the very real cost it can entail, both emotionally and physically, on the programmer. Depression, RSI, burnout: these are all real issues facing our field.

I have many friends who have dealt with these, and I've dealt with RSI myself. I'd like to share my experience and all the mistakes I have made while dealing with them.

I do not come with quick fixes or a bullet list. Preventative measures only go so far. One does not simply walk into good health. It is a methodical process.

One can, though, be aware of what to think and worry about, and how to deal and go forward if one is dealing with health problems. I promise you knowledge, laughs, and the ability to help anyone going through these issues, be it a friend or yourself.

And above all...

A TREANDMILL DESK WILL NOT SAVE YOU!

![](https://raw.github.com/cascadiajs/2014.cascadiajs.com/master/images/unicorn.png')

##Speaker Bio

![](https://raw.github.com/cascadiajs/2014.cascadiajs.com/master/images/matthew-bergman.png')

Matthew is a polyglot programmer who feels there is something to learn from every language... even basic. He is a photo documenter for the js community and continually strives to give back and make things both for "the thought leaders" and people just starting out.


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <title>Figuroner</title>

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

        <link rel="stylesheet" href="css/foundation.css" />
        <link rel="stylesheet" href="css/figuroner.css" />
        <link rel="stylesheet" href="fontawesome/css/font-awesome.min.css" />

        <link rel="apple-touch-icon-precomposed" href="res/favicon-152.png">
        <link rel="icon" href="res/favicon-32.png" sizes="32x32">
        <link rel="icon" href="res/favicon-16.png" sizes="16x16">

Figuroner

                Het spijt ons, maar om deze website te kunnen gebruiken moet JavaScript ingeschakeld zijn. Ook moet de toegang voor externe bronnen ingeschakeld zijn.

Welkom

                        Met deze webapp kan je je benodigde cijfer berekenen om op een bepaald gemiddelde te komen, als je je vorige cijfers, de wegingen daarvan, en je streefcijfer invult.

                    Cijfers invullen

Cijfers invullen

                        Vul hier je cijfers en de wegingen daarvan in

                        <button class="load-data"> Opgeslagen gegevens laden</button>

                    <button class="add-grade tiny"> Toevoegen</button>

                    <button id="enter-grades-complete">Streefcijfer invullen </button>

Hier klopt iets niet

                        Vul één of meer cijfers met wegingen in. Controleer of de ingevulde cijfers geen fouten bevatten.

                        Cijfers zijn geldig als ze tussen 1 en 10 liggen. Wegingen zijn geldig als ze tussen 1 en 32 liggen.

Streefcijfer opgeven

                        Vul hier de weging van je volgende cijfer in

                    <form>
                        <input id="next-grade-weight-input" type="number" min="1" max="32" placeholder="Weging volgende cijfer" required />
                    </form>

                        Vul hier je streefcijfer in

                    <form>
                        <input id="target-grade-input" type="number" min="1" max="10" step="0.1" placeholder="Streefcijfer" required />
                    </form>
                    <button id="enter-target-grade-complete">Resultaten bekijken </button>

Hier klopt iets niet

                        Vul de weging van je volgende cijfer in en vul je streefcijfer in.
Je cijfer is geldig als het tussen 1 en 10 ligt. De weging is geldig als deze tussen 1 en 32 ligt.

Overzicht

Reeds behaalde cijfers

                                Cijfer
                                Weging

a	b

                        Weging volgende cijfer: c

                        Streefcijfer: d

                        Cijfer berekenen

                            Als je deze gegevens opslaat kan je ze op een later moment opnieuw laden.

                        <button class="save-data"> Deze gegevens opslaan</button>

Resultaten

                        Het cijfer dat je minimaal moet halen is:

                        n

                        "c"

                             Opnieuw

                            <button class="warning delete-data"> Opgeslagen gegevens verwijderen</button>

© Paul @dotnetifier 2015


text:
import {
  Component,
  ElementRef,
  Provider,
  Renderer,
  forwardRef,
  NgModule
} from '@angular/core';
import { CommonModule } from '@angular/common';
import {
  NG_VALUE_ACCESSOR as DEPRECATED_NG_VALUE_ACCESSOR
} from '@angular/common';
import {
  NG_VALUE_ACCESSOR,
  FormsModule
} from '@angular/forms';
import { MdlIconModule } from './../icon/mdl-icon.component';
import { MdlCheckboxComponent } from './../checkbox/mdl-checkbox.component';

const DEPRECATED_MD_INPUT_CONTROL_VALUE_ACCESSOR = new Provider(DEPRECATED_NG_VALUE_ACCESSOR, {
  useExisting: forwardRef(() => MdlIconToggleComponent),
  multi: true
});

const MD_INPUT_CONTROL_VALUE_ACCESSOR = new Provider(NG_VALUE_ACCESSOR, {
  useExisting: forwardRef(() => MdlIconToggleComponent),
  multi: true
});

@Component({
  selector: 'mdl-icon-toggle',
  providers: [DEPRECATED_MD_INPUT_CONTROL_VALUE_ACCESSOR, MD_INPUT_CONTROL_VALUE_ACCESSOR],
  host: {
    '(click)': 'onClick()',
    '[class.mdl-icon-toggle]': 'true',
    '[class.is-upgraded]': 'true',
    '[class.is-checked]': 'value'
  },
  template: `
  <input type="checkbox" class="mdl-icon-toggle__input"
    (focus)="onFocus()"
    (blur)="onBlur()"
    [(ngModel)]="value">
  <mdl-icon class="mdl-icon-toggle__label"><ng-content></ng-content></mdl-icon>
  `,
})
export class MdlIconToggleComponent extends MdlCheckboxComponent {

  constructor(elementRef: ElementRef, renderer: Renderer) {
    super(elementRef, renderer);
  }

}

/** @deprecated */
export const MDL_ICON_TOGGLE_DIRECTIVES = [MdlIconToggleComponent];

@NgModule({
  imports: [ MdlIconModule, CommonModule, FormsModule],
  exports: MDL_ICON_TOGGLE_DIRECTIVES,
  declarations: MDL_ICON_TOGGLE_DIRECTIVES,
})
export class MdlIconToggleModule {}


text:
using System.IO;
using Xunit;

namespace System.Runtime.InteropServices
{
    public class RuntimeEnvironmentTests
    {
        [Fact]
        public void RuntimeEnvironmentRuntimeDirectory()
        {
            Assert.True(Directory.Exists(RuntimeEnvironment.GetRuntimeDirectory()));
        }

        [Fact]
        [ActiveIssue(20600, TargetFrameworkMonikers.UapAot)]
        public void RuntimeEnvironmentSysVersion()
        {
            Assert.NotEmpty(RuntimeEnvironment.GetSystemVersion());
        }

        [Fact]
        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "SystemConfigurationFile is not supported on .NET Core.")]
        public void SystemConfigurationFile_Get_ThrowsPlatformNotSupportedException()
        {
            Assert.Throws<PlatformNotSupportedException>(() => RuntimeEnvironment.SystemConfigurationFile);
        }

        [Fact]
        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "GetRuntimeInterfaceAsObject is not supported on .NET Core.")]
        public void GetRuntimeInterfaceAsObject_Invoke_ThrowsPlatformNotSupportedException()
        {
            Assert.Throws<PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid.Empty, Guid.Empty));
        }

        [Fact]
        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "GetRuntimeInterfaceAsIntPtr is not supported on .NET Core.")]
        public void GetRuntimeInterfaceAsIntPtr_Invoke_ThrowsPlatformNotSupportedException()
        {
            Assert.Throws<PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid.Empty, Guid.Empty));
        }

        [Fact]
        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "FromGlobalAccessCache always returns true on .NET Core.")]
        public void FromGlobalAccessCache_nNvoke_ReturnsFalse()
        {
            Assert.False(RuntimeEnvironment.FromGlobalAccessCache(typeof(RuntimeEnvironmentTests).Assembly));
            Assert.False(RuntimeEnvironment.FromGlobalAccessCache(null));
        }
    }
}


text:
INTERPROCEDURAL_OPTIMIZATION
----------------------------

Enable interprocedural optimization for a target.

If set to true, enables interprocedural optimizations if they are
known to be supported by the compiler.

This property is initialized by the
:variable:`CMAKE_INTERPROCEDURAL_OPTIMIZATION` variable if it is set when a
target is created.


text:
One in a list:

- list item 1
- namespace-1/img:1.2.3
- another list item

Another in a blockquote:

> Intro words
> Update this image: namespace-2/img:23.45.67
> more text

extra text


text:
exports = module.exports = App;

// [模块]
var EventEmitter = require('events').EventEmitter;
var inherits = require('util').inherits;
var fs = require('fs');
var path = require('path');
var DirectoryScan = require('./directory-scan');

// [流程]
inherits(App, EventEmitter);

// [函数]
function App() {
	// 输入参数
	this.dir = undefined;

	// 输出参数
	this.contentDir = undefined;
	this.pageDir = undefined;
	this.instructionDir = undefined;

	this.pageList = undefined;
	this.contentList = undefined;
	this.instructionList = undefined;

	this.warningList = undefined;

	// 对外的状态
	this.status = undefined;
	this.success = undefined;
	this.errorText = undefined;
}

App.prototype.start = function() {
	var self = this;

	// 检查参数
	// TODO

	// 当前的实现是同步的,因此调用 start 方法时
	// 一定是处于 stop 状态的

	self.status = 'start';
	self.success = undefined;
	self.errorText = undefined;

	self.contentDir = undefined;
	self.pageDir = undefined;
	self.instructionDir = undefined;

	self.pageList = undefined;
	self.contentList = undefined;
	self.instructionList = undefined;

	self.warningList = undefined;

	self.emit('start');

	// 计算出各个目录
	self.contentDir = path.resolve(self.dir, 'content');
	self.pageDir = path.resolve(self.dir, 'page');
	self.instructionDir = path.resolve(self.dir, 'instruction');

	// 首先是 contentList
	initContentList();

	// 接下来是 pageList
	initPageList();

	// 最后是 instructionList
	initInstructionList();

	// 至此已经完成了全部工作
	self.status = 'stop';
	self.success = true;
	self.errorText = undefined;

	self.emit('stop');

	function initContentList() {
		// 利用 DirectoryScan 来完成 contentList 的构建
		// 注意这里已知 DirectoryScan 是同步的并且不会出错(即使参数不正确)
		var directoryScan = new DirectoryScan();
		directoryScan.dir = self.contentDir;
		directoryScan.start();

		self.contentList = directoryScan.fileList;
		self.warningList = directoryScan.warningList;

		// 这里需要做一个特殊的处理,需要把 contentList 中的 \ 全部替换为 /
		if (Array.isArray(self.contentList)) {
			if (path.sep === '\\') {
				self.contentList.forEach(function(content) {
					content.relativePath = '/' + content.relativePath.replace(/\\/g, '/');
				});
			} else {
				self.contentList.forEach(function(content) {
					content.relativePath = '/' + content.relativePath;
				});
			}
		}
	}

	function initPageList() {
		// 读取文件列表
		self.pageList = [];
		var pageDir = self.pageDir;
		try {
			var shortFileNameList = fs.readdirSync(pageDir);
		} catch(err) {
			// 输出一条警告信息,但是不会出错
			self.warningList.push('[initPageList] ' + err.toString());

			// 不再继续向下执行
			return;
		}

		// 容错
		shortFileNameList = shortFileNameList || [];

		// 将文件名补足为完整路径
		// 注意这里只会考虑 .js 结尾的文件
		var fullFileNameList = [];
		shortFileNameList.forEach(function(shortFileName) {
			// 只加载以 .js 结尾的文件
			if (!/.js$/.test(shortFileName)) return;
			fullFileNameList.push(path.resolve(pageDir, shortFileName));
		});

		// 加载每一个页面
		fullFileNameList.forEach(function(fullFileName) {
			try {
				var page = require(fullFileName);
				self.pageList.push({
					name: path.relative(pageDir, fullFileName),
					def: page.def,
					respond: page.respond
				});
			} catch(err) {
				// 容忍错误,加入警告
				self.warningList.push('[initPageList] ' + err.toString());
			}
		});
	}

	function initInstructionList() {
		self.instructionList = [];
		var instructionDir = self.instructionDir;
		try {
			var shortFileNameList = fs.readdirSync(instructionDir);
		} catch(err) {
			// 输出一条警告信息,但是不会出错
			self.warningList.push('[initInstructionList] ' + err.toString());

			// 不再继续向下执行
		}

		// 容错
		shortFileNameList = shortFileNameList || [];

		// 将文件名补足为完整路径
		// 注意这里只会考虑 .js 结尾的文件
		var fullFileNameList = [];
		shortFileNameList.forEach(function(file) {
			if (!/.js$/.test(file)) return;
			fullFileNameList.push(path.resolve(instructionDir, file));
		});

		// 加载每一个指令
		fullFileNameList.forEach(function(fullFileName) {
			try {
				self.instructionList.push(require(fullFileName));
			} catch(err) {
				// 容忍错误,加入警告
				self.warningList.push('[initInstructionList] ' + err.toString());
			}
		});
	}
}

App.prototype.stop = function() {
	// 当前的实现是同步的,因此调用 stop 方法时
	// 一定不可能处于运行状态
	return false;
}

// // 测试
// var a = new App();
// a.dir = 'F:/Users/Jianru/Desktop/项目相关/Hades/server/app/common';

// a.start();

// debugger;


text:
package biz.webgate.scrum.project;

import java.util.Comparator;
import java.util.Date;

public class ProjectComparator implements Comparator<Project> {
	private int m_SortOrder = ProjectSessionFacade.SORT_BY_SUBJECT;

	public ProjectComparator(int iSortOrder) {
		m_SortOrder = iSortOrder;
	}

	public int compare(Project o1, Project o2) {
		String s1 = "";
		String s2 = "";
		switch (m_SortOrder) {
		case ProjectSessionFacade.SORT_BY_MODIFIEDAT:
			return compareDates(o1.getModifiedAt(), o2.getModifiedAt());
		case ProjectSessionFacade.SORT_BY_SUBJECT:
			s1 = o1.getSubject().toLowerCase();
			s2 = o2.getSubject().toLowerCase();
			break;
		case ProjectSessionFacade.SORT_BY_CUSTOMER:
			s1 = o1.getCustomer().toLowerCase();
			s2 = o2.getCustomer().toLowerCase();
			break;
		case ProjectSessionFacade.SORT_BY_LEADER:
			s1 = o1.getLeader().toLowerCase();
			s2 = o2.getLeader().toLowerCase();
			break;
		case ProjectSessionFacade.SORT_BY_START:
			return compareDates(o1.getStart(), o2.getStart());
		case ProjectSessionFacade.SORT_BY_END:
			return compareDates(o1.getEnd(), o2.getEnd());
		}

		return s1.compareTo(s2);
	}

	int compareDates(Date d1, Date d2) {
		if (d1 == null) {
			d1 = new Date();
		}
		if (d2 == null) {
			d2 = new Date();
		}
		return d1.compareTo(d2);
	}
}


text:
using System;
using System.ComponentModel;

using GuruComponents.Netrix.ComInterop;
using Comzept.Genesis.NetRix.VgxDraw;
using GuruComponents.Netrix.WebEditing.Elements;
using GuruComponents.Netrix.VmlDesigner.Elements;

namespace GuruComponents.Netrix.VmlDesigner.DataTypes
{
    /// <summary>
    /// Zusammenfassung für VgPointsCollection.
    /// </summary>
    public class VgPointsCollection : System.Collections.CollectionBase, IVgPoints
    {

        private Interop.IHTMLElement baseShape;
        private IVgPoints internalPoints;

        internal VgPointsCollection(Interop.IHTMLElement baseShape, IVgPoints internalPoints) : base()
        {
            this.baseShape = baseShape;
            this.internalPoints = internalPoints;
            base.InnerList.Clear();
            // copy original list into internal base list
            for (int i = 0; i < internalPoints.length; i++)
            {
                this.Add(new VgVector2D(internalPoints[i]));
            }
        }

        /// <summary>
        /// Adds a style element to the collection. This member supports the NetRix infrastructure and is used to
        /// support the <see cref="System.Windows.Forms.PropertyGrid"/>.
        /// </summary>
        /// <param name="o"></param>
        public void Add(VgVector2D vector)
        {
            if (vector == null) return;
            base.List.Add(vector);
        }

        /// <summary>
        /// Checks if the element is part of the collection. This member supports the NetRix infrastructure and is used to
        /// support the <see cref="System.Windows.Forms.PropertyGrid"/>.
        /// </summary>
        /// <param name="o"></param>
        /// <returns></returns>
        public bool Contains(VgVector2D vector)
        {
            if (vector == null) return false;
            return List.Contains(vector);
        }

        /// <summary>
        /// Removes the element from the collection. This member supports the NetRix infrastructure and is used to
        /// support the <see cref="System.Windows.Forms.PropertyGrid"/>.
        /// </summary>
        /// <param name="o"></param>
        public void Remove(VgVector2D vector)
        {
            if (vector == null) return;
            base.List.Remove(vector);
        }

        public void RemoveAll()
        {
            base.InnerList.Clear();
        }

        /// <summary>
        /// Gets or sets a style element in the collection using an index. This member supports the NetRix infrastructure and is used to
        /// support the <see cref="System.Windows.Forms.PropertyGrid"/>.
        /// </summary>
        public VgVector2D this[int index]
        {
            get
            {
                return (VgVector2D)base.List[index];
            }
            set
            {
                base.List[index] = value;
            }
        }

        /// <summary>
        /// Fired if the collection editor inserts a new element. This member supports the NetRix infrastructure and is used to
        /// support the <see cref="System.Windows.Forms.PropertyGrid"/>.
        /// </summary>
        public event CollectionInsertHandler Insert;
        /// <summary>
        /// Fired if the colection editor starts a new sequence. This member supports the NetRix infrastructure and is used to
        /// support the <see cref="System.Windows.Forms.PropertyGrid"/>.
        /// </summary>
        public event CollectionClearHandler ClearCollection;

        protected override void OnInsertComplete(int index, object value)
        {
            base.OnInsert (index, value);
            // prevent from fail during first collection fill process, because the handler is temporary removed
            if (Insert != null)
            {
                Insert(index, value);
            }
        }

        protected override void OnClear()
        {
            base.OnClear ();
            // prevent from fail during first collection fill process, because the handler is temporary removed
            if (ClearCollection != null)
            {
                ClearCollection();
            }
        }

        #region IVgPoints Member

        [Browsable(false)]
        public int Creator
        {
            get
            {
                return internalPoints.Creator;
            }
        }

        [Browsable(false)]
        public object parentShape
        {
            get
            {
                return baseShape;
            }
        }

        [Browsable(false)]
        Comzept.Genesis.NetRix.VgxDraw.IVgVector2D Comzept.Genesis.NetRix.VgxDraw.IVgPoints.this[int Index]
        {
            get
            {
                return internalPoints[Index];
            }
        }

        [Browsable(false)]
        public object Application
        {
            get
            {
                return internalPoints.Application;
            }
        }

        public Comzept.Genesis.NetRix.VgxDraw.IVgVector2D add(uint insertionIndex)
        {
            return internalPoints.add(insertionIndex);
        }

        [Browsable(false)]
        public string @value
        {
            get
            {
                return internalPoints.@value;
            }
            set
            {
                internalPoints.@value = value;
            }
        }

        [Browsable(false)]
        public int length
        {
            get
            {
                return internalPoints.length;
            }
        }

        #endregion
    }
}